summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-12-19 19:40:22 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-12-19 19:40:22 +0000
commitf36fc8641eb9e45c79bc3051d06c2887e82a562f (patch)
tree52f420821fac5adf6df506b8baa9764fab6a6648 /src
parent42c9aeff3943f2e6779d3d125fc014cd96d16d71 (diff)
This update is the below two patches, plus the remaining changes
necessary to remove 12 of the final 14 references to the global Machine. The remaining 2 are in fatalerror() and logerror(), which are both local to mame.c, so Machine is now fully static. -- From: Atari Ace [mailto:atari_ace@verizon.net] Sent: Thursday, December 18, 2008 5:47 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Make Machine static followup Hi mamedev, This incremental patch to my last patch undoes the change that caches the ppu2c0x videorom. I changed the code back to how it behaved originally, using an existing machine on the chip struct to eliminate the one troublesome Machine reference. ~aa -- From: Atari Ace [mailto:atari_ace@verizon.net] Sent: Thursday, December 18, 2008 2:54 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Make Machine static! Hi mamedev, This large patch completes the removal of the use of Machine throughout MAME. It does so primarily by adding machine, device or space to various apis and modifying the callers, but for some remaining cases it adds a new api, mame_get_running_machine(), which will be called instead. There are only 14 uses of this api currently, and that number should drop over time. There are a few changes of note: 1. 6821pia.c. I attached machine to the 'device' structure. I'm working on converting this to a proper device, but that change isn't ready. 2. fddebug.c. I added a proper header so that the apis won't get accidentally converted to static again. 3. scsi.c. I added a machine to SCSIInstance. 4. system16.c. I modified sys16_patch_code to take an array of patches. 4. custom.h. I added the owning sound device to the reset/stop routines as well as the token. Note that passing only the device would require exposing the internals of custom_sound, as the token passed is not the device token, but the token returned from the CUSTOM_START routine. Better ideas here are welcome. 4. ppc2c0x.c. To avoid changing more interfaces, the init routine saves the videorom location rather than looks it up each time. I tried to choose what I felt was the natural parameter for an api, rather than always pass machine, but in some cases I used machine to limit the number of additional changes. Some additional cleanup here is probably warranted, I'll look into that later once I'm recovered from this two-week project. ~aa
Diffstat (limited to 'src')
-rw-r--r--src/emu/cpu/dsp32/dsp32.c4
-rw-r--r--src/emu/cpu/dsp32/dsp32.h2
-rw-r--r--src/emu/cpu/i386/i386.h47
-rw-r--r--src/emu/cpu/powerpc/ppc.h2
-rw-r--r--src/emu/cpu/powerpc/ppccom.c2
-rw-r--r--src/emu/cpu/upd7810/upd7810.c20
-rw-r--r--src/emu/cpu/upd7810/upd7810.h2
-rw-r--r--src/emu/cpuintrf.c1
-rw-r--r--src/emu/cpuintrf.h4
-rw-r--r--src/emu/debug/debugvw.c4
-rw-r--r--src/emu/debugger.c81
-rw-r--r--src/emu/debugger.h3
-rw-r--r--src/emu/deprecat.h15
-rw-r--r--src/emu/machine/53c810.c68
-rw-r--r--src/emu/machine/53c810.h8
-rw-r--r--src/emu/machine/6821pia.c45
-rw-r--r--src/emu/machine/74148.c6
-rw-r--r--src/emu/machine/74148.h4
-rw-r--r--src/emu/machine/7474.c6
-rw-r--r--src/emu/machine/7474.h4
-rw-r--r--src/emu/machine/8042kbdc.c44
-rw-r--r--src/emu/machine/8042kbdc.h4
-rw-r--r--src/emu/machine/adc1213x.c32
-rw-r--r--src/emu/machine/adc1213x.h4
-rw-r--r--src/emu/machine/am53cf96.c2
-rw-r--r--src/emu/machine/cr589.c3
-rw-r--r--src/emu/machine/generic.c1
-rw-r--r--src/emu/machine/mb87078.c18
-rw-r--r--src/emu/machine/mb87078.h8
-rw-r--r--src/emu/machine/microtch.c6
-rw-r--r--src/emu/machine/microtch.h2
-rw-r--r--src/emu/machine/pcshare.h2
-rw-r--r--src/emu/machine/scsi.c6
-rw-r--r--src/emu/machine/scsi.h6
-rw-r--r--src/emu/machine/scsicd.c5
-rw-r--r--src/emu/machine/scsidev.c11
-rw-r--r--src/emu/machine/scsihd.c5
-rw-r--r--src/emu/machine/wd33c93.c2
-rw-r--r--src/emu/mame.c4
-rw-r--r--src/emu/sound/5110intf.c2
-rw-r--r--src/emu/sound/5110intf.h2
-rw-r--r--src/emu/sound/custom.c4
-rw-r--r--src/emu/sound/custom.h8
-rw-r--r--src/emu/sound/psx.c6
-rw-r--r--src/emu/sound/psx.h2
-rw-r--r--src/emu/sound/sp0256.c18
-rw-r--r--src/emu/sound/sp0256.h4
-rw-r--r--src/emu/sound/tms5110.c10
-rw-r--r--src/emu/sound/tms5110.h2
-rw-r--r--src/emu/sound/upd7759.c7
-rw-r--r--src/emu/sound/upd7759.h2
-rw-r--r--src/emu/video/generic.c24
-rw-r--r--src/emu/video/generic.h18
-rw-r--r--src/emu/video/vector.c5
-rw-r--r--src/emu/video/vector.h2
-rw-r--r--src/mame/audio/cage.c8
-rw-r--r--src/mame/audio/cinemat.c47
-rw-r--r--src/mame/audio/dcs.c55
-rw-r--r--src/mame/audio/dcs.h2
-rw-r--r--src/mame/audio/gottlieb.c5
-rw-r--r--src/mame/audio/jaguar.c19
-rw-r--r--src/mame/audio/mcr.c58
-rw-r--r--src/mame/audio/mcr.h12
-rw-r--r--src/mame/audio/n8080.c2
-rw-r--r--src/mame/audio/namco54.c9
-rw-r--r--src/mame/audio/namco54.h2
-rw-r--r--src/mame/audio/scramble.c35
-rw-r--r--src/mame/audio/segasnd.c5
-rw-r--r--src/mame/audio/segasnd.h2
-rw-r--r--src/mame/audio/taitosnd.c9
-rw-r--r--src/mame/audio/williams.c48
-rw-r--r--src/mame/audio/williams.h8
-rw-r--r--src/mame/drivers/acommand.c6
-rw-r--r--src/mame/drivers/adp.c2
-rw-r--r--src/mame/drivers/airbustr.c2
-rw-r--r--src/mame/drivers/alg.c12
-rw-r--r--src/mame/drivers/ambush.c2
-rw-r--r--src/mame/drivers/armedf.c6
-rw-r--r--src/mame/drivers/backfire.c4
-rw-r--r--src/mame/drivers/bagman.c5
-rw-r--r--src/mame/drivers/battlane.c2
-rw-r--r--src/mame/drivers/bigfghtr.c2
-rw-r--r--src/mame/drivers/bogeyman.c2
-rw-r--r--src/mame/drivers/calorie.c4
-rw-r--r--src/mame/drivers/cham24.c5
-rw-r--r--src/mame/drivers/chinagat.c2
-rw-r--r--src/mame/drivers/citycon.c2
-rw-r--r--src/mame/drivers/clshroad.c2
-rw-r--r--src/mame/drivers/cntsteer.c2
-rw-r--r--src/mame/drivers/cojag.c2
-rw-r--r--src/mame/drivers/cosmic.c2
-rw-r--r--src/mame/drivers/crbaloon.c6
-rw-r--r--src/mame/drivers/cvs.c18
-rw-r--r--src/mame/drivers/dacholer.c4
-rw-r--r--src/mame/drivers/dblewing.c4
-rw-r--r--src/mame/drivers/ddragon.c6
-rw-r--r--src/mame/drivers/dec8.c4
-rw-r--r--src/mame/drivers/deco156.c4
-rw-r--r--src/mame/drivers/dominob.c10
-rw-r--r--src/mame/drivers/dooyong.c2
-rw-r--r--src/mame/drivers/drmicro.c4
-rw-r--r--src/mame/drivers/enigma2.c2
-rw-r--r--src/mame/drivers/equites.c2
-rw-r--r--src/mame/drivers/ettrivia.c2
-rw-r--r--src/mame/drivers/exzisus.c4
-rw-r--r--src/mame/drivers/fcrash.c4
-rw-r--r--src/mame/drivers/finalizr.c2
-rw-r--r--src/mame/drivers/firebeat.c9
-rw-r--r--src/mame/drivers/firetrap.c2
-rw-r--r--src/mame/drivers/freekick.c4
-rw-r--r--src/mame/drivers/galaga.c4
-rw-r--r--src/mame/drivers/gamecstl.c7
-rw-r--r--src/mame/drivers/gberet.c4
-rw-r--r--src/mame/drivers/gladiatr.c2
-rw-r--r--src/mame/drivers/goindol.c2
-rw-r--r--src/mame/drivers/gpworld.c15
-rw-r--r--src/mame/drivers/gticlub.c8
-rw-r--r--src/mame/drivers/hanaroku.c2
-rw-r--r--src/mame/drivers/hexion.c2
-rw-r--r--src/mame/drivers/hornet.c25
-rw-r--r--src/mame/drivers/jack.c2
-rw-r--r--src/mame/drivers/jackal.c2
-rw-r--r--src/mame/drivers/jailbrek.c2
-rw-r--r--src/mame/drivers/jalmah.c3
-rw-r--r--src/mame/drivers/jangou.c2
-rw-r--r--src/mame/drivers/konamigq.c4
-rw-r--r--src/mame/drivers/konamigv.c4
-rw-r--r--src/mame/drivers/ksys573.c95
-rw-r--r--src/mame/drivers/laserbat.c2
-rw-r--r--src/mame/drivers/looping.c12
-rw-r--r--src/mame/drivers/lsasquad.c2
-rw-r--r--src/mame/drivers/lucky74.c2
-rw-r--r--src/mame/drivers/lwings.c2
-rw-r--r--src/mame/drivers/m63.c10
-rw-r--r--src/mame/drivers/mappy.c2
-rw-r--r--src/mame/drivers/mayumi.c2
-rw-r--r--src/mame/drivers/mcr3.c6
-rw-r--r--src/mame/drivers/mcr68.c4
-rw-r--r--src/mame/drivers/mediagx.c7
-rw-r--r--src/mame/drivers/megadriv.c33
-rw-r--r--src/mame/drivers/megadriv.h2
-rw-r--r--src/mame/drivers/megatech.c2
-rw-r--r--src/mame/drivers/merit.c4
-rw-r--r--src/mame/drivers/meritm.c12
-rw-r--r--src/mame/drivers/metlclsh.c4
-rw-r--r--src/mame/drivers/metro.c10
-rw-r--r--src/mame/drivers/micro3d.c1
-rw-r--r--src/mame/drivers/midvunit.c6
-rw-r--r--src/mame/drivers/mirage.c4
-rw-r--r--src/mame/drivers/missb2.c2
-rw-r--r--src/mame/drivers/model3.c20
-rw-r--r--src/mame/drivers/msisaac.c2
-rw-r--r--src/mame/drivers/multigam.c9
-rw-r--r--src/mame/drivers/namcos11.c16
-rw-r--r--src/mame/drivers/namcos12.c4
-rw-r--r--src/mame/drivers/namcos21.c6
-rw-r--r--src/mame/drivers/ninjakd2.c2
-rw-r--r--src/mame/drivers/nmk16.c2
-rw-r--r--src/mame/drivers/nwk-tr.c19
-rw-r--r--src/mame/drivers/olibochu.c8
-rw-r--r--src/mame/drivers/pacland.c6
-rw-r--r--src/mame/drivers/pitnrun.c4
-rw-r--r--src/mame/drivers/popeye.c2
-rw-r--r--src/mame/drivers/psychic5.c6
-rw-r--r--src/mame/drivers/pturn.c6
-rw-r--r--src/mame/drivers/pushman.c2
-rw-r--r--src/mame/drivers/rallyx.c4
-rw-r--r--src/mame/drivers/rmhaihai.c2
-rw-r--r--src/mame/drivers/royalmah.c6
-rw-r--r--src/mame/drivers/sauro.c8
-rw-r--r--src/mame/drivers/sbowling.c9
-rw-r--r--src/mame/drivers/scotrsht.c2
-rw-r--r--src/mame/drivers/segae.c63
-rw-r--r--src/mame/drivers/segag80r.c2
-rw-r--r--src/mame/drivers/segag80v.c2
-rw-r--r--src/mame/drivers/segas16b.c5
-rw-r--r--src/mame/drivers/segas24.c4
-rw-r--r--src/mame/drivers/senjyo.c2
-rw-r--r--src/mame/drivers/shadfrce.c2
-rw-r--r--src/mame/drivers/shootout.c2
-rw-r--r--src/mame/drivers/snowbros.c2
-rw-r--r--src/mame/drivers/speedbal.c2
-rw-r--r--src/mame/drivers/suna8.c10
-rw-r--r--src/mame/drivers/superqix.c4
-rw-r--r--src/mame/drivers/system16.c180
-rw-r--r--src/mame/drivers/system18.c206
-rw-r--r--src/mame/drivers/taito_b.c11
-rw-r--r--src/mame/drivers/taitowlf.c7
-rw-r--r--src/mame/drivers/taxidrvr.c2
-rw-r--r--src/mame/drivers/thedeep.c4
-rw-r--r--src/mame/drivers/tmaster.c2
-rw-r--r--src/mame/drivers/toypop.c2
-rw-r--r--src/mame/drivers/tsamurai.c2
-rw-r--r--src/mame/drivers/uapce.c12
-rw-r--r--src/mame/drivers/vastar.c2
-rw-r--r--src/mame/drivers/vball.c2
-rw-r--r--src/mame/drivers/warpwarp.c8
-rw-r--r--src/mame/drivers/wwfsstar.c2
-rw-r--r--src/mame/drivers/wwfwfest.c2
-rw-r--r--src/mame/drivers/yumefuda.c2
-rw-r--r--src/mame/drivers/zaxxon.c2
-rw-r--r--src/mame/drivers/zn.c21
-rw-r--r--src/mame/drivers/zr107.c4
-rw-r--r--src/mame/includes/amiga.h10
-rw-r--r--src/mame/includes/carpolo.h10
-rw-r--r--src/mame/includes/galaxold.h4
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/includes/jaguar.h2
-rw-r--r--src/mame/includes/n64.h2
-rw-r--r--src/mame/includes/psx.h10
-rw-r--r--src/mame/includes/system16.h9
-rw-r--r--src/mame/machine/amiga.c28
-rw-r--r--src/mame/machine/atari.c7
-rw-r--r--src/mame/machine/bublbobl.c4
-rw-r--r--src/mame/machine/carpolo.c83
-rw-r--r--src/mame/machine/fddebug.c31
-rw-r--r--src/mame/machine/galaxold.c13
-rw-r--r--src/mame/machine/harddriv.c5
-rw-r--r--src/mame/machine/konppc.c58
-rw-r--r--src/mame/machine/konppc.h4
-rw-r--r--src/mame/machine/mcr.c4
-rw-r--r--src/mame/machine/midtunit.c2
-rw-r--r--src/mame/machine/midwayic.c42
-rw-r--r--src/mame/machine/midwayic.h10
-rw-r--r--src/mame/machine/midwunit.c13
-rw-r--r--src/mame/machine/midyunit.c10
-rw-r--r--src/mame/machine/model1.c223
-rw-r--r--src/mame/machine/n64.c2
-rw-r--r--src/mame/machine/namcoio.c2
-rw-r--r--src/mame/machine/pcecommn.c6
-rw-r--r--src/mame/machine/pcecommn.h2
-rw-r--r--src/mame/machine/pcshare.c9
-rw-r--r--src/mame/machine/playch10.c5
-rw-r--r--src/mame/machine/psx.c94
-rw-r--r--src/mame/machine/s16fd.c39
-rw-r--r--src/mame/machine/s24fd.c37
-rw-r--r--src/mame/machine/scramble.c6
-rw-r--r--src/mame/machine/seicop.c2
-rw-r--r--src/mame/machine/system16.c15
-rw-r--r--src/mame/machine/tx1.c91
-rw-r--r--src/mame/machine/vertigo.c27
-rw-r--r--src/mame/machine/vsnes.c25
-rw-r--r--src/mame/machine/williams.c4
-rw-r--r--src/mame/machine/wrally.c2
-rw-r--r--src/mame/video/1942.c6
-rw-r--r--src/mame/video/1943.c8
-rw-r--r--src/mame/video/40love.c2
-rw-r--r--src/mame/video/aeroboto.c8
-rw-r--r--src/mame/video/ambush.c10
-rw-r--r--src/mame/video/amspdwy.c4
-rw-r--r--src/mame/video/appoooh.c32
-rw-r--r--src/mame/video/arkanoid.c18
-rw-r--r--src/mame/video/armedf.c2
-rw-r--r--src/mame/video/ashnojoe.c2
-rw-r--r--src/mame/video/atari.c33
-rw-r--r--src/mame/video/avgdvg.c25
-rw-r--r--src/mame/video/aztarac.c12
-rw-r--r--src/mame/video/bagman.c8
-rw-r--r--src/mame/video/bankp.c4
-rw-r--r--src/mame/video/baraduke.c16
-rw-r--r--src/mame/video/battlane.c4
-rw-r--r--src/mame/video/battlex.c6
-rw-r--r--src/mame/video/bionicc.c4
-rw-r--r--src/mame/video/bking.c12
-rw-r--r--src/mame/video/blktiger.c6
-rw-r--r--src/mame/video/blueprnt.c6
-rw-r--r--src/mame/video/bogeyman.c4
-rw-r--r--src/mame/video/bombjack.c6
-rw-r--r--src/mame/video/boogwing.c4
-rw-r--r--src/mame/video/bosco.c12
-rw-r--r--src/mame/video/btime.c30
-rw-r--r--src/mame/video/bublbobl.c2
-rw-r--r--src/mame/video/buggychl.c20
-rw-r--r--src/mame/video/cabal.c4
-rw-r--r--src/mame/video/carpolo.c54
-rw-r--r--src/mame/video/cbuster.c4
-rw-r--r--src/mame/video/cchasm.c4
-rw-r--r--src/mame/video/champbas.c2
-rw-r--r--src/mame/video/cinemat.c4
-rw-r--r--src/mame/video/circusc.c4
-rw-r--r--src/mame/video/citycon.c6
-rw-r--r--src/mame/video/cloak.c4
-rw-r--r--src/mame/video/clshroad.c4
-rw-r--r--src/mame/video/cninja.c14
-rw-r--r--src/mame/video/commando.c4
-rw-r--r--src/mame/video/cop01.c4
-rw-r--r--src/mame/video/cosmic.c10
-rw-r--r--src/mame/video/cps1.c10
-rw-r--r--src/mame/video/crbaloon.c2
-rw-r--r--src/mame/video/cvs.c4
-rw-r--r--src/mame/video/dassault.c4
-rw-r--r--src/mame/video/ddragon.c2
-rw-r--r--src/mame/video/ddragon3.c8
-rw-r--r--src/mame/video/deadang.c4
-rw-r--r--src/mame/video/dec0.c113
-rw-r--r--src/mame/video/dec8.c14
-rw-r--r--src/mame/video/deco32.c6
-rw-r--r--src/mame/video/decocass.c12
-rw-r--r--src/mame/video/dietgo.c4
-rw-r--r--src/mame/video/digdug.c8
-rw-r--r--src/mame/video/docastle.c10
-rw-r--r--src/mame/video/dogfgt.c10
-rw-r--r--src/mame/video/dooyong.c14
-rw-r--r--src/mame/video/drmicro.c4
-rw-r--r--src/mame/video/dynduke.c4
-rw-r--r--src/mame/video/equites.c16
-rw-r--r--src/mame/video/esd16.c6
-rw-r--r--src/mame/video/exprraid.c8
-rw-r--r--src/mame/video/exzisus.c8
-rw-r--r--src/mame/video/fastfred.c18
-rw-r--r--src/mame/video/finalizr.c4
-rw-r--r--src/mame/video/firetrap.c4
-rw-r--r--src/mame/video/flower.c6
-rw-r--r--src/mame/video/flstory.c4
-rw-r--r--src/mame/video/freekick.c12
-rw-r--r--src/mame/video/funkybee.c8
-rw-r--r--src/mame/video/funkyjet.c4
-rw-r--r--src/mame/video/fuukifg2.c8
-rw-r--r--src/mame/video/fuukifg3.c8
-rw-r--r--src/mame/video/gaiden.c6
-rw-r--r--src/mame/video/galaga.c6
-rw-r--r--src/mame/video/galaxold.c10
-rw-r--r--src/mame/video/gaplus.c4
-rw-r--r--src/mame/video/gberet.c4
-rw-r--r--src/mame/video/gladiatr.c6
-rw-r--r--src/mame/video/gng.c4
-rw-r--r--src/mame/video/goindol.c8
-rw-r--r--src/mame/video/gottlieb.c14
-rw-r--r--src/mame/video/gotya.c14
-rw-r--r--src/mame/video/gtia.c4
-rw-r--r--src/mame/video/gtia.h4
-rw-r--r--src/mame/video/gticlub.c6
-rw-r--r--src/mame/video/gunsmoke.c4
-rw-r--r--src/mame/video/hanaawas.c8
-rw-r--r--src/mame/video/hexa.c8
-rw-r--r--src/mame/video/higemaru.c6
-rw-r--r--src/mame/video/holeland.c12
-rw-r--r--src/mame/video/hyperspt.c10
-rw-r--r--src/mame/video/hyprduel.c4
-rw-r--r--src/mame/video/ironhors.c10
-rw-r--r--src/mame/video/jack.c8
-rw-r--r--src/mame/video/jackal.c8
-rw-r--r--src/mame/video/jagblit.c10
-rw-r--r--src/mame/video/jagobj.c24
-rw-r--r--src/mame/video/jaguar.c45
-rw-r--r--src/mame/video/jailbrek.c2
-rw-r--r--src/mame/video/kan_panb.c10
-rw-r--r--src/mame/video/kan_pand.c2
-rw-r--r--src/mame/video/kchamp.c6
-rw-r--r--src/mame/video/kingobox.c8
-rw-r--r--src/mame/video/ladybug.c20
-rw-r--r--src/mame/video/lasso.c22
-rw-r--r--src/mame/video/lastduel.c4
-rw-r--r--src/mame/video/liberate.c8
-rw-r--r--src/mame/video/lkage.c8
-rw-r--r--src/mame/video/lsasquad.c18
-rw-r--r--src/mame/video/lwings.c4
-rw-r--r--src/mame/video/m52.c20
-rw-r--r--src/mame/video/m58.c12
-rw-r--r--src/mame/video/m72.c8
-rw-r--r--src/mame/video/m92.c6
-rw-r--r--src/mame/video/mainsnk.c4
-rw-r--r--src/mame/video/mappy.c10
-rw-r--r--src/mame/video/markham.c10
-rw-r--r--src/mame/video/mermaid.c34
-rw-r--r--src/mame/video/metlclsh.c4
-rw-r--r--src/mame/video/metro.c4
-rw-r--r--src/mame/video/mikie.c6
-rw-r--r--src/mame/video/mjkjidai.c4
-rw-r--r--src/mame/video/model1.c14
-rw-r--r--src/mame/video/mole.c2
-rw-r--r--src/mame/video/mouser.c18
-rw-r--r--src/mame/video/mrjong.c6
-rw-r--r--src/mame/video/mustache.c10
-rw-r--r--src/mame/video/n64.c86
-rw-r--r--src/mame/video/n8080.c22
-rw-r--r--src/mame/video/namcos1.c10
-rw-r--r--src/mame/video/namcos22.c11
-rw-r--r--src/mame/video/namcos86.c20
-rw-r--r--src/mame/video/ninjakd2.c2
-rw-r--r--src/mame/video/nmk16.c16
-rw-r--r--src/mame/video/nova2001.c8
-rw-r--r--src/mame/video/othldrby.c6
-rw-r--r--src/mame/video/pacland.c6
-rw-r--r--src/mame/video/paradise.c8
-rw-r--r--src/mame/video/pbaction.c8
-rw-r--r--src/mame/video/pcktgal.c6
-rw-r--r--src/mame/video/pitnrun.c10
-rw-r--r--src/mame/video/pktgaldx.c4
-rw-r--r--src/mame/video/playch10.c5
-rw-r--r--src/mame/video/pokechmp.c6
-rw-r--r--src/mame/video/pooyan.c2
-rw-r--r--src/mame/video/popeye.c12
-rw-r--r--src/mame/video/powerins.c4
-rw-r--r--src/mame/video/ppu2c0x.c50
-rw-r--r--src/mame/video/ppu2c0x.h12
-rw-r--r--src/mame/video/prehisle.c4
-rw-r--r--src/mame/video/psikyo.c4
-rw-r--r--src/mame/video/psx.c81
-rw-r--r--src/mame/video/psychic5.c6
-rw-r--r--src/mame/video/pushman.c2
-rw-r--r--src/mame/video/quizdna.c2
-rw-r--r--src/mame/video/rallyx.c14
-rw-r--r--src/mame/video/realbrk.c10
-rw-r--r--src/mame/video/redclash.c8
-rw-r--r--src/mame/video/renegade.c12
-rw-r--r--src/mame/video/retofinv.c4
-rw-r--r--src/mame/video/rockola.c8
-rw-r--r--src/mame/video/rocnrope.c4
-rw-r--r--src/mame/video/rohga.c12
-rw-r--r--src/mame/video/sauro.c10
-rw-r--r--src/mame/video/sbasketb.c6
-rw-r--r--src/mame/video/scotrsht.c2
-rw-r--r--src/mame/video/segag80v.c8
-rw-r--r--src/mame/video/senjyo.c18
-rw-r--r--src/mame/video/seta2.c6
-rw-r--r--src/mame/video/sf.c6
-rw-r--r--src/mame/video/shangha3.c4
-rw-r--r--src/mame/video/shaolins.c6
-rw-r--r--src/mame/video/shisen.c2
-rw-r--r--src/mame/video/shootout.c6
-rw-r--r--src/mame/video/sidearms.c2
-rw-r--r--src/mame/video/simpl156.c4
-rw-r--r--src/mame/video/skykid.c12
-rw-r--r--src/mame/video/snk.c20
-rw-r--r--src/mame/video/solomon.c6
-rw-r--r--src/mame/video/sonson.c4
-rw-r--r--src/mame/video/spcforce.c6
-rw-r--r--src/mame/video/spdodgeb.c6
-rw-r--r--src/mame/video/speedatk.c2
-rw-r--r--src/mame/video/speedbal.c2
-rw-r--r--src/mame/video/srumbler.c6
-rw-r--r--src/mame/video/sshangha.c6
-rw-r--r--src/mame/video/ssozumo.c4
-rw-r--r--src/mame/video/stfight.c6
-rw-r--r--src/mame/video/strnskil.c10
-rw-r--r--src/mame/video/stvvdp1.c85
-rw-r--r--src/mame/video/suna16.c6
-rw-r--r--src/mame/video/suna8.c4
-rw-r--r--src/mame/video/supbtime.c4
-rw-r--r--src/mame/video/superqix.c10
-rw-r--r--src/mame/video/suprloco.c15
-rw-r--r--src/mame/video/system1.c54
-rw-r--r--src/mame/video/tagteam.c8
-rw-r--r--src/mame/video/tecmo.c4
-rw-r--r--src/mame/video/tecmo16.c2
-rw-r--r--src/mame/video/tehkanwc.c8
-rw-r--r--src/mame/video/terracre.c4
-rw-r--r--src/mame/video/thedeep.c2
-rw-r--r--src/mame/video/tigeroad.c6
-rw-r--r--src/mame/video/timeplt.c2
-rw-r--r--src/mame/video/toki.c4
-rw-r--r--src/mame/video/trackfld.c8
-rw-r--r--src/mame/video/travrusa.c6
-rw-r--r--src/mame/video/tryout.c6
-rw-r--r--src/mame/video/tsamurai.c2
-rw-r--r--src/mame/video/tumblep.c4
-rw-r--r--src/mame/video/twin16.c6
-rw-r--r--src/mame/video/vaportra.c4
-rw-r--r--src/mame/video/vastar.c6
-rw-r--r--src/mame/video/vball.c2
-rw-r--r--src/mame/video/vertigo.c10
-rw-r--r--src/mame/video/vsnes.c5
-rw-r--r--src/mame/video/vulgus.c8
-rw-r--r--src/mame/video/welltris.c2
-rw-r--r--src/mame/video/wrally.c4
-rw-r--r--src/mame/video/wwfsstar.c4
-rw-r--r--src/mame/video/wwfwfest.c4
-rw-r--r--src/mame/video/xain.c12
-rw-r--r--src/mame/video/xevious.c8
-rw-r--r--src/mame/video/ygv608.c29
-rw-r--r--src/mame/video/yiear.c6
-rw-r--r--src/mame/video/yunsun16.c2
-rw-r--r--src/mame/video/zaccaria.c14
-rw-r--r--src/mame/video/zaxxon.c27
-rw-r--r--src/mame/video/zodiack.c10
-rw-r--r--src/osd/windows/input.c82
-rw-r--r--src/osd/windows/output.c9
-rw-r--r--src/osd/windows/winmain.c8
479 files changed, 2797 insertions, 2752 deletions
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index e72ab4427a5..b2777aa0b05 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -181,7 +181,7 @@ struct _dsp32_state
int icount;
UINT8 lastpins;
UINT32 ppc;
- void (*output_pins_changed)(UINT32 pins);
+ void (*output_pins_changed)(const device_config *device, UINT32 pins);
const device_config *device;
const address_space *program;
};
@@ -283,7 +283,7 @@ static void update_pcr(dsp32_state *cpustate, UINT16 newval)
if (newoutput != cpustate->lastpins)
{
cpustate->lastpins = newoutput;
- (*cpustate->output_pins_changed)(newoutput);
+ (*cpustate->output_pins_changed)(cpustate->device, newoutput);
}
}
}
diff --git a/src/emu/cpu/dsp32/dsp32.h b/src/emu/cpu/dsp32/dsp32.h
index e33110568d8..a043853471f 100644
--- a/src/emu/cpu/dsp32/dsp32.h
+++ b/src/emu/cpu/dsp32/dsp32.h
@@ -70,7 +70,7 @@ enum
typedef struct _dsp32_config dsp32_config;
struct _dsp32_config
{
- void (*output_pins_changed)(UINT32 pins); /* a change has occurred on an output pin */
+ void (*output_pins_changed)(const device_config *device, UINT32 pins); /* a change has occurred on an output pin */
};
diff --git a/src/emu/cpu/i386/i386.h b/src/emu/cpu/i386/i386.h
index 441589bce94..9244c27b81f 100644
--- a/src/emu/cpu/i386/i386.h
+++ b/src/emu/cpu/i386/i386.h
@@ -1,22 +1,25 @@
-#pragma once
-
-#ifndef __I386INTF_H__
-#define __I386INTF_H__
-
-#define INPUT_LINE_A20 1
-
-#include "cpuintrf.h"
-
-CPU_GET_INFO( i386 );
-CPU_GET_INFO( i486 );
-CPU_GET_INFO( pentium );
-CPU_GET_INFO( mediagx );
-
-#define CPU_I386 CPU_GET_INFO_NAME( i386 )
-#define CPU_I486 CPU_GET_INFO_NAME( i486 )
-#define CPU_PENTIUM CPU_GET_INFO_NAME( pentium )
-#define CPU_MEDIAGX CPU_GET_INFO_NAME( mediagx )
-
-
-
-#endif /* __I386INTF_H__ */
+#pragma once
+
+#ifndef __I386INTF_H__
+#define __I386INTF_H__
+
+#define INPUT_LINE_A20 1
+
+#include "cpuintrf.h"
+
+// mingw has this defined for 32-bit compiles
+#undef i386
+
+CPU_GET_INFO( i386 );
+CPU_GET_INFO( i486 );
+CPU_GET_INFO( pentium );
+CPU_GET_INFO( mediagx );
+
+#define CPU_I386 CPU_GET_INFO_NAME( i386 )
+#define CPU_I486 CPU_GET_INFO_NAME( i486 )
+#define CPU_PENTIUM CPU_GET_INFO_NAME( pentium )
+#define CPU_MEDIAGX CPU_GET_INFO_NAME( mediagx )
+
+
+
+#endif /* __I386INTF_H__ */
diff --git a/src/emu/cpu/powerpc/ppc.h b/src/emu/cpu/powerpc/ppc.h
index 17f338b49db..5be9b70265b 100644
--- a/src/emu/cpu/powerpc/ppc.h
+++ b/src/emu/cpu/powerpc/ppc.h
@@ -134,7 +134,7 @@ enum
STRUCTURES AND TYPEDEFS
***************************************************************************/
-typedef void (*ppc4xx_spu_tx_handler)(UINT8 data);
+typedef void (*ppc4xx_spu_tx_handler)(const device_config *device, UINT8 data);
typedef struct _powerpc_config powerpc_config;
struct _powerpc_config
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index e61f5776378..e1d88431a59 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -1656,7 +1656,7 @@ static TIMER_CALLBACK( ppc4xx_spu_callback )
{
/* if we have a transmit handler, send it that way */
if (ppc->spu.tx_handler != NULL)
- (*ppc->spu.tx_handler)(ppc->spu.txbuf);
+ (*ppc->spu.tx_handler)(ppc->device, ppc->spu.txbuf);
/* indicate that we have moved it to the shift register */
ppc->spu.regs[SPU4XX_LINE_STATUS] |= 0x04;
diff --git a/src/emu/cpu/upd7810/upd7810.c b/src/emu/cpu/upd7810/upd7810.c
index f7e14ded912..e6c39b40748 100644
--- a/src/emu/cpu/upd7810/upd7810.c
+++ b/src/emu/cpu/upd7810/upd7810.c
@@ -987,7 +987,7 @@ static void upd7810_sio_output(upd7810_state *cpustate)
{
TXD = cpustate->txs & 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TXD,TXD);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TXD,TXD);
cpustate->txs >>= 1;
cpustate->txcnt--;
if (0 == cpustate->txcnt)
@@ -1086,7 +1086,7 @@ static void upd7810_sio_input(upd7810_state *cpustate)
if (cpustate->rxcnt > 0)
{
if (cpustate->config.io_callback)
- RXD = (*cpustate->config.io_callback)(UPD7810_RXD,RXD);
+ RXD = (*cpustate->config.io_callback)(cpustate->device,UPD7810_RXD,RXD);
cpustate->rxs = (cpustate->rxs >> 1) | ((UINT16)RXD << 15);
cpustate->rxcnt--;
if (0 == cpustate->rxcnt)
@@ -1288,7 +1288,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
/* timer 1 chained with timer 0 ? */
if ((TMM & 0xe0) == 0x60)
@@ -1303,7 +1303,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@@ -1325,7 +1325,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
/* timer 1 chained with timer 0 ? */
if ((TMM & 0xe0) == 0x60)
@@ -1340,7 +1340,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@@ -1376,7 +1376,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@@ -1396,7 +1396,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@@ -1417,7 +1417,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
OVCF -= 3;
}
}
@@ -1609,7 +1609,7 @@ static void upd78c05_timers(upd7810_state *cpustate, int cycles)
if (0x00 == (TMM & 0x03)) {
TO ^= 1;
if (cpustate->config.io_callback)
- (*cpustate->config.io_callback)(UPD7810_TO,TO);
+ (*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
while ( cpustate->ovc0 <= 0 ) {
diff --git a/src/emu/cpu/upd7810/upd7810.h b/src/emu/cpu/upd7810/upd7810.h
index 0fd2f94e1b3..e237594049d 100644
--- a/src/emu/cpu/upd7810/upd7810.h
+++ b/src/emu/cpu/upd7810/upd7810.h
@@ -31,7 +31,7 @@ typedef enum
* It will be called whenever an output signal changes or a new
* input line state is to be sampled.
*/
-typedef int (*upd7810_io_callback)(int ioline, int state);
+typedef int (*upd7810_io_callback)(const device_config *device, int ioline, int state);
// use it as reset parameter in the Machine struct
typedef struct {
diff --git a/src/emu/cpuintrf.c b/src/emu/cpuintrf.c
index ed513e60dec..7dbf4afa328 100644
--- a/src/emu/cpuintrf.c
+++ b/src/emu/cpuintrf.c
@@ -10,7 +10,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
/* mingw-gcc defines this */
#undef i386
diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h
index 3e707357341..de9a052d5b1 100644
--- a/src/emu/cpuintrf.h
+++ b/src/emu/cpuintrf.h
@@ -21,10 +21,6 @@
#include <stddef.h>
-// mingw has this defined for 32-bit compiles
-#undef i386
-
-
/***************************************************************************
CONSTANTS
***************************************************************************/
diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c
index 97ddbb37ed8..4d583472d33 100644
--- a/src/emu/debug/debugvw.c
+++ b/src/emu/debug/debugvw.c
@@ -3083,8 +3083,8 @@ static void memory_view_write(debug_view_memory *memdata, UINT8 size, offs_t off
#ifdef FD1094_HACK
if (memdata->desc->base == memory_region(view->machine, "user2"))
{
- extern void fd1094_regenerate_key(void);
- fd1094_regenerate_key();
+ extern void fd1094_regenerate_key(running_machine *machine);
+ fd1094_regenerate_key(view->machine);
}
#endif
}
diff --git a/src/emu/debugger.c b/src/emu/debugger.c
index 3ec7cae249c..6d3f27210ec 100644
--- a/src/emu/debugger.c
+++ b/src/emu/debugger.c
@@ -22,10 +22,32 @@
/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef struct _machine_entry machine_entry;
+struct _machine_entry
+{
+ machine_entry * next;
+ running_machine * machine;
+};
+
+
+
+/***************************************************************************
+ GLOBAL VARIABLES
+***************************************************************************/
+
+static machine_entry *machine_list;
+static int atexit_registered;
+
+
+
+/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
-static void debugger_flush_traces(void);
+static void debugger_exit(running_machine *machine);
@@ -42,12 +64,28 @@ void debugger_init(running_machine *machine)
/* only if debugging is enabled */
if (machine->debug_flags & DEBUG_FLAG_ENABLED)
{
+ machine_entry *entry;
+
+ /* initialize the submodules */
debug_cpu_init(machine);
debug_command_init(machine);
debug_console_init(machine);
debug_view_init(machine);
debug_comment_init(machine);
- atexit(debugger_flush_traces);
+
+ /* allocate a new entry for our global list */
+ add_exit_callback(machine, debugger_exit);
+ entry = malloc_or_die(sizeof(*entry));
+ entry->next = machine_list;
+ entry->machine = machine;
+ machine_list = entry;
+
+ /* register an atexit handler if we haven't yet */
+ if (!atexit_registered)
+ atexit(debugger_flush_all_traces_on_abnormal_exit);
+ atexit_registered = TRUE;
+
+ /* listen in on the errorlog */
add_logerror_callback(machine, debug_errorlog_write_line);
}
}
@@ -65,13 +103,40 @@ void debugger_refresh_display(running_machine *machine)
/*-------------------------------------------------
- debugger_flush_traces - flush any traces in
- the event of an aborted execution
+ debugger_exit - remove ourself from the
+ global list of active machines for cleanup
+-------------------------------------------------*/
+
+static void debugger_exit(running_machine *machine)
+{
+ machine_entry **entryptr;
+
+ /* remove this machine from the list; it came down cleanly */
+ for (entryptr = &machine_list; *entryptr != NULL; entryptr = &(*entryptr)->next)
+ if ((*entryptr)->machine == machine)
+ {
+ machine_entry *deleteme = *entryptr;
+ *entryptr = deleteme->next;
+ free(deleteme);
+ break;
+ }
+}
+
+
+/*-------------------------------------------------
+ debugger_flush_all_traces_on_abnormal_exit -
+ flush any traces in the event of an aborted
+ execution
-------------------------------------------------*/
-static void debugger_flush_traces(void)
+void debugger_flush_all_traces_on_abnormal_exit(void)
{
- extern running_machine *Machine;
- if (Machine != NULL)
- debug_cpu_flush_traces(Machine);
+ /* clear out the machine list and flush traces on each one */
+ while (machine_list != NULL)
+ {
+ machine_entry *deleteme = machine_list;
+ debug_cpu_flush_traces(deleteme->machine);
+ machine_list = deleteme->next;
+ free(deleteme);
+ }
}
diff --git a/src/emu/debugger.h b/src/emu/debugger.h
index d7135caca3d..adc6f9f8cdd 100644
--- a/src/emu/debugger.h
+++ b/src/emu/debugger.h
@@ -30,6 +30,9 @@ void debugger_init(running_machine *machine);
/* redraw the current video display */
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);
+
/***************************************************************************
diff --git a/src/emu/deprecat.h b/src/emu/deprecat.h
index 63a8c684782..175a32b4454 100644
--- a/src/emu/deprecat.h
+++ b/src/emu/deprecat.h
@@ -21,21 +21,6 @@
/*************************************
*
- * Global access to the currently
- * executing machine.
- *
- * Please investigate if it is
- * possible to use a passed in
- * 'machine' argument.
- *
- *************************************/
-
-extern running_machine *Machine;
-
-
-
-/*************************************
- *
* Old way of allowing "VBLANK"
* interrupts to fire more than once
* a frame.
diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c
index b3fbccb8e1b..7cb5250f63c 100644
--- a/src/emu/machine/53c810.c
+++ b/src/emu/machine/53c810.c
@@ -49,9 +49,9 @@ 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(void)
+INLINE UINT32 FETCH(running_machine *machine)
{
- UINT32 r = intf->fetch(lsi810.dsp);
+ UINT32 r = intf->fetch(machine, lsi810.dsp);
lsi810.dsp += 4;
return r;
}
@@ -74,13 +74,13 @@ static OPCODE_HANDLER( dmaop_invalid )
static OPCODE_HANDLER( dmaop_move_memory )
{
- UINT32 src = FETCH();
- UINT32 dst = FETCH();
+ UINT32 src = FETCH(machine);
+ UINT32 dst = FETCH(machine);
int count;
count = lsi810.dcmd & 0xffffff;
if(intf->dma_callback != NULL) {
- intf->dma_callback(src, dst, count, 1);
+ intf->dma_callback(machine, src, dst, count, 1);
}
}
@@ -89,7 +89,7 @@ static OPCODE_HANDLER( dmaop_interrupt )
if(lsi810.dcmd & 0x100000) {
fatalerror("LSI53C810: INTFLY opcode not implemented");
}
- lsi810.dsps = FETCH();
+ lsi810.dsps = FETCH(machine);
lsi810.istat |= 0x1; /* DMA interrupt pending */
lsi810.dstat |= 0x4; /* SIR (SCRIPTS Interrupt Instruction Received) */
@@ -107,12 +107,12 @@ static OPCODE_HANDLER( dmaop_block_move )
UINT32 count;
INT32 dsps;
- address = FETCH();
+ address = FETCH(machine);
count = lsi810.dcmd & 0x00ffffff;
// normal indirect
if (lsi810.dcmd & 0x20000000)
- address = intf->fetch(address);
+ address = intf->fetch(machine, address);
// table indirect
if (lsi810.dcmd & 0x10000000)
@@ -149,7 +149,7 @@ static OPCODE_HANDLER( dmaop_select )
{
UINT32 operand;
- operand = FETCH();
+ operand = FETCH(machine);
if (lsi810.scntl0 & 0x01)
{
@@ -174,7 +174,7 @@ static OPCODE_HANDLER( dmaop_wait_disconnect )
{
UINT32 operand;
- operand = FETCH();
+ operand = FETCH(machine);
if (lsi810.scntl0 & 0x01)
{
@@ -192,7 +192,7 @@ static OPCODE_HANDLER( dmaop_wait_reselect )
{
UINT32 operand;
- operand = FETCH();
+ operand = FETCH(machine);
if (lsi810.scntl0 & 0x01)
{
@@ -210,7 +210,7 @@ static OPCODE_HANDLER( dmaop_set )
{
UINT32 operand;
- operand = FETCH();
+ operand = FETCH(machine);
/* initiator mode */
if (lsi810.dcmd & 0x8)
@@ -239,7 +239,7 @@ static OPCODE_HANDLER( dmaop_clear )
{
UINT32 operand;
- operand = FETCH();
+ operand = FETCH(machine);
/* initiator mode */
if (lsi810.dcmd & 0x8)
@@ -339,12 +339,12 @@ static int scripts_compute_branch(void)
return passed;
}
-static UINT32 scripts_get_jump_dest(void)
+static UINT32 scripts_get_jump_dest(running_machine *machine)
{
INT32 dsps;
UINT32 dest;
- dsps = FETCH();
+ dsps = FETCH(machine);
/* relative or absolute addressing? */
if (lsi810.dcmd & 0x00800000)
@@ -357,7 +357,7 @@ static UINT32 scripts_get_jump_dest(void)
logerror("dsps = %x, dsp = %x\n", dsps, lsi810.dsp);
dsps += lsi810.dsp;
-}
+ }
dest = (UINT32)dsps;
@@ -370,11 +370,11 @@ static OPCODE_HANDLER( dmaop_jump )
{
if (scripts_compute_branch())
{
- lsi810.dsp = scripts_get_jump_dest();
+ lsi810.dsp = scripts_get_jump_dest(machine);
}
else
{
- FETCH(); // skip operand to continue on
+ FETCH(machine); // skip operand to continue on
}
}
@@ -386,11 +386,11 @@ static OPCODE_HANDLER( dmaop_call )
lsi810.temp = lsi810.dsp;
// and go
- lsi810.dsp = scripts_get_jump_dest();
+ lsi810.dsp = scripts_get_jump_dest(machine);
}
else
{
- FETCH(); // skip operand to continue on
+ FETCH(machine); // skip operand to continue on
}
}
@@ -404,7 +404,7 @@ static OPCODE_HANDLER( dmaop_return )
}
else
{
- FETCH(); // skip operand to continue on
+ FETCH(machine); // skip operand to continue on
}
}
@@ -431,11 +431,11 @@ static void dma_exec(running_machine *machine)
if (DASM_OPCODES)
{
char buf[256];
- lsi53c810_dasm(buf, lsi810.dsp);
+ lsi53c810_dasm(machine, buf, lsi810.dsp);
logerror("0x%08X: %s\n", lsi810.dsp, buf);
}
- lsi810.dcmd = FETCH();
+ lsi810.dcmd = FETCH(machine);
op = (lsi810.dcmd >> 24) & 0xff;
dma_opcode[op](machine);
@@ -614,7 +614,7 @@ WRITE8_HANDLER( lsi53c810_reg_w )
if(lsi810.dcntl & 0x14 && !lsi810.halted) /* single-step & start DMA */
{
int op;
- lsi810.dcmd = FETCH();
+ lsi810.dcmd = FETCH(space->machine);
op = (lsi810.dcmd >> 24) & 0xff;
dma_opcode[op](space->machine);
@@ -666,7 +666,7 @@ static void add_opcode(UINT8 op, UINT8 mask, opcode_handler handler)
}
}
-void lsi53c810_init(const struct LSI53C810interface *interface)
+void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface)
{
int i;
@@ -701,7 +701,7 @@ void lsi53c810_init(const struct LSI53C810interface *interface)
// try to open the devices
for (i = 0; i < interface->scsidevs->devs_present; i++)
{
- SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
+ SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
}
}
@@ -760,16 +760,16 @@ void *lsi53c810_get_device(int id)
*
*************************************/
-static UINT32 lsi53c810_dasm_fetch(UINT32 pc)
+static UINT32 lsi53c810_dasm_fetch(running_machine *machine, UINT32 pc)
{
- return intf->fetch(pc);
+ return intf->fetch(machine, pc);
}
-unsigned lsi53c810_dasm(char *buf, UINT32 pc)
+unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc)
{
unsigned result = 0;
const char *op_mnemonic = NULL;
- UINT32 op = lsi53c810_dasm_fetch(pc);
+ UINT32 op = lsi53c810_dasm_fetch(machine, pc);
UINT32 dest;
int i;
@@ -782,7 +782,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
if ((op & 0xF8000000) == 0x40000000)
{
/* SELECT */
- dest = lsi53c810_dasm_fetch(pc + 4);
+ dest = lsi53c810_dasm_fetch(machine, pc + 4);
buf += sprintf(buf, "SELECT%s %d, 0x%08X",
(op & 0x01000000) ? " ATN" : "",
@@ -841,7 +841,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
case 0x98000000: op_mnemonic = "INT"; break;
}
- dest = lsi53c810_dasm_fetch(pc + 4);
+ dest = lsi53c810_dasm_fetch(machine, pc + 4);
if (op & 0x00800000)
{
@@ -887,7 +887,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
else if ((op & 0xE0000000) == 0x00000000)
{
/* MOVE FROM */
- dest = lsi53c810_dasm_fetch(pc + 4);
+ dest = lsi53c810_dasm_fetch(machine, pc + 4);
buf += sprintf(buf, "MOVE FROM 0x%08X, WHEN %s",
dest, phases[(op >> 24) & 0x07]);
@@ -897,7 +897,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
else if ((op & 0xE0000000) == 0x20000000)
{
/* MOVE PTR */
- dest = lsi53c810_dasm_fetch(pc + 4);
+ dest = lsi53c810_dasm_fetch(machine, pc + 4);
buf += sprintf(buf, "MOVE 0x%08X, PTR 0x%08X, WHEN %s",
(op & 0x00FFFFFF), dest, phases[(op >> 24) & 0x07]);
diff --git a/src/emu/machine/53c810.h b/src/emu/machine/53c810.h
index 3230c9913a4..1d3b80772b3 100644
--- a/src/emu/machine/53c810.h
+++ b/src/emu/machine/53c810.h
@@ -7,11 +7,11 @@ struct LSI53C810interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
void (*irq_callback)(running_machine *machine, int); /* IRQ callback */
- void (*dma_callback)(UINT32, UINT32, int, int); /* DMA callback */
- UINT32 (*fetch)(UINT32 dsp);
+ void (*dma_callback)(running_machine *machine, UINT32, UINT32, int, int); /* DMA callback */
+ UINT32 (*fetch)(running_machine *machine, UINT32 dsp);
};
-extern void lsi53c810_init(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(char *buf, UINT32 pc);
+unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc);
#endif
diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c
index 9e3fb2af2c4..df59a428e2e 100644
--- a/src/emu/machine/6821pia.c
+++ b/src/emu/machine/6821pia.c
@@ -5,7 +5,6 @@
**********************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "6821pia.h"
@@ -24,6 +23,7 @@
typedef struct _pia6821 pia6821;
struct _pia6821
{
+ running_machine *machine;
const pia6821_interface *intf;
UINT8 in_a;
@@ -125,6 +125,7 @@ void pia_config(running_machine *machine, int which, const pia6821_interface *in
p = &pias[which];
memset(p, 0, sizeof(pias[0]));
+ p->machine = machine;
p->intf = intf;
state_save_register_item(machine, "6821pia", NULL, which, p->in_a);
@@ -176,12 +177,14 @@ void pia_reset(void)
/* zap each structure, preserving the interface and swizzle */
for (i = 0; i < MAX_PIA; i++)
{
+ running_machine *machine = pias[i].machine;
const pia6821_interface *intf = pias[i].intf;
if (intf == NULL) continue;
memset(&pias[i], 0, sizeof(pias[i]));
+ pias[i].machine = machine;
pias[i].intf = intf;
/*
@@ -195,8 +198,8 @@ void pia_reset(void)
pias[i].in_ca2 = TRUE;
/* clear the IRQs */
- if (intf->irq_a_func) (*intf->irq_a_func)(Machine, FALSE);
- if (intf->irq_b_func) (*intf->irq_b_func)(Machine, FALSE);
+ if (intf->irq_a_func) (*intf->irq_a_func)(machine, FALSE);
+ if (intf->irq_b_func) (*intf->irq_b_func)(machine, FALSE);
}
}
@@ -586,24 +589,24 @@ UINT8 pia_read(int which, offs_t offset)
default: /* impossible */
case 0x00:
if (OUTPUT_SELECTED(p->ctl_a))
- ret = port_a_r(Machine, which);
+ ret = port_a_r(p->machine, which);
else
- ret = ddr_a_r(Machine, which);
+ ret = ddr_a_r(p->machine, which);
break;
case 0x01:
- ret = control_a_r(Machine, which);
+ ret = control_a_r(p->machine, which);
break;
case 0x02:
if (OUTPUT_SELECTED(p->ctl_b))
- ret = port_b_r(Machine, which);
+ ret = port_b_r(p->machine, which);
else
- ret = ddr_b_r(Machine, which);
+ ret = ddr_b_r(p->machine, which);
break;
case 0x03:
- ret = control_b_r(Machine, which);
+ ret = control_b_r(p->machine, which);
break;
}
@@ -821,24 +824,24 @@ void pia_write(int which, offs_t offset, UINT8 data)
default: /* impossible */
case 0x00:
if (OUTPUT_SELECTED(p->ctl_a))
- port_a_w(Machine, which, data);
+ port_a_w(p->machine, which, data);
else
- ddr_a_w(Machine, which, data);
+ ddr_a_w(p->machine, which, data);
break;
case 0x01:
- control_a_w(Machine, which, data);
+ control_a_w(p->machine, which, data);
break;
case 0x02:
if (OUTPUT_SELECTED(p->ctl_b))
- port_b_w(Machine, which, data);
+ port_b_w(p->machine, which, data);
else
- ddr_b_w(Machine, which, data);
+ ddr_b_w(p->machine, which, data);
break;
case 0x03:
- control_b_w(Machine, which, data);
+ control_b_w(p->machine, which, data);
break;
}
}
@@ -893,7 +896,7 @@ UINT8 pia_get_output_a(int which)
p->out_a_needs_pulled = FALSE;
- return get_out_a_value(Machine, which);
+ return get_out_a_value(p->machine, which);
}
@@ -931,11 +934,11 @@ void pia_set_input_ca1(int which, int data)
p->irq_a1 = TRUE;
/* update externals */
- update_interrupts(Machine, p);
+ update_interrupts(p->machine, p);
/* CA2 is configured as output and in read strobe mode and cleared by a CA1 transition */
if (C2_OUTPUT(p->ctl_a) && C2_STROBE_MODE(p->ctl_a) && STROBE_C1_RESET(p->ctl_a))
- set_out_ca2(Machine, which, TRUE);
+ set_out_ca2(p->machine, which, TRUE);
}
/* set the new value for CA1 */
@@ -979,7 +982,7 @@ void pia_set_input_ca2(int which, int data)
p->irq_a2 = TRUE;
/* update externals */
- update_interrupts(Machine, p);
+ update_interrupts(p->machine, p);
}
/* set the new value for CA2 */
@@ -1084,7 +1087,7 @@ void pia_set_input_cb1(int which, int data)
p->irq_b1 = 1;
/* update externals */
- update_interrupts(Machine, p);
+ update_interrupts(p->machine, p);
/* If CB2 is configured as a write-strobe output which is reset by a CB1
transition, this reset will only happen when a read from port B implicitly
@@ -1133,7 +1136,7 @@ void pia_set_input_cb2(int which, int data)
p->irq_b2 = 1;
/* update externals */
- update_interrupts(Machine, p);
+ update_interrupts(p->machine, p);
}
/* set the new value for CA2 */
diff --git a/src/emu/machine/74148.c b/src/emu/machine/74148.c
index d7eae2e7f53..c4f91dc31de 100644
--- a/src/emu/machine/74148.c
+++ b/src/emu/machine/74148.c
@@ -47,7 +47,7 @@
struct TTL74148
{
/* callback */
- void (*output_cb)(void);
+ void (*output_cb)(running_machine *machine);
/* inputs */
int input_lines[8]; /* pins 1-4,10-13 */
@@ -67,7 +67,7 @@ struct TTL74148
static struct TTL74148 chips[MAX_TTL74148];
-void TTL74148_update(int which)
+void TTL74148_update(running_machine *machine, int which)
{
if (chips[which].enable_input)
{
@@ -131,7 +131,7 @@ void TTL74148_update(int which)
chips[which].last_output_valid = chips[which].output_valid;
chips[which].last_enable_output = chips[which].enable_output;
- chips[which].output_cb();
+ chips[which].output_cb(machine);
}
}
diff --git a/src/emu/machine/74148.h b/src/emu/machine/74148.h
index 027e89692fb..e7262a93212 100644
--- a/src/emu/machine/74148.h
+++ b/src/emu/machine/74148.h
@@ -45,14 +45,14 @@
/* The interface structure */
struct TTL74148_interface
{
- void (*output_cb)(void);
+ void (*output_cb)(running_machine *machine);
};
void TTL74148_config(int which, const struct TTL74148_interface *intf);
/* must call TTL74148_update() after setting the inputs */
-void TTL74148_update(int which);
+void TTL74148_update(running_machine *machine, int which);
void TTL74148_input_line_w(int which, int input_line, int data);
void TTL74148_enable_input_w(int which, int data);
diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c
index dba5628cba1..297e9389c42 100644
--- a/src/emu/machine/7474.c
+++ b/src/emu/machine/7474.c
@@ -46,7 +46,7 @@
struct TTL7474
{
/* callback */
- void (*output_cb)(void);
+ void (*output_cb)(running_machine *);
/* inputs */
UINT8 clear; /* pin 1/13 */
@@ -67,7 +67,7 @@ struct TTL7474
static struct TTL7474 chips[MAX_TTL7474];
-void TTL7474_update(int which)
+void TTL7474_update(running_machine *machine, int which)
{
if (!chips[which].preset && chips[which].clear) /* line 1 in truth table */
{
@@ -101,7 +101,7 @@ void TTL7474_update(int which)
chips[which].last_output = chips[which].output;
chips[which].last_output_comp = chips[which].output_comp;
- chips[which].output_cb();
+ chips[which].output_cb(machine);
}
}
diff --git a/src/emu/machine/7474.h b/src/emu/machine/7474.h
index 79e6cf13ce5..5c4a9ce5702 100644
--- a/src/emu/machine/7474.h
+++ b/src/emu/machine/7474.h
@@ -44,14 +44,14 @@
/* The interface structure */
struct TTL7474_interface
{
- void (*output_cb)(void);
+ void (*output_cb)(running_machine *machine);
};
void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf);
/* must call TTL7474_update() after setting the inputs */
-void TTL7474_update(int which);
+void TTL7474_update(running_machine *machine, int which);
void TTL7474_clear_w(int which, int data);
void TTL7474_preset_w(int which, int data);
diff --git a/src/emu/machine/8042kbdc.c b/src/emu/machine/8042kbdc.c
index 0ea49f64d21..617a3837eb2 100644
--- a/src/emu/machine/8042kbdc.c
+++ b/src/emu/machine/8042kbdc.c
@@ -204,8 +204,8 @@
static struct
{
kbdc8042_type_t type;
- void (*set_gate_a20)(int a20);
- void (*keyboard_interrupt)(int state);
+ 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(void);
+static void at_8042_check_keyboard(running_machine *machine);
@@ -244,7 +244,7 @@ static void at_8042_check_keyboard(void);
***************************************************************************/
-static void at_8042_set_outport(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);
@@ -252,7 +252,7 @@ static void at_8042_set_outport(UINT8 data, int initial)
if (change & 0x02)
{
if (kbdc8042.set_gate_a20)
- kbdc8042.set_gate_a20(data & 0x02 ? 1 : 0);
+ kbdc8042.set_gate_a20(machine, data & 0x02 ? 1 : 0);
}
}
@@ -261,7 +261,7 @@ static void at_8042_set_outport(UINT8 data, int initial)
static TIMER_CALLBACK( kbdc8042_time )
{
at_keyboard_polling();
- at_8042_check_keyboard();
+ at_8042_check_keyboard(machine);
}
@@ -277,12 +277,12 @@ void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *in
/* ibmat bios wants 0x20 set! (keyboard locked when not set) 0x80 */
kbdc8042.inport = 0xa0;
- at_8042_set_outport(0xfe, 1);
+ at_8042_set_outport(machine, 0xfe, 1);
timer_pulse(machine, ATTOTIME_IN_HZ(60), NULL, 0, kbdc8042_time);
}
-static void at_8042_receive(UINT8 data)
+static void at_8042_receive(running_machine *machine, UINT8 data)
{
if (LOG_KEYBOARD)
logerror("at_8042_receive Received 0x%02x\n", data);
@@ -292,12 +292,12 @@ static void at_8042_receive(UINT8 data)
if (kbdc8042.keyboard_interrupt)
{
- kbdc8042.keyboard_interrupt(1);
- kbdc8042.keyboard_interrupt(0);
+ kbdc8042.keyboard_interrupt(machine, 1);
+ kbdc8042.keyboard_interrupt(machine, 0);
}
}
-static void at_8042_check_keyboard(void)
+static void at_8042_check_keyboard(running_machine *machine)
{
int data;
@@ -305,7 +305,7 @@ static void at_8042_check_keyboard(void)
&& !kbdc8042.mouse.received)
{
if ( (data = at_keyboard_read())!=-1)
- at_8042_receive(data);
+ at_8042_receive(machine, 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();
+ at_8042_check_keyboard(space->machine);
break;
case 1:
@@ -395,7 +395,7 @@ READ8_HANDLER(kbdc8042_8_r)
break;
case 4:
- at_8042_check_keyboard();
+ at_8042_check_keyboard(space->machine);
if (kbdc8042.keyboard.received || kbdc8042.mouse.received)
data |= 1;
@@ -455,7 +455,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- keyboard clock (output)
* `------------ keyboard data (output)
*/
- at_8042_set_outport(data, 0);
+ at_8042_set_outport(space->machine, data, 0);
break;
case 2:
@@ -506,13 +506,13 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.mouse.on = 1;
break;
case 0xa9: /* test mouse */
- at_8042_receive(PS2_MOUSE_ON ? 0x00 : 0xff);
+ at_8042_receive(space->machine, PS2_MOUSE_ON ? 0x00 : 0xff);
break;
case 0xaa: /* selftest */
- at_8042_receive(0x55);
+ at_8042_receive(space->machine, 0x55);
break;
case 0xab: /* test keyboard */
- at_8042_receive(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(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(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(0x00);
+ at_8042_receive(space->machine, 0x00);
break;
case 0xf0:
@@ -585,7 +585,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* an effect currently is bit 0, which pulses the CPU's reset line
*/
cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
- at_8042_set_outport(kbdc8042.outport | 0x02, 0);
+ 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 126da17e138..f6ec7b4c44c 100644
--- a/src/emu/machine/8042kbdc.h
+++ b/src/emu/machine/8042kbdc.h
@@ -21,8 +21,8 @@ typedef enum
struct kbdc8042_interface
{
kbdc8042_type_t type;
- void (*set_gate_a20)(int a20);
- void (*keyboard_interrupt)(int state);
+ void (*set_gate_a20)(running_machine *machine, int a20);
+ void (*keyboard_interrupt)(running_machine *machine, int state);
int (*get_out2)(running_machine *machine);
};
diff --git a/src/emu/machine/adc1213x.c b/src/emu/machine/adc1213x.c
index eef2493b03a..6d74ff453f0 100644
--- a/src/emu/machine/adc1213x.c
+++ b/src/emu/machine/adc1213x.c
@@ -27,7 +27,7 @@ typedef struct
int output_shift_reg;
int end_conv;
- double (*input_callback)(int input);
+ double (*input_callback)(running_machine *machine, int input);
} ADC1213X;
static ADC1213X adc1213x[MAX_ADC1213X_CHIPS];
@@ -53,7 +53,7 @@ void adc1213x_di_w(int chip, int state)
adc1213x[chip].data_in = state & 1;
}
-static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst)
+static void adc1213x_convert(running_machine *machine, int chip, int channel, int bits16, int lsbfirst)
{
int i;
int bits;
@@ -70,42 +70,42 @@ static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst)
{
case 0x8: // H L L L - CH0 (single-ended)
{
- input = adc1213x[chip].input_callback(0);
+ input = adc1213x[chip].input_callback(machine, 0);
break;
}
case 0xc: // H H L L - CH1 (single-ended)
{
- input = adc1213x[chip].input_callback(1);
+ input = adc1213x[chip].input_callback(machine, 1);
break;
}
case 0x9: // H L L H - CH2 (single-ended)
{
- input = adc1213x[chip].input_callback(2);
+ input = adc1213x[chip].input_callback(machine, 2);
break;
}
case 0xd: // H H L H - CH3 (single-ended)
{
- input = adc1213x[chip].input_callback(3);
+ input = adc1213x[chip].input_callback(machine, 3);
break;
}
case 0xa: // H L H L - CH4 (single-ended)
{
- input = adc1213x[chip].input_callback(4);
+ input = adc1213x[chip].input_callback(machine, 4);
break;
}
case 0xe: // H H H L - CH5 (single-ended)
{
- input = adc1213x[chip].input_callback(5);
+ input = adc1213x[chip].input_callback(machine, 5);
break;
}
case 0xb: // H L H H - CH6 (single-ended)
{
- input = adc1213x[chip].input_callback(6);
+ input = adc1213x[chip].input_callback(machine, 6);
break;
}
case 0xf: // H H H H - CH7 (single-ended)
{
- input = adc1213x[chip].input_callback(7);
+ input = adc1213x[chip].input_callback(machine, 7);
break;
}
default:
@@ -139,7 +139,7 @@ static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst)
adc1213x[chip].output_shift_reg >>= 1;
}
-void adc1213x_cs_w(int chip, int state)
+void adc1213x_cs_w(running_machine *machine, int chip, int state)
{
if (state)
{
@@ -153,22 +153,22 @@ void adc1213x_cs_w(int chip, int state)
{
case 0x0: // X X X X L L L L - 12 or 13 Bit MSB First conversion
{
- adc1213x_convert(chip, (mode >> 4) & 0xf, 0, 0);
+ adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 0, 0);
break;
}
case 0x1: // X X X X L L L H - 16 or 17 Bit MSB First conversion
{
- adc1213x_convert(chip, (mode >> 4) & 0xf, 1, 0);
+ adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 1, 0);
break;
}
case 0x4: // X X X X L H L L - 12 or 13 Bit LSB First conversion
{
- adc1213x_convert(chip, (mode >> 4) & 0xf, 0, 1);
+ adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 0, 1);
break;
}
case 0x5: // X X X X L H L H - 16 or 17 Bit LSB First conversion
{
- adc1213x_convert(chip, (mode >> 4) & 0xf, 1, 1);
+ adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 1, 1);
break;
}
@@ -237,7 +237,7 @@ int adc1213x_eoc_r(int chip)
return adc1213x[chip].end_conv;
}
-void adc1213x_init(int chip, double (*input_callback)( int input ))
+void adc1213x_init(int chip, double (*input_callback)( running_machine *machine, int input ))
{
memset(&adc1213x[chip], 0, sizeof(ADC1213X));
diff --git a/src/emu/machine/adc1213x.h b/src/emu/machine/adc1213x.h
index 1b02b3452e0..5fcc8237bd2 100644
--- a/src/emu/machine/adc1213x.h
+++ b/src/emu/machine/adc1213x.h
@@ -9,10 +9,10 @@
int adc1213x_do_r(int chip);
void adc1213x_di_w(int chip, int state);
-void adc1213x_cs_w(int chip, int state);
+void adc1213x_cs_w(running_machine *machine, int chip, int state);
void adc1213x_sclk_w(int chip, int state);
void adc1213x_conv_w(int chip, int state);
int adc1213x_eoc_r(int chip);
-void adc1213x_init(int chip, double (*input_callback)( int input ));
+void adc1213x_init(int chip, double (*input_callback)( running_machine *machine, int input ));
#endif
diff --git a/src/emu/machine/am53cf96.c b/src/emu/machine/am53cf96.c
index 48e34d13d15..f5a9b0d24a1 100644
--- a/src/emu/machine/am53cf96.c
+++ b/src/emu/machine/am53cf96.c
@@ -221,7 +221,7 @@ void am53cf96_init( running_machine *machine, const struct AM53CF96interface *in
// try to open the devices
for (i = 0; i < interface->scsidevs->devs_present; i++)
{
- SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
+ SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
}
state_save_register_global_array(machine, scsi_regs);
diff --git a/src/emu/machine/cr589.c b/src/emu/machine/cr589.c
index a990d07617a..acca8481835 100644
--- a/src/emu/machine/cr589.c
+++ b/src/emu/machine/cr589.c
@@ -4,7 +4,6 @@
*/
#include "driver.h"
-#include "deprecat.h"
#include "cr589.h"
typedef struct
@@ -111,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 = Machine;
+ running_machine *machine = scsiInstance->machine;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
our_this->download = 0;
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index a502e150555..d4b08f1d761 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -10,7 +10,6 @@
*********************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "config.h"
#include "generic.h"
diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c
index 432e22816d0..75a4a15d6aa 100644
--- a/src/emu/machine/mb87078.c
+++ b/src/emu/machine/mb87078.c
@@ -79,7 +79,7 @@ static int calc_gain_index(int data0, int data1)
}
-static void gain_recalc(int which)
+static void gain_recalc(running_machine *machine, int which)
{
struct MB87078 *c = chip + which;
int i;
@@ -90,21 +90,21 @@ static void gain_recalc(int which)
c->gain[i] = calc_gain_index(c->latch[i], c->latch[4+i]);
if (old_index != c->gain[i])
{
- (*c->intf->gain_changed_cb)(i, MB87078_gain_percent[c->gain[i]] );
+ (*c->intf->gain_changed_cb)(machine, i, MB87078_gain_percent[c->gain[i]] );
}
}
}
-void MB87078_start(int which, const struct MB87078interface *intf)
+void MB87078_start(running_machine *machine, int which, const struct MB87078interface *intf)
{
if (which >= MAX_MB87078) return;
chip[which].intf = intf;
/* reset chip */
- MB87078_reset_comp_w(which,0);
- MB87078_reset_comp_w(which,1);
+ MB87078_reset_comp_w(machine,which,0);
+ MB87078_reset_comp_w(machine,which,1);
}
@@ -115,7 +115,7 @@ void MB87078_stop(void)
}
-void MB87078_reset_comp_w(int which, int level)
+void MB87078_reset_comp_w(running_machine *machine, int which, int level)
{
struct MB87078 *c = chip + which;
@@ -133,11 +133,11 @@ void MB87078_reset_comp_w(int which, int level)
c->latch[6] = 0x2 | 0x4;
c->latch[7] = 0x3 | 0x4;
}
- gain_recalc(which);
+ gain_recalc(machine, which);
}
-void MB87078_data_w(int which, int data, int dsel)
+void MB87078_data_w(running_machine *machine, int which, int data, int dsel)
{
struct MB87078 *c = chip + which;
@@ -152,7 +152,7 @@ void MB87078_data_w(int which, int data, int dsel)
c->channel_latch = data & 3;
c->latch[4+c->channel_latch] = data & 0x1f; //always zero bit 5
}
- gain_recalc(which);
+ gain_recalc(machine, which);
}
diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h
index 03b16c5f63d..30d1d86313c 100644
--- a/src/emu/machine/mb87078.h
+++ b/src/emu/machine/mb87078.h
@@ -74,15 +74,15 @@
/* The interface structure */
struct MB87078interface {
- void (*gain_changed_cb)(int channel, int percent /*, float decibels*/);
+ void (*gain_changed_cb)(running_machine *machine, int channel, int percent /*, float decibels*/);
};
void MB87078_stop(void);
-void MB87078_start(int which, const struct MB87078interface *intf);
+void MB87078_start(running_machine *machine, int which, const struct MB87078interface *intf);
-void MB87078_data_w(int which, int data, int dsel);
-void MB87078_reset_comp_w(int which, int level);
+void MB87078_data_w(running_machine *machine, int which, int data, int dsel);
+void MB87078_reset_comp_w(running_machine *machine, int which, int level);
/* MB87078_gain_decibel_r will return 'channel' gain on chip 'which'.
diff --git a/src/emu/machine/microtch.c b/src/emu/machine/microtch.c
index efa7d044abb..ac9bd01a0ee 100644
--- a/src/emu/machine/microtch.c
+++ b/src/emu/machine/microtch.c
@@ -27,7 +27,7 @@ static struct
int last_touch_state;
int last_x;
int last_y;
- void (*tx_callback)(UINT8 data);
+ void (*tx_callback)(running_machine *machine, UINT8 data);
int (*touch_callback)(int *touch_x, int *touch_y);
} microtouch;
@@ -64,7 +64,7 @@ static TIMER_CALLBACK(microtouch_timer_callback)
{
if ( microtouch.tx_buffer_ptr < microtouch.tx_buffer_num )
{
- microtouch.tx_callback( microtouch.tx_buffer[microtouch.tx_buffer_ptr++] );
+ microtouch.tx_callback( machine, microtouch.tx_buffer[microtouch.tx_buffer_ptr++] );
if ( microtouch.tx_buffer_ptr == microtouch.tx_buffer_num )
{
microtouch.tx_buffer_ptr = microtouch.tx_buffer_num = 0;
@@ -107,7 +107,7 @@ static TIMER_CALLBACK(microtouch_timer_callback)
}
};
-void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data),
+void microtouch_init(running_machine *machine, void (*tx_cb)(running_machine *machine, UINT8 data),
int (*touch_cb)(int *touch_x, int *touch_y))
{
memset(&microtouch, 0, sizeof(microtouch));
diff --git a/src/emu/machine/microtch.h b/src/emu/machine/microtch.h
index 1533e3037d4..012194aac65 100644
--- a/src/emu/machine/microtch.h
+++ b/src/emu/machine/microtch.h
@@ -3,7 +3,7 @@
INPUT_PORTS_EXTERN(microtouch);
-void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
+void microtouch_init(running_machine *machine, void (*tx_cb)(running_machine *machine, UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
void microtouch_rx(int count, UINT8* data);
#endif //_MICROTOUCH_H
diff --git a/src/emu/machine/pcshare.h b/src/emu/machine/pcshare.h
index 34c711d1e90..546953d2bb8 100644
--- a/src/emu/machine/pcshare.h
+++ b/src/emu/machine/pcshare.h
@@ -6,7 +6,7 @@
void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(int));
-void pc_keyboard(void);
+void pc_keyboard(running_machine *machine);
UINT8 pc_keyb_read(void);
void pc_keyb_set_clock(int on);
void pc_keyb_clear(void);
diff --git a/src/emu/machine/scsi.c b/src/emu/machine/scsi.c
index 5e7b3700a87..f2ce60f3b72 100644
--- a/src/emu/machine/scsi.c
+++ b/src/emu/machine/scsi.c
@@ -1,10 +1,11 @@
#include "scsi.h"
-void SCSIAllocInstance( 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;
scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, (void *)scsiClass, 0, &params );
*instance = params.instance;
}
@@ -102,10 +103,11 @@ int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intpa
return scsiClass->baseClass->dispatch( operation, file, intparm, ptrparm );
}
-SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass )
+SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass )
{
SCSIInstance *scsiInstance = (SCSIInstance *) malloc_or_die( SCSISizeof( scsiClass ) );
scsiInstance->scsiClass = scsiClass;
+ scsiInstance->machine = machine;
return scsiInstance;
}
diff --git a/src/emu/machine/scsi.h b/src/emu/machine/scsi.h
index bd742dad588..38bb09df68f 100644
--- a/src/emu/machine/scsi.h
+++ b/src/emu/machine/scsi.h
@@ -22,12 +22,14 @@ typedef struct _SCSIClass
typedef struct
{
const SCSIClass *scsiClass;
+ running_machine *machine;
} SCSIInstance;
typedef struct
{
SCSIInstance *instance;
const char *diskregion;
+ running_machine *machine;
} SCSIAllocInstanceParams;
// commands accepted by a SCSI device's dispatch handler
@@ -83,7 +85,7 @@ enum
#define SCSI_PHASE_MESSAGE_OUT ( 6 )
#define SCSI_PHASE_MESSAGE_IN ( 7 )
-extern void SCSIAllocInstance( 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 );
@@ -96,7 +98,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( 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 8393b34de7c..74ad9f105ed 100644
--- a/src/emu/machine/scsicd.c
+++ b/src/emu/machine/scsicd.c
@@ -11,7 +11,6 @@
#ifdef MESS
#include "devices/chd_cd.h"
#endif
-#include "deprecat.h"
#include "scsicd.h"
typedef struct
@@ -673,7 +672,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 = Machine;
+ running_machine *machine = scsiInstance->machine;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->lba = 0;
@@ -694,7 +693,7 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
#ifdef MESS
/* TODO: get rid of this ifdef MESS section */
- our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( Machine->config->devicelist, CDROM, diskregion ) );
+ our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( machine->config->devicelist, CDROM, diskregion ) );
#else
our_this->cdrom = cdrom_open(get_disk_handle( diskregion ));
diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c
index 460e1ad420c..2fbc07564ed 100644
--- a/src/emu/machine/scsidev.c
+++ b/src/emu/machine/scsidev.c
@@ -5,7 +5,6 @@
***************************************************************************/
#include "scsidev.h"
-#include "deprecat.h"
typedef struct
{
@@ -28,7 +27,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return 0;
default:
- logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
return 0;
}
}
@@ -43,7 +42,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
switch( command[ 0 ] )
{
default:
- logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
break;
}
}
@@ -58,7 +57,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
switch( command[ 0 ] )
{
default:
- logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
break;
}
}
@@ -100,7 +99,7 @@ static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = Machine;
+ running_machine *machine = scsiInstance->machine;
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
@@ -141,7 +140,7 @@ static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptr
case SCSIOP_ALLOC_INSTANCE:
params = ptrparm;
- params->instance = SCSIMalloc( file );
+ params->instance = SCSIMalloc( params->machine, file );
scsidev_alloc_instance( params->instance, params->diskregion );
return 0;
diff --git a/src/emu/machine/scsihd.c b/src/emu/machine/scsihd.c
index 7ca4befe45b..ee6c10b9890 100644
--- a/src/emu/machine/scsihd.c
+++ b/src/emu/machine/scsihd.c
@@ -11,7 +11,6 @@
#ifdef MESS
#include "devices/harddriv.h"
#endif
-#include "deprecat.h"
#include "scsihd.h"
typedef struct
@@ -225,7 +224,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 = Machine;
+ running_machine *machine = scsiInstance->machine;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->lba = 0;
@@ -236,7 +235,7 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
#ifdef MESS
/* TODO: get rid of this ifdef MESS section */
- our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( Machine->config->devicelist, HARDDISK, diskregion ) );
+ our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( machine->config->devicelist, HARDDISK, diskregion ) );
#else
our_this->disk = hard_disk_open(get_disk_handle( diskregion ));
diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c
index de8a7733b8b..ab5baca4684 100644
--- a/src/emu/machine/wd33c93.c
+++ b/src/emu/machine/wd33c93.c
@@ -792,7 +792,7 @@ void wd33c93_init( running_machine *machine, const struct WD33C93interface *inte
// try to open the devices
for (i = 0; i < interface->scsidevs->devs_present; i++)
{
- SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
+ SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
}
/* allocate a timer for commands */
diff --git a/src/emu/mame.c b/src/emu/mame.c
index 02cccdaec90..0e63bd326ad 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -181,7 +181,7 @@ struct _mame_private
***************************************************************************/
/* the active machine */
-running_machine *Machine;
+static running_machine *Machine;
/* the current options */
static core_options *mame_opts;
@@ -1144,6 +1144,7 @@ static void fatalerror_common(running_machine *machine, int exitcode, const char
void CLIB_DECL fatalerror(const char *text, ...)
{
+ extern running_machine *Machine;
running_machine *machine = Machine;
va_list arg;
@@ -1202,6 +1203,7 @@ void CLIB_DECL popmessage(const char *format, ...)
void CLIB_DECL logerror(const char *format, ...)
{
+ extern running_machine *Machine;
running_machine *machine = Machine;
/* currently, we need a machine to do this */
diff --git a/src/emu/sound/5110intf.c b/src/emu/sound/5110intf.c
index e02149b71a4..53f4065abf3 100644
--- a/src/emu/sound/5110intf.c
+++ b/src/emu/sound/5110intf.c
@@ -35,7 +35,7 @@ struct tms5110_info
/* static function prototypes */
static STREAM_UPDATE( tms5110_update );
-static int speech_rom_read_bit(void)
+static int speech_rom_read_bit(const device_config *device)
{
struct tms5110_info *info = sndti_token(SOUND_TMS5110, 0);
diff --git a/src/emu/sound/5110intf.h b/src/emu/sound/5110intf.h
index a92ff347c5a..dc5d6501e9d 100644
--- a/src/emu/sound/5110intf.h
+++ b/src/emu/sound/5110intf.h
@@ -10,7 +10,7 @@
typedef struct _tms5110_interface tms5110_interface;
struct _tms5110_interface
{
- int (*M0_callback)(void); /* function to be called when chip requests another bit */
+ int (*M0_callback)(const device_config *device); /* function to be called when chip requests another bit */
void (*load_address)(int addr); /* speech ROM load address callback */
};
diff --git a/src/emu/sound/custom.c b/src/emu/sound/custom.c
index 3cbe58283b0..cdb563bbd64 100644
--- a/src/emu/sound/custom.c
+++ b/src/emu/sound/custom.c
@@ -34,7 +34,7 @@ static SND_STOP( custom )
{
struct custom_info *info = device->token;
if (info->intf->stop)
- (*info->intf->stop)(info->token);
+ (*info->intf->stop)(device, info->token);
}
@@ -42,7 +42,7 @@ static SND_RESET( custom )
{
struct custom_info *info = device->token;
if (info->intf->reset)
- (*info->intf->reset)(info->token);
+ (*info->intf->reset)(device, info->token);
}
diff --git a/src/emu/sound/custom.h b/src/emu/sound/custom.h
index 40c82b85350..16d7abf847b 100644
--- a/src/emu/sound/custom.h
+++ b/src/emu/sound/custom.h
@@ -7,15 +7,15 @@ typedef struct _custom_sound_interface custom_sound_interface;
struct _custom_sound_interface
{
void *(*start)(const device_config *device, int clock, const custom_sound_interface *config);
- void (*stop)(void *token);
- void (*reset)(void *token);
+ void (*stop)(const device_config *device, void *token);
+ void (*reset)(const device_config *device, void *token);
void *extra_data;
};
void *custom_get_token(int index);
#define CUSTOM_START(name) void *name(const device_config *device, int clock, const custom_sound_interface *config)
-#define CUSTOM_STOP(name) void name(void *token)
-#define CUSTOM_RESET(name) void name(void *token)
+#define CUSTOM_STOP(name) void name(const device_config *device, void *token)
+#define CUSTOM_RESET(name) void name(const device_config *device, void *token)
#endif /* __CUSTOM_H__ */
diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c
index 7c965529fb3..6a2792d9913 100644
--- a/src/emu/sound/psx.c
+++ b/src/emu/sound/psx.c
@@ -213,10 +213,9 @@ static STREAM_UPDATE( PSXSPU_update )
}
}
-static void spu_read( UINT32 n_address, INT32 n_size )
+static void spu_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
struct psxinfo *chip = sndti_token(SOUND_PSXSPU, 0);
- running_machine *machine = chip->device->machine;
verboselog( machine, 1, "spu_read( %08x, %08x )\n", n_address, n_size );
while( n_size > 0 )
@@ -233,10 +232,9 @@ static void spu_read( UINT32 n_address, INT32 n_size )
}
}
-static void spu_write( UINT32 n_address, INT32 n_size )
+static void spu_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
struct psxinfo *chip = sndti_token(SOUND_PSXSPU, 0);
- running_machine *machine = chip->device->machine;
verboselog( machine, 1, "spu_write( %08x, %08x )\n", n_address, n_size );
while( n_size > 0 )
diff --git a/src/emu/sound/psx.h b/src/emu/sound/psx.h
index f7fd8afad9f..6aca4bd34a6 100644
--- a/src/emu/sound/psx.h
+++ b/src/emu/sound/psx.h
@@ -16,7 +16,7 @@ READ32_HANDLER( psx_spu_r );
WRITE32_HANDLER( psx_spu_delay_w );
READ32_HANDLER( psx_spu_delay_r );
-typedef void ( *spu_handler )( UINT32, INT32 );
+typedef void ( *spu_handler )( running_machine *, UINT32, INT32 );
typedef struct _psx_spu_interface psx_spu_interface;
struct _psx_spu_interface
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index deedd736bd3..1ce005c2419 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -58,7 +58,7 @@
if( sp->sby_line != line_state ) \
{ \
sp->sby_line = line_state; \
- if( sp->sby ) sp->sby(sp->sby_line); \
+ if( sp->sby ) sp->sby(sp->device, sp->sby_line); \
} \
}
@@ -77,9 +77,10 @@ struct lpc12_t
struct sp0256
{
+ const device_config *device;
sound_stream *stream; /* MAME core sound stream */
- void (*drq)(int state); /* Data request callback */
- void (*sby)(int state); /* Standby callback */
+ void (*drq)(const device_config *device, int state); /* Data request callback */
+ void (*sby)(const device_config *device, int state); /* Standby callback */
int sby_line; /* Standby line state */
INT16 *cur_buf; /* Current sound buffer. */
int cur_len; /* Fullness of current sound buffer. */
@@ -766,7 +767,7 @@ static void sp0256_micro(struct sp0256 *sp)
sp->ald = 0;
for (i = 0; i < 16; i++)
sp->filt.r[i] = 0;
- if( sp->drq) sp->drq(ASSERT_LINE);
+ if( sp->drq) sp->drq(sp->device, ASSERT_LINE);
}
/* ---------------------------------------------------------------- */
@@ -1175,10 +1176,11 @@ static SND_START( sp0256 )
sp = auto_malloc(sizeof(*sp));
memset(sp, 0, sizeof(*sp));
+ sp->device = device;
sp->drq = intf->lrq_callback;
sp->sby = intf->sby_callback;
- if( sp->drq ) sp->drq(ASSERT_LINE);
- if( sp->sby ) sp->sby(sp->sby_line = ASSERT_LINE);
+ if( sp->drq ) sp->drq(device, ASSERT_LINE);
+ if( sp->sby ) sp->sby(device, sp->sby_line = ASSERT_LINE);
sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0256_update);
@@ -1236,7 +1238,7 @@ static void sp0256_reset(struct sp0256 *sp)
sp->mode = 0;
sp->page = 0x1000 << 3;
sp->silent = 1;
- if( sp->drq ) sp->drq(ASSERT_LINE);
+ if( sp->drq ) sp->drq(sp->device, ASSERT_LINE);
SET_SBY(ASSERT_LINE)
}
@@ -1265,7 +1267,7 @@ WRITE8_HANDLER( sp0256_ALD_w )
/* ---------------------------------------------------------------- */
sp->lrq = 0;
sp->ald = (0xFF & data) << 4;
- if( sp->drq ) sp->drq(CLEAR_LINE);
+ if( sp->drq ) sp->drq(sp->device, CLEAR_LINE);
SET_SBY(CLEAR_LINE)
return;
diff --git a/src/emu/sound/sp0256.h b/src/emu/sound/sp0256.h
index 312408b8fda..edcfd6d0701 100644
--- a/src/emu/sound/sp0256.h
+++ b/src/emu/sound/sp0256.h
@@ -25,8 +25,8 @@
typedef struct _sp0256_interface sp0256_interface;
struct _sp0256_interface {
- void (*lrq_callback)(int state);
- void (*sby_callback)(int state);
+ void (*lrq_callback)(const device_config *device, int state);
+ void (*sby_callback)(const device_config *device, int state);
};
void sp0256_bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length);
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index af198b010dc..fc7315c41a7 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -111,8 +111,9 @@ struct tms5110
UINT8 addr_bit;
/* external callback */
- int (*M0_callback)(void);
+ int (*M0_callback)(const device_config *);
void (*set_load_address)(int);
+ const device_config *device;
/* these contain data describing the current and previous voice frames */
UINT16 old_energy;
@@ -183,6 +184,7 @@ void *tms5110_create(const device_config *device, int variant)
tms = malloc_or_die(sizeof(*tms));
memset(tms, 0, sizeof(*tms));
+ tms->device = device;
tms5110_set_variant(tms, variant);
state_save_register_device_item_array(device, 0, tms->fifo);
@@ -280,7 +282,7 @@ void tms5110_reset_chip(void *chip)
******************************************************************************************/
-void tms5110_set_M0_callback(void *chip, int (*func)(void))
+void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *))
{
struct tms5110 *tms = chip;
tms->M0_callback = func;
@@ -347,7 +349,7 @@ int i;
{
if (tms->M0_callback)
{
- int data = (*tms->M0_callback)();
+ int data = (*tms->M0_callback)(tms->device);
FIFO_data_write(tms, data);
}
else
@@ -361,7 +363,7 @@ static void perform_dummy_read(struct tms5110 *tms)
{
if (tms->M0_callback)
{
- int data = (*tms->M0_callback)();
+ int data = (*tms->M0_callback)(tms->device);
if (DEBUG_5110) logerror("TMS5110 performing dummy read; value read = %1i\n", data&1);
}
else
diff --git a/src/emu/sound/tms5110.h b/src/emu/sound/tms5110.h
index b9c157ee61a..c6a739f2945 100644
--- a/src/emu/sound/tms5110.h
+++ b/src/emu/sound/tms5110.h
@@ -33,7 +33,7 @@ void tms5110_destroy(void *chip);
void tms5110_set_variant(void *chip, int variant);
void tms5110_reset_chip(void *chip);
-void tms5110_set_M0_callback(void *chip, int (*func)(void));
+void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *));
void tms5110_set_load_address(void *chip, void (*func)(int));
void tms5110_CTL_set(void *chip, int data);
diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c
index 7b3b285d863..7fdb0297020 100644
--- a/src/emu/sound/upd7759.c
+++ b/src/emu/sound/upd7759.c
@@ -148,6 +148,7 @@ enum
struct upd7759_chip
{
+ const device_config *device;
sound_stream *channel; /* stream channel for playback */
/* internal clock to output sample rate mapping */
@@ -161,7 +162,7 @@ struct upd7759_chip
UINT8 reset; /* current state of the RESET line */
UINT8 start; /* current state of the START line */
UINT8 drq; /* current state of the DRQ line */
- void (*drqcallback)(int param); /* drq callback */
+ void (*drqcallback)(const device_config *device, int param); /* drq callback */
/* internal state machine */
INT8 state; /* current overall chip state */
@@ -536,7 +537,7 @@ static TIMER_CALLBACK( upd7759_slave_update )
/* if the DRQ changed, update it */
logerror("slave_update: DRQ %d->%d\n", olddrq, chip->drq);
if (olddrq != chip->drq && chip->drqcallback)
- (*chip->drqcallback)(chip->drq);
+ (*chip->drqcallback)(chip->device, chip->drq);
/* set a timer to go off when that is done */
if (chip->state != STATE_IDLE)
@@ -634,6 +635,8 @@ static SND_START( upd7759 )
chip = auto_malloc(sizeof(*chip));
memset(chip, 0, sizeof(*chip));
+ chip->device = device;
+
/* allocate a stream channel */
chip->channel = stream_create(device, 0, 1, clock/4, chip, upd7759_update);
diff --git a/src/emu/sound/upd7759.h b/src/emu/sound/upd7759.h
index 92808ed5d5d..95b966ada1a 100644
--- a/src/emu/sound/upd7759.h
+++ b/src/emu/sound/upd7759.h
@@ -13,7 +13,7 @@
typedef struct _upd7759_interface upd7759_interface;
struct _upd7759_interface
{
- void (*drqcallback)(int param); /* drq callback (per chip, slave mode only) */
+ void (*drqcallback)(const device_config *device, int param); /* drq callback (per chip, slave mode only) */
};
void upd7759_set_bank_base(int which, offs_t base);
diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c
index 61edee55e3c..1e7db38294e 100644
--- a/src/emu/video/generic.c
+++ b/src/emu/video/generic.c
@@ -10,7 +10,6 @@
*********************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "generic.h"
@@ -482,10 +481,10 @@ static void updateflip(running_machine *machine)
flip_screen_set - set global flip
-------------------------------------------------*/
-void flip_screen_set(int on)
+void flip_screen_set(running_machine *machine, int on)
{
- flip_screen_x_set(on);
- flip_screen_y_set(on);
+ flip_screen_x_set(machine, on);
+ flip_screen_y_set(machine, on);
}
@@ -494,7 +493,7 @@ void flip_screen_set(int on)
do not call update_flip.
-------------------------------------------------*/
-void flip_screen_set_no_update(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
@@ -509,13 +508,13 @@ void flip_screen_set_no_update(int on)
flip_screen_x_set - set global horizontal flip
-------------------------------------------------*/
-void flip_screen_x_set(int on)
+void flip_screen_x_set(running_machine *machine, int on)
{
if (on) on = ~0;
if (flip_screen_x != on)
{
flip_screen_x = on;
- updateflip(Machine);
+ updateflip(machine);
}
}
@@ -524,13 +523,13 @@ void flip_screen_x_set(int on)
flip_screen_y_set - set global vertical flip
-------------------------------------------------*/
-void flip_screen_y_set(int on)
+void flip_screen_y_set(running_machine *machine, int on)
{
if (on) on = ~0;
if (flip_screen_y != on)
{
flip_screen_y = on;
- updateflip(Machine);
+ updateflip(machine);
}
}
@@ -539,7 +538,7 @@ void flip_screen_y_set(int on)
flip_screen_get - get global flip
-------------------------------------------------*/
-int flip_screen_get(void)
+int flip_screen_get(running_machine *machine)
{
return flip_screen_x;
}
@@ -549,7 +548,7 @@ int flip_screen_get(void)
flip_screen_x_get - get global x flip
-------------------------------------------------*/
-int flip_screen_x_get(void)
+int flip_screen_x_get(running_machine *machine)
{
return flip_screen_x;
}
@@ -559,12 +558,13 @@ int flip_screen_x_get(void)
flip_screen_get - get global y flip
-------------------------------------------------*/
-int flip_screen_y_get(void)
+int flip_screen_y_get(running_machine *machine)
{
return flip_screen_y;
}
+
/***************************************************************************
COMMON PALETTE INITIALIZATION
***************************************************************************/
diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h
index 30e6cdd5527..92b3270e0f7 100644
--- a/src/emu/video/generic.h
+++ b/src/emu/video/generic.h
@@ -117,15 +117,15 @@ void buffer_spriteram_2(UINT8 *ptr, int length);
/* ----- global attributes ----- */
/* set global attributes */
-void flip_screen_set(int on);
-void flip_screen_set_no_update(int on); /* will not call update_flip */
-void flip_screen_x_set(int on);
-void flip_screen_y_set(int on);
-int flip_screen_get(void);
-int flip_screen_x_get(void);
-int flip_screen_y_get(void);
-
-//#define flip_screen flip_screen_get()
+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/vector.c b/src/emu/video/vector.c
index efebae9b493..311167dd220 100644
--- a/src/emu/video/vector.c
+++ b/src/emu/video/vector.c
@@ -31,7 +31,6 @@
**************************************************************************** */
#include "rendutil.h"
-#include "deprecat.h"
#include "vector.h"
@@ -193,7 +192,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 (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;
@@ -202,7 +201,7 @@ void vector_add_point (int x, int y, rgb_t color, int intensity)
if (flicker && (intensity > 0))
{
- intensity += (intensity * (0x80-(mame_rand(Machine)&0xff)) * flicker)>>16;
+ intensity += (intensity * (0x80-(mame_rand(machine)&0xff)) * flicker)>>16;
if (intensity < 0)
intensity = 0;
if (intensity > 0xff)
diff --git a/src/emu/video/vector.h b/src/emu/video/vector.h
index a141dcb090c..b44abdb883c 100644
--- a/src/emu/video/vector.h
+++ b/src/emu/video/vector.h
@@ -17,7 +17,7 @@ VIDEO_START( vector );
VIDEO_UPDATE( vector );
void vector_clear_list(void);
-void vector_add_point(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/mame/audio/cage.c b/src/mame/audio/cage.c
index 689fc011266..c6b12564411 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -10,7 +10,6 @@
#include "driver.h"
-#include "deprecat.h"
#include "cpu/tms32031/tms32031.h"
#include "sound/dmadac.h"
#include "cage.h"
@@ -193,7 +192,7 @@ void cage_set_irq_handler(void (*irqhandler)(running_machine *, int))
void cage_reset_w(int state)
{
if (state)
- cage_control_w(Machine, 0);
+ cage_control_w(cage_cpu->machine, 0);
cpu_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -529,9 +528,10 @@ static TIMER_CALLBACK( deferred_cage_w )
void main_to_cage_w(UINT16 data)
{
+ running_machine *machine = cage_cpu->machine;
if (LOG_COMM)
- logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(Machine), data);
- timer_call_after_resynch(Machine, NULL, data, deferred_cage_w);
+ logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(machine), data);
+ timer_call_after_resynch(machine, NULL, data, deferred_cage_w);
}
diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c
index 50eb69de6ff..931f48077a1 100644
--- a/src/mame/audio/cinemat.c
+++ b/src/mame/audio/cinemat.c
@@ -18,7 +18,6 @@
#include "driver.h"
#include "cpu/z80/z80.h"
-#include "deprecat.h"
#include "cpu/ccpu/ccpu.h"
#include "cpu/z80/z80daisy.h"
#include "machine/z80ctc.h"
@@ -53,7 +52,7 @@
*
*************************************/
-static void (*sound_handler)(UINT8 sound_val, UINT8 bits_changed);
+static void (*sound_handler)(running_machine *,UINT8 sound_val, UINT8 bits_changed);
static UINT8 sound_control;
/* general shift register variables */
@@ -86,7 +85,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
/* if something changed, call the sound subroutine */
if ((sound_control != oldval) && sound_handler)
- (*sound_handler)(sound_control, sound_control ^ oldval);
+ (*sound_handler)(space->machine, sound_control, sound_control ^ oldval);
}
@@ -97,7 +96,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
*
*************************************/
-static void generic_init(running_machine *machine, void (*callback)(UINT8, UINT8))
+static void generic_init(running_machine *machine, void (*callback)(running_machine *,UINT8, UINT8))
{
/* call the standard init */
MACHINE_RESET_CALL(cinemat);
@@ -160,10 +159,8 @@ static const samples_interface spacewar_samples_interface =
spacewar_sample_names
};
-static void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
- running_machine *machine = Machine;
-
/* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
sample_start(0, (mame_rand(machine) & 1) ? 0 : 6, 0);
@@ -239,7 +236,7 @@ static const samples_interface barrier_samples_interface =
barrier_sample_names
};
-static void barrier_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* Player die - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@@ -290,7 +287,7 @@ static const samples_interface speedfrk_samples_interface =
speedfrk_sample_names
};
-static void speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
if (SOUNDVAL_FALLING_EDGE(0x08))
@@ -353,7 +350,7 @@ static const samples_interface starhawk_samples_interface =
starhawk_sample_names
};
-static void starhawk_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* explosion - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -427,7 +424,7 @@ static const samples_interface sundance_samples_interface =
sundance_sample_names
};
-static void sundance_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* bong - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -495,7 +492,7 @@ static const samples_interface tailg_samples_interface =
tailg_sample_names
};
-static void tailg_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
if (SOUNDVAL_FALLING_EDGE(0x10))
@@ -581,7 +578,7 @@ static const samples_interface warrior_samples_interface =
warrior_sample_names
};
-static void warrior_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* normal level - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -650,7 +647,7 @@ static const samples_interface armora_samples_interface =
armora_sample_names
};
-static void armora_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -749,7 +746,7 @@ static const samples_interface ripoff_samples_interface =
ripoff_sample_names
};
-static void ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x02))
@@ -834,9 +831,8 @@ static const samples_interface starcas_samples_interface =
starcas_sample_names
};
-static void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
- running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -947,9 +943,8 @@ static const samples_interface solarq_samples_interface =
solarq_sample_names
};
-static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
- running_machine *machine = Machine;
static float target_volume, current_volume;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1087,7 +1082,7 @@ static const samples_interface boxingb_samples_interface =
boxingb_sample_names
};
-static void boxingb_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -1216,9 +1211,8 @@ static const samples_interface wotw_samples_interface =
wotw_sample_names
};
-static void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
- running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1329,9 +1323,8 @@ static const samples_interface wotwc_samples_interface =
wotwc_sample_names
};
-static void wotwc_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
- running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1429,10 +1422,8 @@ static TIMER_CALLBACK( synced_sound_w )
}
-static void demon_sound_w(UINT8 sound_val, UINT8 bits_changed)
+static void demon_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
- running_machine *machine = Machine;
-
/* all inputs are inverted */
sound_val = ~sound_val;
@@ -1599,7 +1590,7 @@ MACHINE_DRIVER_END
static WRITE8_HANDLER( qb3_sound_w )
{
UINT16 rega = cpu_get_reg(space->machine->cpu[0], CCPU_A);
- demon_sound_w(0x00 | (~rega & 0x0f), 0x10);
+ demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
}
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index eb0b1c99ee3..621854825fc 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -150,7 +150,6 @@
****************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/adsp2100/adsp2100.h"
#include "dcs.h"
#include "sound/dmadac.h"
@@ -319,8 +318,8 @@ struct _dcs_state
UINT8 last_output_full;
UINT8 last_input_empty;
UINT16 progflags;
- void (*output_full_cb)(int);
- void (*input_empty_cb)(int);
+ void (*output_full_cb)(running_machine *, int);
+ void (*input_empty_cb)(running_machine *, int);
UINT16 (*fifo_data_r)(const device_config *device);
UINT16 (*fifo_status_r)(const device_config *device);
@@ -824,9 +823,9 @@ static TIMER_CALLBACK( dcs_reset )
SET_INPUT_EMPTY();
SET_OUTPUT_EMPTY();
if (!dcs.last_input_empty && dcs.input_empty_cb)
- (*dcs.input_empty_cb)(dcs.last_input_empty = 1);
+ (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 1);
if (dcs.last_output_full && dcs.output_full_cb)
- (*dcs.output_full_cb)(dcs.last_output_full = 0);
+ (*dcs.output_full_cb)(machine, dcs.last_output_full = 0);
/* boot */
dcs_boot();
@@ -1068,7 +1067,7 @@ static WRITE16_HANDLER( dcs_data_bank_select_w )
*
*************************************/
-INLINE void sdrc_update_bank_pointers(void)
+INLINE void sdrc_update_bank_pointers(running_machine *machine)
{
if (SDRC_SM_EN != 0)
{
@@ -1079,15 +1078,15 @@ INLINE void sdrc_update_bank_pointers(void)
{
/* ROM-based; use the memory page to select from ROM */
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
- memory_set_bankptr(Machine, 25, &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
+ memory_set_bankptr(machine, 25, &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
}
else
{
/* RAM-based; use the ROM page to select from ROM, and the memory page to select from RAM */
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
- memory_set_bankptr(Machine, 25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
+ memory_set_bankptr(machine, 25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
if (SDRC_DM_ST != 0)
- memory_set_bankptr(Machine, 26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
+ memory_set_bankptr(machine, 26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
}
}
}
@@ -1148,7 +1147,7 @@ static void sdrc_remap_memory(running_machine *machine)
}
/* update the bank pointers */
- sdrc_update_bank_pointers();
+ sdrc_update_bank_pointers(machine);
}
@@ -1232,7 +1231,7 @@ static WRITE16_HANDLER( sdrc_w )
if (diff & 0x1833)
sdrc_remap_memory(space->machine);
if (diff & 0x0380)
- sdrc_update_bank_pointers();
+ sdrc_update_bank_pointers(space->machine);
break;
/* offset 1 controls RAM mapping */
@@ -1247,7 +1246,7 @@ static WRITE16_HANDLER( sdrc_w )
case 2:
sdrc.reg[2] = data;
if (diff & 0x1fff)
- sdrc_update_bank_pointers();
+ sdrc_update_bank_pointers(space->machine);
break;
/* offset 3 controls security */
@@ -1458,7 +1457,7 @@ READ32_HANDLER( dsio_idma_data_r )
DCS COMMUNICATIONS
****************************************************************************/
-void dcs_set_io_callbacks(void (*output_full_cb)(int), void (*input_empty_cb)(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;
@@ -1476,7 +1475,7 @@ int dcs_control_r(void)
{
/* only boost for DCS2 boards */
if (!dcs.auto_ack && !transfer.hle_enabled)
- cpuexec_boost_interleave(Machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5));
+ cpuexec_boost_interleave(dcs.cpu->machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5));
return dcs.latch_control;
}
@@ -1486,10 +1485,10 @@ void dcs_reset_w(int state)
/* going high halts the CPU */
if (state)
{
- logerror("%s: DCS reset = %d\n", cpuexec_describe_context(Machine), state);
+ logerror("%s: DCS reset = %d\n", cpuexec_describe_context(dcs.cpu->machine), state);
/* just run through the init code again */
- timer_call_after_resynch(Machine, NULL, 0, dcs_reset);
+ timer_call_after_resynch(dcs.cpu->machine, NULL, 0, dcs_reset);
cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
@@ -1541,7 +1540,7 @@ static void dcs_delayed_data_w(running_machine *machine, int data)
/* indicate we are no longer empty */
if (dcs.last_input_empty && dcs.input_empty_cb)
- (*dcs.input_empty_cb)(dcs.last_input_empty = 0);
+ (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 0);
SET_INPUT_FULL();
/* set the data */
@@ -1558,21 +1557,21 @@ static TIMER_CALLBACK( dcs_delayed_data_w_callback )
void dcs_data_w(int data)
{
/* preprocess the write */
- if (preprocess_write(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)
- timer_call_after_resynch(Machine, NULL, data, dcs_delayed_data_w_callback);
+ timer_call_after_resynch(dcs.cpu->machine, NULL, data, dcs_delayed_data_w_callback);
else
- dcs_delayed_data_w(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)(dcs.last_input_empty = 1);
+ (*dcs.input_empty_cb)(space->machine, dcs.last_input_empty = 1);
SET_INPUT_EMPTY();
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
}
@@ -1596,7 +1595,7 @@ static READ16_HANDLER( input_latch_r )
static TIMER_CALLBACK( latch_delayed_w )
{
if (!dcs.last_output_full && dcs.output_full_cb)
- (*dcs.output_full_cb)(dcs.last_output_full = 1);
+ (*dcs.output_full_cb)(machine, dcs.last_output_full = 1);
SET_OUTPUT_FULL();
dcs.output_data = param;
}
@@ -1624,7 +1623,7 @@ static TIMER_CALLBACK( delayed_ack_w_callback )
void dcs_ack_w(void)
{
- timer_call_after_resynch(Machine, NULL, 0, delayed_ack_w_callback);
+ timer_call_after_resynch(dcs.cpu->machine, NULL, 0, delayed_ack_w_callback);
}
@@ -1632,12 +1631,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.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", cpuexec_describe_context(Machine), dcs.output_data);
+ logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context(dcs.cpu->machine), dcs.output_data);
return dcs.output_data;
}
@@ -2064,7 +2063,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(Machine, (*dcs.fifo_data_r)(dcs.cpu));
+ preprocess_write(dcs.cpu->machine, (*dcs.fifo_data_r)(dcs.cpu));
}
}
@@ -2363,9 +2362,9 @@ static int preprocess_write(running_machine *machine, UINT16 data)
if (result && dcs.input_empty_cb)
{
if (dcs.last_input_empty)
- (*dcs.input_empty_cb)(dcs.last_input_empty = 0);
+ (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 0);
if (!dcs.last_input_empty)
- (*dcs.input_empty_cb)(dcs.last_input_empty = 1);
+ (*dcs.input_empty_cb)(machine, dcs.last_input_empty = 1);
}
return result;
}
diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h
index 2b2efb0a1a8..1c46be99b7c 100644
--- a/src/mame/audio/dcs.h
+++ b/src/mame/audio/dcs.h
@@ -17,7 +17,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset);
void dcs_set_auto_ack(int state);
void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(const device_config *device), UINT16 (*fifo_status_r)(const device_config *device));
-void dcs_set_io_callbacks(void (*output_full_cb)(int), void (*input_empty_cb)(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/gottlieb.c b/src/mame/audio/gottlieb.c
index 88c0d86b2d2..9273a0e2c88 100644
--- a/src/mame/audio/gottlieb.c
+++ b/src/mame/audio/gottlieb.c
@@ -6,7 +6,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/m6502/m6502.h"
#include "machine/6532riot.h"
#include "sound/samples.h"
@@ -200,9 +199,9 @@ static void trigger_sample(running_machine *machine, UINT8 data)
#ifdef UNUSED_FUNCTION
-void gottlieb_knocker(void)
+void gottlieb_knocker(running_machine *machine)
{
- if (!strcmp(Machine->gamedrv->name,"reactor")) /* reactor */
+ if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */
{
}
else if (sndti_exists(SOUND_SAMPLES, 0)) /* qbert */
diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c
index 8b69bd37836..08a5245a523 100644
--- a/src/mame/audio/jaguar.c
+++ b/src/mame/audio/jaguar.c
@@ -143,7 +143,6 @@
****************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "memconv.h"
#include "includes/jaguar.h"
#include "cpu/jaguar/jaguar.h"
@@ -209,15 +208,15 @@ void jaguar_dsp_resume(running_machine *machine)
*
*************************************/
-static void update_gpu_irq(void)
+static void update_gpu_irq(running_machine *machine)
{
if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f)
{
- cpu_set_input_line(Machine->cpu[1], 1, ASSERT_LINE);
- jaguar_gpu_resume(Machine);
+ cpu_set_input_line(machine->cpu[1], 1, ASSERT_LINE);
+ jaguar_gpu_resume(machine);
}
else
- cpu_set_input_line(Machine->cpu[1], 1, CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[1], 1, CLEAR_LINE);
}
@@ -227,7 +226,7 @@ void jaguar_external_int(const device_config *device, int state)
gpu_irq_state |= 1;
else
gpu_irq_state &= ~1;
- update_gpu_irq();
+ update_gpu_irq(device->machine);
}
@@ -283,12 +282,12 @@ void cojag_sound_init(running_machine *machine)
*
*************************************/
-void cojag_sound_reset(void)
+void cojag_sound_reset(running_machine *machine)
{
#if ENABLE_SPEEDUP_HACKS
- serial_timer = timer_alloc(Machine, serial_chunky_callback, NULL);
+ serial_timer = timer_alloc(machine, serial_chunky_callback, NULL);
#else
- serial_timer = timer_alloc(Machine, serial_callback, NULL);
+ serial_timer = timer_alloc(machine, serial_callback, NULL);
#endif
}
@@ -323,7 +322,7 @@ WRITE16_HANDLER( jaguar_jerry_regs_w )
{
case JINTCTRL:
gpu_irq_state &= ~(dsp_regs[JINTCTRL] >> 8);
- update_gpu_irq();
+ update_gpu_irq(space->machine);
break;
}
diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c
index bc05c419708..0bc9d8ad94b 100644
--- a/src/mame/audio/mcr.c
+++ b/src/mame/audio/mcr.c
@@ -9,14 +9,12 @@
#include "driver.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
-#include "deprecat.h"
-#include "audio/mcr.h"
-#include "audio/williams.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
#include "sound/5220intf.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
+#include "audio/williams.h"
#include "includes/mcr.h"
#include "audio/mcr.h"
@@ -101,7 +99,7 @@ static const pia6821_interface squawkntalk_pia1_intf;
*
*************************************/
-static void ssio_compute_ay8910_modulation(void);
+static void ssio_compute_ay8910_modulation(running_machine *machine);
@@ -122,7 +120,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
if (mcr_sound_config & MCR_SSIO)
{
ssio_sound_cpu = sound_cpu++;
- ssio_compute_ay8910_modulation();
+ ssio_compute_ay8910_modulation(machine);
state_save_register_global_array(machine, ssio_data);
state_save_register_global(machine, ssio_status);
state_save_register_global(machine, ssio_14024_count);
@@ -172,48 +170,48 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Advanced Audio */
if (mcr_sound_config & MCR_WILLIAMS_SOUND)
{
- williams_cvsd_init(0);
+ williams_cvsd_init(machine, 0);
sound_cpu++;
dac_index++;
}
}
-void mcr_sound_reset(void)
+void mcr_sound_reset(running_machine *machine)
{
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
{
- ssio_reset_w(1);
- ssio_reset_w(0);
+ ssio_reset_w(machine, 1);
+ ssio_reset_w(machine, 0);
}
/* Turbo Chip Squeak */
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
{
- turbocs_reset_w(1);
- turbocs_reset_w(0);
+ turbocs_reset_w(machine, 1);
+ turbocs_reset_w(machine, 0);
}
/* Chip Squeak Deluxe */
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
{
- csdeluxe_reset_w(1);
- csdeluxe_reset_w(0);
+ csdeluxe_reset_w(machine, 1);
+ csdeluxe_reset_w(machine, 0);
}
/* Sounds Good */
if (mcr_sound_config & MCR_SOUNDS_GOOD)
{
- soundsgood_reset_w(1);
- soundsgood_reset_w(0);
+ soundsgood_reset_w(machine, 1);
+ soundsgood_reset_w(machine, 0);
}
/* Squawk n Talk */
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
{
- squawkntalk_reset_w(1);
- squawkntalk_reset_w(0);
+ squawkntalk_reset_w(machine, 1);
+ squawkntalk_reset_w(machine, 0);
}
/* Advanced Audio */
@@ -269,9 +267,9 @@ void mcr_sound_reset(void)
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(void)
+static void ssio_compute_ay8910_modulation(running_machine *machine)
{
- UINT8 *prom = memory_region(Machine, "proms");
+ UINT8 *prom = memory_region(machine, "proms");
int volval;
/* loop over all possible values of the duty cycle */
@@ -393,14 +391,14 @@ READ8_HANDLER( ssio_status_r )
return ssio_status;
}
-void ssio_reset_w(int state)
+void ssio_reset_w(running_machine *machine, int state)
{
/* going high halts the CPU */
if (state)
{
int i;
- cpu_set_input_line(Machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, ASSERT_LINE);
+ cpu_set_input_line(machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, ASSERT_LINE);
/* latches also get reset */
for (i = 0; i < 4; i++)
@@ -410,7 +408,7 @@ void ssio_reset_w(int state)
}
/* going low resets and reactivates the CPU */
else
- cpu_set_input_line(Machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, CLEAR_LINE);
}
READ8_HANDLER( ssio_input_port_r )
@@ -583,9 +581,9 @@ READ8_HANDLER( csdeluxe_status_r )
return csdeluxe_status;
}
-void csdeluxe_reset_w(int state)
+void csdeluxe_reset_w(running_machine *machine, int state)
{
- cpu_set_input_line(Machine->cpu[csdeluxe_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[csdeluxe_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -688,10 +686,10 @@ READ8_HANDLER( soundsgood_status_r )
return soundsgood_status;
}
-void soundsgood_reset_w(int state)
+void soundsgood_reset_w(running_machine *machine, int state)
{
//if (state) mame_printf_debug("SG Reset\n");
- cpu_set_input_line(Machine->cpu[soundsgood_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[soundsgood_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -784,9 +782,9 @@ READ8_HANDLER( turbocs_status_r )
return turbocs_status;
}
-void turbocs_reset_w(int state)
+void turbocs_reset_w(running_machine *machine, int state)
{
- cpu_set_input_line(Machine->cpu[turbocs_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[turbocs_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -910,9 +908,9 @@ WRITE8_HANDLER( squawkntalk_data_w )
timer_call_after_resynch(space->machine, NULL, data, squawkntalk_delayed_data_w);
}
-void squawkntalk_reset_w(int state)
+void squawkntalk_reset_w(running_machine *machine, int state)
{
- cpu_set_input_line(Machine->cpu[squawkntalk_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[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 c026cb546ae..fc7a0be2691 100644
--- a/src/mame/audio/mcr.h
+++ b/src/mame/audio/mcr.h
@@ -13,30 +13,30 @@
/************ Generic MCR routines ***************/
void mcr_sound_init(running_machine *machine, UINT8 config);
-void mcr_sound_reset(void);
+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(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(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(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(int state);
+void soundsgood_reset_w(running_machine *machine, int state);
WRITE8_HANDLER( squawkntalk_data_w );
-void squawkntalk_reset_w(int state);
+void squawkntalk_reset_w(running_machine *machine, int state);
diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c
index 6d3f99dc538..d9f2e91d3dd 100644
--- a/src/mame/audio/n8080.c
+++ b/src/mame/audio/n8080.c
@@ -322,7 +322,7 @@ static void delayed_sound_2(running_machine *machine, int data)
if (n8080_hardware == 1)
{
- flip_screen_set_no_update(data & 0x20);
+ flip_screen_set_no_update(machine, data & 0x20);
}
if (n8080_hardware == 3)
{
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index 88013e463d7..f987b5d8fc6 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -49,7 +49,6 @@ The command format is very simple:
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "namco54.h"
#include "cpu/mb88xx/mb88xx.h"
@@ -114,14 +113,14 @@ static TIMER_CALLBACK( namco_54xx_irq_clear )
cpu_set_input_line(device, 0, CLEAR_LINE);
}
-void namco_54xx_write(UINT8 data)
+void namco_54xx_write(running_machine *machine, UINT8 data)
{
- const device_config *device = cputag_get_cpu(Machine, CPUTAG_54XX);
+ const device_config *device = cputag_get_cpu(machine, CPUTAG_54XX);
if (device == NULL)
return;
- timer_call_after_resynch(Machine, NULL, data, namco_54xx_latch_callback);
+ timer_call_after_resynch(machine, NULL, data, namco_54xx_latch_callback);
cpu_set_input_line(device, 0, ASSERT_LINE);
@@ -130,5 +129,5 @@ void namco_54xx_write(UINT8 data)
// 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.
- timer_set(Machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear);
+ timer_set(machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear);
}
diff --git a/src/mame/audio/namco54.h b/src/mame/audio/namco54.h
index ff6414840e6..37377236144 100644
--- a/src/mame/audio/namco54.h
+++ b/src/mame/audio/namco54.h
@@ -9,7 +9,7 @@ ADDRESS_MAP_EXTERN( namco_54xx_map_program, 8 );
ADDRESS_MAP_EXTERN( namco_54xx_map_data, 8 );
ADDRESS_MAP_EXTERN( namco_54xx_map_io, 8 );
-void namco_54xx_write(UINT8 data);
+void namco_54xx_write(running_machine *machine, UINT8 data);
/* discrete nodes */
#define NAMCO_54XX_0_DATA NODE_01
diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c
index 6cdddbc8585..4f5fbfad8af 100644
--- a/src/mame/audio/scramble.c
+++ b/src/mame/audio/scramble.c
@@ -12,7 +12,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "machine/7474.h"
#include "sound/flt_rc.h"
@@ -84,7 +83,7 @@ WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
{
/* the complement of bit 3 is connected to the flip-flop's clock */
TTL7474_clock_w(2, ~data & 0x08);
- TTL7474_update(2);
+ TTL7474_update(device->machine, 2);
/* bit 4 is sound disable */
sound_global_enable(~data & 0x10);
@@ -94,21 +93,21 @@ WRITE8_HANDLER( sfx_sh_irqtrigger_w )
{
/* bit 1 is connected to the flip-flop's clock */
TTL7474_clock_w(3, data & 0x01);
- TTL7474_update(3);
+ TTL7474_update(space->machine, 3);
}
WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
{
/* the complement of bit 3 is connected to the flip-flop's clock */
TTL7474_clock_w(2, ~data & 0x08);
- TTL7474_update(2);
+ TTL7474_update(device->machine, 2);
}
WRITE8_HANDLER( froggrmc_sh_irqtrigger_w )
{
/* the complement of bit 0 is connected to the flip-flop's clock */
TTL7474_clock_w(2, ~data & 0x01);
- TTL7474_update(2);
+ TTL7474_update(space->machine, 2);
}
@@ -118,10 +117,10 @@ static IRQ_CALLBACK(scramble_sh_irq_callback)
we need to pulse the CLR line because MAME's core never clears this
line, only asserts it */
TTL7474_clear_w(2, 0);
- TTL7474_update(2);
+ TTL7474_update(device->machine, 2);
TTL7474_clear_w(2, 1);
- TTL7474_update(2);
+ TTL7474_update(device->machine, 2);
return 0xff;
}
@@ -132,27 +131,27 @@ static IRQ_CALLBACK(sfx_sh_irq_callback)
we need to pulse the CLR line because MAME's core never clears this
line, only asserts it */
TTL7474_clear_w(3, 0);
- TTL7474_update(3);
+ TTL7474_update(device->machine, 3);
TTL7474_clear_w(3, 1);
- TTL7474_update(3);
+ TTL7474_update(device->machine, 3);
return 0xff;
}
-static void scramble_sh_7474_callback(void)
+static void scramble_sh_7474_callback(running_machine *machine)
{
/* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */
- cpu_set_input_line(Machine->cpu[1], 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[1], 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE);
}
-static void sfx_sh_7474_callback(void)
+static void sfx_sh_7474_callback(running_machine *machine)
{
/* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */
- cpu_set_input_line(Machine->cpu[2], 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[2], 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE);
}
WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
@@ -209,9 +208,8 @@ static const struct TTL7474_interface sfx_sh_7474_intf =
};
-void scramble_sh_init(void)
+void scramble_sh_init(running_machine *machine)
{
- running_machine *machine = Machine;
cpu_set_irq_callback(machine->cpu[1], scramble_sh_irq_callback);
TTL7474_config(machine, 2, &scramble_sh_7474_intf);
@@ -220,9 +218,8 @@ void scramble_sh_init(void)
TTL7474_d_w(2, 1);
}
-void sfx_sh_init(void)
+void sfx_sh_init(running_machine *machine)
{
- running_machine *machine = Machine;
cpu_set_irq_callback(machine->cpu[2], sfx_sh_irq_callback);
TTL7474_config(machine, 3, &sfx_sh_7474_intf);
@@ -338,9 +335,9 @@ static TIMER_CALLBACK( ad2083_step )
timer_set(machine, ATTOTIME_IN_HZ(AD2083_TMS5110_CLOCK / 2),NULL,1,ad2083_step);
}
-static int ad2083_speech_rom_read_bit(void)
+static int ad2083_speech_rom_read_bit(const device_config *device)
{
- UINT8 *ROM = memory_region(Machine, "tms5110");
+ UINT8 *ROM = memory_region(device->machine, "tms5110");
int bit;
speech_rom_address %= 4096;
diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c
index 31ee08482b2..69a06c816e5 100644
--- a/src/mame/audio/segasnd.c
+++ b/src/mame/audio/segasnd.c
@@ -11,7 +11,6 @@
#include "driver.h"
#include "streams.h"
-#include "deprecat.h"
#include "segag80v.h"
#include "cpu/mcs48/mcs48.h"
#include "sound/sp0250.h"
@@ -311,13 +310,13 @@ static TIMER_CALLBACK( increment_t1_clock )
}
-void sega_usb_reset(UINT8 t1_clock_mask)
+void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask)
{
/* halt the USB CPU at reset time */
cpu_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE);
/* start the clock timer */
- timer_pulse(Machine, attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock);
+ timer_pulse(machine, attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock);
usb.t1_clock_mask = t1_clock_mask;
}
diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h
index 0303c6ad568..dc4d5d9f8be 100644
--- a/src/mame/audio/segasnd.h
+++ b/src/mame/audio/segasnd.h
@@ -14,7 +14,7 @@ WRITE8_HANDLER( sega_speech_control_w );
MACHINE_DRIVER_EXTERN( sega_universal_sound_board );
MACHINE_DRIVER_EXTERN( sega_universal_sound_board_rom );
-void sega_usb_reset(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/taitosnd.c b/src/mame/audio/taitosnd.c
index b8882bfc711..953b3c48fa2 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -1,5 +1,4 @@
#include "driver.h"
-#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "taitosnd.h"
@@ -41,11 +40,11 @@ typedef struct TC0140SYT
static struct TC0140SYT tc0140syt;
-static void Interrupt_Controller(void)
+static void Interrupt_Controller(running_machine *machine)
{
if ( tc0140syt.nmi_req && tc0140syt.nmi_enabled )
{
- cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
+ cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
tc0140syt.nmi_req = 0;
}
}
@@ -208,7 +207,7 @@ WRITE8_HANDLER( taitosound_slave_comm_w )
logerror("tc0140syt: Slave cpu written in mode [%02x] data[%02x]\n",tc0140syt.submode, data & 0xff);
}
- Interrupt_Controller();
+ Interrupt_Controller(space->machine);
}
@@ -250,7 +249,7 @@ READ8_HANDLER( taitosound_slave_comm_r )
res = 0;
}
- Interrupt_Controller();
+ Interrupt_Controller(space->machine);
return res;
}
diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c
index eb15ac00167..f63c9d1ccad 100644
--- a/src/mame/audio/williams.c
+++ b/src/mame/audio/williams.c
@@ -23,7 +23,6 @@
****************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "machine/6821pia.h"
#include "cpu/m6809/m6809.h"
#include "williams.h"
@@ -259,9 +258,8 @@ MACHINE_DRIVER_END
INITIALIZATION
****************************************************************************/
-void williams_cvsd_init(int pianum)
+void williams_cvsd_init(running_machine *machine, int pianum)
{
- running_machine *machine = Machine;
UINT8 *ROM;
int bank;
@@ -296,17 +294,17 @@ void williams_cvsd_init(int pianum)
}
-void williams_narc_init(void)
+void williams_narc_init(running_machine *machine)
{
UINT8 *ROM;
int bank;
/* configure the CPU */
- sound_cpu = cputag_get_cpu(Machine, "narc1");
- soundalt_cpu = cputag_get_cpu(Machine, "narc2");
+ sound_cpu = cputag_get_cpu(machine, "narc1");
+ soundalt_cpu = cputag_get_cpu(machine, "narc2");
/* configure master CPU banks */
- ROM = memory_region(Machine, "narc1");
+ ROM = memory_region(machine, "narc1");
for (bank = 0; bank < 16; bank++)
{
/*
@@ -315,12 +313,12 @@ void williams_narc_init(void)
D3 -> A16
*/
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
- memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
+ memory_configure_bank(machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
}
- memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
+ memory_set_bankptr(machine, 6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* configure slave CPU banks */
- ROM = memory_region(Machine, "narc2");
+ ROM = memory_region(machine, "narc2");
for (bank = 0; bank < 16; bank++)
{
/*
@@ -329,33 +327,33 @@ void williams_narc_init(void)
D3 -> A16
*/
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
- memory_configure_bank(Machine, 7, bank, 1, &ROM[0x10000 + offset], 0);
+ memory_configure_bank(machine, 7, bank, 1, &ROM[0x10000 + offset], 0);
}
- memory_set_bankptr(sound_cpu->machine, 8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
+ memory_set_bankptr(machine, 8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* register for save states */
- state_save_register_global(sound_cpu->machine, williams_sound_int_state);
- state_save_register_global(sound_cpu->machine, audio_talkback);
- state_save_register_global(sound_cpu->machine, audio_sync);
+ state_save_register_global(machine, williams_sound_int_state);
+ state_save_register_global(machine, audio_talkback);
+ state_save_register_global(machine, audio_sync);
}
-void williams_adpcm_init(void)
+void williams_adpcm_init(running_machine *machine)
{
UINT8 *ROM;
/* configure the CPU */
- sound_cpu = cputag_get_cpu(Machine, "adpcm");
+ sound_cpu = cputag_get_cpu(machine, "adpcm");
soundalt_cpu = NULL;
/* configure banks */
- ROM = memory_region(Machine, "adpcm");
- memory_configure_bank(Machine, 5, 0, 8, &ROM[0x10000], 0x8000);
- memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
+ ROM = memory_region(machine, "adpcm");
+ memory_configure_bank(machine, 5, 0, 8, &ROM[0x10000], 0x8000);
+ memory_set_bankptr(machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
/* expand ADPCM data */
/* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
- ROM = memory_region(Machine, "oki");
+ ROM = memory_region(machine, "oki");
memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */
memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000);
memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000);
@@ -373,8 +371,8 @@ void williams_adpcm_init(void)
memcpy(ROM + 0x020000, ROM + 0x060000, 0x20000);
/* register for save states */
- state_save_register_global(sound_cpu->machine, williams_sound_int_state);
- state_save_register_global(sound_cpu->machine, audio_talkback);
+ state_save_register_global(machine, williams_sound_int_state);
+ state_save_register_global(machine, audio_talkback);
}
@@ -477,9 +475,9 @@ static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
}
-void williams_cvsd_data_w(int data)
+void williams_cvsd_data_w(running_machine *machine, int data)
{
- timer_call_after_resynch(Machine, NULL, data, williams_cvsd_delayed_data_w);
+ timer_call_after_resynch(machine, NULL, data, williams_cvsd_delayed_data_w);
}
diff --git a/src/mame/audio/williams.h b/src/mame/audio/williams.h
index 580ccd98e9f..134aabec106 100644
--- a/src/mame/audio/williams.h
+++ b/src/mame/audio/williams.h
@@ -8,16 +8,16 @@ MACHINE_DRIVER_EXTERN( williams_cvsd_sound );
MACHINE_DRIVER_EXTERN( williams_adpcm_sound );
MACHINE_DRIVER_EXTERN( williams_narc_sound );
-void williams_cvsd_init(int pianum);
-void williams_cvsd_data_w(int data);
+void williams_cvsd_init(running_machine *machine, int pianum);
+void williams_cvsd_data_w(running_machine *machine, int data);
void williams_cvsd_reset_w(int state);
-void williams_adpcm_init(void);
+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(void);
+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/drivers/acommand.c b/src/mame/drivers/acommand.c
index 3929283cfd9..ff1e6d9363f 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -113,12 +113,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int xx,yy,x;
int delta = 16;
- flipx ^= flip_screen_get();
- flipy ^= flip_screen_get();
+ flipx ^= flip_screen_get(machine);
+ flipy ^= flip_screen_get(machine);
if ((pri&pri_mask)!=priority) continue;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 368 - sx;
sy = 240 - sy;
diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c
index 542acfb3e3f..c1cf955a0bd 100644
--- a/src/mame/drivers/adp.c
+++ b/src/mame/drivers/adp.c
@@ -175,7 +175,7 @@ static void duart_tx(const device_config *device, int channel, UINT8 data)
}
};
-static void microtouch_tx(UINT8 data)
+static void microtouch_tx(running_machine *machine, UINT8 data)
{
duart68681_rx_data(skattv_devices.duart68681, 0, data);
}
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index 4a6a0d84fee..0b8343e6419 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -301,7 +301,7 @@ static WRITE8_HANDLER( slave_bankswitch_w )
{
airbustr_bankswitch(space->machine, "slave", 2, data);
- flip_screen_set(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(data&0x20);
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 87d3c28dc50..754b23b1018 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -114,29 +114,29 @@ static TIMER_CALLBACK( response_timer )
UINT8 data = laserdisc_data_r(laserdisc);
if (data != 0x0a)
mame_printf_debug("Sending serial data = %02X\n", data);
- amiga_serial_in_w(data);
+ amiga_serial_in_w(machine, data);
}
/* if there's more to come, set another timer */
if (laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
- timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
+ timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0);
else
serial_timer_active = FALSE;
}
-static void vsync_callback(void)
+static void vsync_callback(running_machine *machine)
{
/* if we have data available, set a timer to read it */
if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
{
- timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
+ timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0);
serial_timer_active = TRUE;
}
}
-static void serial_w(UINT16 data)
+static void serial_w(running_machine *machine, UINT16 data)
{
/* write to the laserdisc player */
laserdisc_data_w(laserdisc, data & 0xff);
@@ -144,7 +144,7 @@ static void serial_w(UINT16 data)
/* if we have data available, set a timer to read it */
if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
{
- timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
+ timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0);
serial_timer_active = TRUE;
}
}
diff --git a/src/mame/drivers/ambush.c b/src/mame/drivers/ambush.c
index 24cfc79616e..791c51869cd 100644
--- a/src/mame/drivers/ambush.c
+++ b/src/mame/drivers/ambush.c
@@ -53,7 +53,7 @@ static WRITE8_HANDLER( ambush_coin_counter_w )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index 41e0bd410fe..d445fc0afa9 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -173,7 +173,7 @@ static WRITE16_HANDLER( io_w )
COMBINE_DATA(&armedf_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(armedf_vreg & 0x1000);
+ flip_screen_set(space->machine, armedf_vreg & 0x1000);
}
static WRITE16_HANDLER( terraf_io_w )
@@ -181,7 +181,7 @@ static WRITE16_HANDLER( terraf_io_w )
COMBINE_DATA(&armedf_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(armedf_vreg & 0x1000);
+ flip_screen_set(space->machine, armedf_vreg & 0x1000);
if ((armedf_vreg & 0x4000) && !(armedf_vreg & 0x0100))
@@ -203,7 +203,7 @@ static WRITE16_HANDLER( kodure_io_w )
COMBINE_DATA(&armedf_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(armedf_vreg & 0x1000);
+ flip_screen_set(space->machine, armedf_vreg & 0x1000);
/* This is a temporary condition specification. */
if (!(armedf_vreg & 0x0080))
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 38b6ef34d46..ee199bf6ad7 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -91,7 +91,7 @@ static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectang
{
int offs;
- flip_screen_set_no_update(1);
+ flip_screen_set_no_update(machine, 1);
for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
{
@@ -141,7 +141,7 @@ static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectang
inc = 1;
}
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
y=240-y;
x=304-x;
diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c
index 750e6add835..e8ae497f1f8 100644
--- a/src/mame/drivers/bagman.c
+++ b/src/mame/drivers/bagman.c
@@ -62,7 +62,6 @@ DIP locations verified for:
#include "driver.h"
#include "cpu/z80/z80.h"
-#include "deprecat.h"
#include "sound/ay8910.h"
#include "sound/5110intf.h"
#include "sound/tms5110.h"
@@ -106,9 +105,9 @@ static void reset_talking (const address_space *space)
}
-static int bagman_speech_rom_read_bit(void)
+static int bagman_speech_rom_read_bit(const device_config *device)
{
- UINT8 *ROM = memory_region(Machine, "speech");
+ UINT8 *ROM = memory_region(device->machine, "speech");
int bit_no = (ls259_buf[0]<<2) | (ls259_buf[1]<<1) | (ls259_buf[2]<<0);
int byte = 0;
diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c
index ae0aaa0b190..d448757b155 100644
--- a/src/mame/drivers/battlane.c
+++ b/src/mame/drivers/battlane.c
@@ -46,7 +46,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
0x01 = Y Scroll MSB
*/
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
/*
I think that the NMI is an inhibitor. It is constantly set
diff --git a/src/mame/drivers/bigfghtr.c b/src/mame/drivers/bigfghtr.c
index 3e9e96725aa..8441998c4ee 100644
--- a/src/mame/drivers/bigfghtr.c
+++ b/src/mame/drivers/bigfghtr.c
@@ -288,7 +288,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( io_w )
{
COMBINE_DATA(&vreg);
- flip_screen_set(vreg & 0x1000);
+ flip_screen_set(space->machine, vreg & 0x1000);
}
static int read_latch=0;
diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c
index 531fa19f5a5..a46860c9ee3 100644
--- a/src/mame/drivers/bogeyman.c
+++ b/src/mame/drivers/bogeyman.c
@@ -43,7 +43,7 @@ static WRITE8_HANDLER( bogeyman_8910_control_w )
static int last;
// bit 0 is flipscreen
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
// bit 5 goes to 8910 #0 BDIR pin
if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00)
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index 15488d04303..43fca108364 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -142,7 +142,7 @@ static VIDEO_UPDATE( calorie )
ypos = 0xff - calorie_sprites[x+2];
xpos = calorie_sprites[x+3];
- if(flip_screen_get())
+ if(flip_screen_get(screen->machine))
{
if( calorie_sprites[x+1] & 0x10 )
ypos = 0xff - ypos + 32;
@@ -186,7 +186,7 @@ static WRITE8_HANDLER( calorie_bg_w )
static WRITE8_HANDLER( calorie_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
static READ8_HANDLER( calorie_soundlatch_r )
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 490ed413798..716e86f89a4 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -55,7 +55,6 @@ Notes:
*/
#include "driver.h"
-#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "sound/nes_apu.h"
#include "cpu/m6502/m6502.h"
@@ -214,9 +213,9 @@ static PALETTE_INIT( cham24 )
ppu2c0x_init_palette(machine, 0 );
}
-static void ppu_irq( int num, int *ppu_regs )
+static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
{
- cpu_set_input_line(Machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
+ cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
}
/* our ppu interface */
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 0a4fd82a4e8..7c20d4731ae 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -126,7 +126,7 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 );
ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 );
- flip_screen_set(~data & 0x04);
+ flip_screen_set(space->machine, ~data & 0x04);
}
static WRITE8_HANDLER( chinagat_bankswitch_w )
diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c
index f0700a7f28e..e56315d84f2 100644
--- a/src/mame/drivers/citycon.c
+++ b/src/mame/drivers/citycon.c
@@ -25,7 +25,7 @@ VIDEO_START( citycon );
static READ8_HANDLER( citycon_in_r )
{
- return input_port_read(space->machine, flip_screen_get() ? "P2" : "P1");
+ return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1");
}
diff --git a/src/mame/drivers/clshroad.c b/src/mame/drivers/clshroad.c
index ce88405598e..7c4d2b92d86 100644
--- a/src/mame/drivers/clshroad.c
+++ b/src/mame/drivers/clshroad.c
@@ -44,7 +44,7 @@ WRITE8_HANDLER( wiping_sound_w );
static MACHINE_RESET( clshroad )
{
- flip_screen_set(0);
+ flip_screen_set(machine, 0);
}
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index ee7e0cf6513..2d9dc120752 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -433,7 +433,7 @@ static WRITE8_HANDLER(scrivi)
{
rotation_sign = !(data & 1);
- flip_screen_set(!(data & 4));
+ flip_screen_set(space->machine, !(data & 4));
scrolly_hi = (data & 0xf0) << 4;
diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c
index 74ee624f778..df85fbfd11f 100644
--- a/src/mame/drivers/cojag.c
+++ b/src/mame/drivers/cojag.c
@@ -373,7 +373,7 @@ static MACHINE_RESET( cojag )
jaguardsp_ctrl_w(machine->cpu[2], D_CTRL, 0, 0xffffffff);
/* init the sound system */
- cojag_sound_reset();
+ cojag_sound_reset(machine);
/* reset the IDE controller */
devtag_reset(machine, IDE_CONTROLLER, "ide");
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 3b77f73cd0e..8dae9781e39 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -462,7 +462,7 @@ static READ8_HANDLER( nomnlnd_port_0_1_r )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data&0x80);
+ flip_screen_set(space->machine, data&0x80);
}
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index 420174732b5..38f115cf4b1 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -54,9 +54,9 @@ static void pc3092_reset(void)
}
-static void pc3092_update(void)
+static void pc3092_update(running_machine *machine)
{
- flip_screen_set((pc3092_data[1] & 0x01) ? TRUE : FALSE);
+ flip_screen_set(machine, (pc3092_data[1] & 0x01) ? TRUE : FALSE);
}
@@ -66,7 +66,7 @@ static WRITE8_HANDLER( pc3092_w )
if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", cpu_get_pc(space->cpu), offset, pc3092_data[offset]);
- pc3092_update();
+ pc3092_update(space->machine);
}
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 3fd032a11bc..af20d9091f3 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -83,7 +83,6 @@ Hardware Info
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/s2650/s2650.h"
#include "sound/dac.h"
#include "sound/5110intf.h"
@@ -252,10 +251,10 @@ static INTERRUPT_GEN( cvs_main_cpu_interrupt )
}
-static void cvs_dac_cpu_interrupt(void)
+static void cvs_dac_cpu_interrupt(running_machine *machine)
{
- cpu_set_input_line_vector(Machine->cpu[CVS_DAC_CPU_INDEX], 0, 0x03);
- cpu_set_input_line(Machine->cpu[CVS_DAC_CPU_INDEX], 0, HOLD_LINE);
+ cpu_set_input_line_vector(machine->cpu[CVS_DAC_CPU_INDEX], 0, 0x03);
+ cpu_set_input_line(machine->cpu[CVS_DAC_CPU_INDEX], 0, HOLD_LINE);
}
@@ -432,13 +431,14 @@ static WRITE8_HANDLER( cvs_tms5110_pdc_w )
}
-static int speech_rom_read_bit(void)
+static int speech_rom_read_bit(const device_config *device)
{
- UINT8 *ROM = memory_region(Machine, "speechdata");
- int bit;
+ running_machine *machine = device->machine;
+ UINT8 *ROM = memory_region(machine, "speechdata");
+ int bit;
/* before reading the bit, clamp the address to the region length */
- speech_rom_bit_address = speech_rom_bit_address & ((memory_region_length(Machine, "speechdata") * 8) - 1);
+ speech_rom_bit_address = speech_rom_bit_address & ((memory_region_length(machine, "speechdata") * 8) - 1);
bit = (ROM[speech_rom_bit_address >> 3] >> (speech_rom_bit_address & 0x07)) & 0x01;
/* prepare for next bit */
@@ -468,7 +468,7 @@ static WRITE8_HANDLER( audio_command_w )
if (data & 0x80)
{
soundlatch_w(space, 0, data);
- cvs_dac_cpu_interrupt();
+ cvs_dac_cpu_interrupt(space->machine);
LOG(("%04x : CVS: Audio command = %02x\n", cpu_get_pc(space->cpu), data));
}
diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c
index 3dc563e3785..4cf8f615ed3 100644
--- a/src/mame/drivers/dacholer.c
+++ b/src/mame/drivers/dacholer.c
@@ -55,7 +55,7 @@ static WRITE8_HANDLER( bg_bank_w )
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
- flip_screen_set(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
}
@@ -317,7 +317,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = (spriteram[offs+3] - 128) + 256 * (attr & 0x01);
sy = 248 - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index 54dba5e5e8c..24c83422a34 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -104,7 +104,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -154,7 +154,7 @@ static VIDEO_START(dblewing)
static VIDEO_UPDATE(dblewing)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,0); /* not Confirmed */
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index 2adfa71396a..55d20db7b2b 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -216,7 +216,7 @@ static WRITE8_HANDLER( ddragon_bankswitch_w )
{
ddragon_scrollx_hi = ((data & 0x01) << 8);
ddragon_scrolly_hi = ((data & 0x02) << 7);
- flip_screen_set(~data & 0x04);
+ flip_screen_set(space->machine, ~data & 0x04);
/* bit 3 unknown */
@@ -234,7 +234,7 @@ static WRITE8_HANDLER( toffy_bankswitch_w )
ddragon_scrollx_hi = ((data & 0x01) << 8);
ddragon_scrolly_hi = ((data & 0x02) << 7);
-// flip_screen_set(~data & 0x04);
+// flip_screen_set(space->machine, ~data & 0x04);
/* bit 3 unknown */
@@ -291,7 +291,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
ddragon_scrollx_hi = ((data & 0x01) << 8);
ddragon_scrolly_hi = ((data & 0x02) << 7);
-// flip_screen_set(~data & 0x04);
+// flip_screen_set(space->machine, ~data & 0x04);
/* bit 3 unknown */
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 70b50edbb63..69c6f859ebb 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -368,7 +368,7 @@ static WRITE8_HANDLER( ghostb_bank_w )
if (data&1) int_enable=1; else int_enable=0;
if (data&2) nmi_enable=1; else nmi_enable=0;
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
}
static WRITE8_HANDLER( csilver_control_w )
@@ -494,7 +494,7 @@ static WRITE8_HANDLER( shackled_int_w )
static READ8_HANDLER( shackled_sprite_r ) { return spriteram[offset]; }
static WRITE8_HANDLER( shackled_sprite_w ) { spriteram[offset]=data; }
-static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(data); }
+static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine, data); }
/******************************************************************************/
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index b89ed22e2a9..db00e0dd24a 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -61,7 +61,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
int offs;
- flip_screen_set_no_update(1);
+ flip_screen_set_no_update(machine, 1);
for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
{
@@ -107,7 +107,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
y=240-y;
x=304-x;
diff --git a/src/mame/drivers/dominob.c b/src/mame/drivers/dominob.c
index de55208d8de..4bbe248b30e 100644
--- a/src/mame/drivers/dominob.c
+++ b/src/mame/drivers/dominob.c
@@ -50,21 +50,21 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = spriteram[offs];
sy = 248 - spriteram[offs + 1];
- if (flip_screen_x_get()) sx = 248 - sx;
- if (flip_screen_y_get()) sy = 248 - sy;
+ if (flip_screen_x_get(machine)) sx = 248 - sx;
+ if (flip_screen_y_get(machine)) sy = 248 - sy;
code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) ;
drawgfx(bitmap,machine->gfx[0],
2 * code,
((spriteram[offs + 2] & 0xf8) >> 3) ,
- flip_screen_x_get(),flip_screen_y_get(),
- sx,sy + (flip_screen_y_get() ? 8 : -8),
+ flip_screen_x_get(machine),flip_screen_y_get(machine),
+ sx,sy + (flip_screen_y_get(machine) ? 8 : -8),
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[0],
2 * code + 1,
((spriteram[offs + 2] & 0xf8) >> 3) ,
- flip_screen_x_get(),flip_screen_y_get(),
+ flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index a4c85802082..75e493d2e95 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -73,7 +73,7 @@ static MACHINE_START( lastday )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
/***************************************************************************
diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c
index 10996dbb157..6eda33f1b55 100644
--- a/src/mame/drivers/drmicro.c
+++ b/src/mame/drivers/drmicro.c
@@ -24,7 +24,7 @@ WRITE8_HANDLER( drmicro_priority_w );
WRITE8_HANDLER( drmicro_videoram_w );
-extern void drmicro_flip_w( int flip );
+extern void drmicro_flip_w( running_machine *machine, int flip );
/****************************************************************************/
@@ -39,7 +39,7 @@ static INTERRUPT_GEN( drmicro_interrupt )
static WRITE8_HANDLER( nmi_enable_w )
{ // bit2,3 unknown
drmicro_nmi_enable = data & 1;
- drmicro_flip_w(data & 2);
+ drmicro_flip_w(space->machine, data & 2);
}
/****************************************************************************/
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 5601dd21c13..005e33f85ba 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -196,7 +196,7 @@ static VIDEO_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() */
+ 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);
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index a1ebf019131..73ccdaca228 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -398,7 +398,7 @@ static UINT8 eq8155_port_a,eq8155_port_c,ay_port_a,ay_port_b,eq_cymbal_ctrl;
static MACHINE_RESET(equites)
{
- flip_screen_set(0);
+ flip_screen_set(machine, 0);
}
/******************************************************************************/
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index 69581fdd9de..0a1fa944ce3 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -65,7 +65,7 @@ static WRITE8_HANDLER( ettrivia_control_w )
coin_counter_w(0, data & 0x80);
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
static READ8_HANDLER( ettrivia_question_r )
diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c
index a755613e74d..079297aaf86 100644
--- a/src/mame/drivers/exzisus.c
+++ b/src/mame/drivers/exzisus.c
@@ -82,7 +82,7 @@ static WRITE8_HANDLER( exzisus_cpua_bankswitch_w )
}
}
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
}
static WRITE8_HANDLER( exzisus_cpub_bankswitch_w )
@@ -99,7 +99,7 @@ static WRITE8_HANDLER( exzisus_cpub_bankswitch_w )
}
}
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
}
static WRITE8_HANDLER( exzisus_coincounter_w )
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index 938fb388e59..e27ed4abeed 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -211,7 +211,7 @@ static VIDEO_UPDATE( fcrash )
int videocontrol=cps1_cps_a_regs[0x22/2];
- flip_screen_set(videocontrol & 0x8000);
+ flip_screen_set(screen->machine, videocontrol & 0x8000);
layercontrol = cps1_cps_b_regs[0x20/2];
@@ -282,7 +282,7 @@ static VIDEO_UPDATE( kodb )
int videocontrol=cps1_cps_a_regs[0x22/2];
- flip_screen_set(videocontrol & 0x8000);
+ flip_screen_set(screen->machine, videocontrol & 0x8000);
layercontrol = cps1_cps_b_regs[0x20/2];
diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c
index 506621c721d..68cca6173f2 100644
--- a/src/mame/drivers/finalizr.c
+++ b/src/mame/drivers/finalizr.c
@@ -54,7 +54,7 @@ static WRITE8_HANDLER( finalizr_flipscreen_w )
nmi_enable = data & 0x01;
irq_enable = data & 0x02;
- flip_screen_set(~data & 0x08);
+ flip_screen_set(space->machine, ~data & 0x08);
}
static WRITE8_HANDLER( finalizr_i8039_irq_w )
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index daa113ff041..7741a1508aa 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -110,7 +110,6 @@
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "deprecat.h"
#include "cpu/powerpc/ppc.h"
#include "machine/intelfsh.h"
#include "machine/scsicd.h"
@@ -885,9 +884,9 @@ static void atapi_init(running_machine *machine)
atapi_cdata_wait = 0;
// allocate two SCSI CD-ROM devices
- SCSIAllocInstance( SCSI_DEVICE_CDROM, &atapi_device_data[0], "scsi0" );
+ SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &atapi_device_data[0], "scsi0" );
// TODO: the slave drive can be either CD-ROM, DVD-ROM or HDD
- SCSIAllocInstance( SCSI_DEVICE_CDROM, &atapi_device_data[1], "scsi1" );
+ SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &atapi_device_data[1], "scsi1" );
add_exit_callback(machine, atapi_exit);
}
@@ -2253,11 +2252,11 @@ static int ibutton_w(UINT8 data)
return r;
}
-static void security_w(UINT8 data)
+static void security_w(const device_config *device, UINT8 data)
{
int r = ibutton_w(data);
if (r >= 0)
- ppc4xx_spu_receive_byte(Machine->cpu[0], r);
+ ppc4xx_spu_receive_byte(device->machine->cpu[0], r);
}
/*****************************************************************************/
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index 5b3796f0140..f4a2b4fd68d 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -240,7 +240,7 @@ static WRITE8_HANDLER( firetrap_adpcm_data_w )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 01a990548ae..86e24a3ae95 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -66,9 +66,9 @@ static WRITE8_HANDLER( flipscreen_w )
{
/* flip Y/X could be the other way round... */
if (offset)
- flip_screen_y_set(~data & 1);
+ flip_screen_y_set(space->machine, ~data & 1);
else
- flip_screen_x_set(~data & 1);
+ flip_screen_x_set(space->machine, ~data & 1);
}
static WRITE8_HANDLER( coin_w )
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 671144ab8dd..dec2140b931 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -727,12 +727,12 @@ static READ8_HANDLER( bosco_dsw_r )
static WRITE8_HANDLER( galaga_flip_screen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
static WRITE8_HANDLER( bosco_flip_screen_w )
{
- flip_screen_set(~data & 1);
+ flip_screen_set(space->machine, ~data & 1);
}
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index 90059928a14..6a7df3aa0be 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -63,7 +63,6 @@
#include "cpu/i386/i386.h"
#include "memconv.h"
#include "devconv.h"
-#include "deprecat.h"
#include "machine/8237dma.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
@@ -689,12 +688,12 @@ static MACHINE_DRIVER_START(gamecstl)
MACHINE_DRIVER_END
-static void set_gate_a20(int a20)
+static void set_gate_a20(running_machine *machine, int a20)
{
- cpu_set_input_line(Machine->cpu[0], INPUT_LINE_A20, a20);
+ cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(int state)
+static void keyboard_interrupt(running_machine *machine, int state)
{
pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state);
}
diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c
index e99ff6078a3..77b4883f044 100644
--- a/src/mame/drivers/gberet.c
+++ b/src/mame/drivers/gberet.c
@@ -120,7 +120,7 @@ static WRITE8_HANDLER( gberet_flipscreen_w )
nmi_enable = data & 0x01;
irq_enable = data & 0x04;
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
}
static WRITE8_HANDLER( mrgoemon_coin_counter_w )
@@ -141,7 +141,7 @@ static WRITE8_HANDLER( mrgoemon_flipscreen_w )
nmi_enable = data & 0x01;
irq_enable = data & 0x02;
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
}
/* Memory Maps */
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index 6f82a3f637b..59a49723ab7 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -322,7 +322,7 @@ static READ8_HANDLER( glad_cpu_sound_command_r )
static WRITE8_HANDLER( gladiatr_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c
index 6af5e3e71e4..aada4cce90e 100644
--- a/src/mame/drivers/goindol.c
+++ b/src/mame/drivers/goindol.c
@@ -50,7 +50,7 @@ static WRITE8_HANDLER( goindol_bankswitch_w )
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
- flip_screen_set(data & 0x20);
+ flip_screen_set(space->machine, data & 0x20);
}
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index 346f7bfeda8..b566eecd3b0 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -77,9 +77,9 @@ static void gpworld_draw_tiles(running_machine *machine, bitmap_t *bitmap,const
}
}
-INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color)
+INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color,int flip)
{
- if (flip_screen_get())
+ if (flip)
{
x = bitmap->width - x - 1;
y = bitmap->height - y - 1;
@@ -104,6 +104,7 @@ static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
const int SPR_SKIP_HI = 5;
const int SPR_GFXOFS_LO = 6;
const int SPR_GFXOFS_HI = 7;
+ int flip = flip_screen_get(machine);
int i;
@@ -134,7 +135,7 @@ static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
logerror("%02x %02x %02x %02x %02x %02x %02x %02x\n", spr_reg[SPR_Y_TOP], spr_reg[SPR_Y_BOTTOM], spr_reg[SPR_X_LO], spr_reg[SPR_X_HI],
spr_reg[SPR_SKIP_LO], spr_reg[SPR_SKIP_HI], spr_reg[SPR_GFXOFS_LO], spr_reg[SPR_GFXOFS_HI]);
- draw_pixel(bitmap,cliprect,sx,sy,0xffffffff);
+ draw_pixel(bitmap,cliprect,sx,sy,0xffffffff,flip);
*/
for (row = 0; row < height; row++)
@@ -180,10 +181,10 @@ static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
}
/* Daphne says "don't draw the pixel if it's black". */
- draw_pixel(bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200)));
- draw_pixel(bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200)));
- draw_pixel(bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200)));
- draw_pixel(bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200)));
+ draw_pixel(bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200)),flip);
+ draw_pixel(bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200)),flip);
+ draw_pixel(bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200)),flip);
+ draw_pixel(bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200)),flip);
x += 4;
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index ae1583f9f9a..4ecd39556c5 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -1167,7 +1167,7 @@ static void sound_irq_callback(running_machine *machine, int irq)
static DRIVER_INIT(gticlub)
{
- init_konami_cgboard(1, CGBOARD_TYPE_GTICLUB);
+ init_konami_cgboard(machine, 1, CGBOARD_TYPE_GTICLUB);
sharc_dataram_0 = auto_malloc(0x100000);
gticlub_led_reg0 = gticlub_led_reg1 = 0x7f;
@@ -1181,9 +1181,9 @@ static DRIVER_INIT(gticlub)
static DRIVER_INIT(hangplt)
{
- init_konami_cgboard(2, CGBOARD_TYPE_HANGPLT);
- set_cgboard_texture_bank(0, 5, memory_region(machine, "user5"));
- set_cgboard_texture_bank(1, 6, memory_region(machine, "user5"));
+ init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
+ set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5"));
+ set_cgboard_texture_bank(machine, 1, 6, memory_region(machine, "user5"));
sharc_dataram_0 = auto_malloc(0x100000);
sharc_dataram_1 = auto_malloc(0x100000);
diff --git a/src/mame/drivers/hanaroku.c b/src/mame/drivers/hanaroku.c
index 24498a35487..0adb845d866 100644
--- a/src/mame/drivers/hanaroku.c
+++ b/src/mame/drivers/hanaroku.c
@@ -54,7 +54,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = hanaroku_spriteram1[i + 0x200] | ((hanaroku_spriteram2[i + 0x200] & 0x07) << 8);
int sy = 242 - hanaroku_spriteram3[i];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = 242 - sy;
flipx = !flipx;
diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c
index bf9d10eff12..6d4bc8f6e35 100644
--- a/src/mame/drivers/hexion.c
+++ b/src/mame/drivers/hexion.c
@@ -105,7 +105,7 @@ static WRITE8_HANDLER( coincntr_w )
coin_counter_w(1,data & 0x02);
/* bit 5 = flip screen */
- flip_screen_set(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/hornet.c b/src/mame/drivers/hornet.c
index 0706d889887..bba69c88861 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -309,7 +309,6 @@
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "deprecat.h"
#include "cpu/powerpc/ppc.h"
#include "cpu/sharc/sharc.h"
#include "machine/eeprom.h"
@@ -1168,9 +1167,9 @@ MACHINE_DRIVER_END
/*****************************************************************************/
-static void jamma_jvs_cmd_exec(void);
+static void jamma_jvs_cmd_exec(running_machine *machine);
-static void jamma_jvs_w(UINT8 data)
+static void jamma_jvs_w(const device_config *device, UINT8 data)
{
if (jvs_sdata_ptr == 0 && data != 0xe0)
return;
@@ -1178,12 +1177,11 @@ static void jamma_jvs_w(UINT8 data)
jvs_sdata_ptr++;
if (jvs_sdata_ptr >= 3 && jvs_sdata_ptr >= 3 + jvs_sdata[2])
- jamma_jvs_cmd_exec();
+ jamma_jvs_cmd_exec(device->machine);
}
-static int jvs_encode_data(UINT8 *in, int length)
+static int jvs_encode_data(running_machine *machine, UINT8 *in, int length)
{
- running_machine *machine = Machine;
int inptr = 0;
int sum = 0;
@@ -1233,9 +1231,8 @@ static int jvs_decode_data(UINT8 *in, UINT8 *out, int length)
return outptr;
}
-static void jamma_jvs_cmd_exec(void)
+static void jamma_jvs_cmd_exec(running_machine *machine)
{
- running_machine *machine = Machine;
UINT8 sync, node, byte_num;
UINT8 data[1024], rdata[1024];
int length;
@@ -1298,7 +1295,7 @@ static void jamma_jvs_cmd_exec(void)
ppc4xx_spu_receive_byte(machine->cpu[0], 0xe0); // sync
ppc4xx_spu_receive_byte(machine->cpu[0], 0x00); // node
ppc4xx_spu_receive_byte(machine->cpu[0], rdata_ptr+1); // num of bytes
- sum += jvs_encode_data(rdata, rdata_ptr);
+ sum += jvs_encode_data(machine, rdata, rdata_ptr);
ppc4xx_spu_receive_byte(machine->cpu[0], sum - 1); // checksum
jvs_sdata_ptr = 0;
@@ -1321,8 +1318,8 @@ static void sound_irq_callback(running_machine *machine, int irq)
static DRIVER_INIT(hornet)
{
- init_konami_cgboard(1, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(0, 5, memory_region(machine, "user5"));
+ init_konami_cgboard(machine, 1, CGBOARD_TYPE_HORNET);
+ set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5"));
K056800_init(machine, sound_irq_callback);
K033906_init(machine);
@@ -1334,9 +1331,9 @@ static DRIVER_INIT(hornet)
static DRIVER_INIT(hornet_2board)
{
- init_konami_cgboard(2, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(0, 5, memory_region(machine, "user5"));
- set_cgboard_texture_bank(1, 6, memory_region(machine, "user5"));
+ init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
+ set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5"));
+ set_cgboard_texture_bank(machine, 1, 6, memory_region(machine, "user5"));
K056800_init(machine, sound_irq_callback);
K033906_init(machine);
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 11b2fd45bea..fdef7b99613 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -83,7 +83,7 @@ static int joinem_snd_bit = 0;
static WRITE8_HANDLER( joinem_misc_w )
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
joinem_snd_bit = data & 1;
}
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 7e38862554a..f435d889177 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -92,7 +92,7 @@ static READ8_HANDLER( topgunbl_rotary_r )
static WRITE8_HANDLER( jackal_flipscreen_w )
{
irq_enable = data & 0x02;
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
}
/* Memory Maps */
diff --git a/src/mame/drivers/jailbrek.c b/src/mame/drivers/jailbrek.c
index 63ec5d740b6..9977a651d4c 100644
--- a/src/mame/drivers/jailbrek.c
+++ b/src/mame/drivers/jailbrek.c
@@ -61,7 +61,7 @@ static WRITE8_HANDLER( ctrl_w )
{
nmi_enable = data & 0x01;
irq_enable = data & 0x02;
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
}
static INTERRUPT_GEN( jb_interrupt )
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 465cdc8bc9c..e788946a56a 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -101,7 +101,6 @@ OSC: 12.000MHz
*******************************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/m68000/m68000.h"
#include "sound/okim6295.h"
@@ -893,7 +892,7 @@ static WRITE16_HANDLER( jalmah_okibank_w )
static WRITE16_HANDLER( jalmah_flip_screen_w )
{
/*---- ----x flip screen*/
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
// popmessage("%04x",data);
}
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index 935874ee717..408890df5c6 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -282,7 +282,7 @@ static WRITE8_HANDLER( output_w )
*/
// printf("%02x\n",data);
coin_counter_w(0,data & 0x01);
-// flip_screen_set(data & 0x04);
+// flip_screen_set(space->machine, data & 0x04);
// coin_lockout_w(0,~data & 0x20);
}
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index 5d0b7b9cc40..d80fed3836c 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -279,7 +279,7 @@ static const k054539_interface k054539_config =
static UINT8 sector_buffer[ 512 ];
-static void scsi_dma_read( UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
int i;
int n_this;
@@ -312,7 +312,7 @@ static void scsi_dma_read( UINT32 n_address, INT32 n_size )
}
}
-static void scsi_dma_write( UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
}
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index 37d17f1a87b..7e365f94ef3 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -206,7 +206,7 @@ ADDRESS_MAP_END
/* SCSI */
-static void scsi_dma_read( UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
int i;
int n_this;
@@ -249,7 +249,7 @@ static void scsi_dma_read( UINT32 n_address, INT32 n_size )
}
}
-static void scsi_dma_write( UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
int i;
int n_this;
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 471497a1d78..ab2aec359d5 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -205,7 +205,6 @@
*/
#include "driver.h"
-#include "deprecat.h"
#include "cdrom.h"
#include "cpu/mips/psx.h"
#include "includes/psx.h"
@@ -910,7 +909,7 @@ static void atapi_init(running_machine *machine)
{
if( get_disk_handle( diskregions[i] ) != NULL )
{
- SCSIAllocInstance( &SCSIClassCr589, &available_cdroms[ i ], diskregions[i] );
+ SCSIAllocInstance( machine, &SCSIClassCr589, &available_cdroms[ i ], diskregions[i] );
}
else
{
@@ -955,16 +954,14 @@ static WRITE32_HANDLER( atapi_reset_w )
}
}
-static void cdrom_dma_read( 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 );
+ 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( UINT32 n_address, INT32 n_size )
+static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
- running_machine *machine = Machine;
-
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);
@@ -973,7 +970,7 @@ static void cdrom_dma_write( UINT32 n_address, INT32 n_size )
verboselog( machine, 2, "atapi_xfer_end: %d %d\n", atapi_xferlen, 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")
- timer_adjust_oneshot(atapi_timer, cpu_clocks_to_attotime(Machine->cpu[0], (ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))), 0);
+ timer_adjust_oneshot(atapi_timer, cpu_clocks_to_attotime(machine->cpu[0], (ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))), 0);
}
static UINT32 m_n_security_control;
@@ -1126,10 +1123,10 @@ static UINT64 m_p_n_root_start[ 3 ];
#define RC_CLC ( 0x100 )
#define RC_DIV ( 0x200 )
-static UINT64 psxcpu_gettotalcycles( void )
+static UINT64 psxcpu_gettotalcycles( running_machine *machine )
{
/* TODO: should return the start of the current tick. */
- return cpu_get_total_cycles(Machine->cpu[0]) * 2;
+ return cpu_get_total_cycles(machine->cpu[0]) * 2;
}
static int root_divider( int n_counter )
@@ -1150,7 +1147,7 @@ static int root_divider( int n_counter )
return 1;
}
-static UINT16 root_current( int n_counter )
+static UINT16 root_current( running_machine *machine, int n_counter )
{
if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 )
{
@@ -1159,14 +1156,14 @@ static UINT16 root_current( int n_counter )
else
{
UINT64 n_current;
- n_current = psxcpu_gettotalcycles() - m_p_n_root_start[ n_counter ];
+ n_current = psxcpu_gettotalcycles(machine) - m_p_n_root_start[ n_counter ];
n_current /= root_divider( n_counter );
n_current += m_p_n_root_count[ n_counter ];
if( n_current > 0xffff )
{
/* TODO: use timer for wrap on 0x10000. */
m_p_n_root_count[ n_counter ] = n_current;
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine);
}
return n_current;
}
@@ -1182,7 +1179,7 @@ static int root_target( int n_counter )
return 0x10000;
}
-static void root_timer_adjust( int n_counter )
+static void root_timer_adjust( running_machine *machine, int n_counter )
{
if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 )
{
@@ -1192,7 +1189,7 @@ static void root_timer_adjust( int n_counter )
{
int n_duration;
- n_duration = root_target( n_counter ) - root_current( n_counter );
+ n_duration = root_target( n_counter ) - root_current( machine, n_counter );
if( n_duration < 1 )
{
n_duration += 0x10000;
@@ -1212,11 +1209,11 @@ static TIMER_CALLBACK( root_finished )
{
/* TODO: wrap should be handled differently as RC_COUNTTARGET & RC_IRQTARGET don't have to be the same. */
m_p_n_root_count[ n_counter ] = 0;
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine);
}
if( ( m_p_n_root_mode[ n_counter ] & RC_REPEAT ) != 0 )
{
- root_timer_adjust( n_counter );
+ root_timer_adjust( machine, n_counter );
}
if( ( m_p_n_root_mode[ n_counter ] & RC_IRQOVERFLOW ) != 0 ||
( m_p_n_root_mode[ n_counter ] & RC_IRQTARGET ) != 0 )
@@ -1235,11 +1232,11 @@ static WRITE32_HANDLER( k573_counter_w )
{
case 0:
m_p_n_root_count[ n_counter ] = data;
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine);
break;
case 1:
- m_p_n_root_count[ n_counter ] = root_current( n_counter );
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_count[ n_counter ] = root_current( space->machine, n_counter );
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine);
m_p_n_root_mode[ n_counter ] = data;
if( ( m_p_n_root_mode[ n_counter ] & RC_RESET ) != 0 )
@@ -1262,7 +1259,7 @@ static WRITE32_HANDLER( k573_counter_w )
return;
}
- root_timer_adjust( n_counter );
+ root_timer_adjust( space->machine, n_counter );
}
static READ32_HANDLER( k573_counter_r )
@@ -1275,7 +1272,7 @@ static READ32_HANDLER( k573_counter_r )
switch( offset % 4 )
{
case 0:
- data = root_current( n_counter );
+ data = root_current( space->machine, n_counter );
break;
case 1:
data = m_p_n_root_mode[ n_counter ];
@@ -1688,7 +1685,7 @@ Analogue I/O board
*/
static UINT8 gx700pwbf_output_data[ 4 ];
-static void (*gx700pwfbf_output_callback)( int offset, int data );
+static void (*gx700pwfbf_output_callback)( running_machine *machine, int offset, int data );
static READ32_HANDLER( gx700pwbf_io_r )
{
@@ -1721,7 +1718,7 @@ static READ32_HANDLER( gx700pwbf_io_r )
return data;
}
-static void gx700pwbf_output( int offset, UINT8 data )
+static void gx700pwbf_output( running_machine *machine, int offset, UINT8 data )
{
if( gx700pwfbf_output_callback != NULL )
{
@@ -1733,7 +1730,7 @@ static void gx700pwbf_output( int offset, UINT8 data )
int newbit = ( data >> shift[ i ] ) & 1;
if( oldbit != newbit )
{
- gx700pwfbf_output_callback( ( offset * 8 ) + i, newbit );
+ gx700pwfbf_output_callback( machine, ( offset * 8 ) + i, newbit );
}
}
}
@@ -1750,28 +1747,28 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( 0, data & 0xff );
+ gx700pwbf_output( space->machine, 0, data & 0xff );
}
break;
case 0x22:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( 1, data & 0xff );
+ gx700pwbf_output( space->machine, 1, data & 0xff );
}
break;
case 0x24:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( 2, data & 0xff );
+ gx700pwbf_output( space->machine, 2, data & 0xff );
}
break;
case 0x26:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( 3, data & 0xff );
+ gx700pwbf_output( space->machine, 3, data & 0xff );
}
break;
@@ -1781,7 +1778,7 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
}
}
-static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) )
+static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) )
{
memset( gx700pwbf_output_data, 0, sizeof( gx700pwbf_output_data ) );
@@ -1829,7 +1826,7 @@ static void gn845pwbb_do_w( int offset, int data )
stage[ offset ].DO = !data;
}
-static void gn845pwbb_clk_w( int offset, int data )
+static void gn845pwbb_clk_w( running_machine *machine, int offset, int data )
{
int clk = !data;
@@ -1873,7 +1870,7 @@ static void gn845pwbb_clk_w( int offset, int data )
}
}
- verboselog( Machine, 2, "stage: %dp data clk=%d state=%d d0=%d shift=%08x bit=%d stage_mask=%08x\n", offset + 1, clk, stage[ offset ].state, stage[ offset ].DO, stage[ offset ].shift, stage[ offset ].bit, stage_mask );
+ verboselog( machine, 2, "stage: %dp data clk=%d state=%d d0=%d shift=%08x bit=%d stage_mask=%08x\n", offset + 1, clk, stage[ offset ].state, stage[ offset ].DO, stage[ offset ].shift, stage[ offset ].bit, stage_mask );
}
static CUSTOM_INPUT( gn845pwbb_read )
@@ -1881,7 +1878,7 @@ static CUSTOM_INPUT( gn845pwbb_read )
return input_port_read(field->port->machine, "STAGE" ) & stage_mask;
}
-static void gn845pwbb_output_callback( int offset, int data )
+static void gn845pwbb_output_callback( running_machine *machine, int offset, int data )
{
switch( offset )
{
@@ -1906,7 +1903,7 @@ static void gn845pwbb_output_callback( int offset, int data )
break;
case 7:
- gn845pwbb_clk_w( 0, !data );
+ gn845pwbb_clk_w( machine, 0, !data );
break;
case 8:
@@ -1930,7 +1927,7 @@ static void gn845pwbb_output_callback( int offset, int data )
break;
case 15:
- gn845pwbb_clk_w( 1, !data );
+ gn845pwbb_clk_w( machine, 1, !data );
break;
case 17:
@@ -2161,9 +2158,9 @@ static char *binary( UINT32 data )
static UINT32 a,b,c,d;
static UINT16 gx894pwbba_output_data[ 8 ];
-static void (*gx894pwbba_output_callback)( int offset, int data );
+static void (*gx894pwbba_output_callback)( running_machine *machine, int offset, int data );
-static void gx894pwbba_output( int offset, UINT8 data )
+static void gx894pwbba_output( running_machine *machine, int offset, UINT8 data )
{
if( gx894pwbba_output_callback != NULL )
{
@@ -2175,7 +2172,7 @@ static void gx894pwbba_output( int offset, UINT8 data )
int newbit = ( data >> shift[ i ] ) & 1;
if( oldbit != newbit )
{
- gx894pwbba_output_callback( ( offset * 4 ) + i, newbit );
+ gx894pwbba_output_callback( machine, ( offset * 4 ) + i, newbit );
}
}
}
@@ -2239,22 +2236,22 @@ static WRITE32_HANDLER( gx894pwbba_w )
case 0x38:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( 0, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine, 0, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( 1, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine, 1, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &a );
break;
case 0x39:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( 7, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine, 7, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( 3, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine, 3, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &b );
break;
@@ -2289,18 +2286,18 @@ static WRITE32_HANDLER( gx894pwbba_w )
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( 4, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine, 4, ( data >> 28 ) & 0xf );
}
COMBINE_DATA( &c );
break;
case 0x3f:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( 2, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine, 2, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( 5, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine, 5, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &d );
break;
@@ -2314,7 +2311,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
}
}
-static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) )
+static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) )
{
int gx894_ram_size = 24 * 1024 * 1024;
@@ -2354,7 +2351,7 @@ static DRIVER_INIT( gtrfrkdigital )
/* ddr solo */
-static void ddrsolo_output_callback( int offset, int data )
+static void ddrsolo_output_callback( running_machine *machine, int offset, int data )
{
switch( offset )
{
@@ -2416,7 +2413,7 @@ static DRIVER_INIT( ddrsolo )
/* drummania */
-static void drmn_output_callback( int offset, int data )
+static void drmn_output_callback( running_machine *machine, int offset, int data )
{
switch( offset )
{
@@ -2496,7 +2493,7 @@ static DRIVER_INIT( drmndigital )
/* dance maniax */
-static void dmx_output_callback( int offset, int data )
+static void dmx_output_callback( running_machine *machine, int offset, int data )
{
switch( offset )
{
diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c
index 074241bd1d5..c089337307d 100644
--- a/src/mame/drivers/laserbat.c
+++ b/src/mame/drivers/laserbat.c
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( laserbat_input_mux_w )
{
laserbat_input_mux = (data & 0x30) >> 4;
- flip_screen_set_no_update(data & 0x08);
+ flip_screen_set_no_update(space->machine, data & 0x08);
coin_counter_w(0,data & 1);
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index 1ca4ebefe68..69546e018d5 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -193,16 +193,16 @@ static VIDEO_START( looping )
static WRITE8_HANDLER( flip_screen_x_w )
{
looping_state *state = space->machine->driver_data;
- flip_screen_x_set(~data & 0x01);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0);
+ 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;
- flip_screen_y_set(~data & 0x01);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0);
+ flip_screen_y_set(space->machine, ~data & 0x01);
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
}
@@ -257,13 +257,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int code = source[1] & 0x3f;
int color = source[2];
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c
index 7fe2e9625f6..f883fdd76f5 100644
--- a/src/mame/drivers/lsasquad.c
+++ b/src/mame/drivers/lsasquad.c
@@ -163,7 +163,7 @@ static WRITE8_HANDLER( lsasquad_bankswitch_w )
/* bit 3 is zeroed on startup, maybe reset sound CPU */
/* bit 4 flips screen */
- flip_screen_set(data & 0x10);
+ flip_screen_set(space->machine, data & 0x10);
/* other bits unknown */
}
diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c
index b7e6850f1e6..59692828c73 100644
--- a/src/mame/drivers/lucky74.c
+++ b/src/mame/drivers/lucky74.c
@@ -725,7 +725,7 @@ static WRITE8_HANDLER( ym2149_portb_w )
bit 0 contains the screen orientation.
*/
ym2149_portb = data;
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
static READ8_HANDLER( usart_8251_r )
diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c
index 502a16767a9..bd286a40702 100644
--- a/src/mame/drivers/lwings.c
+++ b/src/mame/drivers/lwings.c
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( lwings_bankswitch_w )
int bank;
/* bit 0 is flip screen */
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
/* bits 1 and 2 select ROM bank */
RAM = memory_region(space->machine, "main");
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index 61b2e139899..bef6f591c9e 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -216,17 +216,17 @@ static WRITE8_HANDLER( m63_palbank_w )
static WRITE8_HANDLER( m63_flipscreen_w )
{
- if (flip_screen_get() != (~data & 0x01))
+ if (flip_screen_get(space->machine) != (~data & 0x01))
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
static WRITE8_HANDLER( fghtbskt_flipscreen_w )
{
- flip_screen_set(data);
- fg_flag = flip_screen_get() ? TILE_FLIPX : 0;
+ flip_screen_set(space->machine, data);
+ fg_flag = flip_screen_get(space->machine) ? TILE_FLIPX : 0;
}
@@ -273,7 +273,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs + 3];
int sy = sy_offset - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = sy_offset - sy;
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 87fb4c9ee6c..b1d1bea59f9 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -803,7 +803,7 @@ static WRITE8_HANDLER( mappy_latch_w )
break;
case 0x04: /* FLIP */
- flip_screen_set(bit);
+ flip_screen_set(space->machine, bit);
break;
case 0x06: /* SOUND ON */
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index fd1c3453ebb..38ede1a45b6 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -37,7 +37,7 @@ static WRITE8_HANDLER( bank_sel_w )
int_enable = data & 1;
- flip_screen_set(data & 2);
+ flip_screen_set(space->machine, data & 2);
}
static MACHINE_RESET( mayumi )
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index 005b7adbbc3..0cabf48fd1c 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -261,7 +261,7 @@ static READ8_HANDLER( rampage_ip4_r )
static WRITE8_HANDLER( rampage_op6_w )
{
/* bit 5 controls reset of the Sounds Good board */
- soundsgood_reset_w((~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);
@@ -305,7 +305,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((~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);
@@ -348,7 +348,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((~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));
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index 6e92476294a..3abd594eda9 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -159,7 +159,7 @@ static WRITE16_HANDLER( spyhunt2_control_w )
/* turbocs_reset_w(~control_word & 0x0080);*/
turbocs_data_w(space, offset, (control_word >> 8) & 0x001f);
- soundsgood_reset_w(~control_word & 0x2000);
+ soundsgood_reset_w(space->machine, ~control_word & 0x2000);
soundsgood_data_w(space, offset, (control_word >> 8) & 0x001f);
}
@@ -211,7 +211,7 @@ static WRITE16_HANDLER( archrivl_control_w )
{
COMBINE_DATA(&control_word);
williams_cvsd_reset_w(~control_word & 0x0400);
- williams_cvsd_data_w(control_word & 0x3ff);
+ williams_cvsd_data_w(space->machine, control_word & 0x3ff);
}
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 708e38c9faf..3575995b21b 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -66,7 +66,6 @@
#include "driver.h"
#include "cpu/i386/i386.h"
#include "devconv.h"
-#include "deprecat.h"
#include "machine/8237dma.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
@@ -1074,12 +1073,12 @@ static MACHINE_DRIVER_START(mediagx)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
MACHINE_DRIVER_END
-static void set_gate_a20(int a20)
+static void set_gate_a20(running_machine *machine, int a20)
{
- cpu_set_input_line(Machine->cpu[0], INPUT_LINE_A20, a20);
+ cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(int state)
+static void keyboard_interrupt(running_machine *machine, int state)
{
pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state);
}
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index 3aba3db193b..0a1cb49c220 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -637,13 +637,13 @@ static void update_megadrive_vdp_code_and_address(void)
((megadrive_vdp_command_part2 & 0x0003) << 14);
}
-static UINT16 (*vdp_get_word_from_68k_mem)(UINT32 source);
+static UINT16 (*vdp_get_word_from_68k_mem)(running_machine *machine, UINT32 source);
-static UINT16 vdp_get_word_from_68k_mem_default(UINT32 source)
+static UINT16 vdp_get_word_from_68k_mem_default(running_machine *machine, UINT32 source)
{
if (( source >= 0x000000 ) && ( source <= 0x3fffff ))
{
- UINT16 *rom = (UINT16*)memory_region(Machine, "main");
+ UINT16 *rom = (UINT16*)memory_region(machine, "main");
return rom[(source&0x3fffff)>>1];
}
else if (( source >= 0xe00000 ) && ( source <= 0xffffff ))
@@ -655,7 +655,7 @@ static UINT16 vdp_get_word_from_68k_mem_default(UINT32 source)
else
{
printf("DMA Read unmapped %06x\n",source);
- return mame_rand(Machine);
+ return mame_rand(machine);
}
}
@@ -713,18 +713,18 @@ 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(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 */
- cpu_spinuntil_time(Machine->cpu[0], ATTOTIME_IN_NSEC(length*1000/3500));
+ cpu_spinuntil_time(machine->cpu[0], ATTOTIME_IN_NSEC(length*1000/3500));
for (count = 0;count<(length>>1);count++)
{
- vdp_vram_write(vdp_get_word_from_68k_mem(source));
+ vdp_vram_write(vdp_get_word_from_68k_mem(machine, source));
source+=2;
if (source>0xffffff) source = 0xe00000;
}
@@ -750,7 +750,7 @@ static void megadrive_do_insta_68k_to_cram_dma(running_machine *machine,UINT32 s
{
//if (megadrive_vdp_address>=0x80) return; // abandon
- write_cram_value(machine, (megadrive_vdp_address&0x7e)>>1, vdp_get_word_from_68k_mem(source));
+ write_cram_value(machine, (megadrive_vdp_address&0x7e)>>1, vdp_get_word_from_68k_mem(machine, source));
source+=2;
if (source>0xffffff) source = 0xfe0000;
@@ -768,7 +768,7 @@ static void megadrive_do_insta_68k_to_cram_dma(running_machine *machine,UINT32 s
}
-static void megadrive_do_insta_68k_to_vsram_dma(UINT32 source,UINT16 length)
+static void megadrive_do_insta_68k_to_vsram_dma(running_machine *machine,UINT32 source,UINT16 length)
{
int count;
@@ -778,7 +778,7 @@ static void megadrive_do_insta_68k_to_vsram_dma(UINT32 source,UINT16 length)
{
if (megadrive_vdp_address>=0x80) return; // abandon
- megadrive_vdp_vsram[(megadrive_vdp_address&0x7e)>>1] = vdp_get_word_from_68k_mem(source);
+ megadrive_vdp_vsram[(megadrive_vdp_address&0x7e)>>1] = vdp_get_word_from_68k_mem(machine, source);
source+=2;
if (source>0xffffff) source = 0xfe0000;
@@ -824,7 +824,7 @@ static void handle_dma_bits(running_machine *machine)
/* The 68k is frozen during this transfer, it should be safe to throw a few cycles away and do 'instant' DMA because the 68k can't detect it being in progress (can the z80?) */
//mame_printf_debug("68k->VRAM DMA transfer source %06x length %04x dest %04x enabled %01x\n", source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE);
- if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vram_dma(source,length);
+ if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vram_dma(machine,source,length);
}
else if (MEGADRIVE_REG17_DMATYPE==0x2)
@@ -885,7 +885,7 @@ static void handle_dma_bits(running_machine *machine)
/* The 68k is frozen during this transfer, it should be safe to throw a few cycles away and do 'instant' DMA because the 68k can't detect it being in progress (can the z80?) */
//mame_printf_debug("68k->VSRAM DMA transfer source %06x length %04x dest %04x enabled %01x\n", source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE);
- if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vsram_dma(source,length);
+ if (MEGADRIVE_REG01_DMA_ENABLE) megadrive_do_insta_68k_to_vsram_dma(machine,source,length);
}
else if (MEGADRIVE_REG17_DMATYPE==0x2)
{
@@ -1923,9 +1923,8 @@ 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(int offset, int ctrl)
+UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl)
{
- running_machine *machine = Machine;
UINT8 retdata;
if (ctrl==0x55)
@@ -3888,11 +3887,11 @@ ADDRESS_MAP_END
/* DMA read function for SVP */
-static UINT16 vdp_get_word_from_68k_mem_svp(UINT32 source)
+static UINT16 vdp_get_word_from_68k_mem_svp(running_machine *machine, UINT32 source)
{
if ((source & 0xe00000) == 0x000000)
{
- UINT16 *rom = (UINT16*)memory_region(Machine, "main");
+ UINT16 *rom = (UINT16*)memory_region(machine, "main");
source -= 2; // DMA latency
return rom[source >> 1];
}
@@ -3910,7 +3909,7 @@ static UINT16 vdp_get_word_from_68k_mem_svp(UINT32 source)
else
{
mame_printf_debug("DMA Read unmapped %06x\n",source);
- return mame_rand(Machine);
+ return mame_rand(machine);
}
}
diff --git a/src/mame/drivers/megadriv.h b/src/mame/drivers/megadriv.h
index 3c5abdc4d8d..31790a176f3 100644
--- a/src/mame/drivers/megadriv.h
+++ b/src/mame/drivers/megadriv.h
@@ -21,7 +21,7 @@ MACHINE_DRIVER_EXTERN( genesis_32x_scd );
extern UINT16* megadriv_backupram;
extern int megadriv_backupram_length;
extern UINT16* megadrive_ram;
-extern UINT8 megatech_bios_port_cc_dc_r(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);
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 34724dd9c53..43dbb64a4ea 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -543,7 +543,7 @@ static WRITE8_HANDLER (megatech_bios_port_ctrl_w)
static READ8_HANDLER (megatech_bios_joypad_r)
{
- return megatech_bios_port_cc_dc_r(offset,bios_port_ctrl);
+ return megatech_bios_port_cc_dc_r(space->machine,offset,bios_port_ctrl);
}
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index 7a5f441c79e..9bb93960836 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -289,7 +289,7 @@ static WRITE8_HANDLER( led2_w )
static WRITE8_DEVICE_HANDLER( misc_w )
{
- flip_screen_set(~data & 0x10);
+ flip_screen_set(device->machine, ~data & 0x10);
extra_video_bank_bit = (data & 2) << 8;
lscnblk = (data >> 3) & 1;
@@ -298,7 +298,7 @@ static WRITE8_DEVICE_HANDLER( misc_w )
static WRITE8_DEVICE_HANDLER( misc_couple_w )
{
- flip_screen_set(~data & 0x10);
+ flip_screen_set(device->machine, ~data & 0x10);
extra_video_bank_bit = (data & 2) << 8;
lscnblk = (data >> 3) & 1;
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 79f4f42e36c..f06cacb2db4 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -231,9 +231,9 @@ static void pc16650d_tx_callback(int channel, int count, UINT8* data)
microtouch_rx(count, data);
};
-static void meritm_microtouch_tx_callback(UINT8 data)
+static void meritm_microtouch_tx_callback(running_machine *machine, UINT8 data)
{
- pc16552d_rx_data(Machine, 0, 0, data);
+ pc16552d_rx_data(machine, 0, 0, data);
};
/*************************************
@@ -823,13 +823,6 @@ static const z80pio_interface meritm_io_pio_intf =
0
};
-#ifdef UNUSED_FUNCTION
-static void meritm_pio1_portb_input_changed_callback(void *param, UINT32 oldval, UINT32 newval)
-{
- z80pio_p_w(Machine, 1, 1, (UINT8)newval);
-}
-#endif
-
static const z80_daisy_chain meritm_daisy_chain[] =
{
{ Z80PIO, "z80pio_1" },
@@ -841,7 +834,6 @@ static MACHINE_START(merit_common)
{
meritm_z80pio[0] = devtag_get_device( machine, Z80PIO, "z80pio_0" );
meritm_z80pio[1] = devtag_get_device( machine, Z80PIO, "z80pio_1" );
- //input_port_set_changed_callback(port_tag_to_index("PIO1_PORTB"), 0xff, meritm_pio1_portb_input_changed_callback, NULL);
};
diff --git a/src/mame/drivers/metlclsh.c b/src/mame/drivers/metlclsh.c
index 0f082b26c5c..e28f5f6f20e 100644
--- a/src/mame/drivers/metlclsh.c
+++ b/src/mame/drivers/metlclsh.c
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( metlclsh_ack_nmi2 )
static WRITE8_HANDLER( metlclsh_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
static ADDRESS_MAP_START( metlclsh_readmem2, ADDRESS_SPACE_PROGRAM, 8 )
@@ -308,7 +308,7 @@ static INTERRUPT_GEN( metlclsh_interrupt2 )
static MACHINE_RESET( metlclsh )
{
- flip_screen_set(0);
+ flip_screen_set(machine, 0);
}
static MACHINE_DRIVER_START( metlclsh )
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index e8bb2b1879e..429046ad3d3 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -81,9 +81,9 @@ driver modified by Eisuke Watanabe
***************************************************************************/
#include "driver.h"
+#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
-#include "deprecat.h"
#include "cpu/h83002/h8.h"
#include "cpu/upd7810/upd7810.h"
#include "machine/eeprom.h"
@@ -335,13 +335,13 @@ static void ymf278b_interrupt(running_machine *machine, int active)
static UINT16 metro_soundstatus;
static int porta, portb, busy_sndcpu;
-static int metro_io_callback(int ioline, int state)
+static int metro_io_callback(const device_config *device, int ioline, int state)
{
- const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
+ const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
UINT8 data = 0;
- switch ( ioline )
+ switch ( ioline )
{
case UPD7810_RXD: /* read the RxD line */
data = soundlatch_r(space,0);
@@ -350,7 +350,7 @@ static int metro_io_callback(int ioline, int state)
break;
default:
logerror("upd7810 ioline %d not handled\n", ioline);
- }
+ }
return state;
}
diff --git a/src/mame/drivers/micro3d.c b/src/mame/drivers/micro3d.c
index f6af56202ca..752d8b921c5 100644
--- a/src/mame/drivers/micro3d.c
+++ b/src/mame/drivers/micro3d.c
@@ -23,7 +23,6 @@
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "deprecat.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/mcs51/mcs51.h"
#include "sound/2151intf.h"
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index 065a475acf1..77413e48f58 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -375,20 +375,20 @@ static WRITE32_HANDLER( bit_reset_w )
static READ32_HANDLER( offroadc_serial_status_r )
{
- int status = midway_serial_pic2_status_r();
+ int status = midway_serial_pic2_status_r(space);
return (input_port_read(space->machine, "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
}
static READ32_HANDLER( offroadc_serial_data_r )
{
- return midway_serial_pic2_r() << 16;
+ return midway_serial_pic2_r(space) << 16;
}
static WRITE32_HANDLER( offroadc_serial_data_w )
{
- midway_serial_pic2_w(space->machine, data >> 16);
+ midway_serial_pic2_w(space, data >> 16);
}
diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c
index 1cc7fb1aa16..59766e6bc85 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -82,7 +82,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -121,7 +121,7 @@ static VIDEO_START(mirage)
static VIDEO_UPDATE(mirage)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,256); /* not verified */
diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c
index edbca77837e..60f998e7e76 100644
--- a/src/mame/drivers/missb2.c
+++ b/src/mame/drivers/missb2.c
@@ -97,7 +97,7 @@ static VIDEO_UPDATE( missb2 )
x = sx + xc * 8;
y = (sy + yc * 8) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
x = 248 - x;
y = 248 - y;
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index a1f1874e92a..5952eb1ce4d 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -380,7 +380,7 @@ static int model3_crom_bank = 0;
static int model3_controls_bank;
static UINT32 real3d_device_id;
-static void real3d_dma_callback(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 UINT16 *model3_soundram;
@@ -766,9 +766,9 @@ static WRITE64_HANDLER(scsi_w)
}
}
-static UINT32 scsi_fetch(UINT32 dsp)
+static UINT32 scsi_fetch(running_machine *machine, UINT32 dsp)
{
- const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
+ const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
UINT32 result;
result = memory_read_dword(space, dsp);
return FLIPENDIAN_INT32(result);
@@ -826,11 +826,11 @@ static WRITE64_HANDLER( real3d_dma_w )
int length = FLIPENDIAN_INT32((UINT32)(data >> 32)) * 4;
if (dma_endian & 0x80)
{
- real3d_dma_callback(dma_source, dma_dest, length, 0);
+ real3d_dma_callback(space->machine, dma_source, dma_dest, length, 0);
}
else
{
- real3d_dma_callback(dma_source, dma_dest, length, 1);
+ real3d_dma_callback(space->machine, dma_source, dma_dest, length, 1);
}
dma_irq |= 0x01;
scsi_irq_callback(space->machine, 1);
@@ -872,9 +872,9 @@ static WRITE64_HANDLER( real3d_dma_w )
fatalerror("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(UINT32 src, UINT32 dst, int length, int byteswap)
+static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst, int length, int byteswap)
{
- const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
+ const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
switch(dst >> 24)
{
case 0x88: /* Display List End Trigger */
@@ -898,7 +898,7 @@ static void real3d_dma_callback(UINT32 src, UINT32 dst, int length, int byteswap
case 0x9c: /* Unknown */
break;
default:
- fatalerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(Machine->cpu[0]));
+ fatalerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine->cpu[0]));
break;
}
}
@@ -994,13 +994,13 @@ static void configure_fast_ram(running_machine *machine)
static MACHINE_START(model3_10)
{
- lsi53c810_init(&scsi_intf);
+ lsi53c810_init(machine, &scsi_intf);
add_exit_callback(machine, model3_exit);
configure_fast_ram(machine);
}
static MACHINE_START(model3_15)
{
- lsi53c810_init(&scsi_intf);
+ lsi53c810_init(machine, &scsi_intf);
add_exit_callback(machine, model3_exit);
configure_fast_ram(machine);
}
diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c
index f4b93fb60a9..21adbb687cc 100644
--- a/src/mame/drivers/msisaac.c
+++ b/src/mame/drivers/msisaac.c
@@ -76,7 +76,7 @@ static WRITE8_HANDLER( nmi_enable_w )
#if 0
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
static WRITE8_HANDLER( msisaac_coin_counter_w )
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 14887d7ab07..0197afc0d00 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -40,7 +40,6 @@
*/
#include "driver.h"
-#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "sound/nes_apu.h"
#include "cpu/m6502/m6502.h"
@@ -206,14 +205,14 @@ static int multigam3_mmc3_4screen;
static int multigam3_mmc3_last_bank;
static UINT8* multigmc_mmc3_6000_ram;
-static void multigam3_mmc3_scanline_cb( int num, int scanline, int vblank, int blanked )
+static void multigam3_mmc3_scanline_cb( running_machine *machine, int num, int scanline, int vblank, int blanked )
{
if ( !vblank && !blanked )
{
if ( --multigam3_mmc3_scanline_counter == -1 )
{
multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch;
- generic_pulse_irq_line(Machine->cpu[0], 0);
+ generic_pulse_irq_line(machine->cpu[0], 0);
}
}
}
@@ -513,9 +512,9 @@ static PALETTE_INIT( multigam )
ppu2c0x_init_palette(machine, 0 );
}
-static void ppu_irq( int num, int *ppu_regs )
+static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
{
- cpu_set_input_line(Machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
+ cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
}
/* our ppu interface */
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index 0db17b78c7d..d97dff88c1b 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -638,9 +638,9 @@ static TIMER_CALLBACK( mcu_timer )
static UINT32 m_n_bankoffset;
-INLINE void bankswitch_rom8( int n_bank, int n_data )
+INLINE void bankswitch_rom8( const address_space *space, int n_bank, int n_data )
{
- memory_set_bank( Machine, n_bank + 1, ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) );
+ memory_set_bank( space->machine, n_bank + 1, ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) );
}
static WRITE32_HANDLER( bankswitch_rom32_w )
@@ -649,11 +649,11 @@ static WRITE32_HANDLER( bankswitch_rom32_w )
if( ACCESSING_BITS_0_15 )
{
- bankswitch_rom8( ( offset * 2 ), data & 0xffff );
+ bankswitch_rom8( space, ( offset * 2 ), data & 0xffff );
}
if( ACCESSING_BITS_16_31 )
{
- bankswitch_rom8( ( offset * 2 ) + 1, data >> 16 );
+ bankswitch_rom8( space, ( offset * 2 ) + 1, data >> 16 );
}
}
@@ -671,10 +671,10 @@ static WRITE32_HANDLER( bankswitch_rom64_upper_w )
}
}
-INLINE void bankswitch_rom64( int n_bank, int n_data )
+INLINE void bankswitch_rom64( const address_space *space, int n_bank, int n_data )
{
/* todo: verify behaviour */
- memory_set_bank( Machine, n_bank + 1, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ m_n_bankoffset ) );
+ memory_set_bank( space->machine, n_bank + 1, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ m_n_bankoffset ) );
}
static WRITE32_HANDLER( bankswitch_rom64_w )
@@ -683,11 +683,11 @@ static WRITE32_HANDLER( bankswitch_rom64_w )
if( ACCESSING_BITS_0_15 )
{
- bankswitch_rom64( ( offset * 2 ), data & 0xffff );
+ bankswitch_rom64( space, ( offset * 2 ), data & 0xffff );
}
if( ACCESSING_BITS_16_31 )
{
- bankswitch_rom64( ( offset * 2 ) + 1, data >> 16 );
+ bankswitch_rom64( space, ( offset * 2 ) + 1, data >> 16 );
}
}
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 096d3c81909..39d84a5a820 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -922,7 +922,6 @@ Notes:
*/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/mips/psx.h"
#include "cpu/h83002/h8.h"
#include "includes/psx.h"
@@ -1016,9 +1015,8 @@ static WRITE32_HANDLER( dmaoffset_w )
verboselog( space->machine, 1, "dmaoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, m_n_dmaoffset );
}
-static void namcos12_rom_read( UINT32 n_address, INT32 n_size )
+static void namcos12_rom_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
- running_machine *machine = Machine;
const char *n_region;
int n_offset;
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index b9940529e93..8745bbe2415 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -559,7 +559,7 @@ namcos21_kickstart( running_machine *machine, int internal )
}
static UINT16
-ReadWordFromSlaveInput( void )
+ReadWordFromSlaveInput( const address_space *space )
{
UINT16 data = 0;
if( mpDspState->slaveBytesAvailable>0 )
@@ -571,7 +571,7 @@ ReadWordFromSlaveInput( void )
{
mpDspState->slaveBytesAdvertised--;
}
- logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context(Machine), data, mpDspState->slaveBytesAvailable );
+ logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context(space->machine), data, mpDspState->slaveBytesAvailable );
}
return data;
} /* ReadWordFromSlaveInput */
@@ -889,7 +889,7 @@ RenderSlaveOutput( UINT16 data )
static READ16_HANDLER(slave_port0_r)
{
- return ReadWordFromSlaveInput();
+ return ReadWordFromSlaveInput(space);
} /* slave_port0_r */
static WRITE16_HANDLER(slave_port0_w)
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index 131e9275845..68058ef45bd 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -194,7 +194,7 @@ static WRITE8_HANDLER( ninjakd2_soundreset_w )
cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
// bit 7 flips screen
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
// other bits unused
}
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index a9f399c98d3..0432aa97d6c 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -4633,7 +4633,7 @@ static WRITE16_HANDLER( twinactn_scroll1_w )
static WRITE16_HANDLER( twinactn_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(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);
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index 91df4f6f999..b897ebb55aa 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -214,7 +214,6 @@ Thrill Drive 713A13 - 713A14 -
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "deprecat.h"
#include "cpu/powerpc/ppc.h"
#include "cpu/sharc/sharc.h"
#include "machine/konppc.h"
@@ -735,16 +734,16 @@ static VIDEO_UPDATE( nwktr )
/*****************************************************************************/
-static double adc12138_input_callback(int input)
+static double adc12138_input_callback(running_machine *machine, int input)
{
int value = 0;
switch (input)
{
- case 0: value = input_port_read(Machine, "ANALOG1") - 0x800; break;
- case 1: value = input_port_read(Machine, "ANALOG2"); break;
- case 2: value = input_port_read(Machine, "ANALOG3"); break;
- case 3: value = input_port_read(Machine, "ANALOG4"); break;
- case 4: value = input_port_read(Machine, "ANALOG5"); break;
+ case 0: value = input_port_read(machine, "ANALOG1") - 0x800; break;
+ case 1: value = input_port_read(machine, "ANALOG2"); break;
+ case 2: value = input_port_read(machine, "ANALOG3"); break;
+ case 3: value = input_port_read(machine, "ANALOG4"); break;
+ case 4: value = input_port_read(machine, "ANALOG5"); break;
}
return (double)(value) / 2047.0;
@@ -805,7 +804,7 @@ static WRITE32_HANDLER( sysreg_w )
int di = (data >> 25) & 0x1;
int sclk = (data >> 24) & 0x1;
- adc1213x_cs_w(0, cs);
+ adc1213x_cs_w(space->machine, 0, cs);
adc1213x_conv_w(0, conv);
adc1213x_di_w(0, di);
adc1213x_sclk_w(0, sclk);
@@ -1148,8 +1147,8 @@ static void sound_irq_callback(running_machine *machine, int irq)
static DRIVER_INIT(nwktr)
{
- init_konami_cgboard(1, CGBOARD_TYPE_NWKTR);
- set_cgboard_texture_bank(0, 5, memory_region(machine, "user5"));
+ init_konami_cgboard(machine, 1, CGBOARD_TYPE_NWKTR);
+ set_cgboard_texture_bank(machine, 0, 5, memory_region(machine, "user5"));
sharc_dataram = auto_malloc(0x100000);
led_reg0 = led_reg1 = 0x7f;
diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c
index b9dbfaaea60..2fe6fb5e6ef 100644
--- a/src/mame/drivers/olibochu.c
+++ b/src/mame/drivers/olibochu.c
@@ -68,9 +68,9 @@ static WRITE8_HANDLER( olibochu_colorram_w )
static WRITE8_HANDLER( olibochu_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -109,7 +109,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs+3];
int sy = ((spriteram[offs+2] + 8) & 0xff) - 8;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -137,7 +137,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram_2[offs+3];
int sy = spriteram_2[offs+2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 248 - sx;
sy = 248 - sy;
diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c
index 7ebe721d435..4599b050712 100644
--- a/src/mame/drivers/pacland.c
+++ b/src/mame/drivers/pacland.c
@@ -200,9 +200,9 @@ static WRITE8_HANDLER( pacland_subreset_w )
static WRITE8_HANDLER( pacland_flipscreen_w )
{
int bit = !BIT(offset,11);
- /* can't use flip_screen_set() because the visible area is asymmetrical */
- flip_screen_set_no_update(bit);
- tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (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_TILEMAPS,flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
diff --git a/src/mame/drivers/pitnrun.c b/src/mame/drivers/pitnrun.c
index 156b1b13cac..ee3588e23f7 100644
--- a/src/mame/drivers/pitnrun.c
+++ b/src/mame/drivers/pitnrun.c
@@ -83,12 +83,12 @@ static WRITE8_HANDLER( nmi_enable_w )
static WRITE8_HANDLER(pitnrun_hflip_w)
{
- flip_screen_x_set(data);
+ flip_screen_x_set(space->machine, data);
}
static WRITE8_HANDLER(pitnrun_vflip_w)
{
- flip_screen_y_set(data);
+ flip_screen_y_set(space->machine, data);
}
static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c
index 2f9926af409..f6d7801bc1e 100644
--- a/src/mame/drivers/popeye.c
+++ b/src/mame/drivers/popeye.c
@@ -444,7 +444,7 @@ static int dswbit;
static WRITE8_HANDLER( popeye_portB_w )
{
/* bit 0 flips screen */
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
/* bits 1-3 select DSW1 bit to read */
dswbit = (data & 0x0e) >> 1;
diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c
index c98bac7abf5..a7203c7ee5a 100644
--- a/src/mame/drivers/psychic5.c
+++ b/src/mame/drivers/psychic5.c
@@ -341,7 +341,7 @@ static UINT8 psychic5_bank_latch;
static MACHINE_RESET( psychic5 )
{
psychic5_bank_latch = 0xff;
- flip_screen_set(0);
+ flip_screen_set(machine, 0);
}
/***************************************************************************
@@ -404,7 +404,7 @@ static WRITE8_HANDLER( psychic5_coin_counter_w )
// bit 7 toggles flip screen
if (data & 0x80)
{
- flip_screen_set(!flip_screen_get());
+ flip_screen_set(space->machine, !flip_screen_get(space->machine));
}
}
@@ -413,7 +413,7 @@ static WRITE8_HANDLER( bombsa_flipscreen_w )
// bit 7 toggles flip screen
if (data & 0x80)
{
- flip_screen_set(!flip_screen_get());
+ flip_screen_set(space->machine, !flip_screen_get(space->machine));
}
}
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 472d2ce181b..6bd9cdf83a8 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -144,13 +144,13 @@ static VIDEO_UPDATE(pturn)
flipy=spriteram[offs+1]&0x80;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(screen->machine))
{
sx = 224 - sx;
flipx ^= 0x40;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(screen->machine))
{
flipy ^= 0x80;
sy = 224 - sy;
@@ -243,7 +243,7 @@ static WRITE8_HANDLER(bgbank_w)
static WRITE8_HANDLER(flip_w)
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
diff --git a/src/mame/drivers/pushman.c b/src/mame/drivers/pushman.c
index 5a947150721..9ffc56d4958 100644
--- a/src/mame/drivers/pushman.c
+++ b/src/mame/drivers/pushman.c
@@ -43,7 +43,7 @@ static WRITE16_HANDLER( pushman_flipscreen_w )
{
if (ACCESSING_BITS_8_15)
{
- flip_screen_set(data & 0x0200);
+ flip_screen_set(space->machine, data & 0x0200);
coin_counter_w(0, data & 0x4000);
coin_counter_w(1, data & 0x8000);
}
diff --git a/src/mame/drivers/rallyx.c b/src/mame/drivers/rallyx.c
index b950ce3df2c..6fa22acb790 100644
--- a/src/mame/drivers/rallyx.c
+++ b/src/mame/drivers/rallyx.c
@@ -252,7 +252,7 @@ static WRITE8_HANDLER( rallyx_latch_w )
break;
case 0x03: /* FLIP */
- flip_screen_set(bit);
+ flip_screen_set(space->machine, bit);
break;
case 0x04:
@@ -293,7 +293,7 @@ static WRITE8_HANDLER( locomotn_latch_w )
break;
case 0x03: /* FLIP */
- flip_screen_set(bit);
+ flip_screen_set(space->machine, bit);
break;
case 0x04: /* OUT1 */
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index c3e6b91325a..c465d189589 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -143,7 +143,7 @@ static WRITE8_HANDLER( adpcm_w )
static WRITE8_HANDLER( ctrl_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
// (data & 0x02) is switched on and off in service mode
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index 18c4a11586b..0ae9c58c6e5 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -309,7 +309,7 @@ static WRITE8_HANDLER ( mjapinky_bank_w )
static WRITE8_HANDLER( mjapinky_palbank_w )
{
- flip_screen_set(~data & 4);
+ flip_screen_set(space->machine, ~data & 4);
palette_base = (data >> 3) & 0x01;
coin_counter_w(0,data & 2); // in
coin_counter_w(1,data & 1); // out
@@ -534,7 +534,7 @@ static READ8_HANDLER( janptr96_unknown_r )
static WRITE8_HANDLER( janptr96_coin_counter_w )
{
- flip_screen_set(~data & 4);
+ flip_screen_set(space->machine, ~data & 4);
coin_counter_w(0,data & 2); // in
coin_counter_w(1,data & 1); // out
}
@@ -563,7 +563,7 @@ static UINT8 mjifb_rom_enable;
static WRITE8_HANDLER( mjifb_coin_counter_w )
{
- flip_screen_set( data & 4);
+ flip_screen_set(space->machine, data & 4);
coin_counter_w(0,data & 2); // in
coin_counter_w(1,data & 1); // out
}
diff --git a/src/mame/drivers/sauro.c b/src/mame/drivers/sauro.c
index 7de70b5997a..fb7ebd9888a 100644
--- a/src/mame/drivers/sauro.c
+++ b/src/mame/drivers/sauro.c
@@ -127,7 +127,7 @@ static WRITE8_HANDLER( sauro_coin2_w )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
static WRITE8_HANDLER( adpcm_w )
@@ -135,10 +135,10 @@ static WRITE8_HANDLER( adpcm_w )
sp0256_ALD_w(space, 0, data);
}
-static void lrq_callback(int state)
+static void lrq_callback(const device_config *device, int state)
{
- //cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
- cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, state);
+ //cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
+ cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, state);
}
static ADDRESS_MAP_START( sauro_readmem, ADDRESS_SPACE_PROGRAM, 8 )
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index dd6a480cbc0..01ac41308c1 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -61,9 +61,9 @@ static TILE_GET_INFO( get_sb_tile_info )
SET_TILE_INFO(0, tileno, 0, 0);
}
-static void plot_pixel_sbw(int x, int y, int col)
+static void plot_pixel_sbw(int x, int y, int col, int flip)
{
- if (flip_screen_get())
+ if (flip)
{
y = 255-y;
x = 247-x;
@@ -73,6 +73,7 @@ static void plot_pixel_sbw(int x, int y, int col)
static WRITE8_HANDLER( sbw_videoram_w )
{
+ int flip = flip_screen_get(space->machine);
int x,y,i,v1,v2;
videoram[offset] = data;
@@ -87,7 +88,7 @@ static WRITE8_HANDLER( sbw_videoram_w )
for(i = 0; i < 8; i++)
{
- plot_pixel_sbw(x++, y, color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ) );
+ plot_pixel_sbw(x++, y, color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip);
v1 >>= 1;
v2 >>= 1;
}
@@ -148,7 +149,7 @@ static WRITE8_HANDLER (system_w)
-----x-- 1 ?
----x--- flip screen/controls
*/
- flip_screen_set(data&1);
+ flip_screen_set(space->machine, data&1);
if((sbw_system^data)&1)
{
diff --git a/src/mame/drivers/scotrsht.c b/src/mame/drivers/scotrsht.c
index 039db7c8039..f36b0ea461d 100644
--- a/src/mame/drivers/scotrsht.c
+++ b/src/mame/drivers/scotrsht.c
@@ -53,7 +53,7 @@ static int irq_enable;
static WRITE8_HANDLER( ctrl_w )
{
irq_enable = data & 0x02;
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
}
static INTERRUPT_GEN( scotrsht_interrupt )
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index 87b2f215ce2..07d842b0b6f 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -297,7 +297,6 @@ covert megatech / megaplay drivers to use new code etc. etc.
#include "driver.h"
#include "cpu/z80/z80.h"
-#include "deprecat.h"
#include "sound/sn76496.h"
#include "machine/mc8123.h"
#include "machine/segacrpt.h"
@@ -571,38 +570,38 @@ enum
GEN_VDP = 3 // Genesis VDP running in SMS2 Mode
};
-static int sms_vdp_null_irq_callback(int status)
+static int sms_vdp_null_irq_callback(running_machine *machine, int status)
{
return -1;
}
-static int sms_vdp_cpu0_irq_callback(int status)
+static int sms_vdp_cpu0_irq_callback(running_machine *machine, int status)
{
if (status==1)
- cpu_set_input_line(Machine->cpu[0],0,HOLD_LINE);
+ cpu_set_input_line(machine->cpu[0],0,HOLD_LINE);
else
- cpu_set_input_line(Machine->cpu[0],0,CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[0],0,CLEAR_LINE);
return 0;
}
-static int sms_vdp_cpu1_irq_callback(int status)
+static int sms_vdp_cpu1_irq_callback(running_machine *machine, int status)
{
if (status==1)
- cpu_set_input_line(Machine->cpu[1],0,HOLD_LINE);
+ cpu_set_input_line(machine->cpu[1],0,HOLD_LINE);
else
- cpu_set_input_line(Machine->cpu[1],0,CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[1],0,CLEAR_LINE);
return 0;
}
-static int sms_vdp_cpu2_irq_callback(int status)
+static int sms_vdp_cpu2_irq_callback(running_machine *machine, int status)
{
if (status==1)
- cpu_set_input_line(Machine->cpu[2],0,HOLD_LINE);
+ cpu_set_input_line(machine->cpu[2],0,HOLD_LINE);
else
- cpu_set_input_line(Machine->cpu[2],0,CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[2],0,CLEAR_LINE);
return 0;
}
@@ -649,7 +648,7 @@ struct sms_vdp
int sms_framerate;
emu_timer* sms_scanline_timer;
UINT16* cram_mamecolours; // for use on RGB_DIRECT screen
- int (*set_irq)(int state);
+ int (*set_irq)(running_machine *machine, int state);
};
@@ -688,7 +687,7 @@ static void *start_vdp(running_machine *machine, int type)
chip->vram = auto_malloc(0x4000);
memset(chip->vram,0x00,0x4000);
- //printf("%d\n", (*chip->set_irq)(200));
+ //printf("%d\n", (*chip->set_irq)(machine, 200));
if (chip->vdp_type==GG_VDP)
{
@@ -826,7 +825,7 @@ static void vdp_data_w(const address_space *space, UINT8 data, struct sms_vdp* c
}
-static UINT8 vdp_ctrl_r(struct sms_vdp *chip)
+static UINT8 vdp_ctrl_r(const address_space *space, struct sms_vdp *chip)
{
UINT8 retvalue;
@@ -840,7 +839,7 @@ static UINT8 vdp_ctrl_r(struct sms_vdp *chip)
chip->sprite_collision = 0;
chip->sprite_overflow = 0;
- (chip->set_irq)(0); // clear IRQ;
+ (chip->set_irq)(space->machine, 0); // clear IRQ;
return retvalue;
@@ -853,7 +852,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(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;
@@ -866,11 +865,11 @@ static void vdp_set_register(struct sms_vdp *chip)
{
if ((chip->regs[0x1]&0x20) && chip->frame_irq_pending)
{
- (chip->set_irq)(1); // set IRQ;
+ (chip->set_irq)(machine, 1); // set IRQ;
}
else
{
- (chip->set_irq)(0); // clear IRQ;
+ (chip->set_irq)(machine, 0); // clear IRQ;
}
}
@@ -878,11 +877,11 @@ static void vdp_set_register(struct sms_vdp *chip)
{
if ((chip->regs[0x0]&0x10) && chip->line_irq_pending)
{
- (chip->set_irq)(1); // set IRQ;
+ (chip->set_irq)(machine, 1); // set IRQ;
}
else
{
- (chip->set_irq)(0); // clear IRQ;
+ (chip->set_irq)(machine, 0); // clear IRQ;
}
}
@@ -890,7 +889,7 @@ static void vdp_set_register(struct sms_vdp *chip)
// printf("VDP: setting register %01x to %02x\n",reg, chip->cmd_part1);
}
-static void vdp_ctrl_w(UINT8 data, struct sms_vdp *chip)
+static void vdp_ctrl_w(const address_space *space, UINT8 data, struct sms_vdp *chip)
{
if (chip->cmd_pend)
{ /* Part 2 of a command word write */
@@ -911,7 +910,7 @@ static void vdp_ctrl_w(UINT8 data, struct sms_vdp *chip)
break;
case 0x2: /* REG setting */
- vdp_set_register(chip);
+ vdp_set_register(space->machine, chip);
chip->writemode = 0;
break;
@@ -947,12 +946,12 @@ WRITE8_HANDLER( md_sms_vdp_data_w )
READ8_HANDLER( md_sms_vdp_ctrl_r )
{
- return vdp_ctrl_r(md_sms_vdp);
+ return vdp_ctrl_r(space, md_sms_vdp);
}
WRITE8_HANDLER( md_sms_vdp_ctrl_w )
{
- vdp_ctrl_w(data, md_sms_vdp);
+ vdp_ctrl_w(space, data, md_sms_vdp);
}
@@ -975,12 +974,12 @@ WRITE8_HANDLER( sms_vdp_data_w )
READ8_HANDLER( sms_vdp_ctrl_r )
{
- return vdp_ctrl_r(vdp1);
+ return vdp_ctrl_r(space, vdp1);
}
WRITE8_HANDLER( sms_vdp_ctrl_w )
{
- vdp_ctrl_w(data, vdp1);
+ vdp_ctrl_w(space, data, vdp1);
}
WRITE8_HANDLER( sms_sn76496_w )
@@ -1314,11 +1313,11 @@ static TIMER_CALLBACK( sms_scanline_timer_callback )
chip->hint_counter=chip->regs[0xa];
if (chip->regs[0x0]&0x10)
{
- (chip->set_irq)(1); // set IRQ;
+ (chip->set_irq)(machine, 1); // set IRQ;
}
else
{
- (chip->set_irq)(0); // clear IRQ;
+ (chip->set_irq)(machine, 0); // clear IRQ;
}
}
@@ -1334,11 +1333,11 @@ static TIMER_CALLBACK( sms_scanline_timer_callback )
chip->frame_irq_pending = 1;
if (chip->regs[0x1]&0x20)
{
- (chip->set_irq)(1); // set IRQ;
+ (chip->set_irq)(machine, 1); // set IRQ;
}
else
{
- (chip->set_irq)(0); // clear IRQ;
+ (chip->set_irq)(machine, 0); // clear IRQ;
}
}
}
@@ -2093,12 +2092,12 @@ static WRITE8_HANDLER( sms_vdp_2_data_w )
static READ8_HANDLER( sms_vdp_2_ctrl_r )
{
- return vdp_ctrl_r(vdp2);
+ return vdp_ctrl_r(space, vdp2);
}
static WRITE8_HANDLER( sms_vdp_2_ctrl_w )
{
- vdp_ctrl_w(data, vdp2);
+ vdp_ctrl_w(space, data, vdp2);
}
static WRITE8_HANDLER( segasyse_videoram_w )
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index 467f3c54358..a6e47723ba5 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -172,7 +172,7 @@ static MACHINE_START( g80r )
static MACHINE_RESET( pignewt )
{
- sega_usb_reset(0x10);
+ sega_usb_reset(machine, 0x10);
}
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index 885d1f0d684..8d9d11dda29 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -202,7 +202,7 @@ static MACHINE_RESET( g80v )
{
/* if we have a Universal Sound Board, reset it here */
if (has_usb)
- sega_usb_reset(0x10);
+ sega_usb_reset(machine, 0x10);
}
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index fbdda080da9..e21790cfb5b 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -871,7 +871,6 @@ CPU - 317-0092 |--------------------------------------------------------------
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "cpu/mcs51/mcs51.h"
-#include "deprecat.h"
#include "system16.h"
#include "machine/segaic16.h"
#include "machine/fd1089.h"
@@ -1345,10 +1344,10 @@ static READ8_HANDLER( upd7759_status_r )
}
-static void upd7759_generate_nmi(int state)
+static void upd7759_generate_nmi(const device_config *device, int state)
{
if (state)
- cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
+ cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 7388b3bedf2..2e0908194e2 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -347,7 +347,7 @@ Notes:
UINT16* s24_mainram1;
-extern void s24_fd1094_machine_init(void);
+extern void s24_fd1094_machine_init(running_machine *machine);
extern void s24_fd1094_driver_init(running_machine *machine);
VIDEO_START(system24);
@@ -697,7 +697,7 @@ static void reset_reset(running_machine *machine)
cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, PULSE_LINE);
// mame_printf_debug("enable 2nd cpu!\n");
// debugger_break(machine);
- s24_fd1094_machine_init();
+ s24_fd1094_machine_init(machine);
} else
cpu_set_input_line(machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE);
diff --git a/src/mame/drivers/senjyo.c b/src/mame/drivers/senjyo.c
index 2e25101123b..f9fa7abfa5e 100644
--- a/src/mame/drivers/senjyo.c
+++ b/src/mame/drivers/senjyo.c
@@ -95,7 +95,7 @@ static INTERRUPT_GEN( senjyo_interrupt )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
static WRITE8_HANDLER( paletteram_IIBBGGRR_w )
diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c
index 663683a8e99..5bece20316f 100644
--- a/src/mame/drivers/shadfrce.c
+++ b/src/mame/drivers/shadfrce.c
@@ -107,7 +107,7 @@ static int vblank = 0;
static WRITE16_HANDLER( shadfrce_flip_screen )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index 832c2b4284a..c42124173eb 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -66,7 +66,7 @@ static WRITE8_HANDLER( sound_cpu_command_w )
static WRITE8_HANDLER( shootout_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
static WRITE8_HANDLER( shootout_coin_counter_w )
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index 94656f8dd34..70cf0265366 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -76,7 +76,7 @@ out of the sprite list at that point.. (verify on real hw)
static WRITE16_HANDLER( snowbros_flipscreen_w )
{
if (ACCESSING_BITS_8_15)
- flip_screen_set(~data & 0x8000);
+ flip_screen_set(space->machine, ~data & 0x8000);
}
diff --git a/src/mame/drivers/speedbal.c b/src/mame/drivers/speedbal.c
index a436324aa50..743f24b2d37 100644
--- a/src/mame/drivers/speedbal.c
+++ b/src/mame/drivers/speedbal.c
@@ -68,7 +68,7 @@ static WRITE8_HANDLER( speedbal_coincounter_w )
{
coin_counter_w(0, data & 0x80);
coin_counter_w(1, data & 0x40);
- flip_screen_set(data & 8); // also changes data & 0x10 at the same time too (flipx and flipy?)
+ 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/suna8.c b/src/mame/drivers/suna8.c
index 2018727d806..28cfed0e3a3 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -501,7 +501,7 @@ static WRITE8_HANDLER( hardhead_bankswitch_w )
*/
static WRITE8_HANDLER( hardhead_flipscreen_w )
{
- flip_screen_set( data & 0x04);
+ flip_screen_set(space->machine, data & 0x04);
coin_lockout_w ( 0, data & 0x08);
coin_lockout_w ( 1, data & 0x10);
}
@@ -559,7 +559,7 @@ static WRITE8_HANDLER( rranger_bankswitch_w )
memory_set_bank(space->machine, 1, bank);
- flip_screen_set( data & 0x20);
+ flip_screen_set(space->machine, data & 0x20);
coin_lockout_w ( 0, data & 0x40);
coin_lockout_w ( 1, data & 0x80);
}
@@ -642,7 +642,7 @@ static WRITE8_HANDLER( brickzn_spritebank_w )
{
suna8_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( data & 0x01 );
+ flip_screen_set(space->machine, data & 0x01 );
}
static WRITE8_HANDLER( brickzn_unknown_w )
@@ -711,7 +711,7 @@ static WRITE8_HANDLER( hardhea2_nmi_w )
*/
static WRITE8_HANDLER( hardhea2_flipscreen_w )
{
- flip_screen_set(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);
}
@@ -876,7 +876,7 @@ static WRITE8_HANDLER( sparkman_nmi_w )
*/
static WRITE8_HANDLER( sparkman_flipscreen_w )
{
- flip_screen_set(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);
}
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 466c85f1ca1..0b9688ecbef 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -243,7 +243,7 @@ static WRITE8_HANDLER( mcu_p1_w )
coin_lockout_global_w((data & 1) ^ invert_coin_lockout);
break;
case 4:
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
break;
case 5:
port1 = data;
@@ -305,7 +305,7 @@ static READ8_HANDLER( bootleg_in0_r )
static WRITE8_HANDLER( bootleg_flipscreen_w )
{
- flip_screen_set(~data & 1);
+ flip_screen_set(space->machine, ~data & 1);
}
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 1c86153ca22..49db39fe8f4 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -793,18 +793,23 @@ static void dduxbl_update_proc( void )
static MACHINE_RESET( dduxbl )
{
- sys16_patch_code( 0x1eb2e, 0x01 );
- sys16_patch_code( 0x1eb2f, 0x01 );
- sys16_patch_code( 0x1eb3c, 0x00 );
- sys16_patch_code( 0x1eb3d, 0x00 );
- sys16_patch_code( 0x23132, 0x01 );
- sys16_patch_code( 0x23133, 0x01 );
- sys16_patch_code( 0x23140, 0x00 );
- sys16_patch_code( 0x23141, 0x00 );
- sys16_patch_code( 0x24a9a, 0x01 );
- sys16_patch_code( 0x24a9b, 0x01 );
- sys16_patch_code( 0x24aa8, 0x00 );
- sys16_patch_code( 0x24aa9, 0x00 );
+ static const sys16_patch patch[] =
+ {
+ { 0x1eb2e, 0x01 },
+ { 0x1eb2f, 0x01 },
+ { 0x1eb3c, 0x00 },
+ { 0x1eb3d, 0x00 },
+ { 0x23132, 0x01 },
+ { 0x23133, 0x01 },
+ { 0x23140, 0x00 },
+ { 0x23141, 0x00 },
+ { 0x24a9a, 0x01 },
+ { 0x24a9b, 0x01 },
+ { 0x24aa8, 0x00 },
+ { 0x24aa9, 0x00 }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
}
static DRIVER_INIT( dduxbl )
@@ -923,10 +928,16 @@ static MACHINE_RESET( eswatbl )
2,3, 6,7,
10,11, 14,15
};
+ static const sys16_patch patch[] =
+ {
+ { 0x3897, 0x11 }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
+
sys16_obj_bank = bank;
sys16_sprxoffset = -0x23c;
- sys16_patch_code( 0x3897, 0x11 );
sys16_update_proc = eswatbl_update_proc;
}
@@ -1016,30 +1027,34 @@ static void fpoint_update_proc( void )
static MACHINE_RESET( fpointbl )
{
- sys16_patch_code( 0x454, 0x33 );
- sys16_patch_code( 0x455, 0xf8 );
- sys16_patch_code( 0x456, 0xe0 );
- sys16_patch_code( 0x457, 0xe2 );
- sys16_patch_code( 0x8ce8, 0x16 );
- sys16_patch_code( 0x8ce9, 0x66 );
- sys16_patch_code( 0x17687, 0x00 );
- sys16_patch_code( 0x7bed, 0x04 );
-
- sys16_patch_code( 0x7ea8, 0x61 );
- sys16_patch_code( 0x7ea9, 0x00 );
- sys16_patch_code( 0x7eaa, 0x84 );
- sys16_patch_code( 0x7eab, 0x16 );
- sys16_patch_code( 0x2c0, 0xe7 );
- sys16_patch_code( 0x2c1, 0x48 );
- sys16_patch_code( 0x2c2, 0xe7 );
- sys16_patch_code( 0x2c3, 0x49 );
- sys16_patch_code( 0x2c4, 0x04 );
- sys16_patch_code( 0x2c5, 0x40 );
- sys16_patch_code( 0x2c6, 0x00 );
- sys16_patch_code( 0x2c7, 0x10 );
- sys16_patch_code( 0x2c8, 0x4e );
- sys16_patch_code( 0x2c9, 0x75 );
+ static const sys16_patch patch[] =
+ {
+ { 0x454, 0x33 },
+ { 0x455, 0xf8 },
+ { 0x456, 0xe0 },
+ { 0x457, 0xe2 },
+ { 0x8ce8, 0x16 },
+ { 0x8ce9, 0x66 },
+ { 0x17687, 0x00 },
+ { 0x7bed, 0x04 },
+
+ { 0x7ea8, 0x61 },
+ { 0x7ea9, 0x00 },
+ { 0x7eaa, 0x84 },
+ { 0x7eab, 0x16 },
+ { 0x2c0, 0xe7 },
+ { 0x2c1, 0x48 },
+ { 0x2c2, 0xe7 },
+ { 0x2c3, 0x49 },
+ { 0x2c4, 0x04 },
+ { 0x2c5, 0x40 },
+ { 0x2c6, 0x00 },
+ { 0x2c7, 0x10 },
+ { 0x2c8, 0x4e },
+ { 0x2c9, 0x75 }
+ };
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
sys16_update_proc = fpoint_update_proc;
}
@@ -1249,11 +1264,18 @@ static MACHINE_RESET( goldnaxe )
2,3,6,7,
10,11,0,0
};
+#if 0
+ // protection patch; no longer needed
+ static const sys16_patch patch =
+ {
+ { 0x3CB2, 0x60 },
+ { 0x3CB3, 0x1e }
+ };
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
+#endif
+
sys16_obj_bank = bank;
-// protection patch; no longer needed
-// sys16_patch_code( 0x3CB2, 0x60 );
-// sys16_patch_code( 0x3CB3, 0x1e );
sys16_sprxoffset = -0xb8;
sys16_update_proc = goldnaxe_update_proc;
@@ -1451,23 +1473,31 @@ static void passht4b_update_proc( void )
static MACHINE_RESET( passsht )
{
+ // fix name entry
+ static const sys16_patch patch[] =
+ {
+ { 0x13a8,0xc0 }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
sys16_sprxoffset = -0x48;
sys16_spritesystem = sys16_sprite_passshot;
- // fix name entry
- sys16_patch_code( 0x13a8,0xc0);
-
sys16_update_proc = passsht_update_proc;
}
static MACHINE_RESET( passht4b )
{
+ // fix name entry
+ static const sys16_patch patch[] =
+ {
+ { 0x138a,0xc0 }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
sys16_sprxoffset = -0xb8;
sys16_spritesystem = sys16_sprite_passshot;
- // fix name entry
- sys16_patch_code( 0x138a,0xc0);
-
sys16_update_proc = passht4b_update_proc;
}
@@ -1775,8 +1805,15 @@ static void tetris_bootleg_update_proc( void )
static MACHINE_RESET( tetrisbl )
{
-// sys16_patch_code( 0xba6, 0x4e );
-// sys16_patch_code( 0xba7, 0x71 );
+#if 0
+ static const sys16_patch patch[] =
+ {
+ { 0xba6, 0x4e },
+ { 0xba7, 0x71 }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
+#endif
sys16_sprxoffset = -0x40;
sys16_update_proc = tetris_bootleg_update_proc;
@@ -2102,30 +2139,35 @@ static MACHINE_RESET( wb3bbl )
0,1,
0,0
};
- sys16_obj_bank = bank;
#if 1
- sys16_patch_code( 0x17058, 0x4e );
- sys16_patch_code( 0x17059, 0xb9 );
- sys16_patch_code( 0x1705a, 0x00 );
- sys16_patch_code( 0x1705b, 0x00 );
- sys16_patch_code( 0x1705c, 0x09 );
- sys16_patch_code( 0x1705d, 0xdc );
- sys16_patch_code( 0x1705e, 0x4e );
- sys16_patch_code( 0x1705f, 0xf9 );
- sys16_patch_code( 0x17060, 0x00 );
- sys16_patch_code( 0x17061, 0x01 );
- sys16_patch_code( 0x17062, 0x70 );
- sys16_patch_code( 0x17063, 0xe0 );
- sys16_patch_code( 0x1a3a, 0x31 );
- sys16_patch_code( 0x1a3b, 0x7c );
- sys16_patch_code( 0x1a3c, 0x80 );
- sys16_patch_code( 0x1a3d, 0x00 );
- sys16_patch_code( 0x23df8, 0x14 );
- sys16_patch_code( 0x23df9, 0x41 );
- sys16_patch_code( 0x23dfa, 0x10 );
- sys16_patch_code( 0x23dfd, 0x14 );
- sys16_patch_code( 0x23dff, 0x1c );
+ static const sys16_patch patch[] =
+ {
+ { 0x17058, 0x4e },
+ { 0x17059, 0xb9 },
+ { 0x1705a, 0x00 },
+ { 0x1705b, 0x00 },
+ { 0x1705c, 0x09 },
+ { 0x1705d, 0xdc },
+ { 0x1705e, 0x4e },
+ { 0x1705f, 0xf9 },
+ { 0x17060, 0x00 },
+ { 0x17061, 0x01 },
+ { 0x17062, 0x70 },
+ { 0x17063, 0xe0 },
+ { 0x1a3a, 0x31 },
+ { 0x1a3b, 0x7c },
+ { 0x1a3c, 0x80 },
+ { 0x1a3d, 0x00 },
+ { 0x23df8, 0x14 },
+ { 0x23df9, 0x41 },
+ { 0x23dfa, 0x10 },
+ { 0x23dfd, 0x14 },
+ { 0x23dff, 0x1c }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
#endif
+ sys16_obj_bank = bank;
sys16_update_proc = wb3bbl_update_proc;
}
diff --git a/src/mame/drivers/system18.c b/src/mame/drivers/system18.c
index 0552120f8aa..08e83d488be 100644
--- a/src/mame/drivers/system18.c
+++ b/src/mame/drivers/system18.c
@@ -840,48 +840,51 @@ static void mwalkbl_update_proc( void ){
}
static MACHINE_RESET( mwalkbl ){
+ static const sys16_patch patch[] =
+ {
+ { 0x70116, 0x4e },
+ { 0x70117, 0x71 },
+
+ { 0x0314a, 0x46 },
+ { 0x0314b, 0x42 },
+ { 0x0311b, 0x3f },
+
+ { 0x70103, 0x00 },
+ { 0x70109, 0x00 },
+ { 0x07727, 0x00 },
+ { 0x07729, 0x00 },
+ { 0x0780d, 0x00 },
+ { 0x0780f, 0x00 },
+ { 0x07861, 0x00 },
+ { 0x07863, 0x00 },
+ { 0x07d47, 0x00 },
+ { 0x07863, 0x00 },
+ { 0x08533, 0x00 },
+ { 0x08535, 0x00 },
+ { 0x085bd, 0x00 },
+ { 0x085bf, 0x00 },
+ { 0x09a4b, 0x00 },
+ { 0x09a4d, 0x00 },
+ { 0x09b2f, 0x00 },
+ { 0x09b31, 0x00 },
+ { 0x0a05b, 0x00 },
+ { 0x0a05d, 0x00 },
+ { 0x0a23f, 0x00 },
+ { 0x0a241, 0x00 },
+ { 0x10159, 0x00 },
+ { 0x1015b, 0x00 },
+ { 0x109fb, 0x00 },
+ { 0x109fd, 0x00 },
+
+ // * SEGA mark
+ { 0x70212, 0x4e },
+ { 0x70213, 0x71 }
+ };
+
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
sys16_bg_priority_value=0x1000;
sys16_sprxoffset = -0x238;
- sys16_patch_code( 0x70116, 0x4e);
- sys16_patch_code( 0x70117, 0x71);
-
- sys16_patch_code( 0x314a, 0x46);
- sys16_patch_code( 0x314b, 0x42);
-
- sys16_patch_code( 0x311b, 0x3f);
-
- sys16_patch_code( 0x70103, 0x00);
- sys16_patch_code( 0x70109, 0x00);
- sys16_patch_code( 0x07727, 0x00);
- sys16_patch_code( 0x07729, 0x00);
- sys16_patch_code( 0x0780d, 0x00);
- sys16_patch_code( 0x0780f, 0x00);
- sys16_patch_code( 0x07861, 0x00);
- sys16_patch_code( 0x07863, 0x00);
- sys16_patch_code( 0x07d47, 0x00);
- sys16_patch_code( 0x07863, 0x00);
- sys16_patch_code( 0x08533, 0x00);
- sys16_patch_code( 0x08535, 0x00);
- sys16_patch_code( 0x085bd, 0x00);
- sys16_patch_code( 0x085bf, 0x00);
- sys16_patch_code( 0x09a4b, 0x00);
- sys16_patch_code( 0x09a4d, 0x00);
- sys16_patch_code( 0x09b2f, 0x00);
- sys16_patch_code( 0x09b31, 0x00);
- sys16_patch_code( 0x0a05b, 0x00);
- sys16_patch_code( 0x0a05d, 0x00);
- sys16_patch_code( 0x0a23f, 0x00);
- sys16_patch_code( 0x0a241, 0x00);
- sys16_patch_code( 0x10159, 0x00);
- sys16_patch_code( 0x1015b, 0x00);
- sys16_patch_code( 0x109fb, 0x00);
- sys16_patch_code( 0x109fd, 0x00);
-
- // * SEGA mark
- sys16_patch_code( 0x70212, 0x4e);
- sys16_patch_code( 0x70213, 0x71);
-
sys16_update_proc = mwalkbl_update_proc;
}
@@ -989,68 +992,71 @@ static void astormbl_update_proc( void ){
}
static MACHINE_RESET( astormbl ){
- sys16_fgxoffset = sys16_bgxoffset = -9;
-
- sys16_patch_code( 0x2D6E, 0x32 );
- sys16_patch_code( 0x2D6F, 0x3c );
- sys16_patch_code( 0x2D70, 0x80 );
- sys16_patch_code( 0x2D71, 0x00 );
- sys16_patch_code( 0x2D72, 0x33 );
- sys16_patch_code( 0x2D73, 0xc1 );
- sys16_patch_code( 0x2ea2, 0x30 );
- sys16_patch_code( 0x2ea3, 0x38 );
- sys16_patch_code( 0x2ea4, 0xec );
- sys16_patch_code( 0x2ea5, 0xf6 );
- sys16_patch_code( 0x2ea6, 0x30 );
- sys16_patch_code( 0x2ea7, 0x80 );
- sys16_patch_code( 0x2e5c, 0x30 );
- sys16_patch_code( 0x2e5d, 0x38 );
- sys16_patch_code( 0x2e5e, 0xec );
- sys16_patch_code( 0x2e5f, 0xe2 );
- sys16_patch_code( 0x2e60, 0xc0 );
- sys16_patch_code( 0x2e61, 0x7c );
-
- sys16_patch_code( 0x4cd8, 0x02 );
- sys16_patch_code( 0x4cec, 0x03 );
- sys16_patch_code( 0x2dc6c, 0xe9 );
- sys16_patch_code( 0x2dc64, 0x10 );
- sys16_patch_code( 0x2dc65, 0x10 );
- sys16_patch_code( 0x3a100, 0x10 );
- sys16_patch_code( 0x3a101, 0x13 );
- sys16_patch_code( 0x3a102, 0x90 );
- sys16_patch_code( 0x3a103, 0x2b );
- sys16_patch_code( 0x3a104, 0x00 );
- sys16_patch_code( 0x3a105, 0x01 );
- sys16_patch_code( 0x3a106, 0x0c );
- sys16_patch_code( 0x3a107, 0x00 );
- sys16_patch_code( 0x3a108, 0x00 );
- sys16_patch_code( 0x3a109, 0x01 );
- sys16_patch_code( 0x3a10a, 0x66 );
- sys16_patch_code( 0x3a10b, 0x06 );
- sys16_patch_code( 0x3a10c, 0x42 );
- sys16_patch_code( 0x3a10d, 0x40 );
- sys16_patch_code( 0x3a10e, 0x54 );
- sys16_patch_code( 0x3a10f, 0x8b );
- sys16_patch_code( 0x3a110, 0x60 );
- sys16_patch_code( 0x3a111, 0x02 );
- sys16_patch_code( 0x3a112, 0x30 );
- sys16_patch_code( 0x3a113, 0x1b );
- sys16_patch_code( 0x3a114, 0x34 );
- sys16_patch_code( 0x3a115, 0xc0 );
- sys16_patch_code( 0x3a116, 0x34 );
- sys16_patch_code( 0x3a117, 0xdb );
- sys16_patch_code( 0x3a118, 0x24 );
- sys16_patch_code( 0x3a119, 0xdb );
- sys16_patch_code( 0x3a11a, 0x24 );
- sys16_patch_code( 0x3a11b, 0xdb );
- sys16_patch_code( 0x3a11c, 0x4e );
- sys16_patch_code( 0x3a11d, 0x75 );
- sys16_patch_code( 0xaf8e, 0x66 );
-
- /* fix missing credit text */
- sys16_patch_code( 0x3f9a, 0xec );
- sys16_patch_code( 0x3f9b, 0x36 );
+ static const sys16_patch patch[] =
+ {
+ { 0x02D6E, 0x32 },
+ { 0x02D6F, 0x3c },
+ { 0x02D70, 0x80 },
+ { 0x02D71, 0x00 },
+ { 0x02D72, 0x33 },
+ { 0x02D73, 0xc1 },
+ { 0x02ea2, 0x30 },
+ { 0x02ea3, 0x38 },
+ { 0x02ea4, 0xec },
+ { 0x02ea5, 0xf6 },
+ { 0x02ea6, 0x30 },
+ { 0x02ea7, 0x80 },
+ { 0x02e5c, 0x30 },
+ { 0x02e5d, 0x38 },
+ { 0x02e5e, 0xec },
+ { 0x02e5f, 0xe2 },
+ { 0x02e60, 0xc0 },
+ { 0x02e61, 0x7c },
+
+ { 0x04cd8, 0x02 },
+ { 0x04cec, 0x03 },
+ { 0x2dc6c, 0xe9 },
+ { 0x2dc64, 0x10 },
+ { 0x2dc65, 0x10 },
+ { 0x3a100, 0x10 },
+ { 0x3a101, 0x13 },
+ { 0x3a102, 0x90 },
+ { 0x3a103, 0x2b },
+ { 0x3a104, 0x00 },
+ { 0x3a105, 0x01 },
+ { 0x3a106, 0x0c },
+ { 0x3a107, 0x00 },
+ { 0x3a108, 0x00 },
+ { 0x3a109, 0x01 },
+ { 0x3a10a, 0x66 },
+ { 0x3a10b, 0x06 },
+ { 0x3a10c, 0x42 },
+ { 0x3a10d, 0x40 },
+ { 0x3a10e, 0x54 },
+ { 0x3a10f, 0x8b },
+ { 0x3a110, 0x60 },
+ { 0x3a111, 0x02 },
+ { 0x3a112, 0x30 },
+ { 0x3a113, 0x1b },
+ { 0x3a114, 0x34 },
+ { 0x3a115, 0xc0 },
+ { 0x3a116, 0x34 },
+ { 0x3a117, 0xdb },
+ { 0x3a118, 0x24 },
+ { 0x3a119, 0xdb },
+ { 0x3a11a, 0x24 },
+ { 0x3a11b, 0xdb },
+ { 0x3a11c, 0x4e },
+ { 0x3a11d, 0x75 },
+ { 0x0af8e, 0x66 },
+
+ /* fix missing credit text */
+ { 0x03f9a, 0xec },
+ { 0x03f9b, 0x36 }
+ };
+ sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
+ sys16_fgxoffset = sys16_bgxoffset = -9;
sys16_update_proc = astormbl_update_proc;
}
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index 4437c0e8464..469a6bcf099 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -169,7 +169,6 @@ Notes:
#include "driver.h"
#include "cpu/z80/z80.h"
-#include "deprecat.h"
#include "taitoipt.h"
#include "cpu/m68000/m68000.h"
#include "video/taitoic.h"
@@ -342,12 +341,12 @@ static WRITE16_HANDLER( gain_control_w )
{
if (offset==0)
{
- MB87078_data_w(0, data>>8, 0);
+ MB87078_data_w(space->machine, 0, data>>8, 0);
//logerror("MB87078 dsel=0 data=%4x\n",data);
}
else
{
- MB87078_data_w(0, data>>8, 1);
+ MB87078_data_w(space->machine, 0, data>>8, 1);
//logerror("MB87078 dsel=1 data=%4x\n",data);
}
}
@@ -2388,11 +2387,11 @@ 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(int channel, int percent)
+static void mb87078_gain_changed(running_machine *machine, int channel, int percent)
{
if (channel==1)
{
- sound_type type = Machine->config->sound[0].type;
+ sound_type type = machine->config->sound[0].type;
sndti_set_output_gain(type, 0, 0, percent / 100.0);
sndti_set_output_gain(type, 1, 0, percent / 100.0);
sndti_set_output_gain(type, 2, 0, percent / 100.0);
@@ -2408,7 +2407,7 @@ static const struct MB87078interface mb87078_interface =
static MACHINE_RESET( mb87078 )
{
- MB87078_start(0, &mb87078_interface); /*chip #0*/
+ MB87078_start(machine, 0, &mb87078_interface); /*chip #0*/
/*
{
int i;
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 4e0bd84e6c7..6426c6e6578 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -7,7 +7,6 @@
#include "cpu/i386/i386.h"
#include "memconv.h"
#include "devconv.h"
-#include "deprecat.h"
#include "machine/8237dma.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
@@ -638,12 +637,12 @@ static MACHINE_DRIVER_START(taitowlf)
MACHINE_DRIVER_END
-static void set_gate_a20(int a20)
+static void set_gate_a20(running_machine *machine, int a20)
{
- cpu_set_input_line(Machine->cpu[0], INPUT_LINE_A20, a20);
+ cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(int state)
+static void keyboard_interrupt(running_machine *machine, int state)
{
pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state);
}
diff --git a/src/mame/drivers/taxidrvr.c b/src/mame/drivers/taxidrvr.c
index a17d9409ecc..3c27b79f3ed 100644
--- a/src/mame/drivers/taxidrvr.c
+++ b/src/mame/drivers/taxidrvr.c
@@ -50,7 +50,7 @@ static WRITE8_DEVICE_HANDLER( p0c_w )
/* bit 2 toggles during gameplay */
- flip_screen_set(data & 8);
+ flip_screen_set(device->machine, data & 8);
// popmessage("%02x",data&0x0f);
}
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index 6c49dee2f0e..16ee39b78ee 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -73,11 +73,11 @@ static WRITE8_HANDLER( thedeep_protection_w )
switch (protection_command)
{
case 0x11:
- flip_screen_set(1);
+ flip_screen_set(space->machine, 1);
break;
case 0x20:
- flip_screen_set(0);
+ flip_screen_set(space->machine, 0);
break;
case 0x30:
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index 729be7212ab..ba514eb99dd 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -158,7 +158,7 @@ static void duart_tx(const device_config *device, int channel, UINT8 data)
}
};
-static void microtouch_tx(UINT8 data)
+static void microtouch_tx(running_machine *machine, UINT8 data)
{
duart68681_rx_data(tmaster_devices.duart68681, 0, data);
}
diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c
index bb6180410e8..8a5ea75d327 100644
--- a/src/mame/drivers/toypop.c
+++ b/src/mame/drivers/toypop.c
@@ -79,7 +79,7 @@ static WRITE8_HANDLER( out_coin1 )
}
static WRITE8_HANDLER( flip )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
/* chip #0: player inputs, buttons, coins */
diff --git a/src/mame/drivers/tsamurai.c b/src/mame/drivers/tsamurai.c
index e0dea1a43bc..9f495cb1f2e 100644
--- a/src/mame/drivers/tsamurai.c
+++ b/src/mame/drivers/tsamurai.c
@@ -121,7 +121,7 @@ static WRITE8_HANDLER( sound_command3_w )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
static WRITE8_HANDLER( tsamurai_coin_counter_w )
diff --git a/src/mame/drivers/uapce.c b/src/mame/drivers/uapce.c
index 176af55569d..a02b957c64c 100644
--- a/src/mame/drivers/uapce.c
+++ b/src/mame/drivers/uapce.c
@@ -24,12 +24,12 @@
*/
#include "driver.h"
-#include "cpu/z80/z80.h"
#include "deprecat.h"
-#include "machine/pcecommn.h"
-#include "video/vdc.h"
+#include "cpu/z80/z80.h"
#include "cpu/h6280/h6280.h"
#include "sound/c6280.h"
+#include "machine/pcecommn.h"
+#include "video/vdc.h"
static UINT8 jamma_if_control_latch = 0;
@@ -97,15 +97,15 @@ static READ8_HANDLER( jamma_if_read_dsw )
return dsw_val & 1;
}
-static UINT8 jamma_if_read_joystick( void )
+static UINT8 jamma_if_read_joystick( running_machine *machine )
{
if ( jamma_if_control_latch & 0x10 )
{
- return input_port_read(Machine, "JOY" );
+ return input_port_read(machine, "JOY" );
}
else
{
- return input_port_read(Machine, "JOY" ) | 0x08;
+ return input_port_read(machine, "JOY" ) | 0x08;
}
}
diff --git a/src/mame/drivers/vastar.c b/src/mame/drivers/vastar.c
index 3248d84210d..4bdf3904f4f 100644
--- a/src/mame/drivers/vastar.c
+++ b/src/mame/drivers/vastar.c
@@ -110,7 +110,7 @@ static WRITE8_HANDLER( vastar_sharedram_w )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index 46d7c24ec22..e3d11f9b5dc 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -137,7 +137,7 @@ static WRITE8_HANDLER( cpu_sound_command_w ) {
*/
static WRITE8_HANDLER( vb_scrollx_hi_w )
{
- flip_screen_set(~data&1);
+ flip_screen_set(space->machine, ~data&1);
vb_scrollx_hi = (data & 0x02) << 7;
vb_bgprombank_w(space->machine, (data >> 2)&0x07);
vb_spprombank_w(space->machine, (data >> 5)&0x07);
diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c
index 2f7c1a30fb2..662a73ffa82 100644
--- a/src/mame/drivers/warpwarp.c
+++ b/src/mame/drivers/warpwarp.c
@@ -151,7 +151,7 @@ static READ8_HANDLER( geebee_in_r )
res = input_port_read_safe(space->machine, portnames[offset], 0);
if (offset == 3)
{
- res = input_port_read(space->machine, (flip_screen_get() & 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 (handle_joystick)
{
/* map digital two-way joystick to two fixed VOLIN values */
@@ -211,7 +211,7 @@ static WRITE8_HANDLER( geebee_out7_w )
warpwarp_ball_on = data & 1;
break;
case 7:
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
break;
}
}
@@ -234,7 +234,7 @@ static READ8_HANDLER( warpwarp_vol_r )
{
int res;
- res = input_port_read(space->machine, (flip_screen_get() & 1) ? "VOLIN2" : "VOLIN1");
+ res = input_port_read(space->machine, (flip_screen_get(space->machine) & 1) ? "VOLIN2" : "VOLIN1");
if (handle_joystick)
{
if (res & 1) return 0x0f;
@@ -294,7 +294,7 @@ static WRITE8_HANDLER( warpwarp_out3_w )
cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE);
break;
case 7:
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
break;
}
}
diff --git a/src/mame/drivers/wwfsstar.c b/src/mame/drivers/wwfsstar.c
index 79ea5cca5ad..3a535f5f121 100644
--- a/src/mame/drivers/wwfsstar.c
+++ b/src/mame/drivers/wwfsstar.c
@@ -222,7 +222,7 @@ static WRITE16_HANDLER ( wwfsstar_soundwrite )
static WRITE16_HANDLER( wwfsstar_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
static WRITE16_HANDLER( wwfsstar_irqack_w )
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index b9b495662bc..e9e0dd6d111 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -55,7 +55,7 @@ static WRITE16_HANDLER ( wwfwfest_soundwrite );
static WRITE16_HANDLER( wwfwfest_flipscreen_w )
{
- flip_screen_set(data&1);
+ flip_screen_set(space->machine, data&1);
}
/*******************************************************************************
diff --git a/src/mame/drivers/yumefuda.c b/src/mame/drivers/yumefuda.c
index 419b41c8f9e..80520e7f43a 100644
--- a/src/mame/drivers/yumefuda.c
+++ b/src/mame/drivers/yumefuda.c
@@ -203,7 +203,7 @@ static WRITE8_HANDLER( yumefuda_videoregs_w )
{
switch(address)
{
- case 0x0d: flip_screen_set(data & 0x80); break;
+ case 0x0d: flip_screen_set(space->machine, data & 0x80); break;
default:
logerror("Video Register %02x called with %02x data\n",address,data);
}
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index dc009d30448..24821b1ab58 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -399,7 +399,7 @@ static MACHINE_START( zaxxon )
static MACHINE_RESET( razmataz )
{
/* the timer value is unknown, but this seems to work well */
- sega_usb_reset(0x10);
+ sega_usb_reset(machine, 0x10);
}
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index b1c15406050..5831c11157f 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -191,13 +191,13 @@ static READ32_HANDLER( znsecsel_r )
return m_n_znsecsel;
}
-static void sio_znsec0_handler( int n_data )
+static void sio_znsec0_handler( running_machine *machine, int n_data )
{
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
if( m_b_lastclock )
{
- psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 0, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
+ psx_sio_input( machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 0, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
}
m_b_lastclock = 0;
}
@@ -207,13 +207,13 @@ static void sio_znsec0_handler( int n_data )
}
}
-static void sio_znsec1_handler( int n_data )
+static void sio_znsec1_handler( running_machine *machine, int n_data )
{
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
if( m_b_lastclock )
{
- psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 1, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
+ psx_sio_input( machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 1, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
}
m_b_lastclock = 0;
}
@@ -223,10 +223,8 @@ static void sio_znsec1_handler( int n_data )
}
}
-static void sio_pad_handler( int n_data )
+static void sio_pad_handler( running_machine *machine, int n_data )
{
- running_machine *machine = Machine;
-
if( ( n_data & PSX_SIO_OUT_DTR ) != 0 )
{
m_b_znsecport = 1;
@@ -240,13 +238,12 @@ static void sio_pad_handler( 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( int n_data )
+static void sio_dip_handler( running_machine *machine, int n_data )
{
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
if( m_b_lastclock )
{
- running_machine *machine = Machine;
int bit = ( ( input_port_read(machine, "DSW") >> m_n_dip_bit ) & 1 );
verboselog( machine, 2, "read dip %02x -> %02x\n", n_data, bit * PSX_SIO_IN_DATA );
psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
@@ -1593,9 +1590,9 @@ static void atpsx_interrupt(const device_config *device, int state)
}
}
-static void atpsx_dma_read( UINT32 n_address, INT32 n_size )
+static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
- const device_config *ide = device_list_find_by_tag(Machine->config->devicelist, IDE_CONTROLLER, "ide");
+ const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address);
@@ -1616,7 +1613,7 @@ static void atpsx_dma_read( UINT32 n_address, INT32 n_size )
}
}
-static void atpsx_dma_write( 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);
}
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index 2aebbce523e..b4e1b236302 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -853,13 +853,13 @@ static void init_zr107(running_machine *machine)
static DRIVER_INIT(zr107)
{
- init_konami_cgboard(1, CGBOARD_TYPE_ZR107);
+ init_konami_cgboard(machine, 1, CGBOARD_TYPE_ZR107);
init_zr107(machine);
}
static DRIVER_INIT(jetwave)
{
- init_konami_cgboard(1, CGBOARD_TYPE_GTICLUB);
+ init_konami_cgboard(machine, 1, CGBOARD_TYPE_GTICLUB);
init_zr107(machine);
}
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 08eb42e37d3..b8cbba6c0d7 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -316,9 +316,9 @@ struct _amiga_machine_interface
UINT16 (*dskbytr_r)(void);
void (*dsklen_w)(UINT16 data);
- void (*serdat_w)(UINT16 data);
+ void (*serdat_w)(running_machine *, UINT16 data);
- void (*scanline0_callback)(void);
+ void (*scanline0_callback)(running_machine *);
void (*reset_callback)(void);
void (*nmi_callback)(void);
@@ -376,10 +376,10 @@ WRITE16_HANDLER( amiga_cia_w );
READ16_HANDLER( amiga_custom_r );
WRITE16_HANDLER( amiga_custom_w );
-void amiga_serial_in_w(UINT16 data);
-attotime amiga_get_serial_char_period(void);
+void amiga_serial_in_w(running_machine *machine, UINT16 data);
+attotime amiga_get_serial_char_period(running_machine *machine);
-void amiga_add_autoconfig(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 );
diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h
index 8302ecb446d..ebfb8fccec1 100644
--- a/src/mame/includes/carpolo.h
+++ b/src/mame/includes/carpolo.h
@@ -30,11 +30,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(int car1, int car2);
-void carpolo_generate_ball_screen_interrupt(UINT8 cause);
-void carpolo_generate_car_goal_interrupt(int car, int right_goal);
-void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y);
-void carpolo_generate_car_border_interrupt(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/galaxold.h b/src/mame/includes/galaxold.h
index 50dfda3d0e0..97441451d16 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -189,8 +189,8 @@ CUSTOM_INPUT( darkplnt_custom_r );
/*----------- defined in audio/scramble.c -----------*/
-void scramble_sh_init(void);
-void sfx_sh_init(void);
+void scramble_sh_init(running_machine *machine);
+void sfx_sh_init(running_machine *machine);
WRITE8_HANDLER( scramble_filter_w );
WRITE8_HANDLER( frogger_filter_w );
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index a0f12aafadb..4b6a7f116ef 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -128,7 +128,7 @@ READ16_HANDLER( hd68k_ds3_program_r );
WRITE16_HANDLER( hd68k_ds3_program_w );
/* DSK board */
-void hddsk_update_pif(UINT32 pins);
+void hddsk_update_pif(const device_config *device, UINT32 pins);
WRITE16_HANDLER( hd68k_dsk_control_w );
READ16_HANDLER( hd68k_dsk_ram_r );
WRITE16_HANDLER( hd68k_dsk_ram_w );
diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h
index 2ae06455793..a1b0988c21d 100644
--- a/src/mame/includes/jaguar.h
+++ b/src/mame/includes/jaguar.h
@@ -33,7 +33,7 @@ void jaguar_dsp_suspend(running_machine *machine);
void jaguar_dsp_resume(running_machine *machine);
void cojag_sound_init(running_machine *machine);
-void cojag_sound_reset(void);
+void cojag_sound_reset(running_machine *machine);
void jaguar_external_int(const device_config *device, int state);
diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h
index 1e300941fb1..ab7bcc1445e 100644
--- a/src/mame/includes/n64.h
+++ b/src/mame/includes/n64.h
@@ -9,7 +9,7 @@ extern int fb_width;
extern VIDEO_START( n64 );
extern VIDEO_UPDATE( n64 );
-extern void rdp_process_list(void);
+extern void rdp_process_list(running_machine *machine);
#define DACRATE_NTSC (48681812)
#define DACRATE_PAL (49656530)
diff --git a/src/mame/includes/psx.h b/src/mame/includes/psx.h
index fef3feffd26..85016965024 100644
--- a/src/mame/includes/psx.h
+++ b/src/mame/includes/psx.h
@@ -14,8 +14,8 @@ VIDEO_START( psx_type2 );
VIDEO_UPDATE( psx );
INTERRUPT_GEN( psx_vblank );
extern void psx_gpu_reset( running_machine *machine );
-extern void psx_gpu_read( UINT32 *p_ram, INT32 n_size );
-extern void psx_gpu_write( UINT32 *p_ram, INT32 n_size );
+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( int, int );
@@ -24,8 +24,8 @@ extern void psx_lightgun_set( int, int );
extern UINT32 *g_p_n_psxram;
extern size_t g_n_psxramsize;
-typedef void ( *psx_dma_read_handler )( UINT32, INT32 );
-typedef void ( *psx_dma_write_handler )( UINT32, INT32 );
+typedef void ( *psx_dma_read_handler )( running_machine *, UINT32, INT32 );
+typedef void ( *psx_dma_write_handler )( running_machine *, UINT32, INT32 );
WRITE32_HANDLER( psx_com_delay_w );
READ32_HANDLER( psx_com_delay_r );
WRITE32_HANDLER( psx_irq_w );
@@ -39,7 +39,7 @@ WRITE32_HANDLER( psx_counter_w );
READ32_HANDLER( psx_counter_r );
WRITE32_HANDLER( psx_sio_w );
READ32_HANDLER( psx_sio_r );
-typedef void ( *psx_sio_handler )( int );
+typedef void ( *psx_sio_handler )( running_machine *, int );
extern void psx_sio_install_handler( int, psx_sio_handler );
extern void psx_sio_input( running_machine *, int, int, int );
diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h
index ceb4ea13106..c00c1921c91 100644
--- a/src/mame/includes/system16.h
+++ b/src/mame/includes/system16.h
@@ -101,7 +101,14 @@ extern const upd7759_interface sys16_upd7759_interface;
extern int sys18_sound_info[4*2];
-extern void sys16_patch_code( int offset, int data );
+typedef struct _sys16_patch sys16_patch;
+struct _sys16_patch
+{
+ offs_t offset;
+ UINT8 data;
+};
+
+extern void sys16_patch_code( running_machine *machine, const sys16_patch *patch, int count );
#define SYS16_MWA16_PALETTERAM sys16_paletteram_w
#define SYS16_MRA16_PALETTERAM SMH_RAM
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c
index 7fddc10baa4..38ea92be105 100644
--- a/src/mame/machine/amiga.c
+++ b/src/mame/machine/amiga.c
@@ -9,7 +9,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "includes/amiga.h"
#include "cpu/m68000/m68000.h"
#include "machine/6526cia.h"
@@ -170,7 +169,7 @@ const char *const amiga_custom_names[0x100] =
*
*************************************/
-static void custom_reset(void);
+static void custom_reset(running_machine *machine);
static void autoconfig_reset(void);
static TIMER_CALLBACK( amiga_irq_proc );
static TIMER_CALLBACK( amiga_blitter_proc );
@@ -284,7 +283,7 @@ static void amiga_m68k_reset(const device_config *device)
/* Initialize the various chips */
devtag_reset(device->machine, CIA8520, "cia_0");
devtag_reset(device->machine, CIA8520, "cia_1");
- custom_reset();
+ custom_reset(device->machine);
autoconfig_reset();
/* set the overlay bit */
@@ -341,7 +340,7 @@ static TIMER_CALLBACK( scanline_callback )
/* call the system-specific callback */
if (amiga_intf->scanline0_callback != NULL)
- (*amiga_intf->scanline0_callback)();
+ (*amiga_intf->scanline0_callback)(machine);
}
/* on every scanline, clock the second CIA TOD */
@@ -1111,9 +1110,9 @@ void amiga_cia_1_irq(const device_config *device, int state)
*
*************************************/
-static void custom_reset(void)
+static void custom_reset(running_machine *machine)
{
- int clock = cpu_get_clock(Machine->cpu[0]);
+ int clock = cpu_get_clock(machine->cpu[0]);
UINT16 vidmode = (clock == AMIGA_68000_NTSC_CLOCK || clock == AMIGA_68EC020_NTSC_CLOCK ) ? 0x1000 : 0x0000; /* NTSC or PAL? */
CUSTOM_REG(REG_DDFSTRT) = 0x18;
@@ -1280,9 +1279,9 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_SERDAT:
if (amiga_intf->serdat_w != NULL)
- (*amiga_intf->serdat_w)(data);
+ (*amiga_intf->serdat_w)(space->machine, data);
CUSTOM_REG(REG_SERDATR) &= ~0x3000;
- timer_set(space->machine, amiga_get_serial_char_period(), NULL, 0, finish_serial_write);
+ timer_set(space->machine, amiga_get_serial_char_period(space->machine), NULL, 0, finish_serial_write);
break;
case REG_BLTSIZE:
@@ -1469,8 +1468,9 @@ WRITE16_HANDLER( amiga_custom_w )
*
*************************************/
-void amiga_serial_in_w(UINT16 data)
+void amiga_serial_in_w(running_machine *machine, UINT16 data)
{
+ const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
int mask = (CUSTOM_REG(REG_SERPER) & 0x8000) ? 0x1ff : 0xff;
/* copy the data to the low 8 bits of SERDATR and set RBF */
@@ -1485,14 +1485,14 @@ void amiga_serial_in_w(UINT16 data)
}
/* signal an interrupt */
- amiga_custom_w(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), REG_INTREQ, 0x8000 | INTENA_RBF, 0xffff);
+ amiga_custom_w(space, REG_INTREQ, 0x8000 | INTENA_RBF, 0xffff);
}
-attotime amiga_get_serial_char_period(void)
+attotime amiga_get_serial_char_period(running_machine *machine)
{
UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1;
- UINT32 baud = cpu_get_clock(Machine->cpu[0]) / 2 / divisor;
+ UINT32 baud = cpu_get_clock(machine->cpu[0]) / 2 / divisor;
UINT32 numbits = 2 + ((CUSTOM_REG(REG_SERPER) & 0x8000) ? 9 : 8);
return attotime_mul(ATTOTIME_IN_HZ(baud), numbits);
}
@@ -1505,12 +1505,12 @@ attotime amiga_get_serial_char_period(void)
*
*************************************/
-void amiga_add_autoconfig(const amiga_autoconfig_device *device)
+void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_device *device)
{
autoconfig_device *dev, **d;
/* validate the data */
- assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call amiga_add_autoconfig at init time!");
+ assert_always(mame_get_phase(machine) == MAME_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 */
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index f31e3997439..da3a9805001 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -9,7 +9,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/m6502/m6502.h"
#include "includes/atari.h"
#include "sound/pokey.h"
@@ -708,14 +707,14 @@ static void cart_reset(running_machine *machine)
-static UINT8 console_read(void)
+static UINT8 console_read(const address_space *space)
{
- return input_port_read(Machine, "console");
+ return input_port_read(space->machine, "console");
}
-static void console_write(UINT8 data)
+static void console_write(const address_space *space, UINT8 data)
{
if (data & 0x08)
dac_data_w(0, -120);
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index 9f1401a7656..d1f347d865a 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -34,7 +34,7 @@ WRITE8_HANDLER( bublbobl_bankswitch_w )
bublbobl_video_enable = data & 0x40;
/* bit 7 flips screen */
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
WRITE8_HANDLER( tokio_bankswitch_w )
@@ -48,7 +48,7 @@ WRITE8_HANDLER( tokio_bankswitch_w )
WRITE8_HANDLER( tokio_videoctrl_w )
{
/* bit 7 flips screen */
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
/* other bits unknown */
}
diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c
index 179487c809e..84a1e182968 100644
--- a/src/mame/machine/carpolo.c
+++ b/src/mame/machine/carpolo.c
@@ -7,7 +7,6 @@
****************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/m6502/m6502.h"
#include "machine/6821pia.h"
#include "machine/7474.h"
@@ -88,63 +87,63 @@ static UINT8 priority_0_extension;
static UINT8 last_wheel_value[4];
-static void TTL74148_3S_cb(void)
+static void TTL74148_3S_cb(running_machine *machine)
{
- cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, TTL74148_output_valid_r(TTL74148_3S) ? CLEAR_LINE : ASSERT_LINE);
+ cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, TTL74148_output_valid_r(TTL74148_3S) ? CLEAR_LINE : ASSERT_LINE);
}
/* the outputs of the flip-flops are connected to the priority encoder */
-static void TTL7474_2S_1_cb(void)
+static void TTL7474_2S_1_cb(running_machine *machine)
{
TTL74148_input_line_w(TTL74148_3S, COIN1_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2S_1));
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-static void TTL7474_2S_2_cb(void)
+static void TTL7474_2S_2_cb(running_machine *machine)
{
TTL74148_input_line_w(TTL74148_3S, COIN2_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2S_2));
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-static void TTL7474_2U_1_cb(void)
+static void TTL7474_2U_1_cb(running_machine *machine)
{
TTL74148_input_line_w(TTL74148_3S, COIN3_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2U_1));
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-static void TTL7474_2U_2_cb(void)
+static void TTL7474_2U_2_cb(running_machine *machine)
{
TTL74148_input_line_w(TTL74148_3S, COIN4_PRIORITY_LINE, TTL7474_output_comp_r(TTL7474_2U_2));
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-void carpolo_generate_ball_screen_interrupt(UINT8 cause)
+void carpolo_generate_ball_screen_interrupt(running_machine *machine, UINT8 cause)
{
ball_screen_collision_cause = cause;
TTL74148_input_line_w(TTL74148_3S, BALL_SCREEN_PRIORITY_LINE, 0);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-void carpolo_generate_car_car_interrupt(int car1, int car2)
+void carpolo_generate_car_car_interrupt(running_machine *machine, int car1, int car2)
{
car_car_collision_cause = ~((1 << (3 - car1)) | (1 << (3 - car2)));
TTL74148_input_line_w(TTL74148_3S, CAR_CAR_PRIORITY_LINE, 0);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-void carpolo_generate_car_goal_interrupt(int car, int right_goal)
+void carpolo_generate_car_goal_interrupt(running_machine *machine, int car, int right_goal)
{
car_goal_collision_cause = car | (right_goal ? 0x08 : 0x00);
TTL74148_input_line_w(TTL74148_3S, CAR_GOAL_PRIORITY_LINE, 0);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-void carpolo_generate_car_ball_interrupt(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)
{
car_ball_collision_cause = car;
car_ball_collision_x = car_x;
@@ -153,17 +152,17 @@ void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y)
priority_0_extension = CAR_BALL_EXTRA_BITS;
TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 0);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
-void carpolo_generate_car_border_interrupt(int car, int horizontal_border)
+void carpolo_generate_car_border_interrupt(running_machine *machine, int car, int horizontal_border)
{
car_border_collision_cause = car | (horizontal_border ? 0x04 : 0x00);
priority_0_extension = CAR_BORDER_EXTRA_BITS;
TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 0);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(machine, TTL74148_3S);
}
@@ -237,7 +236,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 0);
priority_0_extension = TIMER_EXTRA_BITS;
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(device->machine, TTL74148_3S);
/* check the coins here as well - they drive the clock of the flip-flops */
@@ -248,10 +247,10 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
TTL7474_clock_w(TTL7474_2U_1, port_value & 0x04);
TTL7474_clock_w(TTL7474_2U_2, port_value & 0x08);
- TTL7474_update(TTL7474_2S_1);
- TTL7474_update(TTL7474_2S_2);
- TTL7474_update(TTL7474_2U_1);
- TTL7474_update(TTL7474_2U_2);
+ TTL7474_update(device->machine, TTL7474_2S_1);
+ TTL7474_update(device->machine, TTL7474_2S_2);
+ TTL7474_update(device->machine, TTL7474_2U_1);
+ TTL7474_update(device->machine, TTL7474_2U_2);
/* read the steering controls */
@@ -275,8 +274,8 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
TTL7474_clock_w(movement_flip_flop, port_value & 0x01);
TTL7474_clock_w(dir_flip_flop, port_value & 0x01);
- TTL7474_update(movement_flip_flop);
- TTL7474_update(dir_flip_flop);
+ TTL7474_update(device->machine, movement_flip_flop);
+ TTL7474_update(device->machine, dir_flip_flop);
}
@@ -314,61 +313,61 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
static WRITE8_HANDLER( coin1_interrupt_clear_w )
{
TTL7474_clear_w(TTL7474_2S_1, data);
- TTL7474_update(TTL7474_2S_1);
+ TTL7474_update(space->machine, TTL7474_2S_1);
}
static WRITE8_HANDLER( coin2_interrupt_clear_w )
{
TTL7474_clear_w(TTL7474_2S_2, data);
- TTL7474_update(TTL7474_2S_2);
+ TTL7474_update(space->machine, TTL7474_2S_2);
}
static WRITE8_HANDLER( coin3_interrupt_clear_w )
{
TTL7474_clear_w(TTL7474_2U_1, data);
- TTL7474_update(TTL7474_2U_1);
+ TTL7474_update(space->machine, TTL7474_2U_1);
}
static WRITE8_HANDLER( coin4_interrupt_clear_w )
{
TTL7474_clear_w(TTL7474_2U_2, data);
- TTL7474_update(TTL7474_2U_2);
+ TTL7474_update(space->machine, TTL7474_2U_2);
}
WRITE8_HANDLER( carpolo_ball_screen_interrupt_clear_w )
{
TTL74148_input_line_w(TTL74148_3S, BALL_SCREEN_PRIORITY_LINE, 1);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(space->machine, TTL74148_3S);
}
WRITE8_HANDLER( carpolo_car_car_interrupt_clear_w )
{
TTL74148_input_line_w(TTL74148_3S, CAR_CAR_PRIORITY_LINE, 1);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(space->machine, TTL74148_3S);
}
WRITE8_HANDLER( carpolo_car_goal_interrupt_clear_w )
{
TTL74148_input_line_w(TTL74148_3S, CAR_GOAL_PRIORITY_LINE, 1);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(space->machine, TTL74148_3S);
}
WRITE8_HANDLER( carpolo_car_ball_interrupt_clear_w )
{
TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 1);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(space->machine, TTL74148_3S);
}
WRITE8_HANDLER( carpolo_car_border_interrupt_clear_w )
{
TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 1);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(space->machine, TTL74148_3S);
}
WRITE8_HANDLER( carpolo_timer_interrupt_clear_w )
{
TTL74148_input_line_w(TTL74148_3S, PRI0_PRIORTITY_LINE, 1);
- TTL74148_update(TTL74148_3S);
+ TTL74148_update(space->machine, TTL74148_3S);
}
@@ -397,10 +396,10 @@ static WRITE8_HANDLER( pia_0_port_a_w )
TTL7474_clear_w(TTL7474_1C_1, data & 0x08);
TTL7474_clear_w(TTL7474_1A_1, data & 0x08);
- TTL7474_update(TTL7474_1F_1);
- TTL7474_update(TTL7474_1D_1);
- TTL7474_update(TTL7474_1C_1);
- TTL7474_update(TTL7474_1A_1);
+ TTL7474_update(space->machine, TTL7474_1F_1);
+ TTL7474_update(space->machine, TTL7474_1D_1);
+ TTL7474_update(space->machine, TTL7474_1C_1);
+ TTL7474_update(space->machine, TTL7474_1A_1);
}
diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c
index 690dda9549b..2ecd4fc6ab9 100644
--- a/src/mame/machine/fddebug.c
+++ b/src/mame/machine/fddebug.c
@@ -106,7 +106,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "machine/fd1094.h"
#include "cpu/m68000/m68kcpu.h"
@@ -114,6 +113,7 @@
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "debug/debugvw.h"
+#include "machine/fddebug.h"
@@ -246,7 +246,7 @@ static UINT16 * keystatus;
static UINT32 keystatus_words;
/* key changed callback */
-static void (*key_changed)(void);
+static void (*key_changed)(running_machine *);
@@ -257,7 +257,6 @@ static void (*key_changed)(void);
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 fd1094_regenerate_key(void);
static int instruction_hook(const device_config *device, offs_t curpc);
@@ -477,7 +476,7 @@ INLINE int addr_is_valid(const 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)(void))
+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;
@@ -541,7 +540,7 @@ void fd1094_init_debugging(running_machine *machine, const char *cpureg, const c
/* regenerate the key */
if (keydirty)
- fd1094_regenerate_key();
+ fd1094_regenerate_key(machine);
}
@@ -644,7 +643,7 @@ static void save_overlay_file(running_machine *machine)
data
-----------------------------------------------*/
-void fd1094_regenerate_key(void)
+void fd1094_regenerate_key(running_machine *machine)
{
int reps = keystatus_words / KEY_SIZE;
int keyaddr, repnum;
@@ -675,11 +674,11 @@ void fd1094_regenerate_key(void)
/* update the key with the current fd1094 manager */
if (key_changed != NULL)
- (*key_changed)();
+ (*key_changed)(machine);
/* force all memory and disassembly views to update */
- debug_view_update_type(Machine, DVT_MEMORY);
- debug_view_update_type(Machine, DVT_DISASSEMBLY);
+ debug_view_update_type(machine, DVT_MEMORY);
+ debug_view_update_type(machine, DVT_DISASSEMBLY);
/* reset keydirty */
keydirty = FALSE;
@@ -724,13 +723,13 @@ static int instruction_hook(const device_config *device, offs_t curpc)
/* try all possible decodings at the current pc */
posscount = try_all_possibilities(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
if (keydirty)
- fd1094_regenerate_key();
+ 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();
+ fd1094_regenerate_key(device->machine);
return 0;
}
@@ -763,7 +762,7 @@ static void execute_fdoutput(running_machine *machine, int ref, int params, cons
/* make sure we're up-to-date */
if (keydirty)
- fd1094_regenerate_key();
+ fd1094_regenerate_key(machine);
/* determin the filename and open the file */
filerr = mame_fopen(SEARCHPATH_RAW, param[0], OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file);
@@ -798,7 +797,7 @@ static void execute_fdseed(running_machine *machine, int ref, int params, const
memset(keystatus, 0, keystatus_words * sizeof(keystatus[0]));
/* regenerate the key and reset the 68000 */
- fd1094_regenerate_key();
+ fd1094_regenerate_key(machine);
}
@@ -827,7 +826,7 @@ static void execute_fdlockguess(running_machine *machine, int ref, int params, c
/* tag this possibility as indicated by the ref parameter, and then regenerate the key */
tag_possibility(machine, &posslist[num1], ref);
- fd1094_regenerate_key();
+ fd1094_regenerate_key(machine);
}
@@ -963,7 +962,7 @@ static void execute_fdundo(running_machine *machine, int ref, int params, const
{
/* copy the undobuffer back and regenerate the key */
memcpy(keystatus, undobuff, keystatus_words * 2);
- fd1094_regenerate_key();
+ fd1094_regenerate_key(machine);
debug_console_printf(machine, "Undid last change\n");
}
@@ -1015,7 +1014,7 @@ static void execute_fdstate(running_machine *machine, int ref, int params, const
if (!debug_command_parameter_number(machine, param[0], &newstate))
return;
fd1094_set_state(keyregion, newstate);
- fd1094_regenerate_key();
+ fd1094_regenerate_key(machine);
debug_view_update_type(machine, DVT_MEMORY);
debug_view_update_type(machine, DVT_DISASSEMBLY);
}
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index 0917c8ef1d3..0a839858361 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -8,7 +8,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "machine/7474.h"
#include "includes/galaxold.h"
@@ -17,18 +16,18 @@ static emu_timer *int_timer;
static UINT8 _4in1_bank;
-static void galaxold_7474_9M_2_callback(void)
+static void galaxold_7474_9M_2_callback(running_machine *machine)
{
/* Q bar clocks the other flip-flop,
Q is VBLANK (not visible to the CPU) */
TTL7474_clock_w(1, TTL7474_output_comp_r(0));
- TTL7474_update(1);
+ TTL7474_update(machine, 1);
}
-static void galaxold_7474_9M_1_callback(void)
+static void galaxold_7474_9M_1_callback(running_machine *machine)
{
/* Q goes to the NMI line */
- cpu_set_input_line(Machine->cpu[0], irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE);
+ cpu_set_input_line(machine->cpu[0], irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE);
}
static const struct TTL7474_interface galaxold_7474_9M_2_intf =
@@ -45,7 +44,7 @@ static const struct TTL7474_interface galaxold_7474_9M_1_intf =
WRITE8_HANDLER( galaxold_nmi_enable_w )
{
TTL7474_preset_w(1, data);
- TTL7474_update(1);
+ TTL7474_update(space->machine, 1);
}
@@ -61,7 +60,7 @@ static TIMER_CALLBACK( interrupt_timer )
timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param);
- TTL7474_update(0);
+ TTL7474_update(machine, 0);
}
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index d4cd3c7745e..2369416f1bb 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -5,7 +5,6 @@
****************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/adsp2100/adsp2100.h"
#include "cpu/m68000/m68000.h"
@@ -1415,10 +1414,10 @@ WRITE16_HANDLER( hd68k_ds3_program_w )
*
*************************************/
-void hddsk_update_pif(UINT32 pins)
+void hddsk_update_pif(const device_config *device, UINT32 pins)
{
atarigen_sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0);
- hd68k_update_interrupts(Machine);
+ hd68k_update_interrupts(device->machine);
}
diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c
index 69caf1a600c..cf03b39ba52 100644
--- a/src/mame/machine/konppc.c
+++ b/src/mame/machine/konppc.c
@@ -1,7 +1,6 @@
/* Konami PowerPC-based 3D games common functions */
#include "driver.h"
-#include "deprecat.h"
#include "cpu/sharc/sharc.h"
#include "video/voodoo.h"
#include "konppc.h"
@@ -40,9 +39,8 @@ static UINT32 *nwk_ram[MAX_CG_BOARDS];
/*****************************************************************************/
-void init_konami_cgboard(int num_boards, int type)
+void init_konami_cgboard(running_machine *machine, int num_boards, int type)
{
- running_machine *machine = Machine;
int i;
num_cgboards = num_boards;
@@ -119,11 +117,11 @@ int get_cgboard_id(void)
}
}
-void set_cgboard_texture_bank(int board, int bank, UINT8 *rom)
+void set_cgboard_texture_bank(running_machine *machine, int board, int bank, UINT8 *rom)
{
texture_bank[board] = bank;
- memory_configure_bank(Machine, bank, 0, 2, rom, 0x800000);
+ memory_configure_bank(machine, bank, 0, 2, rom, 0x800000);
}
/*****************************************************************************/
@@ -349,27 +347,28 @@ WRITE32_HANDLER( cgboard_1_shared_sharc_w )
/*****************************************************************************/
-static UINT32 nwk_fifo_r(int board)
+static UINT32 nwk_fifo_r(const address_space *space, int board)
{
int cpu = (board == 0) ? 2 : 3;
+ const device_config *device = space->machine->cpu[cpu];
UINT32 data;
if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r)
{
- sharc_set_flag_input(Machine->cpu[cpu], 1, CLEAR_LINE);
+ sharc_set_flag_input(device, 1, CLEAR_LINE);
}
else
{
- sharc_set_flag_input(Machine->cpu[cpu], 1, ASSERT_LINE);
+ sharc_set_flag_input(device, 1, ASSERT_LINE);
}
if (nwk_fifo_read_ptr[board] < nwk_fifo_full)
{
- sharc_set_flag_input(Machine->cpu[cpu], 2, ASSERT_LINE);
+ sharc_set_flag_input(device, 2, ASSERT_LINE);
}
else
{
- sharc_set_flag_input(Machine->cpu[cpu], 2, CLEAR_LINE);
+ sharc_set_flag_input(device, 2, CLEAR_LINE);
}
data = nwk_fifo[board][nwk_fifo_read_ptr[board]];
@@ -379,20 +378,21 @@ static UINT32 nwk_fifo_r(int board)
return data;
}
-static void nwk_fifo_w(int board, UINT32 data)
+static void nwk_fifo_w(running_machine *machine, int board, UINT32 data)
{
int cpu = (board == 0) ? 2 : 3;
+ const device_config *device = machine->cpu[cpu];
if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w)
{
- sharc_set_flag_input(Machine->cpu[cpu], 1, ASSERT_LINE);
+ sharc_set_flag_input(device, 1, ASSERT_LINE);
}
else
{
- sharc_set_flag_input(Machine->cpu[cpu], 1, CLEAR_LINE);
+ sharc_set_flag_input(device, 1, CLEAR_LINE);
}
- sharc_set_flag_input(Machine->cpu[cpu], 2, ASSERT_LINE);
+ sharc_set_flag_input(device, 2, ASSERT_LINE);
nwk_fifo[board][nwk_fifo_write_ptr[board]] = data;
nwk_fifo_write_ptr[board]++;
@@ -420,7 +420,7 @@ void K033906_init(running_machine *machine)
}
}
-static UINT32 K033906_r(int chip, int reg)
+static UINT32 K033906_r(const address_space *space, int chip, int reg)
{
switch(reg)
{
@@ -430,12 +430,12 @@ static UINT32 K033906_r(int chip, int reg)
case 0x0f: return K033906_reg[chip][0x0f]; // interrupt_line, interrupt_pin, min_gnt, max_lat
default:
- fatalerror("%s:K033906_r: %d, %08X", cpuexec_describe_context(Machine), chip, reg);
+ fatalerror("%s:K033906_r: %d, %08X", cpuexec_describe_context(space->machine), chip, reg);
}
return 0;
}
-static void K033906_w(running_machine *machine, int chip, int reg, UINT32 data)
+static void K033906_w(const address_space *space, int chip, int reg, UINT32 data)
{
switch(reg)
{
@@ -466,7 +466,7 @@ static void K033906_w(running_machine *machine, int chip, int reg, UINT32 data)
case 0x10: // initEnable
{
- const device_config *device = device_list_find_by_index(machine->config->devicelist, VOODOO_GRAPHICS, chip);
+ const device_config *device = device_list_find_by_index(space->machine->config->devicelist, VOODOO_GRAPHICS, chip);
voodoo_set_init_enable(device, data);
break;
}
@@ -479,7 +479,7 @@ static void K033906_w(running_machine *machine, int chip, int reg, UINT32 data)
break;
default:
- fatalerror("%s:K033906_w: %d, %08X, %08X", cpuexec_describe_context(machine), chip, data, reg);
+ fatalerror("%s:K033906_w: %d, %08X, %08X", cpuexec_describe_context(space->machine), chip, data, reg);
}
}
@@ -487,13 +487,13 @@ READ32_HANDLER(K033906_0_r)
{
if (nwk_device_sel[0] & 0x01)
{
- return nwk_fifo_r(0);
+ return nwk_fifo_r(space, 0);
}
else
{
if (pci_bridge_enable[0])
{
- return K033906_r(0, offset);
+ return K033906_r(space, 0, offset);
}
else
{
@@ -506,7 +506,7 @@ WRITE32_HANDLER(K033906_0_w)
{
if (pci_bridge_enable[0])
{
- K033906_w(space->machine, 0, offset, data);
+ K033906_w(space, 0, offset, data);
}
else
{
@@ -518,13 +518,13 @@ READ32_HANDLER(K033906_1_r)
{
if (nwk_device_sel[1] & 0x01)
{
- return nwk_fifo_r(1);
+ return nwk_fifo_r(space, 1);
}
else
{
if (pci_bridge_enable[1])
{
- return K033906_r(1, offset);
+ return K033906_r(space, 1, offset);
}
else
{
@@ -537,7 +537,7 @@ WRITE32_HANDLER(K033906_1_w)
{
if (pci_bridge_enable[1])
{
- K033906_w(space->machine, 1, offset, data);
+ K033906_w(space, 1, offset, data);
}
else
{
@@ -551,7 +551,7 @@ WRITE32_DEVICE_HANDLER(nwk_fifo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
- nwk_fifo_w(0, data);
+ nwk_fifo_w(device->machine, 0, data);
}
else if (nwk_device_sel[0] & 0x02)
{
@@ -568,7 +568,7 @@ WRITE32_DEVICE_HANDLER(nwk_fifo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
- nwk_fifo_w(1, data);
+ nwk_fifo_w(device->machine, 1, data);
}
else if (nwk_device_sel[1] & 0x02)
{
@@ -609,7 +609,7 @@ WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
- nwk_fifo_w(0, data);
+ nwk_fifo_w(device->machine, 0, data);
}
else if (nwk_device_sel[0] & 0x02)
{
@@ -626,7 +626,7 @@ WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
- nwk_fifo_w(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 b63aea2f2c9..e2486707fc4 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(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(int board, int bank, UINT8 *rom);
+void set_cgboard_texture_bank(running_machine *machine, int board, int bank, UINT8 *rom);
READ32_HANDLER( cgboard_dsp_comm_r_ppc );
WRITE32_HANDLER( cgboard_dsp_comm_w_ppc );
diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c
index 958bd691f28..ee9ffa0368f 100644
--- a/src/mame/machine/mcr.c
+++ b/src/mame/machine/mcr.c
@@ -284,7 +284,7 @@ MACHINE_RESET( mcr )
mcr_cocktail_flip = 0;
/* initialize the sound */
- mcr_sound_reset();
+ mcr_sound_reset(machine);
}
@@ -354,7 +354,7 @@ static void mcr68_common_init(running_machine *machine)
mcr_cocktail_flip = 0;
/* initialize the sound */
- mcr_sound_reset();
+ mcr_sound_reset(machine);
}
diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c
index 1cd5fe5f31e..419bad422bb 100644
--- a/src/mame/machine/midtunit.c
+++ b/src/mame/machine/midtunit.c
@@ -419,7 +419,7 @@ static void init_tunit_generic(running_machine *machine, int sound)
{
case SOUND_ADPCM:
case SOUND_ADPCM_LARGE:
- williams_adpcm_init();
+ williams_adpcm_init(machine);
break;
case SOUND_DCS:
diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c
index 280ffb287d6..852a41c731c 100644
--- a/src/mame/machine/midwayic.c
+++ b/src/mame/machine/midwayic.c
@@ -5,7 +5,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "debugger.h"
#include "midwayic.h"
#include "machine/idectrl.h"
@@ -206,17 +205,17 @@ UINT8 midway_serial_pic_status_r(void)
}
-UINT8 midway_serial_pic_r(void)
+UINT8 midway_serial_pic_r(const address_space *space)
{
- logerror("%s:security R = %04X\n", cpuexec_describe_context(Machine), serial.buffer);
+ logerror("%s:security R = %04X\n", cpuexec_describe_context(space->machine), serial.buffer);
serial.status = 1;
return serial.buffer;
}
-void midway_serial_pic_w(UINT8 data)
+void midway_serial_pic_w(const address_space *space, UINT8 data)
{
- logerror("%s:security W = %04X\n", cpuexec_describe_context(Machine), data);
+ logerror("%s:security W = %04X\n", cpuexec_describe_context(space->machine), data);
/* status seems to reflect the clock bit */
serial.status = (data >> 4) & 1;
@@ -294,31 +293,31 @@ void midway_serial_pic2_set_default_nvram(const UINT8 *nvram)
}
-UINT8 midway_serial_pic2_status_r(void)
+UINT8 midway_serial_pic2_status_r(const address_space *space)
{
UINT8 result = 0;
/* if we're still holding the data ready bit high, do it */
if (pic.latch & 0xf00)
{
- if (attotime_compare(timer_get_time(Machine), pic.latch_expire_time) > 0)
+ if (attotime_compare(timer_get_time(space->machine), pic.latch_expire_time) > 0)
pic.latch &= 0xff;
else
pic.latch -= 0x100;
result = 1;
}
- logerror("%s:PIC status %d\n", cpuexec_describe_context(Machine), result);
+ logerror("%s:PIC status %d\n", cpuexec_describe_context(space->machine), result);
return result;
}
-UINT8 midway_serial_pic2_r(void)
+UINT8 midway_serial_pic2_r(const address_space *space)
{
UINT8 result = 0;
/* PIC data register */
- logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", cpuexec_describe_context(Machine), pic.index, pic.total, pic.latch);
+ logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", cpuexec_describe_context(space->machine), pic.index, pic.total, pic.latch);
/* return the current result */
if (pic.latch & 0xf00)
@@ -333,8 +332,9 @@ UINT8 midway_serial_pic2_r(void)
}
-void midway_serial_pic2_w(running_machine *machine, UINT8 data)
+void midway_serial_pic2_w(const address_space *space, UINT8 data)
{
+ running_machine *machine = space->machine;
static FILE *nvramlog;
if (LOG_NVRAM && !nvramlog)
nvramlog = fopen("nvram.log", "w");
@@ -560,8 +560,8 @@ enum
static UINT16 ioasic_fifo_r(const device_config *device);
static UINT16 ioasic_fifo_status_r(const device_config *device);
-static void ioasic_input_empty(int state);
-static void ioasic_output_full(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);
@@ -695,25 +695,25 @@ static void cage_irq_handler(running_machine *machine, int reason)
}
-static void ioasic_input_empty(int state)
+static void ioasic_input_empty(running_machine *machine, int state)
{
// logerror("ioasic_input_empty(%d)\n", state);
if (state)
ioasic.sound_irq_state |= 0x0080;
else
ioasic.sound_irq_state &= ~0x0080;
- update_ioasic_irq(Machine);
+ update_ioasic_irq(machine);
}
-static void ioasic_output_full(int state)
+static void ioasic_output_full(running_machine *machine, int state)
{
// logerror("ioasic_output_full(%d)\n", state);
if (state)
ioasic.sound_irq_state |= 0x0040;
else
ioasic.sound_irq_state &= ~0x0040;
- update_ioasic_irq(Machine);
+ update_ioasic_irq(machine);
}
@@ -925,7 +925,7 @@ READ32_HANDLER( midway_ioasic_r )
break;
case IOASIC_PICIN:
- result = midway_serial_pic2_r() | (midway_serial_pic2_status_r() << 8);
+ result = midway_serial_pic2_r(space) | (midway_serial_pic2_status_r(space) << 8);
break;
default:
@@ -1025,11 +1025,11 @@ WRITE32_HANDLER( midway_ioasic_w )
case IOASIC_PICOUT:
if (ioasic.shuffle_type == MIDWAY_IOASIC_VAPORTRX)
- midway_serial_pic2_w(space->machine, newreg ^ 0x0a);
+ midway_serial_pic2_w(space, newreg ^ 0x0a);
else if (ioasic.shuffle_type == MIDWAY_IOASIC_SFRUSHRK)
- midway_serial_pic2_w(space->machine, newreg ^ 0x05);
+ midway_serial_pic2_w(space, newreg ^ 0x05);
else
- midway_serial_pic2_w(space->machine, newreg);
+ midway_serial_pic2_w(space, newreg);
break;
case IOASIC_INTCTL:
diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h
index 613041d8bee..a44bf9e4d91 100644
--- a/src/mame/machine/midwayic.h
+++ b/src/mame/machine/midwayic.h
@@ -9,16 +9,16 @@
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(void);
-void midway_serial_pic_w(UINT8 data);
+UINT8 midway_serial_pic_r(const address_space *space);
+void midway_serial_pic_w(const 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_set_default_nvram(const UINT8 *nvram);
-UINT8 midway_serial_pic2_status_r(void);
-UINT8 midway_serial_pic2_r(void);
-void midway_serial_pic2_w(running_machine *machine, UINT8 data);
+UINT8 midway_serial_pic2_status_r(const address_space *space);
+UINT8 midway_serial_pic2_r(const address_space *space);
+void midway_serial_pic2_w(const address_space *space, UINT8 data);
NVRAM_HANDLER( midway_serial_pic2 );
diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c
index 662c5d9bdc3..ac75c6f1083 100644
--- a/src/mame/machine/midwunit.c
+++ b/src/mame/machine/midwunit.c
@@ -5,7 +5,6 @@
**************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/m6809/m6809.h"
#include "audio/dcs.h"
@@ -30,7 +29,7 @@ static UINT8 security_bits;
/* prototype */
static READ16_HANDLER( midwunit_sound_state_r );
-static void midxunit_dcs_output_full(int state);
+static void midxunit_dcs_output_full(running_machine *machine, int state);
@@ -254,11 +253,11 @@ READ16_HANDLER( midxunit_status_r )
*
*************************************/
-void midxunit_dcs_output_full(int state)
+static void midxunit_dcs_output_full(running_machine *machine, int state)
{
/* only signal if not in loopback state */
if (uart[1] != 0x66)
- cpu_set_input_line(Machine->cpu[0], 1, state ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[0], 1, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -647,14 +646,14 @@ MACHINE_RESET( midxunit )
READ16_HANDLER( midwunit_security_r )
{
- return midway_serial_pic_r();
+ return midway_serial_pic_r(space);
}
WRITE16_HANDLER( midwunit_security_w )
{
if (offset == 0 && ACCESSING_BITS_0_7)
- midway_serial_pic_w(data);
+ midway_serial_pic_w(space, data);
}
@@ -668,7 +667,7 @@ WRITE16_HANDLER( midxunit_security_w )
WRITE16_HANDLER( midxunit_security_clock_w )
{
if (offset == 0 && ACCESSING_BITS_0_7)
- midway_serial_pic_w(((~data & 2) << 3) | security_bits);
+ midway_serial_pic_w(space, ((~data & 2) << 3) | security_bits);
}
diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c
index 3e415571a2a..b9c2955cd38 100644
--- a/src/mame/machine/midyunit.c
+++ b/src/mame/machine/midyunit.c
@@ -292,25 +292,25 @@ static void init_generic(running_machine *machine, int bpp, int sound, int prot_
switch (sound)
{
case SOUND_CVSD_SMALL:
- williams_cvsd_init(0);
+ williams_cvsd_init(machine, 0);
memory_install_write8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, cvsd_protection_w);
cvsd_protection_base = memory_region(machine, "cvsd") + 0x10000 + (prot_start - 0x8000);
break;
case SOUND_CVSD:
- williams_cvsd_init(0);
+ williams_cvsd_init(machine, 0);
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9);
memory_set_bankptr(machine, 9, auto_malloc(0x80));
break;
case SOUND_ADPCM:
- williams_adpcm_init();
+ williams_adpcm_init(machine);
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9);
memory_set_bankptr(machine, 9, auto_malloc(0x80));
break;
case SOUND_NARC:
- williams_narc_init();
+ williams_narc_init(machine);
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9);
memory_set_bankptr(machine, 9, auto_malloc(0x80));
break;
@@ -573,7 +573,7 @@ WRITE16_HANDLER( midyunit_sound_w )
case SOUND_CVSD_SMALL:
case SOUND_CVSD:
williams_cvsd_reset_w((~data & 0x100) >> 8);
- williams_cvsd_data_w((data & 0xff) | ((data & 0x200) >> 1));
+ williams_cvsd_data_w(space->machine, (data & 0xff) | ((data & 0x200) >> 1));
break;
case SOUND_ADPCM:
diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c
index 3b4a2a1319b..5524c7dffc3 100644
--- a/src/mame/machine/model1.c
+++ b/src/mame/machine/model1.c
@@ -3,12 +3,15 @@
*/
#include "driver.h"
-#include "deprecat.h"
#include "debugger.h"
#include "cpu/mb86233/mb86233.h"
#include "cpu/v60/v60.h"
#include "includes/model1.h"
+#define TGP_FUNCTION(name) void name(running_machine *machine)
+typedef void (*tgp_func)(running_machine *machine);
+
+
enum {FIFO_SIZE = 256};
enum {MAT_STACK_SIZE = 32};
@@ -21,7 +24,7 @@ static UINT32 fifoin_data[FIFO_SIZE];
static int model1_swa;
static int fifoin_cbcount;
-static void (*fifoin_cb)(void);
+static tgp_func fifoin_cb;
static INT32 fifoout_rpos, fifoout_wpos;
static UINT32 fifoout_data[FIFO_SIZE];
@@ -95,7 +98,7 @@ static void fifoin_push(const address_space *space, UINT32 data)
logerror("TGP FIFOIN overflow\n");
fifoin_cbcount--;
if(!fifoin_cbcount)
- fifoin_cb();
+ fifoin_cb(space->machine);
}
static float fifoin_pop_f(void)
@@ -103,8 +106,8 @@ static float fifoin_pop_f(void)
return u2f(fifoin_pop());
}
-static void function_get_vf(void);
-static void function_get_swa(void);
+static TGP_FUNCTION( function_get_vf );
+static TGP_FUNCTION( function_get_swa );
static void next_fn(void)
{
@@ -146,7 +149,7 @@ static float ram_get_f(void)
return u2f(ram_data[ram_scanadr++]);
}
-static void fadd(void)
+static TGP_FUNCTION( fadd )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -156,7 +159,7 @@ static void fadd(void)
next_fn();
}
-static void fsub(void)
+static TGP_FUNCTION( fsub )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -167,7 +170,7 @@ static void fsub(void)
next_fn();
}
-static void fmul(void)
+static TGP_FUNCTION( fmul )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -177,7 +180,7 @@ static void fmul(void)
next_fn();
}
-static void fdiv(void)
+static TGP_FUNCTION( fdiv )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -188,7 +191,7 @@ static void fdiv(void)
next_fn();
}
-static void matrix_push(void)
+static TGP_FUNCTION( matrix_push )
{
if(mat_stack_pos != MAT_STACK_SIZE) {
memcpy(mat_stack[mat_stack_pos], cmat, sizeof(cmat));
@@ -198,7 +201,7 @@ static void matrix_push(void)
next_fn();
}
-static void matrix_pop(void)
+static TGP_FUNCTION( matrix_pop )
{
if(mat_stack_pos) {
mat_stack_pos--;
@@ -208,7 +211,7 @@ static void matrix_pop(void)
next_fn();
}
-static void matrix_write(void)
+static TGP_FUNCTION( matrix_write )
{
int i;
for(i=0; i<12; i++)
@@ -219,14 +222,14 @@ static void matrix_write(void)
next_fn();
}
-static void clear_stack(void)
+static TGP_FUNCTION( clear_stack )
{
logerror("TGP clear_stack (%x)\n", pushpc);
mat_stack_pos = 0;
next_fn();
}
-static void matrix_mul(void)
+static TGP_FUNCTION( matrix_mul )
{
float m[12];
float a = fifoin_pop_f();
@@ -259,7 +262,7 @@ static void matrix_mul(void)
next_fn();
}
-static void anglev(void)
+static TGP_FUNCTION( anglev )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -279,7 +282,7 @@ static void anglev(void)
next_fn();
}
-static void f11(void)
+static TGP_FUNCTION( f11 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -306,7 +309,7 @@ static void f11(void)
next_fn();
}
-static void normalize(void)
+static TGP_FUNCTION( normalize )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -319,7 +322,7 @@ static void normalize(void)
next_fn();
}
-static void acc_seti(void)
+static TGP_FUNCTION( acc_seti )
{
INT32 a = fifoin_pop();
model1_dump = 1;
@@ -328,7 +331,7 @@ static void acc_seti(void)
next_fn();
}
-static void track_select(void)
+static TGP_FUNCTION( track_select )
{
INT32 a = fifoin_pop();
logerror("TGP track_select %d (%x)\n", a, pushpc);
@@ -336,7 +339,7 @@ static void track_select(void)
next_fn();
}
-static void f14(void)
+static TGP_FUNCTION( f14 )
{
tgp_vr_base[0] = fifoin_pop_f();
tgp_vr_base[1] = fifoin_pop_f();
@@ -346,14 +349,14 @@ static void f14(void)
next_fn();
}
-static void f15_swa(void)
+static TGP_FUNCTION( f15_swa )
{
logerror("TGP f15_swa (%x)\n", pushpc);
next_fn();
}
-static void anglep(void)
+static TGP_FUNCTION( anglep )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -377,7 +380,7 @@ static void anglep(void)
next_fn();
}
-static void matrix_ident(void)
+static TGP_FUNCTION( matrix_ident )
{
logerror("TGP matrix_ident (%x)\n", pushpc);
memset(cmat, 0, sizeof(cmat));
@@ -387,7 +390,7 @@ static void matrix_ident(void)
next_fn();
}
-static void matrix_read(void)
+static TGP_FUNCTION( matrix_read )
{
int i;
logerror("TGP matrix_read (%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f) (%x)\n",
@@ -397,7 +400,7 @@ static void matrix_read(void)
next_fn();
}
-static void matrix_trans(void)
+static TGP_FUNCTION( matrix_trans )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -409,7 +412,7 @@ static void matrix_trans(void)
next_fn();
}
-static void matrix_scale(void)
+static TGP_FUNCTION( matrix_scale )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -427,7 +430,7 @@ static void matrix_scale(void)
next_fn();
}
-static void matrix_rotx(void)
+static TGP_FUNCTION( matrix_rotx )
{
INT16 a = fifoin_pop();
float s = tsin(a);
@@ -449,7 +452,7 @@ static void matrix_rotx(void)
next_fn();
}
-static void matrix_roty(void)
+static TGP_FUNCTION( matrix_roty )
{
INT16 a = fifoin_pop();
float s = tsin(a);
@@ -472,7 +475,7 @@ static void matrix_roty(void)
next_fn();
}
-static void matrix_rotz(void)
+static TGP_FUNCTION( matrix_rotz )
{
INT16 a = fifoin_pop();
float s = tsin(a);
@@ -495,9 +498,9 @@ static void matrix_rotz(void)
next_fn();
}
-static void track_read_quad(void)
+static TGP_FUNCTION( track_read_quad )
{
- const UINT32 *tgp_data = (const UINT32 *)memory_region(Machine, "user2");
+ const UINT32 *tgp_data = (const UINT32 *)memory_region(machine, "user2");
UINT32 a = fifoin_pop();
int offd;
@@ -519,7 +522,7 @@ static void track_read_quad(void)
next_fn();
}
-static void f24_swa(void)
+static TGP_FUNCTION( f24_swa )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -540,7 +543,7 @@ static void f24_swa(void)
next_fn();
}
-static void transform_point(void)
+static TGP_FUNCTION( transform_point )
{
float x = fifoin_pop_f();
float y = fifoin_pop_f();
@@ -553,7 +556,7 @@ static void transform_point(void)
next_fn();
}
-static void fcos_m1(void)
+static TGP_FUNCTION( fcos_m1 )
{
INT16 a = fifoin_pop();
logerror("TGP fcos %d (%x)\n", a, pushpc);
@@ -561,7 +564,7 @@ static void fcos_m1(void)
next_fn();
}
-static void fsin_m1(void)
+static TGP_FUNCTION( fsin_m1 )
{
INT16 a = fifoin_pop();
logerror("TGP fsin %d (%x)\n", a, pushpc);
@@ -569,7 +572,7 @@ static void fsin_m1(void)
next_fn();
}
-static void fcosm_m1(void)
+static TGP_FUNCTION( fcosm_m1 )
{
INT16 a = fifoin_pop();
float b = fifoin_pop_f();
@@ -578,7 +581,7 @@ static void fcosm_m1(void)
next_fn();
}
-static void fsinm_m1(void)
+static TGP_FUNCTION( fsinm_m1 )
{
INT16 a = fifoin_pop();
float b = fifoin_pop_f();
@@ -588,7 +591,7 @@ static void fsinm_m1(void)
next_fn();
}
-static void distance3(void)
+static TGP_FUNCTION( distance3 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -604,7 +607,7 @@ static void distance3(void)
next_fn();
}
-static void ftoi(void)
+static TGP_FUNCTION( ftoi )
{
float a = fifoin_pop_f();
logerror("TGP ftoi %f (%x)\n", a, pushpc);
@@ -612,7 +615,7 @@ static void ftoi(void)
next_fn();
}
-static void itof(void)
+static TGP_FUNCTION( itof )
{
INT32 a = fifoin_pop();
logerror("TGP itof %d (%x)\n", a, pushpc);
@@ -620,7 +623,7 @@ static void itof(void)
next_fn();
}
-static void acc_set(void)
+static TGP_FUNCTION( acc_set )
{
float a = fifoin_pop_f();
logerror("TGP acc_set %f (%x)\n", a, pushpc);
@@ -628,14 +631,14 @@ static void acc_set(void)
next_fn();
}
-static void acc_get(void)
+static TGP_FUNCTION( acc_get )
{
logerror("TGP acc_get (%x)\n", pushpc);
fifoout_push_f(acc);
next_fn();
}
-static void acc_add(void)
+static TGP_FUNCTION( acc_add )
{
float a = fifoin_pop_f();
logerror("TGP acc_add %f (%x)\n", a, pushpc);
@@ -643,7 +646,7 @@ static void acc_add(void)
next_fn();
}
-static void acc_sub(void)
+static TGP_FUNCTION( acc_sub )
{
float a = fifoin_pop_f();
logerror("TGP acc_sub %f (%x)\n", a, pushpc);
@@ -651,7 +654,7 @@ static void acc_sub(void)
next_fn();
}
-static void acc_mul(void)
+static TGP_FUNCTION( acc_mul )
{
float a = fifoin_pop_f();
logerror("TGP acc_mul %f (%x)\n", a, pushpc);
@@ -659,7 +662,7 @@ static void acc_mul(void)
next_fn();
}
-static void acc_div(void)
+static TGP_FUNCTION( acc_div )
{
float a = fifoin_pop_f();
logerror("TGP acc_div %f (%x)\n", a, pushpc);
@@ -667,7 +670,7 @@ static void acc_div(void)
next_fn();
}
-static void f42(void)
+static TGP_FUNCTION( f42 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -676,7 +679,7 @@ static void f42(void)
(void)b;
(void)c;
logerror("TGP f42 %f, %f, %f (%x)\n", a, b, c, pushpc);
- // fifoout_push_f((mame_rand(Machine) % 1000) - 500);
+ // fifoout_push_f((mame_rand(machine) % 1000) - 500);
fifoout_push_f(0);
fifoout_push_f(0);
fifoout_push_f(0);
@@ -689,7 +692,7 @@ static void f42(void)
// r = (x2 + y2 + z2)1/2, f = tan-1(y/(x2+z2)1/2), q = tan-1(z/x)
-static void xyz2rqf(void)
+static TGP_FUNCTION( xyz2rqf )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -727,7 +730,7 @@ static void xyz2rqf(void)
next_fn();
}
-static void f43(void)
+static TGP_FUNCTION( f43 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -749,7 +752,7 @@ static void f43(void)
next_fn();
}
-static void f43_swa(void)
+static TGP_FUNCTION( f43_swa )
{
float a = fifoin_pop_f();
int b = fifoin_pop();
@@ -764,7 +767,7 @@ static void f43_swa(void)
next_fn();
}
-static void f44(void)
+static TGP_FUNCTION( f44 )
{
float a = fifoin_pop_f();
(void)a;
@@ -775,7 +778,7 @@ static void f44(void)
next_fn();
}
-static void matrix_sdir(void)
+static TGP_FUNCTION( matrix_sdir )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -825,7 +828,7 @@ static void matrix_sdir(void)
next_fn();
}
-static void f45(void)
+static TGP_FUNCTION( f45 )
{
float a = fifoin_pop_f();
(void)a;
@@ -834,7 +837,7 @@ static void f45(void)
next_fn();
}
-static void vlength(void)
+static TGP_FUNCTION( vlength )
{
float a = fifoin_pop_f() - tgp_vr_base[0];
float b = fifoin_pop_f() - tgp_vr_base[1];
@@ -849,7 +852,7 @@ static void vlength(void)
next_fn();
}
-static void f47(void)
+static TGP_FUNCTION( f47 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -860,9 +863,9 @@ static void f47(void)
next_fn();
}
-static void track_read_info(void)
+static TGP_FUNCTION( track_read_info )
{
- const UINT32 *tgp_data = (const UINT32 *)memory_region(Machine, "user2");
+ const UINT32 *tgp_data = (const UINT32 *)memory_region(machine, "user2");
UINT16 a = fifoin_pop();
int offd;
@@ -873,7 +876,7 @@ static void track_read_info(void)
next_fn();
}
-static void colbox_set(void)
+static TGP_FUNCTION( colbox_set )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -903,7 +906,7 @@ static void colbox_set(void)
next_fn();
}
-static void colbox_test(void)
+static TGP_FUNCTION( colbox_test )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -919,7 +922,7 @@ static void colbox_test(void)
next_fn();
}
-static void f49_swa(void)
+static TGP_FUNCTION( f49_swa )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -937,7 +940,7 @@ static void f49_swa(void)
next_fn();
}
-static void f50_swa(void)
+static TGP_FUNCTION( f50_swa )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -952,13 +955,13 @@ static void f50_swa(void)
next_fn();
}
-static void f52(void)
+static TGP_FUNCTION( f52 )
{
logerror("TGP f52 (%x)\n", pushpc);
next_fn();
}
-static void matrix_rdir(void)
+static TGP_FUNCTION( matrix_rdir )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1007,9 +1010,9 @@ static void tri_calc_pq(float ax, float ay, float bx, float by, float cx, float
*t2 = (bx*py-by*px)/d;
}
-static void track_lookup(void)
+static TGP_FUNCTION( track_lookup )
{
- const UINT32 *tgp_data = (const UINT32 *)memory_region(Machine, "user2");
+ const UINT32 *tgp_data = (const UINT32 *)memory_region(machine, "user2");
float a = fifoin_pop_f();
UINT32 b = fifoin_pop();
float c = fifoin_pop_f();
@@ -1065,7 +1068,7 @@ static void track_lookup(void)
next_fn();
}
-static void f56(void)
+static TGP_FUNCTION( f56 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1087,7 +1090,7 @@ static void f56(void)
next_fn();
}
-static void f57(void)
+static TGP_FUNCTION( f57 )
{
logerror("TGP f57 (%x)\n", pushpc);
fifoout_push_f(0);
@@ -1096,7 +1099,7 @@ static void f57(void)
next_fn();
}
-static void matrix_readt(void)
+static TGP_FUNCTION( matrix_readt )
{
logerror("TGP matrix_readt (%x)\n", pushpc);
fifoout_push_f(cmat[9]);
@@ -1105,14 +1108,14 @@ static void matrix_readt(void)
next_fn();
}
-static void acc_geti(void)
+static TGP_FUNCTION( acc_geti )
{
logerror("TGP acc_geti (%x)\n", pushpc);
fifoout_push((int)acc);
next_fn();
}
-static void f60(void)
+static TGP_FUNCTION( f60 )
{
logerror("TGP f60 (%x)\n", pushpc);
fifoout_push_f(0);
@@ -1121,7 +1124,7 @@ static void f60(void)
next_fn();
}
-static void col_setcirc(void)
+static TGP_FUNCTION( col_setcirc )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1133,7 +1136,7 @@ static void col_setcirc(void)
next_fn();
}
-static void col_testpt(void)
+static TGP_FUNCTION( col_testpt )
{
float x, y;
float a = fifoin_pop_f();
@@ -1145,7 +1148,7 @@ static void col_testpt(void)
next_fn();
}
-static void push_and_ident(void)
+static TGP_FUNCTION( push_and_ident )
{
if(mat_stack_pos != MAT_STACK_SIZE) {
memcpy(mat_stack[mat_stack_pos], cmat, sizeof(cmat));
@@ -1159,7 +1162,7 @@ static void push_and_ident(void)
next_fn();
}
-static void catmull_rom(void)
+static TGP_FUNCTION( catmull_rom )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1193,7 +1196,7 @@ static void catmull_rom(void)
next_fn();
}
-static void distance(void)
+static TGP_FUNCTION( distance )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1206,7 +1209,7 @@ static void distance(void)
next_fn();
}
-static void car_move(void)
+static TGP_FUNCTION( car_move )
{
INT16 a = fifoin_pop();
float b = fifoin_pop_f();
@@ -1225,7 +1228,7 @@ static void car_move(void)
next_fn();
}
-static void cpa(void)
+static TGP_FUNCTION( cpa )
{
float dv_x, dv_y, dv_z, dv2, dw_x, dw_y, dw_z, dt;
@@ -1269,7 +1272,7 @@ static void cpa(void)
next_fn();
}
-static void vmat_store(void)
+static TGP_FUNCTION( vmat_store )
{
UINT32 a = fifoin_pop();
if(a<21)
@@ -1280,7 +1283,7 @@ static void vmat_store(void)
next_fn();
}
-static void vmat_restore(void)
+static TGP_FUNCTION( vmat_restore )
{
UINT32 a = fifoin_pop();
if(a<21)
@@ -1291,7 +1294,7 @@ static void vmat_restore(void)
next_fn();
}
-static void vmat_mul(void)
+static TGP_FUNCTION( vmat_mul )
{
UINT32 a = fifoin_pop();
UINT32 b = fifoin_pop();
@@ -1314,7 +1317,7 @@ static void vmat_mul(void)
next_fn();
}
-static void vmat_read(void)
+static TGP_FUNCTION( vmat_read )
{
UINT32 a = fifoin_pop();
logerror("TGP vmat_read %d (%x)\n", a, pushpc);
@@ -1331,7 +1334,7 @@ static void vmat_read(void)
next_fn();
}
-static void matrix_rtrans(void)
+static TGP_FUNCTION( matrix_rtrans )
{
logerror("TGP matrix_rtrans (%x)\n", pushpc);
fifoout_push_f(cmat[ 9]);
@@ -1340,7 +1343,7 @@ static void matrix_rtrans(void)
next_fn();
}
-static void matrix_unrot(void)
+static TGP_FUNCTION( matrix_unrot )
{
logerror("TGP matrix_unrot (%x)\n", pushpc);
memset(cmat, 0, 9*sizeof(cmat[0]));
@@ -1350,14 +1353,14 @@ static void matrix_unrot(void)
next_fn();
}
-static void f80(void)
+static TGP_FUNCTION( f80 )
{
logerror("TGP f80 (%x)\n", pushpc);
// cmat[9] = cmat[10] = cmat[11] = 0;
next_fn();
}
-static void vmat_save(void)
+static TGP_FUNCTION( vmat_save )
{
UINT32 a = fifoin_pop();
int i;
@@ -1367,7 +1370,7 @@ static void vmat_save(void)
next_fn();
}
-static void vmat_load(void)
+static TGP_FUNCTION( vmat_load )
{
UINT32 a = fifoin_pop();
int i;
@@ -1377,14 +1380,14 @@ static void vmat_load(void)
next_fn();
}
-static void ram_setadr(void)
+static TGP_FUNCTION( ram_setadr )
{
ram_scanadr = fifoin_pop() - 0x8000;
logerror("TGP f0 ram_setadr 0x%x (%x)\n", ram_scanadr+0x8000, pushpc);
next_fn();
}
-static void groundbox_test(void)
+static TGP_FUNCTION( groundbox_test )
{
int out_x, out_y, out_z;
float x, y, z;
@@ -1407,7 +1410,7 @@ static void groundbox_test(void)
next_fn();
}
-static void f89(void)
+static TGP_FUNCTION( f89 )
{
UINT32 a = fifoin_pop();
UINT32 b = fifoin_pop();
@@ -1421,7 +1424,7 @@ static void f89(void)
next_fn();
}
-static void f92(void)
+static TGP_FUNCTION( f92 )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1435,7 +1438,7 @@ static void f92(void)
next_fn();
}
-static void f93(void)
+static TGP_FUNCTION( f93 )
{
float a = fifoin_pop_f();
(void)a;
@@ -1443,7 +1446,7 @@ static void f93(void)
next_fn();
}
-static void f94(void)
+static TGP_FUNCTION( f94 )
{
UINT32 a = fifoin_pop();
(void)a;
@@ -1451,7 +1454,7 @@ static void f94(void)
next_fn();
}
-static void vmat_flatten(void)
+static TGP_FUNCTION( vmat_flatten )
{
int i;
float m[12];
@@ -1477,7 +1480,7 @@ static void vmat_flatten(void)
next_fn();
}
-static void vmat_load1(void)
+static TGP_FUNCTION( vmat_load1 )
{
UINT32 a = fifoin_pop();
logerror("TGP vmat_load1 0x%x (%x)\n", a, pushpc);
@@ -1485,7 +1488,7 @@ static void vmat_load1(void)
next_fn();
}
-static void ram_trans(void)
+static TGP_FUNCTION( ram_trans )
{
float a = ram_get_f();
float b = ram_get_f();
@@ -1497,7 +1500,7 @@ static void ram_trans(void)
next_fn();
}
-static void f98_load(void)
+static TGP_FUNCTION( f98_load )
{
int i;
for(i=0; i<list_length; i++) {
@@ -1508,7 +1511,7 @@ static void f98_load(void)
next_fn();
}
-static void f98(void)
+static TGP_FUNCTION( f98 )
{
UINT32 a = fifoin_pop();
(void)a;
@@ -1517,22 +1520,22 @@ static void f98(void)
fifoin_cb = f98_load;
}
-static void f99(void)
+static TGP_FUNCTION( f99 )
{
logerror("TGP f99 (%x)\n", pushpc);
next_fn();
}
-static void f100(void)
+static TGP_FUNCTION( f100 )
{
int i;
logerror("TGP f100 get list (%x)\n", pushpc);
for(i=0; i<list_length; i++)
- fifoout_push_f((mame_rand(Machine) % 1000)/100.0);
+ fifoout_push_f((mame_rand(machine) % 1000)/100.0);
next_fn();
}
-static void groundbox_set(void)
+static TGP_FUNCTION( groundbox_set )
{
float a = fifoin_pop_f();
float b = fifoin_pop_f();
@@ -1553,7 +1556,7 @@ static void groundbox_set(void)
next_fn();
}
-static void f102(void)
+static TGP_FUNCTION( f102 )
{
static int ccount = 0;
float px, py, pz;
@@ -1606,7 +1609,7 @@ static void f102(void)
next_fn();
}
-static void f103(void)
+static TGP_FUNCTION( f103 )
{
ram_scanadr = fifoin_pop() - 0x8000;
logerror("TGP f0 mve_setadr 0x%x (%x)\n", ram_scanadr, pushpc);
@@ -1615,7 +1618,7 @@ static void f103(void)
}
struct function {
- void (*cb)(void);
+ tgp_func cb;
int count;
};
@@ -1813,14 +1816,14 @@ static const struct function ftab_swa[] = {
};
-static void dump(void)
+static TGP_FUNCTION( dump )
{
logerror("TGP FIFOIN write %08x (%x)\n", fifoin_pop(), pushpc);
fifoin_cbcount = 1;
fifoin_cb = dump;
}
-static void function_get_vf(void)
+static TGP_FUNCTION( function_get_vf )
{
UINT32 f = fifoin_pop() >> 23;
@@ -1835,7 +1838,7 @@ static void function_get_vf(void)
fifoin_cb = ftab_vf[f].cb;
// logerror("TGP function %d request, %d parameters\n", f, fifoin_cbcount);
if(!fifoin_cbcount)
- fifoin_cb();
+ fifoin_cb(machine);
} else {
logerror("TGP function %d unimplemented (%x)\n", f, pushpc);
fifoin_cbcount = 1;
@@ -1843,7 +1846,7 @@ static void function_get_vf(void)
}
}
-static void function_get_swa(void)
+static TGP_FUNCTION( function_get_swa )
{
UINT32 f = fifoin_pop();
@@ -1858,7 +1861,7 @@ static void function_get_swa(void)
fifoin_cb = ftab_swa[f].cb;
// logerror("TGP function %d request, %d parameters\n", f, fifoin_cbcount);
if(!fifoin_cbcount)
- fifoin_cb();
+ fifoin_cb(machine);
} else {
logerror("TGP function %d unimplemented (%x)\n", f, pushpc);
fifoin_cbcount = 1;
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index 8db025a2066..7ca0909ad06 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -529,7 +529,7 @@ WRITE32_HANDLER( n64_dp_reg_w )
case 0x04/4: // DP_END_REG
dp_end = data;
- rdp_process_list();
+ rdp_process_list(space->machine);
break;
case 0x0c/4: // DP_STATUS_REG
diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c
index c56c3722e03..7e2157d5d74 100644
--- a/src/mame/machine/namcoio.c
+++ b/src/mame/machine/namcoio.c
@@ -932,7 +932,7 @@ static void namco_06xx_data_write(running_machine *machine,int chipnum,UINT8 dat
case NAMCOIO_50XX_2: namco_50xx_2_write(machine, data); break;
case NAMCOIO_51XX: namcoio_51XX_write(machine,chipnum,data); break;
case NAMCOIO_52XX: namcoio_52xx_write(data); break;
- case NAMCOIO_54XX: namco_54xx_write(data); break;
+ case NAMCOIO_54XX: namco_54xx_write(machine, data); break;
default:
logerror("%s: custom IO type %d unsupported write\n",cpuexec_describe_context(machine),io[chipnum].type);
break;
diff --git a/src/mame/machine/pcecommn.c b/src/mame/machine/pcecommn.c
index e489964e288..f911218bd5f 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)(void) = NULL;
+static UINT8 (*pce_joystick_readinputport_callback)(running_machine *) = NULL;
DRIVER_INIT( pce ) {
pce.io_port_options = PCE_JOY_SIG | CONST_SIG;
@@ -53,7 +53,7 @@ READ8_HANDLER ( pce_joystick_r )
if ( pce_joystick_readinputport_callback != NULL )
{
- data = pce_joystick_readinputport_callback();
+ data = pce_joystick_readinputport_callback(space->machine);
}
else
{
@@ -67,7 +67,7 @@ READ8_HANDLER ( pce_joystick_r )
return (ret);
}
-void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(void))
+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 d0bda6d0bd6..61b9dac4327 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)(void));
+void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine *));
#endif
diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c
index cb08ca2d839..d29e4fa0c71 100644
--- a/src/mame/machine/pcshare.c
+++ b/src/mame/machine/pcshare.c
@@ -21,17 +21,16 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "machine/pcshare.h"
#include "machine/pckeybrd.h"
#define VERBOSE_DBG 0 /* general debug messages */
#define DBG_LOG(N,M,A) \
- if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time(Machine)),(char*)M ); logerror A; }
+ if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time(machine)),(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",attotime_to_double(timer_get_time(Machine)),(char*)M ); logerror A; }
+ if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time(machine)),(char*)M ); logerror A; }
static emu_timer *pc_keyboard_timer;
@@ -75,7 +74,7 @@ UINT8 pc_keyb_read(void)
static TIMER_CALLBACK( pc_keyb_timer )
{
if ( pc_keyb.on ) {
- pc_keyboard();
+ pc_keyboard(machine);
} else {
/* Clock has been low for more than 5 msec, start diagnostic test */
at_keyboard_reset();
@@ -116,7 +115,7 @@ void pc_keyb_clear(void)
}
}
-void pc_keyboard(void)
+void pc_keyboard(running_machine *machine)
{
int data;
diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c
index b76020ce6a2..bba6283b1d4 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -1,5 +1,4 @@
#include "driver.h"
-#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "machine/rp5h01.h"
#include "includes/playch10.h"
@@ -668,14 +667,14 @@ static int gboard_4screen;
static int gboard_last_bank;
static int gboard_command;
-static void gboard_scanline_cb( int num, int scanline, int vblank, int blanked )
+static void gboard_scanline_cb( running_machine *machine, int num, int scanline, int vblank, int blanked )
{
if ( !vblank && !blanked )
{
if ( --gboard_scanline_counter == -1 )
{
gboard_scanline_counter = gboard_scanline_latch;
- generic_pulse_irq_line(Machine->cpu[1], 0);
+ generic_pulse_irq_line(machine->cpu[1], 0);
}
}
}
diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c
index e8f8593177b..a050f7de84c 100644
--- a/src/mame/machine/psx.c
+++ b/src/mame/machine/psx.c
@@ -7,7 +7,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/mips/psx.h"
#include "includes/psx.h"
@@ -191,7 +190,7 @@ static void dma_interrupt_update( running_machine *machine )
m_n_dicr &= 0x00ffffff | ( m_n_dicr << 8 );
}
-static void dma_finished(running_machine *machine, int n_channel)
+static void dma_finished(const address_space *space, int n_channel)
{
if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000401 && n_channel == 2 )
{
@@ -225,7 +224,7 @@ static void dma_finished(running_machine *machine, int n_channel)
n_address &= n_adrmask;
n_nextaddress = g_p_n_psxram[ n_address / 4 ];
n_size = n_nextaddress >> 24;
- m_p_fn_dma_write[ n_channel ]( n_address + 4, n_size );
+ m_p_fn_dma_write[ n_channel ]( space->machine, n_address + 4, n_size );
//FIXME:
// The following conditions will cause an endless loop.
// If stopping the transfer is correct I cannot judge
@@ -247,13 +246,14 @@ static void dma_finished(running_machine *machine, int n_channel)
m_p_n_dmachannelcontrol[ n_channel ] &= ~( ( 1L << 0x18 ) | ( 1L << 0x1c ) );
m_n_dicr |= 1 << ( 24 + n_channel );
- dma_interrupt_update(machine);
+ dma_interrupt_update(space->machine);
dma_stop_timer( n_channel );
}
static TIMER_CALLBACK( dma_finished_callback )
{
- dma_finished(machine, param);
+ const address_space *space = NULL;
+ dma_finished(space, param);
}
void psx_dma_install_read_handler( int n_channel, psx_dma_read_handler p_fn_dma_read )
@@ -312,45 +312,45 @@ WRITE32_HANDLER( psx_dma_w )
m_p_fn_dma_read[ n_channel ] != NULL )
{
verboselog( machine, 1, "dma %d read block %08x %08x\n", n_channel, n_address, n_size );
- m_p_fn_dma_read[ n_channel ]( n_address, n_size );
- dma_finished( space->machine, n_channel );
+ m_p_fn_dma_read[ n_channel ]( space->machine, n_address, n_size );
+ dma_finished( space, n_channel );
}
else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000200 &&
m_p_fn_dma_read[ n_channel ] != NULL )
{
verboselog( machine, 1, "dma %d read block %08x %08x\n", n_channel, n_address, n_size );
- m_p_fn_dma_read[ n_channel ]( n_address, n_size );
+ m_p_fn_dma_read[ n_channel ]( space->machine, n_address, n_size );
if( n_channel == 1 )
{
dma_start_timer( n_channel, 26000 );
}
else
{
- dma_finished( space->machine, n_channel );
+ dma_finished( space, n_channel );
}
}
else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000201 &&
m_p_fn_dma_write[ n_channel ] != NULL )
{
verboselog( machine, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size );
- m_p_fn_dma_write[ n_channel ]( n_address, n_size );
- dma_finished( space->machine, n_channel );
+ m_p_fn_dma_write[ n_channel ]( space->machine, n_address, n_size );
+ dma_finished( space, n_channel );
}
else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x11050100 &&
m_p_fn_dma_write[ n_channel ] != NULL )
{
/* todo: check this is a write not a read... */
verboselog( machine, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size );
- m_p_fn_dma_write[ n_channel ]( n_address, n_size );
- dma_finished( space->machine, n_channel );
+ m_p_fn_dma_write[ n_channel ]( space->machine, n_address, n_size );
+ dma_finished( space, n_channel );
}
else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x11150100 &&
m_p_fn_dma_write[ n_channel ] != NULL )
{
/* todo: check this is a write not a read... */
verboselog( machine, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size );
- m_p_fn_dma_write[ n_channel ]( n_address, n_size );
- dma_finished( space->machine, n_channel );
+ m_p_fn_dma_write[ n_channel ]( space->machine, n_address, n_size );
+ dma_finished( space, n_channel );
}
else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x01000401 &&
n_channel == 2 &&
@@ -359,7 +359,7 @@ WRITE32_HANDLER( psx_dma_w )
verboselog( machine, 1, "dma %d write linked list %08x\n",
n_channel, m_p_n_dmabase[ n_channel ] );
- dma_finished( space->machine, n_channel );
+ dma_finished( space, n_channel );
}
else if( m_p_n_dmachannelcontrol[ n_channel ] == 0x11000002 &&
n_channel == 6 )
@@ -483,10 +483,10 @@ static UINT64 m_p_n_root_start[ 3 ];
#define RC_CLC ( 0x100 )
#define RC_DIV ( 0x200 )
-static UINT64 psxcpu_gettotalcycles( void )
+static UINT64 psxcpu_gettotalcycles( running_machine *machine )
{
/* TODO: should return the start of the current tick. */
- return cpu_get_total_cycles(Machine->cpu[0]) * 2;
+ return cpu_get_total_cycles(machine->cpu[0]) * 2;
}
static int root_divider( int n_counter )
@@ -507,7 +507,7 @@ static int root_divider( int n_counter )
return 1;
}
-static UINT16 root_current( int n_counter )
+static UINT16 root_current( running_machine *machine, int n_counter )
{
if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 )
{
@@ -516,14 +516,14 @@ static UINT16 root_current( int n_counter )
else
{
UINT64 n_current;
- n_current = psxcpu_gettotalcycles() - m_p_n_root_start[ n_counter ];
+ n_current = psxcpu_gettotalcycles(machine) - m_p_n_root_start[ n_counter ];
n_current /= root_divider( n_counter );
n_current += m_p_n_root_count[ n_counter ];
if( n_current > 0xffff )
{
/* TODO: use timer for wrap on 0x10000. */
m_p_n_root_count[ n_counter ] = n_current;
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine);
}
return n_current;
}
@@ -539,7 +539,7 @@ static int root_target( int n_counter )
return 0x10000;
}
-static void root_timer_adjust( int n_counter )
+static void root_timer_adjust( running_machine *machine, int n_counter )
{
if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 )
{
@@ -549,7 +549,7 @@ static void root_timer_adjust( int n_counter )
{
int n_duration;
- n_duration = root_target( n_counter ) - root_current( n_counter );
+ n_duration = root_target( n_counter ) - root_current( machine, n_counter );
if( n_duration < 1 )
{
n_duration += 0x10000;
@@ -565,16 +565,16 @@ static TIMER_CALLBACK( root_finished )
{
int n_counter = param;
- verboselog( machine, 2, "root_finished( %d ) %04x\n", n_counter, root_current( n_counter ) );
+ verboselog( machine, 2, "root_finished( %d ) %04x\n", n_counter, root_current( machine, n_counter ) );
// if( ( m_p_n_root_mode[ n_counter ] & RC_COUNTTARGET ) != 0 )
{
/* TODO: wrap should be handled differently as RC_COUNTTARGET & RC_IRQTARGET don't have to be the same. */
m_p_n_root_count[ n_counter ] = 0;
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(machine);
}
if( ( m_p_n_root_mode[ n_counter ] & RC_REPEAT ) != 0 )
{
- root_timer_adjust( n_counter );
+ root_timer_adjust( machine, n_counter );
}
if( ( m_p_n_root_mode[ n_counter ] & RC_IRQOVERFLOW ) != 0 ||
( m_p_n_root_mode[ n_counter ] & RC_IRQTARGET ) != 0 )
@@ -595,11 +595,11 @@ WRITE32_HANDLER( psx_counter_w )
{
case 0:
m_p_n_root_count[ n_counter ] = data;
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine);
break;
case 1:
- m_p_n_root_count[ n_counter ] = root_current( n_counter );
- m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles();
+ m_p_n_root_count[ n_counter ] = root_current( space->machine, n_counter );
+ m_p_n_root_start[ n_counter ] = psxcpu_gettotalcycles(space->machine);
m_p_n_root_mode[ n_counter ] = data;
if( ( m_p_n_root_mode[ n_counter ] & RC_RESET ) != 0 )
@@ -621,7 +621,7 @@ WRITE32_HANDLER( psx_counter_w )
return;
}
- root_timer_adjust( n_counter );
+ root_timer_adjust( space->machine, n_counter );
}
READ32_HANDLER( psx_counter_r )
@@ -634,7 +634,7 @@ READ32_HANDLER( psx_counter_r )
switch( offset % 4 )
{
case 0:
- data = root_current( n_counter );
+ data = root_current( space->machine, n_counter );
break;
case 1:
data = m_p_n_root_mode[ n_counter ];
@@ -701,9 +701,8 @@ static void sio_interrupt( running_machine *machine, int n_port )
}
}
-static void sio_timer_adjust( int n_port )
+static void sio_timer_adjust( running_machine *machine, int n_port )
{
- running_machine *machine = Machine;
attotime n_time;
if( ( m_p_n_sio_status[ n_port ] & SIO_STATUS_TX_EMPTY ) == 0 || m_p_n_sio_tx_bits[ n_port ] != 0 )
{
@@ -775,10 +774,10 @@ static TIMER_CALLBACK( sio_clock )
if( n_port == 0 )
{
m_p_n_sio_tx[ n_port ] &= ~PSX_SIO_OUT_CLOCK;
- m_p_f_sio_handler[ n_port ]( m_p_n_sio_tx[ n_port ] );
+ m_p_f_sio_handler[ n_port ]( machine, m_p_n_sio_tx[ n_port ] );
m_p_n_sio_tx[ n_port ] |= PSX_SIO_OUT_CLOCK;
}
- m_p_f_sio_handler[ n_port ]( m_p_n_sio_tx[ n_port ] );
+ m_p_f_sio_handler[ n_port ]( machine, m_p_n_sio_tx[ n_port ] );
}
if( m_p_n_sio_tx_bits[ n_port ] == 0 &&
@@ -811,7 +810,7 @@ static TIMER_CALLBACK( sio_clock )
}
}
- sio_timer_adjust( n_port );
+ sio_timer_adjust( machine, n_port );
}
void psx_sio_input( running_machine *machine, int n_port, int n_mask, int n_data )
@@ -849,7 +848,7 @@ WRITE32_HANDLER( psx_sio_w )
m_p_n_sio_tx_data[ n_port ] = data;
m_p_n_sio_status[ n_port ] &= ~( SIO_STATUS_TX_RDY );
m_p_n_sio_status[ n_port ] &= ~( SIO_STATUS_TX_EMPTY );
- sio_timer_adjust( n_port );
+ sio_timer_adjust( machine, n_port );
break;
case 1:
verboselog( machine, 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
@@ -890,7 +889,7 @@ WRITE32_HANDLER( psx_sio_w )
{
if( m_p_f_sio_handler[ n_port ] != NULL )
{
- m_p_f_sio_handler[ n_port ]( m_p_n_sio_tx[ n_port ] );
+ m_p_f_sio_handler[ n_port ]( space->machine, m_p_n_sio_tx[ n_port ] );
}
}
m_p_n_sio_tx_prev[ n_port ] = m_p_n_sio_tx[ n_port ];
@@ -1339,9 +1338,8 @@ static void mdec_yuv2_to_rgb24( void )
mdec_decoded = ( 24 * 16 ) / 2;
}
-static void mdec0_write( UINT32 n_address, INT32 n_size )
+static void mdec0_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
- running_machine *machine = Machine;
int n_index;
verboselog( machine, 2, "mdec0_write( %08x, %08x )\n", n_address, n_size );
@@ -1396,12 +1394,12 @@ static void mdec0_write( UINT32 n_address, INT32 n_size )
}
}
-static void mdec1_read( UINT32 n_address, INT32 n_size )
+static void mdec1_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
UINT32 n_this;
UINT32 n_nextaddress;
- verboselog( Machine, 2, "mdec1_read( %08x, %08x )\n", n_address, n_size );
+ verboselog( machine, 2, "mdec1_read( %08x, %08x )\n", n_address, n_size );
if( ( m_n_mdec0_command & ( 1L << 29 ) ) != 0 && m_n_mdec0_size != 0 )
{
while( n_size > 0 )
@@ -1484,14 +1482,14 @@ READ32_HANDLER( psx_mdec_r )
return 0;
}
-static void gpu_read( UINT32 n_address, INT32 n_size )
+static void gpu_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
- psx_gpu_read( &g_p_n_psxram[ n_address / 4 ], n_size );
+ psx_gpu_read( machine, &g_p_n_psxram[ n_address / 4 ], n_size );
}
-static void gpu_write( UINT32 n_address, INT32 n_size )
+static void gpu_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
- psx_gpu_write( &g_p_n_psxram[ n_address / 4 ], n_size );
+ psx_gpu_write( machine, &g_p_n_psxram[ n_address / 4 ], n_size );
}
void psx_machine_init( running_machine *machine )
@@ -1551,12 +1549,12 @@ static STATE_POSTLOAD( psx_postload )
for( n = 0; n < 3; n++ )
{
- root_timer_adjust( n );
+ root_timer_adjust( machine, n );
}
for( n = 0; n < 2; n++ )
{
- sio_timer_adjust( n );
+ sio_timer_adjust( machine, n );
}
mdec_cos_precalc();
diff --git a/src/mame/machine/s16fd.c b/src/mame/machine/s16fd.c
index c6ff8253d4d..59878985461 100644
--- a/src/mame/machine/s16fd.c
+++ b/src/mame/machine/s16fd.c
@@ -9,9 +9,9 @@ make more configurable (select caches per game?)
*/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/m68000/m68000.h"
#include "machine/fd1094.h"
+#include "machine/fddebug.h"
#include "includes/system16.h"
@@ -38,19 +38,19 @@ void *fd1094_get_decrypted_base(void)
return fd1094_userregion;
}
-static void set_decrypted_region(void)
+static void set_decrypted_region(running_machine *machine)
{
if (fd1094_set_decrypted != NULL)
- (*fd1094_set_decrypted)(Machine, (UINT8 *)fd1094_userregion);
+ (*fd1094_set_decrypted)(machine, (UINT8 *)fd1094_userregion);
else
- memory_set_decrypted_region(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0, fd1094_cpuregionsize - 1, fd1094_userregion);
+ memory_set_decrypted_region(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 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(int state)
+static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
{
int i;
UINT32 addr;
@@ -65,7 +65,7 @@ static void fd1094_setstate_and_decrypt(int state)
fd1094_state = state;
- cpu_set_reg(Machine->cpu[0], M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
+ cpu_set_reg(machine->cpu[0], 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;
@@ -77,8 +77,8 @@ static void fd1094_setstate_and_decrypt(int state)
{
/* copy cached state */
fd1094_userregion=fd1094_cacheregion[i];
- set_decrypted_region();
- m68k_set_encrypted_opcode_range(Machine->cpu[0],0,fd1094_cpuregionsize);
+ set_decrypted_region(machine);
+ m68k_set_encrypted_opcode_range(machine->cpu[0],0,fd1094_cpuregionsize);
return;
}
@@ -96,8 +96,8 @@ static void fd1094_setstate_and_decrypt(int state)
/* copy newly decrypted data to user region */
fd1094_userregion=fd1094_cacheregion[fd1094_current_cacheposition];
- set_decrypted_region();
- m68k_set_encrypted_opcode_range(Machine->cpu[0],0,fd1094_cpuregionsize);
+ set_decrypted_region(machine);
+ m68k_set_encrypted_opcode_range(machine->cpu[0],0,fd1094_cpuregionsize);
fd1094_current_cacheposition++;
@@ -113,20 +113,20 @@ static void fd1094_cmp_callback(const device_config *device, UINT32 val, int reg
{
if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ?
{
- fd1094_setstate_and_decrypt((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(FD1094_STATE_IRQ);
+ fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_IRQ);
return (0x60+irqline*4)/4; // vector address
}
static void fd1094_rte_callback (const device_config *device)
{
- fd1094_setstate_and_decrypt(FD1094_STATE_RTE);
+ fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE);
}
@@ -147,7 +147,7 @@ void fd1094_machine_init(const device_config *device)
if (!fd1094_key)
return;
- fd1094_setstate_and_decrypt(FD1094_STATE_RESET);
+ fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RESET);
fd1094_kludge_reset_values();
device_set_info_fct(device, CPUINFO_FCT_M68K_CMPILD_CALLBACK, (genf *)fd1094_cmp_callback);
@@ -166,13 +166,13 @@ static STATE_POSTLOAD( fd1094_postload )
fd1094_machine_init(machine->cpu[0]);
- fd1094_setstate_and_decrypt(selected_state);
- fd1094_setstate_and_decrypt(state);
+ fd1094_setstate_and_decrypt(machine, selected_state);
+ fd1094_setstate_and_decrypt(machine, state);
}
}
-static void key_changed(void)
+static void key_changed(running_machine *machine)
{
int addr;
@@ -186,11 +186,11 @@ static void key_changed(void)
/* set cache entry 0 to be the active one, and reset the cache position to 1 */
fd1094_userregion = fd1094_cacheregion[0];
- set_decrypted_region();
+ set_decrypted_region(machine);
fd1094_current_cacheposition = 1;
/* flush the prefetch queue */
- cpu_set_reg(Machine->cpu[0], M68K_PREF_ADDR, 0x0010);
+ cpu_set_reg(machine->cpu[0], M68K_PREF_ADDR, 0x0010);
}
@@ -219,7 +219,6 @@ void fd1094_driver_init(running_machine *machine, void (*set_decrypted)(running_
/* key debugging */
if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0 && memory_region(machine, "user2") != NULL)
{
- void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(void));
fd1094_init_debugging(machine, "main", "user1", "user2", key_changed);
}
diff --git a/src/mame/machine/s24fd.c b/src/mame/machine/s24fd.c
index 3c19fc30eaa..f62ce549f1c 100644
--- a/src/mame/machine/s24fd.c
+++ b/src/mame/machine/s24fd.c
@@ -6,7 +6,6 @@ this could get messy if games change their own code after initial loading as we'
*/
#include "driver.h"
-#include "deprecat.h"
#include "cpu/m68000/m68000.h"
#include "machine/fd1094.h"
@@ -30,7 +29,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(int state)
+static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state)
{
int i;
UINT32 addr;
@@ -45,7 +44,7 @@ static void s24_fd1094_setstate_and_decrypt(int state)
fd1094_state = state;
- cpu_set_reg(Machine->cpu[1], M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
+ cpu_set_reg(machine->cpu[1], 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;
@@ -57,8 +56,8 @@ static void s24_fd1094_setstate_and_decrypt(int state)
{
/* copy cached state */
s24_fd1094_userregion=s24_fd1094_cacheregion[i];
- memory_set_decrypted_region(cpu_get_address_space(Machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
- m68k_set_encrypted_opcode_range(Machine->cpu[1],0,s24_fd1094_cpuregionsize);
+ memory_set_decrypted_region(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
+ m68k_set_encrypted_opcode_range(machine->cpu[1],0,s24_fd1094_cpuregionsize);
return;
}
@@ -78,8 +77,8 @@ static void s24_fd1094_setstate_and_decrypt(int state)
/* copy newly decrypted data to user region */
s24_fd1094_userregion=s24_fd1094_cacheregion[fd1094_current_cacheposition];
- memory_set_decrypted_region(cpu_get_address_space(Machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
- m68k_set_encrypted_opcode_range(Machine->cpu[1],0,s24_fd1094_cpuregionsize);
+ memory_set_decrypted_region(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
+ m68k_set_encrypted_opcode_range(machine->cpu[1],0,s24_fd1094_cpuregionsize);
fd1094_current_cacheposition++;
@@ -95,20 +94,20 @@ static void s24_fd1094_cmp_callback(const device_config *device, UINT32 val, int
{
if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ?
{
- s24_fd1094_setstate_and_decrypt((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(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 (const device_config *device)
{
- s24_fd1094_setstate_and_decrypt(FD1094_STATE_RTE);
+ s24_fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE);
}
@@ -123,20 +122,20 @@ static void s24_fd1094_kludge_reset_values(void)
/* function, to be called from MACHINE_RESET (every reset) */
-void s24_fd1094_machine_init(void)
+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)
return;
- s24_fd1094_setstate_and_decrypt(FD1094_STATE_RESET);
+ s24_fd1094_setstate_and_decrypt(machine, FD1094_STATE_RESET);
s24_fd1094_kludge_reset_values();
- device_set_info_fct(Machine->cpu[1], CPUINFO_FCT_M68K_CMPILD_CALLBACK, (genf *)s24_fd1094_cmp_callback);
- device_set_info_fct(Machine->cpu[1], CPUINFO_FCT_M68K_RTE_CALLBACK, (genf *)s24_fd1094_rte_callback);
- cpu_set_irq_callback(Machine->cpu[1], s24_fd1094_int_callback);
+ device_set_info_fct(machine->cpu[1], CPUINFO_FCT_M68K_CMPILD_CALLBACK, (genf *)s24_fd1094_cmp_callback);
+ device_set_info_fct(machine->cpu[1], CPUINFO_FCT_M68K_RTE_CALLBACK, (genf *)s24_fd1094_rte_callback);
+ cpu_set_irq_callback(machine->cpu[1], s24_fd1094_int_callback);
- device_reset(Machine->cpu[1]);
+ device_reset(machine->cpu[1]);
}
static STATE_POSTLOAD( s24_fd1094_postload )
@@ -146,10 +145,10 @@ static STATE_POSTLOAD( s24_fd1094_postload )
int selected_state = fd1094_selected_state;
int state = fd1094_state;
- s24_fd1094_machine_init();
+ s24_fd1094_machine_init(machine);
- s24_fd1094_setstate_and_decrypt(selected_state);
- s24_fd1094_setstate_and_decrypt(state);
+ s24_fd1094_setstate_and_decrypt(machine, selected_state);
+ s24_fd1094_setstate_and_decrypt(machine, state);
}
}
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index 97e1f89e0da..646e5c36864 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -21,7 +21,7 @@ MACHINE_RESET( scramble )
MACHINE_RESET_CALL(galaxold);
if (machine->cpu[1] != NULL)
- scramble_sh_init();
+ scramble_sh_init(machine);
security_2B_counter = 0;
}
@@ -30,7 +30,7 @@ MACHINE_RESET( sfx )
{
MACHINE_RESET_CALL(scramble);
- sfx_sh_init();
+ sfx_sh_init(machine);
}
static int monsterz_count = 0;
@@ -47,7 +47,7 @@ MACHINE_RESET( monsterz )
*/
MACHINE_RESET_CALL(scramble);
- sfx_sh_init();
+ sfx_sh_init(machine);
monsterz_count = 0;
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index fcf4724a04e..fb4f535f056 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -163,7 +163,7 @@ static UINT8 xy_check;
visarea.min_y = 0; \
visarea.max_y = _y_-1; \
video_screen_configure(space->machine->primary_screen, _x_, _y_, &visarea, video_screen_get_frame_period(space->machine->primary_screen).attoseconds ); \
- flip_screen_set(_flip_); \
+ flip_screen_set(space->machine, _flip_); \
} \
/*TODO: numbers over 65535?*/
diff --git a/src/mame/machine/system16.c b/src/mame/machine/system16.c
index 565ac8463aa..81367999d47 100644
--- a/src/mame/machine/system16.c
+++ b/src/mame/machine/system16.c
@@ -1,5 +1,4 @@
#include "driver.h"
-#include "deprecat.h"
#include "system16.h"
#include "sound/upd7759.h"
@@ -9,9 +8,8 @@ UINT16 *sys16_extraram;
UINT16 *sys16_extraram2;
UINT16 *sys16_extraram3;
-static void patch_codeX( int offset, int data, const char *cpu ){
+static void patch_codeX( UINT16 *mem, offs_t offset, int data ){
int aligned_offset = offset&0xfffffe;
- UINT16 *mem = (UINT16 *)memory_region(Machine, cpu);
int old_word = mem[aligned_offset/2];
if( offset&1 )
@@ -22,8 +20,11 @@ static void patch_codeX( int offset, int data, const char *cpu ){
mem[aligned_offset/2] = data;
}
-void sys16_patch_code( int offset, int data ){
- patch_codeX(offset,data,"main");
+void sys16_patch_code( running_machine *machine, const sys16_patch *data, int count ){
+ int i;
+ UINT16 *mem = (UINT16 *)memory_region(machine, "main");
+ for (i=0; i<count; i++)
+ patch_codeX(mem, data[i].offset, data[i].data);
}
@@ -54,9 +55,9 @@ GFXDECODE_END
/* sound */
-static void sound_cause_nmi( int chip ){
+static void sound_cause_nmi( const device_config *device, int chip ){
/* upd7759 callback */
- cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
+ cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c
index 287afaa61ee..cc88787a5ed 100644
--- a/src/mame/machine/tx1.c
+++ b/src/mame/machine/tx1.c
@@ -4,7 +4,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "debugger.h"
#include "machine/8255ppi.h"
#include "tx1.h"
@@ -188,14 +187,14 @@ static void sn_multiply(void)
SN74S516.ZWfl = 0;
}
-static void sn_divide(void)
+static void sn_divide(running_machine *machine)
{
INT32 Z = 0;
INT32 W = 0;
if ( SN74S516.X == 0 )
{
- mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context(Machine));
+ mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context(machine));
SN74S516.ZW.Z = 0xffff;
SN74S516.ZW.W = 0xffff;
SN74S516.ZWfl = 0;
@@ -237,7 +236,7 @@ static void sn_divide(void)
SN74S516.ZWfl = 0;
}
-static void sn74s516_update(const int ins)
+static void sn74s516_update(running_machine *machine, int ins)
{
SN74S516.state = state_table[SN74S516.state][ins];
@@ -248,12 +247,12 @@ static void sn74s516_update(const int ins)
}
else if ( SN74S516.state == 5 )
{
- sn_divide();
+ sn_divide(machine);
SN74S516.state = 10;
}
}
-static void kick_sn74s516(UINT16 *data, const int ins)
+static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins)
{
#define LOAD_X (SN74S516.X = *data)
@@ -279,16 +278,16 @@ static void kick_sn74s516(UINT16 *data, const int ins)
if (ins < 4)
{
LOAD_Y;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 4)
{
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins < 7)
{
LOAD_X;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 7)
{
@@ -307,27 +306,27 @@ static void kick_sn74s516(UINT16 *data, const int ins)
if (ins < 4)
{
LOAD_Y;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 4)
{
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 5)
{
// Rounding
// Operation
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 6)
{
LOAD_X;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 7)
{
READ_ZW;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
break;
}
@@ -337,28 +336,28 @@ static void kick_sn74s516(UINT16 *data, const int ins)
if (SN74S516.code == 0x6666)
{
CLEAR_SEQUENCE;
- mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", cpuexec_describe_context(Machine), math.promaddr);
+ mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", cpuexec_describe_context(machine), math.promaddr);
}
UPDATE_SEQUENCE;
if (ins < 4)
{
LOAD_Y;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins < 6)
{
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 6)
{
LOAD_Z;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 7)
{
// Pointless operation.
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
break;
@@ -369,26 +368,26 @@ static void kick_sn74s516(UINT16 *data, const int ins)
if (ins < 4)
{
LOAD_Y;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 4)
{
LOAD_W;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 5)
{
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 6)
{
LOAD_W;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 7)
{
READ_ZW;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
break;
}
@@ -398,22 +397,22 @@ static void kick_sn74s516(UINT16 *data, const int ins)
if (ins < 4)
{
LOAD_Y;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins < 6)
{
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 6)
{
// CHECK: Incomplete state
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
else if (ins == 7)
{
/* 6667 = Load X, Load Z, Load W, Clear Z */
SN74S516.ZW.Z = 0;
- sn74s516_update(ins);
+ sn74s516_update(machine, ins);
}
break;
}
@@ -424,7 +423,7 @@ static void kick_sn74s516(UINT16 *data, const int ins)
}
math.dbgaddr = math.promaddr;
- math.dbgpc = cpu_get_previouspc(Machine->cpu[1]);
+ math.dbgpc = cpu_get_previouspc(machine->cpu[1]);
}
@@ -548,7 +547,7 @@ static void tx1_update_state(running_machine *machine)
else if ( dsel == 3 )
data = ROL16(SWAP16(math.muxlatch), 3);
- kick_sn74s516(&data, ins);
+ kick_sn74s516(machine, &data, ins);
}
/*
TODO: Changed ppshift to muxlatch for TX-1
@@ -564,7 +563,7 @@ static void tx1_update_state(running_machine *machine)
{
UINT16 data;
- kick_sn74s516(&data, ins);
+ kick_sn74s516(machine, &data, ins);
/* All latches enabled */
if ( LHIEN(math.inslatch) && LLOEN(math.inslatch) )
@@ -638,13 +637,13 @@ static void tx1_update_state(running_machine *machine)
{
if ( math.mux == TX1_SEL_PPSEN )
{
- kick_sn74s516(&math.ppshift, ins);
+ kick_sn74s516(machine, &math.ppshift, ins);
}
else
{
/* Bus pullups give 0xffff */
UINT16 data = 0xffff;
- kick_sn74s516(&data, ins);
+ kick_sn74s516(machine, &data, ins);
}
}
}
@@ -677,7 +676,7 @@ READ16_HANDLER( tx1_math_r )
}
/* TODO What do we return? */
- kick_sn74s516(&math.retval, ins);
+ kick_sn74s516(space->machine, &math.retval, ins);
}
/* /PPSEN */
else if ( offset < 0x800 )
@@ -794,7 +793,7 @@ WRITE16_HANDLER( tx1_math_w )
ins = (offset >> 1) & 7;
}
- kick_sn74s516(&math.cpulatch, ins);
+ kick_sn74s516(space->machine, &math.cpulatch, ins);
}
/* /PPSEN */
else if ( (offset & 0xc00) == 0x400 )
@@ -872,7 +871,7 @@ READ16_HANDLER( tx1_spcs_rom_r )
int ins = math.inslatch & 7;
TX1_SET_INS0_BIT;
- kick_sn74s516(&math.cpulatch, ins);
+ kick_sn74s516(space->machine, &math.cpulatch, ins);
}
else if ( math.mux == TX1_SEL_PPSEN )
{
@@ -936,7 +935,7 @@ READ16_HANDLER( tx1_spcs_ram_r )
int ins = math.inslatch & 7;
TX1_SET_INS0_BIT;
- kick_sn74s516(&math.cpulatch, ins);
+ kick_sn74s516(space->machine, &math.cpulatch, ins);
}
else if ( math.mux == TX1_SEL_PPSEN )
{
@@ -1071,11 +1070,11 @@ static void buggyboy_update_state(running_machine *machine)
{
UINT16 *romdata = (UINT16*)memory_region(machine, "user1");
UINT16 addr = get_bb_datarom_addr();
- kick_sn74s516(&romdata[addr], ins);
+ kick_sn74s516(machine, &romdata[addr], ins);
}
else if ( math.mux == BB_MUX_PPOE )
{
- kick_sn74s516(&math.ppshift, ins);
+ kick_sn74s516(machine, &math.ppshift, ins);
}
/* This is quite tricky. */
/* It can either be a read operation or */
@@ -1084,7 +1083,7 @@ static void buggyboy_update_state(running_machine *machine)
{
UINT16 data;
- kick_sn74s516(&data, ins);
+ kick_sn74s516(machine, &data, ins);
if ( LHIEN(math.inslatch) && LLOEN(math.inslatch) )
{
@@ -1121,13 +1120,13 @@ static void buggyboy_update_state(running_machine *machine)
{
if ( math.mux == BB_MUX_PPSEN )
{
- kick_sn74s516(&math.ppshift, ins);
+ kick_sn74s516(machine, &math.ppshift, ins);
}
else
{
/* Bus pullups give 0xffff */
UINT16 data = 0xffff;
- kick_sn74s516(&data, ins);
+ kick_sn74s516(machine, &data, ins);
}
}
}
@@ -1170,7 +1169,7 @@ READ16_HANDLER( buggyboy_math_r )
}
/* TODO What do we return? */
- kick_sn74s516(&math.retval, ins);
+ kick_sn74s516(space->machine, &math.retval, ins);
/* TODO */
//if (math.mux == BB_MUX_PPSEN)
@@ -1247,7 +1246,7 @@ WRITE16_HANDLER( buggyboy_math_w )
ins = (offset >> 1) & 7;
}
- kick_sn74s516(&math.cpulatch, ins);
+ kick_sn74s516(space->machine, &math.cpulatch, ins);
}
/* /PPSEN */
else if ( (offset & 0xc00) == 0x400 )
@@ -1326,7 +1325,7 @@ READ16_HANDLER( buggyboy_spcs_rom_r )
int ins = math.inslatch & 7;
BB_SET_INS0_BIT;
- kick_sn74s516(&math.cpulatch, ins);
+ kick_sn74s516(space->machine, &math.cpulatch, ins);
}
else if ( math.mux == BB_MUX_PPSEN )
{
@@ -1394,7 +1393,7 @@ READ16_HANDLER( buggyboy_spcs_ram_r )
int ins = math.inslatch & 7;
BB_SET_INS0_BIT;
- kick_sn74s516(&math.cpulatch, ins);
+ kick_sn74s516(space->machine, &math.cpulatch, ins);
}
else if ( math.mux == BB_MUX_PPSEN )
{
diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c
index 7429e185aef..e9c3af38c50 100644
--- a/src/mame/machine/vertigo.c
+++ b/src/mame/machine/vertigo.c
@@ -5,7 +5,6 @@
*************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "vertigo.h"
#include "exidy440.h"
#include "machine/74148.h"
@@ -21,7 +20,7 @@
static PIT8253_OUTPUT_CHANGED( v_irq4_w );
static PIT8253_OUTPUT_CHANGED( v_irq3_w );
-static void update_irq(void);
+static void update_irq(running_machine *machine);
@@ -75,28 +74,28 @@ static const struct TTL74148_interface irq_encoder =
*
*************************************/
-static void update_irq(void)
+static void update_irq(running_machine *machine)
{
if (irq_state < 7)
- cpu_set_input_line(Machine->cpu[0], irq_state ^ 7, CLEAR_LINE);
+ cpu_set_input_line(machine->cpu[0], irq_state ^ 7, CLEAR_LINE);
irq_state = TTL74148_output_r(0);
if (irq_state < 7)
- cpu_set_input_line(Machine->cpu[0], irq_state ^ 7, ASSERT_LINE);
+ cpu_set_input_line(machine->cpu[0], irq_state ^ 7, ASSERT_LINE);
}
-static void update_irq_encoder(int line, int state)
+static void update_irq_encoder(running_machine *machine, int line, int state)
{
TTL74148_input_line_w(0, line, !state);
- TTL74148_update(0);
+ TTL74148_update(machine, 0);
}
static PIT8253_OUTPUT_CHANGED( v_irq4_w )
{
- update_irq_encoder(INPUT_LINE_IRQ4, state);
+ update_irq_encoder(device->machine, INPUT_LINE_IRQ4, state);
vertigo_vproc(cpu_attotime_to_clocks(device->machine->cpu[0], attotime_sub(timer_get_time(device->machine), irq4_time)), state);
irq4_time = timer_get_time(device->machine);
}
@@ -107,7 +106,7 @@ static PIT8253_OUTPUT_CHANGED( v_irq3_w )
if (state)
cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_IRQ0, ASSERT_LINE);
- update_irq_encoder(INPUT_LINE_IRQ3, state);
+ update_irq_encoder(device->machine, INPUT_LINE_IRQ3, state);
}
@@ -127,21 +126,21 @@ READ16_HANDLER( vertigo_io_convert )
else
adc_result = input_port_read(space->machine, adcnames[offset]);
- update_irq_encoder(INPUT_LINE_IRQ2, ASSERT_LINE);
+ update_irq_encoder(space->machine, INPUT_LINE_IRQ2, ASSERT_LINE);
return 0;
}
READ16_HANDLER( vertigo_io_adc )
{
- update_irq_encoder(INPUT_LINE_IRQ2, CLEAR_LINE);
+ update_irq_encoder(space->machine, INPUT_LINE_IRQ2, CLEAR_LINE);
return adc_result;
}
READ16_HANDLER( vertigo_coin_r )
{
- update_irq_encoder(INPUT_LINE_IRQ6, CLEAR_LINE);
+ update_irq_encoder(space->machine, INPUT_LINE_IRQ6, CLEAR_LINE);
return (input_port_read(space->machine, "COIN"));
}
@@ -150,7 +149,7 @@ INTERRUPT_GEN( vertigo_interrupt )
{
/* Coin inputs cause IRQ6 */
if ((input_port_read(device->machine, "COIN") & 0x7) < 0x7)
- update_irq_encoder(INPUT_LINE_IRQ6, ASSERT_LINE);
+ update_irq_encoder(device->machine, INPUT_LINE_IRQ6, ASSERT_LINE);
}
@@ -218,7 +217,7 @@ MACHINE_RESET( vertigo )
for (i = 0; i < 8; i++)
TTL74148_input_line_w(0, i, 1);
- TTL74148_update(0);
+ TTL74148_update(machine, 0);
vertigo_vproc_init(machine);
irq4_time = timer_get_time(machine);
diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c
index 7278dbc57e2..f4a5cef362c 100644
--- a/src/mame/machine/vsnes.c
+++ b/src/mame/machine/vsnes.c
@@ -8,7 +8,6 @@ Nintendo VS UniSystem and DualSystem - (c) 1984 Nintendo of America
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "includes/vsnes.h"
@@ -88,7 +87,7 @@ static const UINT8 rp2c05004_colortable[] =
/* remap callback */
-static int remap_colors( int num, int addr, int data )
+static int remap_colors( running_machine *machine, int num, int addr, int data )
{
/* this is the protection. color codes are shuffled around */
/* the ones with value 0xff are unknown */
@@ -806,9 +805,9 @@ static int MMC3_chr[6];
static int MMC3_prg_chunks, MMC3_prg_mask;
static int IRQ_enable, IRQ_count, IRQ_count_latch;
-static void mapper4_set_prg (void)
+static void mapper4_set_prg (const address_space *space)
{
- UINT8 *prg = memory_region( Machine, "main" );
+ UINT8 *prg = memory_region( space->machine, "main" );
MMC3_prg0 &= MMC3_prg_mask;
MMC3_prg1 &= MMC3_prg_mask;
@@ -825,7 +824,7 @@ static void mapper4_set_prg (void)
memcpy( &prg[0xa000], &prg[0x2000 * (MMC3_prg1) + 0x10000], 0x2000 );
}
-static void mapper4_set_chr (void)
+static void mapper4_set_chr (const address_space *space)
{
UINT8 chr_page = (MMC3_cmd & 0x80) >> 5;
ppu2c0x_set_videorom_bank(0, chr_page ^ 0, 2, MMC3_chr[0], 1);
@@ -839,7 +838,7 @@ static void mapper4_set_chr (void)
#define BOTTOM_VISIBLE_SCANLINE 239 /* The bottommost visible scanline */
#define NUM_SCANLINE 262
-static void mapper4_irq ( int num, int scanline, int vblank, int blanked )
+static void mapper4_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
{
mame_printf_debug("entra\n");
if ((scanline < BOTTOM_VISIBLE_SCANLINE) || (scanline == NUM_SCANLINE-1))
@@ -849,7 +848,7 @@ static void mapper4_irq ( int num, int scanline, int vblank, int blanked )
if (IRQ_count == 0)
{
IRQ_count = IRQ_count_latch;
- cpu_set_input_line (Machine->cpu[0], 0, HOLD_LINE);
+ cpu_set_input_line (machine->cpu[0], 0, HOLD_LINE);
}
IRQ_count --;
}
@@ -867,8 +866,8 @@ static WRITE8_HANDLER( mapper4_w )
if (last_bank != (data & 0xc0))
{
/* Reset the banks */
- mapper4_set_prg ();
- mapper4_set_chr ();
+ mapper4_set_prg (space);
+ mapper4_set_chr (space);
}
last_bank = data & 0xc0;
@@ -882,24 +881,24 @@ static WRITE8_HANDLER( mapper4_w )
case 0: case 1:
data &= 0xfe;
MMC3_chr[cmd] = data * 64;
- mapper4_set_chr ();
+ mapper4_set_chr (space);
break;
case 2: case 3: case 4: case 5:
MMC3_chr[cmd] = data * 64;
- mapper4_set_chr ();
+ mapper4_set_chr (space);
break;
case 6:
MMC3_prg0 = data;
- mapper4_set_prg ();
+ mapper4_set_prg (space);
break;
case 7:
MMC3_prg1 = data;
- mapper4_set_prg ();
+ mapper4_set_prg (space);
break;
}
break;
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 2160e0f4df9..3a02d2d7f17 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -933,7 +933,7 @@ static WRITE8_HANDLER( tshoot_lamp_w )
MACHINE_START( joust2 )
{
- williams_cvsd_init(3);
+ williams_cvsd_init(machine, 3);
}
@@ -963,6 +963,6 @@ static WRITE8_HANDLER( joust2_pia_3_cb1_w )
static WRITE8_HANDLER( joust2_snd_cmd_w )
{
joust2_current_sound_data = (joust2_current_sound_data & ~0xff) | (data & 0xff);
- williams_cvsd_data_w(joust2_current_sound_data);
+ williams_cvsd_data_w(space->machine, joust2_current_sound_data);
timer_call_after_resynch(space->machine, NULL, joust2_current_sound_data, joust2_deferred_snd_cmd_w);
}
diff --git a/src/mame/machine/wrally.c b/src/mame/machine/wrally.c
index e06333a72d6..849b4215458 100644
--- a/src/mame/machine/wrally.c
+++ b/src/mame/machine/wrally.c
@@ -28,7 +28,7 @@ WRITE16_HANDLER( wrally_vram_w )
WRITE16_HANDLER( wrally_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
WRITE16_HANDLER( OKIM6295_bankswitch_w )
diff --git a/src/mame/video/1942.c b/src/mame/video/1942.c
index 96504040712..1a26420616a 100644
--- a/src/mame/video/1942.c
+++ b/src/mame/video/1942.c
@@ -187,7 +187,7 @@ WRITE8_HANDLER( c1942_c804_w )
cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
@@ -213,7 +213,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sx = spriteram[offs + 3] - 0x10 * (spriteram[offs + 1] & 0x10);
sy = spriteram[offs + 2];
dir = 1;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -228,7 +228,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
drawgfx(bitmap,machine->gfx[2],
code + i,col,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy + 16 * i * dir,
cliprect,TRANSPARENCY_PEN,15);
diff --git a/src/mame/video/1943.c b/src/mame/video/1943.c
index 39b6e1d9e10..4f2f88d1745 100644
--- a/src/mame/video/1943.c
+++ b/src/mame/video/1943.c
@@ -153,7 +153,7 @@ WRITE8_HANDLER( c1943_c804_w )
/* bit 5 resets the sound CPU - we ignore it */
/* bit 6 flips screen */
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
/* bit 7 enables characters */
chon = data & 0x80;
@@ -234,7 +234,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs + 3] - ((attr & 0x10) << 4);
int sy = spriteram[offs + 2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -245,7 +245,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
if (color != 0x0a && color != 0x0b)
{
- drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(), flip_screen_get(),
+ drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine),
sx, sy, cliprect, TRANSPARENCY_PEN, 0);
}
}
@@ -253,7 +253,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
if (color == 0x0a || color == 0x0b)
{
- drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(), flip_screen_get(),
+ drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine),
sx, sy, cliprect, TRANSPARENCY_PEN, 0);
}
}
diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c
index 7c8d8ede940..6dc17537d76 100644
--- a/src/mame/video/40love.c
+++ b/src/mame/video/40love.c
@@ -153,7 +153,7 @@ WRITE8_HANDLER( fortyl_pixram_sel_w )
if (fortyl_flipscreen != f)
{
fortyl_flipscreen = f;
- flip_screen_set(fortyl_flipscreen);
+ flip_screen_set(space->machine, fortyl_flipscreen);
fortyl_pix_redraw = 1;
for (offs=0;offs<32;offs++)
diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c
index 6d65f6507a4..acec8a7caa4 100644
--- a/src/mame/video/aeroboto.c
+++ b/src/mame/video/aeroboto.c
@@ -75,13 +75,13 @@ VIDEO_START( aeroboto )
READ8_HANDLER( aeroboto_in0_r )
{
- return input_port_read(space->machine, flip_screen_get() ? "P2" : "P1");
+ return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1");
}
WRITE8_HANDLER( aeroboto_3000_w )
{
/* bit 0 selects both flip screen and player1/player2 controls */
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
/* bit 1 = char bank select */
if (aeroboto_charbank != ((data & 0x02) >> 1))
@@ -126,7 +126,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int x = spriteram[offs+3];
int y = 240 - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 248 - x;
y = 240 - y;
@@ -135,7 +135,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap, machine->gfx[1],
spriteram[offs+1],
spriteram[offs+2] & 0x07,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(machine), flip_screen_get(machine),
((x + 8) & 0xff) - 8, y,
cliprect, TRANSPARENCY_PEN, 0);
}
diff --git a/src/mame/video/ambush.c b/src/mame/video/ambush.c
index d7b6c7d67d1..82695f4a39a 100644
--- a/src/mame/video/ambush.c
+++ b/src/mame/video/ambush.c
@@ -73,7 +73,7 @@ static void draw_chars(running_machine *machine, bitmap_t *bitmap, const rectang
code = videoram[offs] | ((col & 0x60) << 3);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 31 - sx;
sy = 31 - sy;
@@ -83,7 +83,7 @@ static void draw_chars(running_machine *machine, bitmap_t *bitmap, const rectang
drawgfx(bitmap,machine->gfx[0],
code,
(col & 0x0f) | ((*ambush_colorbank & 0x03) << 4),
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
8*sx, (8*sy + scroll) & 0xff,
cliprect,transparency,0);
}
@@ -124,7 +124,7 @@ VIDEO_UPDATE( ambush )
/* 16x16 sprites */
gfx = 1;
- if (!flip_screen_get())
+ if (!flip_screen_get(screen->machine))
{
sy = 240 - sy;
}
@@ -139,7 +139,7 @@ VIDEO_UPDATE( ambush )
gfx = 0;
code <<= 2;
- if (!flip_screen_get())
+ if (!flip_screen_get(screen->machine))
{
sy = 248 - sy;
}
@@ -153,7 +153,7 @@ VIDEO_UPDATE( ambush )
flipx = spriteram[offs + 1] & 0x40;
flipy = spriteram[offs + 1] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
flipx = !flipx;
flipy = !flipy;
diff --git a/src/mame/video/amspdwy.c b/src/mame/video/amspdwy.c
index 1cbb756c386..c0c04d67b8a 100644
--- a/src/mame/video/amspdwy.c
+++ b/src/mame/video/amspdwy.c
@@ -29,7 +29,7 @@ WRITE8_HANDLER( amspdwy_flipscreen_w )
{
static int flip = 0;
flip ^= 1;
- flip_screen_set( flip );
+ flip_screen_set(space->machine, flip );
}
/***************************************************************************
@@ -117,7 +117,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int flipx = attr & 0x80;
int flipy = attr & 0x40;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = max_x - x - 8; y = max_y - y - 8;
flipx = !flipx; flipy = !flipy;
diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c
index 8f4120614be..a52b8996ca0 100644
--- a/src/mame/video/appoooh.c
+++ b/src/mame/video/appoooh.c
@@ -183,7 +183,7 @@ WRITE8_HANDLER( appoooh_out_w )
interrupt_enable_w(space,0,data & 0x01);
/* bit 1 flip screen */
- flip_screen_set(data & 0x02);
+ flip_screen_set(space->machine, data & 0x02);
/* bits 2-3 unknown */
@@ -203,7 +203,8 @@ WRITE8_HANDLER( appoooh_out_w )
/* bit 7 unknown (used) */
}
-static void appoooh_draw_sprites(bitmap_t *dest_bmp,
+static void appoooh_draw_sprites(running_machine *machine,
+ bitmap_t *dest_bmp,
const rectangle *cliprect,
const gfx_element *gfx,
UINT8 *sprite)
@@ -220,7 +221,7 @@ static void appoooh_draw_sprites(bitmap_t *dest_bmp,
if(sx>=248) sx -= 256;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 239 - sx;
sy = 239 - sy;
@@ -229,14 +230,15 @@ static void appoooh_draw_sprites(bitmap_t *dest_bmp,
drawgfx( dest_bmp, gfx,
code,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx, sy,
cliprect,
TRANSPARENCY_PEN , 0);
}
}
-static void robowres_draw_sprites(bitmap_t *dest_bmp,
+static void robowres_draw_sprites(running_machine *machine,
+ bitmap_t *dest_bmp,
const rectangle *cliprect,
const gfx_element *gfx,
UINT8 *sprite)
@@ -253,7 +255,7 @@ static void robowres_draw_sprites(bitmap_t *dest_bmp,
if(sx>=248) sx -= 256;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 239 - sx;
sy = 239 - sy;
@@ -262,7 +264,7 @@ static void robowres_draw_sprites(bitmap_t *dest_bmp,
drawgfx( dest_bmp, gfx,
code,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx, sy,
cliprect,
TRANSPARENCY_PEN , 0);
@@ -281,16 +283,16 @@ VIDEO_UPDATE( appoooh )
if (priority == 1)
{
/* sprite set #1 */
- appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
+ appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
/* sprite set #2 */
- appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
+ appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
}
else
{
/* sprite set #2 */
- appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
+ appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
/* sprite set #1 */
- appoooh_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
+ appoooh_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
}
if (priority != 0) /* fg in front of sprites */
@@ -309,16 +311,16 @@ VIDEO_UPDATE( robowres )
if (priority == 1)
{
/* sprite set #1 */
- robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
+ robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
/* sprite set #2 */
- robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
+ robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
}
else
{
/* sprite set #2 */
- robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
+ robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[3],spriteram_2);
/* sprite set #1 */
- robowres_draw_sprites( bitmap, cliprect, screen->machine->gfx[2],spriteram);
+ robowres_draw_sprites( screen->machine, bitmap, cliprect, screen->machine->gfx[2],spriteram);
}
if (priority != 0) /* fg in front of sprites */
diff --git a/src/mame/video/arkanoid.c b/src/mame/video/arkanoid.c
index 3bfd5316704..13d5ae45a8d 100644
--- a/src/mame/video/arkanoid.c
+++ b/src/mame/video/arkanoid.c
@@ -24,13 +24,13 @@ WRITE8_HANDLER( arkanoid_d008_w )
int bank;
/* bits 0 and 1 flip X and Y, I don't know which is which */
- if (flip_screen_x_get() != (data & 0x01)) {
- flip_screen_x_set(data & 0x01);
+ if (flip_screen_x_get(space->machine) != (data & 0x01)) {
+ flip_screen_x_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
- if (flip_screen_y_get() != (data & 0x02)) {
- flip_screen_y_set(data & 0x02);
+ if (flip_screen_y_get(space->machine) != (data & 0x02)) {
+ flip_screen_y_set(space->machine, data & 0x02);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
@@ -97,21 +97,21 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = spriteram[offs];
sy = 248 - spriteram[offs + 1];
- if (flip_screen_x_get()) sx = 248 - sx;
- if (flip_screen_y_get()) sy = 248 - sy;
+ if (flip_screen_x_get(machine)) sx = 248 - sx;
+ if (flip_screen_y_get(machine)) sy = 248 - sy;
code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) + 1024 * gfxbank;
drawgfx(bitmap,machine->gfx[0],
2 * code,
((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank,
- flip_screen_x_get(),flip_screen_y_get(),
- sx,sy + (flip_screen_y_get() ? 8 : -8),
+ flip_screen_x_get(machine),flip_screen_y_get(machine),
+ sx,sy + (flip_screen_y_get(machine) ? 8 : -8),
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[0],
2 * code + 1,
((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank,
- flip_screen_x_get(),flip_screen_y_get(),
+ flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/video/armedf.c b/src/mame/video/armedf.c
index b4221952f88..cdbdfb6b582 100644
--- a/src/mame/video/armedf.c
+++ b/src/mame/video/armedf.c
@@ -242,7 +242,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = buffered_spriteram16[offs+3];
int sy = sprite_offy+240-(buffered_spriteram16[offs+0]&0x1ff);
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sx = 320 - sx + 176; /* don't ask where 176 comes from, just tried it out */
sy = 240 - sy + 1; /* don't ask where 1 comes from, just tried it out */
flipx = !flipx; /* the values seem to result in pixel-correct placement */
diff --git a/src/mame/video/ashnojoe.c b/src/mame/video/ashnojoe.c
index f615d66fb46..081990a2313 100644
--- a/src/mame/video/ashnojoe.c
+++ b/src/mame/video/ashnojoe.c
@@ -205,7 +205,7 @@ VIDEO_UPDATE( ashnojoe )
// ashnojoe_tilemap_reg[0] & 0x10 // ?? on coin insertion
- flip_screen_set(ashnojoe_tilemap_reg[0] & 1);
+ flip_screen_set(screen->machine, ashnojoe_tilemap_reg[0] & 1);
if(ashnojoe_tilemap_reg[0] & 0x02)
tilemap_draw(bitmap,cliprect,joetilemap7,0,0);
diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c
index 0494ed18b0b..04b66d1e588 100644
--- a/src/mame/video/atari.c
+++ b/src/mame/video/atari.c
@@ -7,7 +7,6 @@
******************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "includes/atari.h"
#include "video/gtia.h"
@@ -1243,7 +1242,7 @@ static TIMER_CALLBACK( antic_scanline_render )
-INLINE void LMS(int new_cmd)
+INLINE void LMS(running_machine *machine, int new_cmd)
{
/**************************************************************
* If the LMS bit (load memory scan) of the current display
@@ -1253,7 +1252,7 @@ INLINE void LMS(int new_cmd)
**************************************************************/
if( new_cmd & ANTIC_LMS )
{
- const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
+ const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
int addr = RDANTIC(space);
antic.doffs = ++antic.doffs & DOFFS;
addr += 256 * RDANTIC(space);
@@ -1379,77 +1378,77 @@ static void antic_scanline_dma(running_machine *machine, int param)
}
break;
case 0x02:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.chbase = (antic.w.chbash & 0xfc) << 8;
antic.modelines = 8 - (vscrol_subtract & 7);
if( antic.w.chactl & 4 ) /* decrement chbasl? */
antic.w.chbasl = antic.modelines - 1;
break;
case 0x03:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.chbase = (antic.w.chbash & 0xfc) << 8;
antic.modelines = 10 - (vscrol_subtract & 9);
if( antic.w.chactl & 4 ) /* decrement chbasl? */
antic.w.chbasl = antic.modelines - 1;
break;
case 0x04:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.chbase = (antic.w.chbash & 0xfc) << 8;
antic.modelines = 8 - (vscrol_subtract & 7);
if( antic.w.chactl & 4 ) /* decrement chbasl? */
antic.w.chbasl = antic.modelines - 1;
break;
case 0x05:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.chbase = (antic.w.chbash & 0xfc) << 8;
antic.modelines = 16 - (vscrol_subtract & 15);
if( antic.w.chactl & 4 ) /* decrement chbasl? */
antic.w.chbasl = antic.modelines - 1;
break;
case 0x06:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.chbase = (antic.w.chbash & 0xfe) << 8;
antic.modelines = 8 - (vscrol_subtract & 7);
if( antic.w.chactl & 4 ) /* decrement chbasl? */
antic.w.chbasl = antic.modelines - 1;
break;
case 0x07:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.chbase = (antic.w.chbash & 0xfe) << 8;
antic.modelines = 16 - (vscrol_subtract & 15);
if( antic.w.chactl & 4 ) /* decrement chbasl? */
antic.w.chbasl = antic.modelines - 1;
break;
case 0x08:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 8 - (vscrol_subtract & 7);
break;
case 0x09:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 4 - (vscrol_subtract & 3);
break;
case 0x0a:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 4 - (vscrol_subtract & 3);
break;
case 0x0b:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 2 - (vscrol_subtract & 1);
break;
case 0x0c:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 1;
break;
case 0x0d:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 2 - (vscrol_subtract & 1);
break;
case 0x0e:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
antic.modelines = 1;
break;
case 0x0f:
- LMS(new_cmd);
+ LMS(machine, new_cmd);
/* bits 6+7 of the priority select register determine */
/* if newer GTIA or plain graphics modes are used */
switch (gtia.w.prior >> 6)
diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
index 32c1c63255e..03486023718 100644
--- a/src/mame/video/avgdvg.c
+++ b/src/mame/video/avgdvg.c
@@ -12,7 +12,6 @@
**************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "avgdvg.h"
#include "video/vector.h"
@@ -69,6 +68,8 @@ typedef struct _vgvector
typedef struct _vgdata
{
+ running_machine *machine;
+
UINT16 pc;
UINT8 sp;
UINT16 dvx;
@@ -167,14 +168,14 @@ static void avg_apply_flipping(int *x, int *y)
*
*************************************/
-static void vg_flush (void)
+static void vg_flush (running_machine *machine)
{
int i;
for (i = 0; i < nvect; i++)
{
if (vectbuf[i].status == VGVECTOR)
- vector_add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity);
+ vector_add_point(machine, vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity);
if (vectbuf[i].status == VGCLIP)
vector_add_clip(vectbuf[i].x, vectbuf[i].y, vectbuf[i].arg1, vectbuf[i].arg2);
@@ -475,7 +476,7 @@ static void mhavoc_data(vgdata *vg)
if (vg->pc & 0x2000)
{
- bank = &memory_region(Machine, "alpha")[0x18000];
+ bank = &memory_region(vg->machine, "alpha")[0x18000];
vg->data = bank[(vg->map << 13) | ((vg->pc ^ 1) & 0x1fff)];
}
else
@@ -751,7 +752,7 @@ static int avg_common_strobe2(vgdata *vg)
*/
vector_clear_list();
- vg_flush();
+ vg_flush(vg->machine);
}
}
else
@@ -804,7 +805,7 @@ static int mhavoc_strobe2(vgdata *vg)
| ((vg->dvy >> 1) & 2)
| ((vg->dvy << 1) & 4)
| ((vg->dvy << 2) & 8)
- | ((mame_rand(Machine) & 0x7) << 4);
+ | ((mame_rand(vg->machine) & 0x7) << 4);
}
else
{
@@ -1240,7 +1241,7 @@ WRITE8_HANDLER( avgdvg_go_w )
*/
vector_clear_list();
}
- vg_flush();
+ vg_flush(space->machine);
vgc->vggo(vg);
vg_set_halt(0);
@@ -1454,6 +1455,9 @@ static VIDEO_START( avg_common )
{
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
+ vg = &vgd;
+ vg->machine = machine;
+
xmin = visarea->min_x;
ymin = visarea->min_y;
xmax = visarea->max_x;
@@ -1485,6 +1489,7 @@ VIDEO_START( dvg )
vgc = &dvg_default;
vg = &vgd;
+ vg->machine = machine;
xmin = visarea->min_x;
ymin = visarea->min_y;
@@ -1499,42 +1504,36 @@ VIDEO_START( dvg )
VIDEO_START( avg )
{
vgc = &avg_default;
- vg = &vgd;
VIDEO_START_CALL(avg_common);
}
VIDEO_START( avg_starwars )
{
vgc = &avg_starwars;
- vg = &vgd;
VIDEO_START_CALL(avg_common);
}
VIDEO_START( avg_tempest )
{
vgc = &avg_tempest;
- vg = &vgd;
VIDEO_START_CALL(avg_common);
}
VIDEO_START( avg_mhavoc )
{
vgc = &avg_mhavoc;
- vg = &vgd;
VIDEO_START_CALL(avg_common);
}
VIDEO_START( avg_bzone )
{
vgc = &avg_bzone;
- vg = &vgd;
VIDEO_START_CALL(avg_common);
}
VIDEO_START( avg_quantum )
{
vgc = &avg_quantum;
- vg = &vgd;
VIDEO_START_CALL(avg_common);
}
diff --git a/src/mame/video/aztarac.c b/src/mame/video/aztarac.c
index 3974a55f916..96811196746 100644
--- a/src/mame/video/aztarac.c
+++ b/src/mame/video/aztarac.c
@@ -8,8 +8,8 @@
#include "video/vector.h"
#include "aztarac.h"
-#define AVECTOR(x, y, color, intensity) \
-vector_add_point (xcenter + ((x) << 16), ycenter - ((y) << 16), color, intensity)
+#define AVECTOR(m, x, y, color, intensity) \
+vector_add_point (m, xcenter + ((x) << 16), ycenter - ((y) << 16), color, intensity)
UINT16 *aztarac_vectorram;
@@ -44,7 +44,7 @@ WRITE16_HANDLER( aztarac_ubr_w )
if ((c & 0x2000) == 0)
{
defaddr = (c >> 1) & 0x7ff;
- AVECTOR (xoffset, yoffset, 0, 0);
+ AVECTOR (space->machine, xoffset, yoffset, 0, 0);
read_vectorram (defaddr, &x, &ndefs, &c);
ndefs++;
@@ -59,9 +59,9 @@ WRITE16_HANDLER( aztarac_ubr_w )
defaddr++;
read_vectorram (defaddr, &x, &y, &c);
if ((c & 0xff00) == 0)
- AVECTOR (x + xoffset, y + yoffset, 0, 0);
+ AVECTOR (space->machine, x + xoffset, y + yoffset, 0, 0);
else
- AVECTOR (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 (defaddr, &x, &y, &c);
color = VECTOR_COLOR222(c & 0x3f);
- AVECTOR (x + xoffset, y + yoffset, color, c >> 8);
+ AVECTOR (space->machine, x + xoffset, y + yoffset, color, c >> 8);
}
}
}
diff --git a/src/mame/video/bagman.c b/src/mame/video/bagman.c
index 7e2f884e70b..65126cb0f0f 100644
--- a/src/mame/video/bagman.c
+++ b/src/mame/video/bagman.c
@@ -86,9 +86,9 @@ PALETTE_INIT( bagman )
WRITE8_HANDLER( bagman_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
}
@@ -121,12 +121,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = 240 - spriteram[offs + 2];
flipx = spriteram[offs] & 0x40;
flipy = spriteram[offs] & 0x80;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx +1; /* compensate misplacement */
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
diff --git a/src/mame/video/bankp.c b/src/mame/video/bankp.c
index 1a7c17ad086..1a0e2be225d 100644
--- a/src/mame/video/bankp.c
+++ b/src/mame/video/bankp.c
@@ -127,7 +127,7 @@ WRITE8_HANDLER( bankp_out_w )
interrupt_enable_w(space,0,(data & 0x10)>>4);
/* bit 5 controls screen flip */
- flip_screen_set(data & 0x20);
+ flip_screen_set(space->machine, data & 0x20);
/* bits 6-7 unknown */
}
@@ -166,7 +166,7 @@ VIDEO_START( bankp )
VIDEO_UPDATE( bankp )
{
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
tilemap_set_scrollx(fg_tilemap, 0, -scroll_x);
tilemap_set_scrollx(bg_tilemap, 0, 0);
diff --git a/src/mame/video/baraduke.c b/src/mame/video/baraduke.c
index ba575a82208..207c4005bd5 100644
--- a/src/mame/video/baraduke.c
+++ b/src/mame/video/baraduke.c
@@ -261,7 +261,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy -= 16 * sizey;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 496+3 - 16 * sizex - sx;
sy = 240 - 16 * sizey - sy;
@@ -289,14 +289,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void set_scroll(int layer)
+static void set_scroll(running_machine *machine, int layer)
{
static const int xdisp[2] = { 26, 24 };
int scrollx, scrolly;
scrollx = xscroll[layer] + xdisp[layer];
scrolly = yscroll[layer] + 9;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
scrollx = -scrollx + 3;
scrolly = -scrolly;
@@ -312,11 +312,11 @@ VIDEO_UPDATE( baraduke )
int back;
/* flip screen is embedded in the sprite control registers */
- /* can't use flip_screen_set() because the visible area is asymmetrical */
- flip_screen_set_no_update(spriteram[0x07f6] & 0x01);
- tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
- set_scroll(0);
- set_scroll(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_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ set_scroll(screen->machine, 0);
+ set_scroll(screen->machine, 1);
if (((xscroll[0] & 0x0e00) >> 9) == 6)
back = 1;
diff --git a/src/mame/video/battlane.c b/src/mame/video/battlane.c
index 83aa51d9b66..2d1b575fc64 100644
--- a/src/mame/video/battlane.c
+++ b/src/mame/video/battlane.c
@@ -182,7 +182,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = attr & 0x04;
flipy = attr & 0x02;
- if (!flip_screen_get())
+ if (!flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -226,7 +226,7 @@ static void draw_fg_bitmap(running_machine *machine, bitmap_t *bitmap )
if (data)
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
*BITMAP_ADDR16(bitmap, 255 - y, 255 - x) = data;
else
*BITMAP_ADDR16(bitmap, y, x) = data;
diff --git a/src/mame/video/battlex.c b/src/mame/video/battlex.c
index ca55dc72de2..a850b806ffa 100644
--- a/src/mame/video/battlex.c
+++ b/src/mame/video/battlex.c
@@ -60,9 +60,9 @@ WRITE8_HANDLER( battlex_flipscreen_w )
/* bit 7 is flip screen */
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -96,7 +96,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipy = source[1] & 0x80;
int flipx = source[1] & 0x40;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/bionicc.c b/src/mame/video/bionicc.c
index 3385ba02fed..bb6eff90403 100644
--- a/src/mame/video/bionicc.c
+++ b/src/mame/video/bionicc.c
@@ -177,7 +177,7 @@ WRITE16_HANDLER( bionicc_gfxctrl_w )
{
if (ACCESSING_BITS_8_15)
{
- flip_screen_set(data & 0x0100);
+ flip_screen_set(space->machine, data & 0x0100);
tilemap_set_enable(bg_tilemap,data & 0x2000); /* guess */
tilemap_set_enable(fg_tilemap,data & 0x1000); /* guess */
@@ -211,7 +211,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = (INT16)buffered_spriteram16[offs+3]; /* signed */
int sy = (INT16)buffered_spriteram16[offs+2]; /* signed */
if(sy>512-16) sy-=512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index b5b75055888..589778a0c10 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -149,9 +149,9 @@ WRITE8_HANDLER( bking_cont1_w )
coin_lockout_global_w(~data & 0x01);
- flip_screen_set_no_update(data & 0x04);
+ flip_screen_set_no_update(space->machine, data & 0x04);
- tilemap_set_flip(ALL_TILEMAPS, flip_screen_get() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ tilemap_set_flip(ALL_TILEMAPS, flip_screen_get(space->machine) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
controller = data & 0x02;
@@ -323,8 +323,8 @@ VIDEO_EOF( bking )
latch = 0x0400;
}
- tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? -xld : xld);
- tilemap_set_scrolly(bg_tilemap, 0, flip_screen_get() ? -yld : yld);
+ tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get(machine) ? -xld : xld);
+ tilemap_set_scrolly(bg_tilemap, 0, flip_screen_get(machine) ? -yld : yld);
tilemap_draw(helper0, &rect, bg_tilemap, 0, 0);
@@ -350,8 +350,8 @@ VIDEO_EOF( bking )
int col = (xld + x) / 8 + 1;
int row = (yld + y) / 8 + 0;
- latch |= (flip_screen_get() ? 31 - col : col) << 0;
- latch |= (flip_screen_get() ? 31 - row : row) << 5;
+ latch |= (flip_screen_get(machine) ? 31 - col : col) << 0;
+ latch |= (flip_screen_get(machine) ? 31 - row : row) << 5;
pc3259_output[0] = (latch >> 0x0) & 0xf;
pc3259_output[1] = (latch >> 0x4) & 0xf;
diff --git a/src/mame/video/blktiger.c b/src/mame/video/blktiger.c
index c643e2bcc10..9bc0686e82d 100644
--- a/src/mame/video/blktiger.c
+++ b/src/mame/video/blktiger.c
@@ -163,7 +163,7 @@ WRITE8_HANDLER( blktiger_video_control_w )
cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
/* bit 6 flips screen */
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
/* bit 7 enables characters? Just a guess */
chon = ~data & 0x80;
@@ -208,7 +208,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int color = attr & 0x07;
int flipx = attr & 0x08;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -218,7 +218,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[2],
code,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,15);
}
diff --git a/src/mame/video/blueprnt.c b/src/mame/video/blueprnt.c
index 6c1ba0de1ef..7b36d594301 100644
--- a/src/mame/video/blueprnt.c
+++ b/src/mame/video/blueprnt.c
@@ -56,7 +56,7 @@ WRITE8_HANDLER( blueprnt_colorram_w )
WRITE8_HANDLER( blueprnt_flipscreen_w )
{
- flip_screen_set(~data & 0x02);
+ flip_screen_set(space->machine, ~data & 0x02);
if (gfx_bank != ((data & 0x04) >> 2))
{
@@ -97,7 +97,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = spriteram[offs + 2] & 0x40;
int flipy = spriteram[offs + 2 - 4] & 0x80; // -4? Awkward, isn't it?
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 248 - sx;
sy = 240 - sy;
@@ -115,7 +115,7 @@ VIDEO_UPDATE( blueprnt )
{
int i;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
for (i = 0; i < 32; i++)
tilemap_set_scrolly(bg_tilemap, i, blueprnt_scrollram[32 - i]);
else
diff --git a/src/mame/video/bogeyman.c b/src/mame/video/bogeyman.c
index 83dafc6f5ca..7e860ef6987 100644
--- a/src/mame/video/bogeyman.c
+++ b/src/mame/video/bogeyman.c
@@ -118,7 +118,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (multi) sy -= 16;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -138,7 +138,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[2],
code + 1, color,
flipx, flipy,
- sx, sy + (flip_screen_get() ? -16 : 16),
+ sx, sy + (flip_screen_get(machine) ? -16 : 16),
cliprect,
TRANSPARENCY_PEN, 0);
}
diff --git a/src/mame/video/bombjack.c b/src/mame/video/bombjack.c
index 75bd568034c..f19a2583364 100644
--- a/src/mame/video/bombjack.c
+++ b/src/mame/video/bombjack.c
@@ -35,9 +35,9 @@ WRITE8_HANDLER( bombjack_background_w )
WRITE8_HANDLER( bombjack_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -106,7 +106,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = 241-spriteram[offs+2];
flipx = spriteram[offs+1] & 0x40;
flipy = spriteram[offs+1] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
if (spriteram[offs+1] & 0x20)
{
diff --git a/src/mame/video/boogwing.c b/src/mame/video/boogwing.c
index bb95a3a84eb..8fc81192005 100644
--- a/src/mame/video/boogwing.c
+++ b/src/mame/video/boogwing.c
@@ -4,7 +4,7 @@
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, UINT16* spriteram_base, int gfx_region)
{
int offs;
- int flipscreen=!flip_screen_get();
+ int flipscreen=!flip_screen_get(machine);
for (offs = 0x400-4;offs >= 0;offs -= 4)
{
@@ -158,7 +158,7 @@ VIDEO_START(boogwing)
VIDEO_UPDATE(boogwing)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c
index 3d7ccc3e9fc..b7847795bdf 100644
--- a/src/mame/video/bosco.c
+++ b/src/mame/video/bosco.c
@@ -222,7 +222,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = spriteram[offs] & 1;
int flipy = spriteram[offs] & 2;
int color = spriteram_2[offs + 1] & 0x3f;
- if (flip_screen_get()) sx += 32-2;
+ if (flip_screen_get(machine)) sx += 32-2;
drawgfx(bitmap,machine->gfx[1],
(spriteram[offs] & 0xfc) >> 2,
@@ -245,7 +245,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
x = bosco_radarx[offs] + ((~bosco_radarattr[offs] & 0x01) << 8);
y = 253 - bosco_radary[offs];
- if (flip_screen_get()) x -= 3;
+ if (flip_screen_get(machine)) x -= 3;
drawgfx(bitmap,machine->gfx[2],
((bosco_radarattr[offs] & 0x0e) >> 1) ^ 0x07,
@@ -257,7 +257,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
if (1)
{
@@ -280,7 +280,7 @@ static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect)
/* dont draw the stars that are off the screen */
if ( x < 224 && y < 224 )
{
- if (flip_screen_get()) x += 64;
+ if (flip) x += 64;
if (y >= cliprect->min_y && y <= cliprect->max_y)
*BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col;
@@ -297,7 +297,7 @@ VIDEO_UPDATE( bosco )
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())
+ if (flip_screen_get(screen->machine))
{
bg_clip.min_x = 8*8;
fg_clip.max_x = 8*8-1;
@@ -309,7 +309,7 @@ VIDEO_UPDATE( bosco )
}
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- draw_stars(bitmap,cliprect);
+ draw_stars(bitmap,cliprect,flip_screen_get(screen->machine));
tilemap_draw(bitmap,&bg_clip,bg_tilemap,0,0);
tilemap_draw(bitmap,&fg_clip,fg_tilemap,0,0);
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index 2259212d0b7..21ecbe344e6 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -268,7 +268,7 @@ WRITE8_HANDLER( zoar_video_control_w )
// Bit 7 = Flip Screen
btime_palette = (data & 0x30) >> 3;
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
WRITE8_HANDLER( btime_video_control_w )
@@ -278,7 +278,7 @@ WRITE8_HANDLER( btime_video_control_w )
// Bit 0 = Flip screen
// Bit 1-7 = Unknown
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
WRITE8_HANDLER( bnj_video_control_w )
@@ -312,7 +312,7 @@ WRITE8_HANDLER( disco_video_control_w )
if (!(input_port_read(space->machine, "DSW1") & 0x40)) /* cocktail mode */
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
}
@@ -338,7 +338,7 @@ static void draw_chars(running_machine *machine, bitmap_t *bitmap, const rectang
/* check priority */
if ((priority != -1) && (priority != ((code >> 7) & 0x01))) continue;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 31 - x;
y = 31 - y;
@@ -347,7 +347,7 @@ static void draw_chars(running_machine *machine, bitmap_t *bitmap, const rectang
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
8*x,8*y,
cliprect,transparency,0);
}
@@ -374,7 +374,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = sprite_ram[offs + 0] & 0x04;
flipy = sprite_ram[offs + 0] & 0x02;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 240 - x;
y = 240 - y + sprite_y_adjust_flip_screen;
@@ -392,7 +392,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
x, y,
cliprect,TRANSPARENCY_PEN,0);
- y = y + (flip_screen_get() ? -256 : 256);
+ y = y + (flip_screen_get(machine) ? -256 : 256);
// Wrap around
drawgfx(bitmap,machine->gfx[1],
@@ -426,7 +426,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
int x = 240 - (16 * (offs / 16) + scroll);
int y = 16 * (offs % 16);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 240 - x;
y = 240 - y;
@@ -435,7 +435,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
drawgfx(bitmap, machine->gfx[2],
gfx[tileoffset + offs],
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
x,y,
cliprect,TRANSPARENCY_NONE,0);
}
@@ -489,7 +489,7 @@ VIDEO_UPDATE( btime )
// Generate tile map
static UINT8 btime_tilemap[4];
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
start = 0;
else
start = 1;
@@ -562,7 +562,7 @@ VIDEO_UPDATE( bnj )
sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8);
sx = 496 - sx;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 496 - sx;
sy = 240 - sy;
@@ -571,14 +571,14 @@ VIDEO_UPDATE( bnj )
drawgfx(background_bitmap, screen->machine->gfx[2],
(bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32,
0,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(screen->machine), flip_screen_get(screen->machine),
sx, sy,
0, TRANSPARENCY_NONE, 0);
}
/* copy the background bitmap to the screen */
scroll = (bnj_scroll1 & 0x02) * 128 + 511 - bnj_scroll2;
- if (!flip_screen_get())
+ if (!flip_screen_get(screen->machine))
scroll = 767-scroll;
copyscrollbitmap(bitmap, background_bitmap, 1, &scroll, 0, 0, cliprect);
@@ -609,7 +609,7 @@ VIDEO_UPDATE( cookrace )
sx = 31 - (offs / 32);
sy = offs % 32;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 31 - sx;
sy = 31 - sy;
@@ -618,7 +618,7 @@ VIDEO_UPDATE( cookrace )
drawgfx(bitmap, screen->machine->gfx[2],
bnj_backgroundram[offs],
0,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(screen->machine), flip_screen_get(screen->machine),
8*sx,8*sy,
cliprect, TRANSPARENCY_NONE, 0);
}
diff --git a/src/mame/video/bublbobl.c b/src/mame/video/bublbobl.c
index ad7cbed1182..c26b4f4d231 100644
--- a/src/mame/video/bublbobl.c
+++ b/src/mame/video/bublbobl.c
@@ -78,7 +78,7 @@ VIDEO_UPDATE( bublbobl )
x = sx + xc * 8;
y = (sy + yc * 8) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
x = 248 - x;
y = 248 - y;
diff --git a/src/mame/video/buggychl.c b/src/mame/video/buggychl.c
index 30c85aec204..41969e841d2 100644
--- a/src/mame/video/buggychl.c
+++ b/src/mame/video/buggychl.c
@@ -70,8 +70,8 @@ WRITE8_HANDLER( buggychl_ctrl_w )
bit0 = VINV
*/
- flip_screen_y_set(data & 0x01);
- flip_screen_x_set(data & 0x02);
+ flip_screen_y_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine, data & 0x02);
bg_on = data & 0x04;
sky_on = data & 0x08;
@@ -112,13 +112,13 @@ static void draw_bg(running_machine *machine, bitmap_t *bitmap, const rectangle
int sx = offs % 32;
int sy = offs / 32;
- if (flip_screen_x_get()) sx = 31 - sx;
- if (flip_screen_y_get()) sy = 31 - sy;
+ if (flip_screen_x_get(machine)) sx = 31 - sx;
+ if (flip_screen_y_get(machine)) sy = 31 - sy;
drawgfx(tmpbitmap1,machine->gfx[0],
code,
2,
- flip_screen_x_get(),flip_screen_y_get(),
+ flip_screen_x_get(machine),flip_screen_y_get(machine),
8*sx,8*sy,
NULL,TRANSPARENCY_NONE,0);
}
@@ -151,13 +151,13 @@ static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle
int code = videoram[offs];
- if (flip_screen_x_get()) sx = 31 - sx;
- if (flip_screen_y_get()) sy = 31 - sy;
+ if (flip_screen_x_get(machine)) sx = 31 - sx;
+ if (flip_screen_y_get(machine)) sy = 31 - sy;
drawgfx(bitmap,machine->gfx[0],
code,
0,
- flip_screen_x_get(),flip_screen_y_get(),
+ flip_screen_x_get(machine),flip_screen_y_get(machine),
8*sx,8*sy,
cliprect,transp,0);
}
@@ -190,7 +190,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (y = 0;y < 64;y++)
{
- int dy = flip_screen_y_get() ? (255 - sy - y) : (sy + y);
+ int dy = flip_screen_y_get(machine) ? (255 - sy - y) : (sy + y);
if ((dy & ~0xff) == 0)
{
@@ -219,7 +219,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
col = pendata[x];
if (col)
{
- int dx = flip_screen_x_get() ? (255 - sx - px) : (sx + px);
+ int dx = flip_screen_x_get(machine) ? (255 - sx - px) : (sx + px);
if ((dx & ~0xff) == 0)
*BITMAP_ADDR16(bitmap, dy, dx) = sprite_color_base + col;
}
diff --git a/src/mame/video/cabal.c b/src/mame/video/cabal.c
index 04304a616af..c17ba58b94b 100644
--- a/src/mame/video/cabal.c
+++ b/src/mame/video/cabal.c
@@ -60,7 +60,7 @@ WRITE16_HANDLER( cabal_flipscreen_w )
tilemap_set_flip(background_layer,flip);
tilemap_set_flip(text_layer,flip);
- flip_screen_set(data & 0x20);
+ flip_screen_set(space->machine, data & 0x20);
}
}
@@ -119,7 +119,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if ( sx>256 ) sx -= 512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c
index a493c699b68..597f617fe78 100644
--- a/src/mame/video/carpolo.c
+++ b/src/mame/video/carpolo.c
@@ -603,42 +603,42 @@ VIDEO_EOF( carpolo )
car1_x, car1_y, car1_code, car1_flipy,
car2_x, car2_y, car2_code, car2_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(0, 1);
+ carpolo_generate_car_car_interrupt(machine, 0, 1);
/* cars 1 and 3 */
else if (check_sprite_sprite_collision(machine,
car1_x, car1_y, car1_code, car1_flipy,
car3_x, car3_y, car3_code, car3_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(0, 2);
+ carpolo_generate_car_car_interrupt(machine, 0, 2);
/* cars 1 and 4 */
else if (check_sprite_sprite_collision(machine,
car1_x, car1_y, car1_code, car1_flipy,
car4_x, car4_y, car4_code, car4_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(0, 3);
+ carpolo_generate_car_car_interrupt(machine, 0, 3);
/* cars 2 and 3 */
else if (check_sprite_sprite_collision(machine,
car2_x, car2_y, car2_code, car2_flipy,
car3_x, car3_y, car3_code, car3_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(1, 2);
+ carpolo_generate_car_car_interrupt(machine, 1, 2);
/* cars 2 and 4 */
else if (check_sprite_sprite_collision(machine,
car2_x, car2_y, car2_code, car2_flipy,
car4_x, car4_y, car4_code, car4_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(1, 3);
+ carpolo_generate_car_car_interrupt(machine, 1, 3);
/* cars 3 and 4 */
else if (check_sprite_sprite_collision(machine,
car3_x, car3_y, car3_code, car3_flipy,
car4_x, car4_y, car4_code, car4_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(2, 3);
+ carpolo_generate_car_car_interrupt(machine, 2, 3);
@@ -647,51 +647,51 @@ VIDEO_EOF( carpolo )
car1_x, car1_y, car1_code, car1_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(0, col_x, col_y);
+ carpolo_generate_car_ball_interrupt(machine, 0, col_x, col_y);
else if (check_sprite_sprite_collision(machine,
car2_x, car2_y, car2_code, car2_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(1, col_x, col_y);
+ carpolo_generate_car_ball_interrupt(machine, 1, col_x, col_y);
else if (check_sprite_sprite_collision(machine,
car3_x, car3_y, car3_code, car3_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(2, col_x, col_y);
+ carpolo_generate_car_ball_interrupt(machine, 2, col_x, col_y);
else if (check_sprite_sprite_collision(machine,
car4_x, car4_y, car4_code, car4_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(3, col_x, col_y);
+ carpolo_generate_car_ball_interrupt(machine, 3, col_x, col_y);
/* check car-goal collision */
if (check_sprite_left_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1))
- carpolo_generate_car_goal_interrupt(0, 0);
+ carpolo_generate_car_goal_interrupt(machine, 0, 0);
else if (check_sprite_right_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1))
- carpolo_generate_car_goal_interrupt(0, 1);
+ carpolo_generate_car_goal_interrupt(machine, 0, 1);
else if (check_sprite_left_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1))
- carpolo_generate_car_goal_interrupt(1, 0);
+ carpolo_generate_car_goal_interrupt(machine, 1, 0);
else if (check_sprite_right_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1))
- carpolo_generate_car_goal_interrupt(1, 1);
+ carpolo_generate_car_goal_interrupt(machine, 1, 1);
else if (check_sprite_left_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1))
- carpolo_generate_car_goal_interrupt(2, 0);
+ carpolo_generate_car_goal_interrupt(machine, 2, 0);
else if (check_sprite_right_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1))
- carpolo_generate_car_goal_interrupt(2, 1);
+ carpolo_generate_car_goal_interrupt(machine, 2, 1);
else if (check_sprite_left_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1))
- carpolo_generate_car_goal_interrupt(3, 0);
+ carpolo_generate_car_goal_interrupt(machine, 3, 0);
else if (check_sprite_right_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1))
- carpolo_generate_car_goal_interrupt(3, 1);
+ carpolo_generate_car_goal_interrupt(machine, 3, 1);
/* check ball collision with static screen elements */
@@ -700,18 +700,18 @@ VIDEO_EOF( carpolo )
col = check_sprite_left_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0);
- if (col == 1) carpolo_generate_ball_screen_interrupt(0x05);
- if (col == 2) carpolo_generate_ball_screen_interrupt(0x03);
+ if (col == 1) carpolo_generate_ball_screen_interrupt(machine, 0x05);
+ if (col == 2) carpolo_generate_ball_screen_interrupt(machine, 0x03);
col = check_sprite_right_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0);
- if (col == 1) carpolo_generate_ball_screen_interrupt(0x05 | 0x08);
- if (col == 2) carpolo_generate_ball_screen_interrupt(0x03 | 0x08);
+ if (col == 1) carpolo_generate_ball_screen_interrupt(machine, 0x05 | 0x08);
+ if (col == 2) carpolo_generate_ball_screen_interrupt(machine, 0x03 | 0x08);
if (check_sprite_border_collision(machine, ball_x, ball_y, ball_code, ball_flipy))
- carpolo_generate_ball_screen_interrupt(0x06);
+ carpolo_generate_ball_screen_interrupt(machine, 0x06);
}
@@ -722,25 +722,25 @@ VIDEO_EOF( carpolo )
col = check_sprite_border_collision(machine, car1_x, car1_y, car1_code, car1_flipy);
if (col)
- carpolo_generate_car_border_interrupt(0, (col == 2));
+ carpolo_generate_car_border_interrupt(machine, 0, (col == 2));
else
{
col = check_sprite_border_collision(machine, car2_x, car2_y, car2_code, car2_flipy);
if (col)
- carpolo_generate_car_border_interrupt(1, (col == 2));
+ carpolo_generate_car_border_interrupt(machine, 1, (col == 2));
else
{
col = check_sprite_border_collision(machine, car3_x, car3_y, car3_code, car3_flipy);
if (col)
- carpolo_generate_car_border_interrupt(2, (col == 2));
+ carpolo_generate_car_border_interrupt(machine, 2, (col == 2));
else
{
col = check_sprite_border_collision(machine, car4_x, car4_y, car4_code, car4_flipy);
if (col)
- carpolo_generate_car_border_interrupt(3, (col == 2));
+ carpolo_generate_car_border_interrupt(machine, 3, (col == 2));
}
}
}
diff --git a/src/mame/video/cbuster.c b/src/mame/video/cbuster.c
index ddb7a2bebef..1d5abe8f0f0 100644
--- a/src/mame/video/cbuster.c
+++ b/src/mame/video/cbuster.c
@@ -110,7 +110,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=240-x;
if (fx) fx=0; else fx=1;
@@ -137,7 +137,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( twocrude )
{
- flip_screen_set( !(deco16_pf12_control[0]&0x80) );
+ flip_screen_set(screen->machine, !(deco16_pf12_control[0]&0x80) );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
diff --git a/src/mame/video/cchasm.c b/src/mame/video/cchasm.c
index 1c456056e42..5419a63244f 100644
--- a/src/mame/video/cchasm.c
+++ b/src/mame/video/cchasm.c
@@ -79,7 +79,7 @@ static void cchasm_refresh (running_machine *machine)
case LENGTH:
if (move)
{
- vector_add_point (currentx, currenty, 0, 0);
+ vector_add_point (machine, currentx, currenty, 0, 0);
move = 0;
}
@@ -89,7 +89,7 @@ static void cchasm_refresh (running_machine *machine)
total_length += abs(data);
if (color)
- vector_add_point (currentx, currenty, color, 0xff);
+ vector_add_point (machine, currentx, currenty, color, 0xff);
else
move = 1;
break;
diff --git a/src/mame/video/champbas.c b/src/mame/video/champbas.c
index f8342965d8c..67d0bb55e13 100644
--- a/src/mame/video/champbas.c
+++ b/src/mame/video/champbas.c
@@ -191,7 +191,7 @@ WRITE8_HANDLER( champbas_palette_bank_w )
WRITE8_HANDLER( champbas_flipscreen_w )
{
- flip_screen_set(~data & 1);
+ flip_screen_set(space->machine, ~data & 1);
}
diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c
index 4e9e40e0118..920b1271142 100644
--- a/src/mame/video/cinemat.c
+++ b/src/mame/video/cinemat.c
@@ -63,10 +63,10 @@ void cinemat_vector_callback(const device_config *device, INT16 sx, INT16 sy, IN
/* move to the starting position if we're not there already */
if (sx != lastx || sy != lasty)
- vector_add_point(sx << 16, sy << 16, 0, 0);
+ vector_add_point(device->machine, sx << 16, sy << 16, 0, 0);
/* draw the vector */
- vector_add_point(ex << 16, ey << 16, vector_color, intensity);
+ vector_add_point(device->machine, ex << 16, ey << 16, vector_color, intensity);
/* remember the last point */
lastx = ex;
diff --git a/src/mame/video/circusc.c b/src/mame/video/circusc.c
index 62bcfeb8b45..49eb2bc8b63 100644
--- a/src/mame/video/circusc.c
+++ b/src/mame/video/circusc.c
@@ -154,7 +154,7 @@ WRITE8_HANDLER( circusc_colorram_w )
WRITE8_HANDLER( circusc_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
@@ -185,7 +185,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = sr[offs + 1] & 0x40;
int flipy = sr[offs + 1] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/citycon.c b/src/mame/video/citycon.c
index 6e1a85d49d0..053ea84cffa 100644
--- a/src/mame/video/citycon.c
+++ b/src/mame/video/citycon.c
@@ -99,7 +99,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(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
/* bits 1-3 are unknown */
// if ((data & 0x0e) != 0) logerror("background register = %02x\n",data);
@@ -119,7 +119,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = spriteram[offs + 3];
sy = 239 - spriteram[offs];
flipx = ~spriteram[offs + 2] & 0x10;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 238 - sy;
@@ -129,7 +129,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1],
spriteram[offs + 1] & 0x7f,
spriteram[offs + 2] & 0x0f,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/video/cloak.c b/src/mame/video/cloak.c
index 71efd77aae1..282df17c4e4 100644
--- a/src/mame/video/cloak.c
+++ b/src/mame/video/cloak.c
@@ -155,7 +155,7 @@ WRITE8_HANDLER( cloak_videoram_w )
WRITE8_HANDLER( cloak_flipscreen_w )
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -215,7 +215,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs + 192];
int sy = 240 - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx -= 9;
sy = 240 - sy;
diff --git a/src/mame/video/clshroad.c b/src/mame/video/clshroad.c
index 618cca4316f..ba895d98501 100644
--- a/src/mame/video/clshroad.c
+++ b/src/mame/video/clshroad.c
@@ -48,7 +48,7 @@ WRITE8_HANDLER( clshroad_flipscreen_w );
WRITE8_HANDLER( clshroad_flipscreen_w )
{
- flip_screen_set( data & 1 );
+ flip_screen_set(space->machine, data & 1 );
}
@@ -305,7 +305,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipy = 0;
x -= 0x4a/2;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y = 240 - y;
flipx = !flipx;
diff --git a/src/mame/video/cninja.c b/src/mame/video/cninja.c
index a7e9d3bb61a..34f5191866c 100644
--- a/src/mame/video/cninja.c
+++ b/src/mame/video/cninja.c
@@ -196,7 +196,7 @@ static void cninja_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=240-x;
if (fx) fx=0; else fx=1;
@@ -264,7 +264,7 @@ static void robocop2_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=304-x;
if (fx) fx=0; else fx=1;
@@ -354,7 +354,7 @@ static void mutantf_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
fx = (spriteptr[offs+0]&0x4000);
fy = (spriteptr[offs+0]&0x8000);
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
if (fx) fx=0; else fx=1;
if (fy) fy=0; else fy=1;
@@ -397,7 +397,7 @@ static void mutantf_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
VIDEO_UPDATE( cninja )
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
@@ -415,7 +415,7 @@ VIDEO_UPDATE( cninja )
VIDEO_UPDATE( edrandy )
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
@@ -446,7 +446,7 @@ VIDEO_UPDATE( robocop2 )
}
/* Update playfields */
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
@@ -482,7 +482,7 @@ VIDEO_UPDATE( robocop2 )
VIDEO_UPDATE( mutantf )
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
diff --git a/src/mame/video/commando.c b/src/mame/video/commando.c
index dd2b2e2c33a..884b784ae1d 100644
--- a/src/mame/video/commando.c
+++ b/src/mame/video/commando.c
@@ -62,7 +62,7 @@ WRITE8_HANDLER( commando_c804_w )
cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
// bit 7 flips screen
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -112,7 +112,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = buffered_spriteram[offs + 3] - ((attr & 0x01) << 8);
int sy = buffered_spriteram[offs + 2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/cop01.c b/src/mame/video/cop01.c
index 9c13eaee5ae..0e89a893e5b 100644
--- a/src/mame/video/cop01.c
+++ b/src/mame/video/cop01.c
@@ -154,7 +154,7 @@ WRITE8_HANDLER( cop01_vreg_w )
{
coin_counter_w(0,data & 1);
coin_counter_w(1,data & 2);
- flip_screen_set(data & 4);
+ flip_screen_set(space->machine, data & 4);
}
}
@@ -185,7 +185,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = (spriteram[offs+3] - 0x80) + 256 * (attr & 0x01);
sy = 240 - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c
index 303f7e8d385..d96fb894f13 100644
--- a/src/mame/video/cosmic.c
+++ b/src/mame/video/cosmic.c
@@ -266,7 +266,7 @@ static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectan
{
if (data & 0x80)
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
*BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen;
else
*BITMAP_ADDR16(bitmap, y, x) = pen;
@@ -332,7 +332,7 @@ static void cosmica_draw_starfield(const device_config *screen, bitmap_t *bitmap
UINT8 x1;
int hc, hb_;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
x1 = x - video_screen_get_frame_number(screen);
else
x1 = x + video_screen_get_frame_number(screen);
@@ -403,7 +403,7 @@ static void devzone_draw_grid(running_machine *machine, bitmap_t *bitmap, const
if (!(vert_data & horz_data & 0x80)) /* NAND gate */
{
/* blue */
- if (flip_screen_get())
+ if (flip_screen_get(machine))
*BITMAP_ADDR16(bitmap, 255-y, 255-x) = 4;
else
*BITMAP_ADDR16(bitmap, y, x) = 4;
@@ -488,7 +488,7 @@ static void nomnlnd_draw_background(const device_config *screen, bitmap_t *bitma
if (!hd_ & hc_ & !hb_)
{
offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) |
- (flip_screen_get() ? 0x80 : 0);
+ (flip_screen_get(screen->machine) ? 0x80 : 0);
UINT8 plane1 = PROM[offs ] << (x & 0x07);
UINT8 plane2 = PROM[offs | 0x0400] << (x & 0x07);
@@ -522,7 +522,7 @@ static void nomnlnd_draw_background(const device_config *screen, bitmap_t *bitma
if (color != 0)
{
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
*BITMAP_ADDR16(bitmap, 255-y, 255-x) = color;
else
*BITMAP_ADDR16(bitmap, y, x) = color;
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index e2fd0d21172..f4e2f5493fe 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -2210,7 +2210,7 @@ static void cps1_render_sprites(running_machine *machine, bitmap_t *bitmap, cons
{
#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \
{ \
- if (flip_screen_get()) \
+ if (flip_screen_get(machine)) \
pdrawgfx(bitmap,machine->gfx[2], \
CODE, \
COLOR, \
@@ -2446,7 +2446,7 @@ static void cps2_render_sprites(running_machine *machine, bitmap_t *bitmap,const
{
#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \
{ \
- if (flip_screen_get()) \
+ if (flip_screen_get(machine)) \
pdrawgfx(bitmap,machine->gfx[2], \
CODE, \
COLOR, \
@@ -2613,7 +2613,7 @@ static void cps1_render_stars(const device_config *screen, bitmap_t *bitmap,cons
int sy = (offs % 256);
sx = (sx - stars2x + (col & 0x1f)) & 0x1ff;
sy = (sy - stars2y) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 511 - sx;
sy = 255 - sy;
@@ -2639,7 +2639,7 @@ static void cps1_render_stars(const device_config *screen, bitmap_t *bitmap,cons
int sy = (offs % 256);
sx = (sx - stars1x + (col & 0x1f)) & 0x1ff;
sy = (sy - stars1y) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 511 - sx;
sy = 255 - sy;
@@ -2699,7 +2699,7 @@ VIDEO_UPDATE( cps1 )
int videocontrol = cps1_cps_a_regs[CPS1_VIDEOCONTROL];
- flip_screen_set(videocontrol & 0x8000);
+ flip_screen_set(screen->machine, videocontrol & 0x8000);
layercontrol = cps1_cps_b_regs[cps1_game_config->layer_control/2];
diff --git a/src/mame/video/crbaloon.c b/src/mame/video/crbaloon.c
index f47debd432e..6848379c5e2 100644
--- a/src/mame/video/crbaloon.c
+++ b/src/mame/video/crbaloon.c
@@ -108,7 +108,7 @@ static void draw_sprite_and_check_collision(running_machine *machine, bitmap_t *
UINT8 *gfx = memory_region(machine, "gfx2") + (code << 7);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
sy += 32;
/* assume no collision */
diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c
index 28001ecac5c..44c74ebb70f 100644
--- a/src/mame/video/cvs.c
+++ b/src/mame/video/cvs.c
@@ -361,10 +361,10 @@ VIDEO_UPDATE( cvs )
if ((y & 1) ^ ((x >> 4) & 1))
{
- if (flip_screen_x_get())
+ if (flip_screen_x_get(screen->machine))
x = ~x;
- if (flip_screen_y_get())
+ if (flip_screen_y_get(screen->machine))
y = ~y;
if ((y >= cliprect->min_y) && (y <= cliprect->max_y) &&
diff --git a/src/mame/video/dassault.c b/src/mame/video/dassault.c
index 3cacb0a66e3..046f403e6e1 100644
--- a/src/mame/video/dassault.c
+++ b/src/mame/video/dassault.c
@@ -71,7 +71,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=304-x;
if (fx) fx=0; else fx=1;
@@ -166,7 +166,7 @@ VIDEO_START( dassault )
VIDEO_UPDATE( dassault )
{
/* Update tilemaps */
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
diff --git a/src/mame/video/ddragon.c b/src/mame/video/ddragon.c
index a9615c09826..dc3babf3105 100644
--- a/src/mame/video/ddragon.c
+++ b/src/mame/video/ddragon.c
@@ -203,7 +203,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
which = src[i+3] + ( ( src[i+2] & 0x0f ) << 8 );
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 256 - sy;
diff --git a/src/mame/video/ddragon3.c b/src/mame/video/ddragon3.c
index 1ac501e05db..0b3e79bfc26 100644
--- a/src/mame/video/ddragon3.c
+++ b/src/mame/video/ddragon3.c
@@ -28,7 +28,7 @@ WRITE16_HANDLER( ddragon3_scroll16_w )
case 2: COMBINE_DATA(&ddragon3_bg_scrollx); break; // Scroll X, BG0
case 3: COMBINE_DATA(&ddragon3_bg_scrolly); break; // Scroll Y, BG0
case 4: break; // Unknown write
- case 5: flip_screen_set(data & 0x01); break; // Flip Screen
+ case 5: flip_screen_set(space->machine, data & 0x01); break; // Flip Screen
case 6:
COMBINE_DATA(&ddragon3_bg_tilebase); // BG Tile Base
ddragon3_bg_tilebase &= 0x1ff;
@@ -45,7 +45,7 @@ READ16_HANDLER( ddragon3_scroll16_r )
case 1: return ddragon3_fg_scrolly;
case 2: return ddragon3_bg_scrollx;
case 3: return ddragon3_bg_scrolly;
- case 5: return flip_screen_get();
+ case 5: return flip_screen_get(space->machine);
case 6: return ddragon3_bg_tilebase;
}
@@ -153,7 +153,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
if (attr & 0x02) sy = 239 + (0x100 - sy); else sy = 240 - sy;
if (sx > 0x17f) sx = 0 - (0x200 - sx);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 304 - sx;
sy = 224 - sy;
@@ -164,7 +164,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
for (i = 0; i <= height; i++)
{
drawgfx(bitmap, machine->gfx[1], code + i, color, flipx, flipy,
- sx, sy + (flip_screen_get() ? (i * 16) : (-i * 16)), cliprect,
+ sx, sy + (flip_screen_get(machine) ? (i * 16) : (-i * 16)), cliprect,
TRANSPARENCY_PEN, 0);
}
}
diff --git a/src/mame/video/deadang.c b/src/mame/video/deadang.c
index 90ffee907e1..d059b1f6a25 100644
--- a/src/mame/video/deadang.c
+++ b/src/mame/video/deadang.c
@@ -108,7 +108,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color = (spriteram16[offs+1]>>12)&0xf;
sprite = spriteram16[offs+1]&0xfff;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
x=240-x;
y=240-y;
if (fx) fx=0; else fx=1;
@@ -145,7 +145,7 @@ VIDEO_UPDATE( deadang )
tilemap_set_enable(pf3_layer,!(deadang_scroll_ram[0x34]&1));
tilemap_set_enable(pf1_layer,!(deadang_scroll_ram[0x34]&2));
tilemap_set_enable(pf2_layer,!(deadang_scroll_ram[0x34]&4));
- flip_screen_set( deadang_scroll_ram[0x34]&0x40 );
+ flip_screen_set(screen->machine, deadang_scroll_ram[0x34]&0x40 );
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
bitmap_fill(priority_bitmap,cliprect,0);
diff --git a/src/mame/video/dec0.c b/src/mame/video/dec0.c
index ab1419b55f1..9e1663bbf07 100644
--- a/src/mame/video/dec0.c
+++ b/src/mame/video/dec0.c
@@ -190,7 +190,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=240-x;
if (fx) fx=0; else fx=1;
@@ -215,7 +215,8 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
/******************************************************************************/
-static void custom_tilemap_draw(bitmap_t *bitmap,
+static void custom_tilemap_draw(running_machine *machine,
+ bitmap_t *bitmap,
const rectangle *cliprect,
tilemap *tilemap_ptr,
const UINT16 *rowscroll_ptr,
@@ -255,7 +256,7 @@ static void custom_tilemap_draw(bitmap_t *bitmap,
doesn't affect any games.
*/
- if (flip_screen_get())
+ if (flip_screen_get(machine))
src_y = (src_bitmap->height - 256) - scrolly;
else
src_y = scrolly;
@@ -266,7 +267,7 @@ static void custom_tilemap_draw(bitmap_t *bitmap,
else
src_x=scrollx;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
src_x=(src_bitmap->width - 256) - src_x;
for (x=0; x<=cliprect->max_x; x++) {
@@ -294,50 +295,50 @@ static void custom_tilemap_draw(bitmap_t *bitmap,
/******************************************************************************/
-static void dec0_pf1_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags)
+static void dec0_pf1_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags)
{
switch (dec0_pf1_control_0[3]&0x3) {
case 0: /* 4x1 */
- custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_0,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_0,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
break;
case 1: /* 2x2 */
default:
- custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_1,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_1,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
break;
case 2: /* 1x4 */
- custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_2,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_2,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
break;
};
}
-static void dec0_pf2_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags)
+static void dec0_pf2_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags)
{
switch (dec0_pf2_control_0[3]&0x3) {
case 0: /* 4x1 */
- custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_0,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_0,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
break;
case 1: /* 2x2 */
default:
- custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_1,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_1,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
break;
case 2: /* 1x4 */
- custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_2,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_2,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
break;
};
}
-static void dec0_pf3_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags)
+static void dec0_pf3_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags)
{
switch (dec0_pf3_control_0[3]&0x3) {
case 0: /* 4x1 */
- custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_0,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_0,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
break;
case 1: /* 2x2 */
default:
- custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_1,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_1,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
break;
case 2: /* 1x4 */
- custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_2,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
+ custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_2,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
break;
};
}
@@ -346,16 +347,16 @@ static void dec0_pf3_draw(bitmap_t *bitmap,const rectangle *cliprect,int flags)
VIDEO_UPDATE( hbarrel )
{
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
draw_sprites(screen->machine,bitmap,cliprect,0x08,0x08);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
/* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
draw_sprites(screen->machine,bitmap,cliprect,0x08,0x00);
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
@@ -363,37 +364,37 @@ VIDEO_UPDATE( hbarrel )
VIDEO_UPDATE( baddudes )
{
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
/* WARNING: inverted wrt Midnight Resistance */
if ((dec0_pri & 0x01) == 0)
{
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
- dec0_pf3_draw(bitmap,cliprect,0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,0);
if (dec0_pri & 2)
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
if (dec0_pri & 4)
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
}
else
{
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
if (dec0_pri & 2)
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
if (dec0_pri & 4)
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
}
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
@@ -403,7 +404,7 @@ VIDEO_UPDATE( robocop )
{
int trans;
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
if (dec0_pri & 0x04)
trans = 0x08;
@@ -416,21 +417,21 @@ VIDEO_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) */
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE);
if (dec0_pri & 0x02)
draw_sprites(screen->machine,bitmap,cliprect,0x08,trans);
- dec0_pf3_draw(bitmap,cliprect,0);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,0);
}
else
{
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
if (dec0_pri & 0x02)
draw_sprites(screen->machine,bitmap,cliprect,0x08,trans);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
}
if (dec0_pri & 0x02)
@@ -438,7 +439,7 @@ VIDEO_UPDATE( robocop )
else
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
@@ -446,14 +447,14 @@ VIDEO_UPDATE( robocop )
VIDEO_UPDATE( birdtry )
{
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
/* 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]);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
@@ -461,21 +462,21 @@ VIDEO_UPDATE( birdtry )
VIDEO_UPDATE( hippodrm )
{
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
if (dec0_pri & 0x01)
{
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
- dec0_pf3_draw(bitmap,cliprect,0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,0);
}
else
{
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
}
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
@@ -483,18 +484,18 @@ VIDEO_UPDATE( hippodrm )
VIDEO_UPDATE( slyspy )
{
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
/* Redraw top 8 pens of top 8 palettes over sprites */
if (dec0_pri&0x80)
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0);
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
@@ -504,7 +505,7 @@ VIDEO_UPDATE( midres )
{
int trans;
- flip_screen_set(dec0_pf1_control_0[0]&0x80);
+ flip_screen_set(screen->machine, dec0_pf1_control_0[0]&0x80);
if (dec0_pri & 0x04)
trans = 0x00;
@@ -512,21 +513,21 @@ VIDEO_UPDATE( midres )
if (dec0_pri & 0x01)
{
- dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
if (dec0_pri & 0x02)
draw_sprites(screen->machine,bitmap,cliprect,0x08,trans);
- dec0_pf3_draw(bitmap,cliprect,0);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,0);
}
else
{
- dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
+ dec0_pf3_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
if (dec0_pri & 0x02)
draw_sprites(screen->machine,bitmap,cliprect,0x08,trans);
- dec0_pf2_draw(bitmap,cliprect,0);
+ dec0_pf2_draw(screen->machine,bitmap,cliprect,0);
}
if (dec0_pri & 0x02)
@@ -534,7 +535,7 @@ VIDEO_UPDATE( midres )
else
draw_sprites(screen->machine,bitmap,cliprect,0x00,0x00);
- dec0_pf1_draw(bitmap,cliprect,0);
+ dec0_pf1_draw(screen->machine,bitmap,cliprect,0);
return 0;
}
diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c
index 87c95f45fff..434c2e634a2 100644
--- a/src/mame/video/dec8.c
+++ b/src/mame/video/dec8.c
@@ -276,7 +276,7 @@ static void draw_sprites1(running_machine* machine, bitmap_t *bitmap, const rect
y=(y+16)%0x200;
x=256 - x;
y=256 - y;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=240-x;
if (fx) fx=0; else fx=1;
@@ -348,7 +348,7 @@ static void draw_sprites2(running_machine* machine, bitmap_t *bitmap, const rect
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
y=240-y;
x=240-x;
if (fx) fx=0; else fx=1;
@@ -394,7 +394,7 @@ static void srdarwin_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
fx = buffered_spriteram[offs+1] & 0x04;
multi = buffered_spriteram[offs+1] & 0x10;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sy=240-sy;
sx=240-sx;
if (fx) fx=0; else fx=1;
@@ -405,14 +405,14 @@ static void srdarwin_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
drawgfx(bitmap,machine->gfx[1],
code,
color,
- fx,flip_screen_get(),
+ fx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
if (multi)
drawgfx(bitmap,machine->gfx[1],
code+1,
color,
- fx,flip_screen_get(),
+ fx,flip_screen_get(machine),
sx,sy2,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -448,7 +448,7 @@ VIDEO_UPDATE( cobracom )
tilemap_set_scrolly( dec8_pf0_tilemap,0, (dec8_pf0_control[0x12]<<8)+dec8_pf0_control[0x13] );
tilemap_set_scrollx( dec8_pf1_tilemap,0, (dec8_pf1_control[0x10]<<8)+dec8_pf1_control[0x11] );
tilemap_set_scrolly( dec8_pf1_tilemap,0, (dec8_pf1_control[0x12]<<8)+dec8_pf1_control[0x13] );
- flip_screen_set(dec8_pf0_control[0]>>7);
+ flip_screen_set(screen->machine, dec8_pf0_control[0]>>7);
tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,0,0);
draw_sprites2(screen->machine,bitmap,cliprect,1);
@@ -573,7 +573,7 @@ VIDEO_UPDATE( oscar )
{
tilemap_set_scrollx( dec8_pf0_tilemap,0, (dec8_pf0_control[0x10]<<8)+dec8_pf0_control[0x11] );
tilemap_set_scrolly( dec8_pf0_tilemap,0, (dec8_pf0_control[0x12]<<8)+dec8_pf0_control[0x13] );
- flip_screen_set(dec8_pf0_control[1]>>7);
+ flip_screen_set(screen->machine, dec8_pf0_control[1]>>7);
tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 0,0);
tilemap_draw(bitmap,cliprect,dec8_pf0_tilemap,TILEMAP_DRAW_LAYER1 | 1,0);
diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c
index 53429085fe8..23af89ccfe5 100644
--- a/src/mame/video/deco32.c
+++ b/src/mame/video/deco32.c
@@ -240,7 +240,7 @@ static void captaven_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
fx = !(spritedata[offs+0]&0x4000);
fy = !(spritedata[offs+0]&0x8000);
- if (!flip_screen_get()) {
+ if (!flip_screen_get(machine)) {
sx = sx & 0x01ff;
sy = sy & 0x01ff;
if (sx>0x180) sx=-(0x200 - sx);
@@ -1218,8 +1218,8 @@ VIDEO_UPDATE( captaven )
int pf1_enable,pf2_enable,pf3_enable;
static int last_pf3_bank;
- flip_screen_set(deco32_pf12_control[0]&0x80);
- tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ flip_screen_set(screen->machine, deco32_pf12_control[0]&0x80);
+ tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
deco32_setup_scroll(pf1_tilemap, 256,(deco32_pf12_control[5]>>0)&0xff,(deco32_pf12_control[6]>>0)&0xff,deco32_pf12_control[2],deco32_pf12_control[1],deco32_pf1_rowscroll,deco32_pf1_rowscroll+0x200);
deco32_setup_scroll(pf1a_tilemap,512,(deco32_pf12_control[5]>>0)&0xff,(deco32_pf12_control[6]>>0)&0xff,deco32_pf12_control[2],deco32_pf12_control[1],deco32_pf1_rowscroll,deco32_pf1_rowscroll+0x200);
diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c
index ab23104315d..2b39997b097 100644
--- a/src/mame/video/decocass.c
+++ b/src/mame/video/decocass.c
@@ -427,7 +427,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
flipx = sprite_ram[offs + 0] & 0x04;
flipy = sprite_ram[offs + 0] & 0x02;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy + sprite_y_adjust_flip_screen;
@@ -445,7 +445,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
sx,sy,
cliprect, TRANSPARENCY_PEN, 0);
- sy += (flip_screen_get() ? -256 : 256);
+ sy += (flip_screen_get(machine) ? -256 : 256);
// Wrap around
drawgfx(bitmap,machine->gfx[1],
@@ -458,7 +458,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
}
-static void draw_missiles(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)
{
@@ -472,7 +472,7 @@ static void draw_missiles(bitmap_t *bitmap, const rectangle *cliprect,
sy = 255 - missile_ram[offs + 0*interleave];
sx = 255 - missile_ram[offs + 2*interleave];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy + missile_y_adjust_flip_screen;
@@ -488,7 +488,7 @@ static void draw_missiles(bitmap_t *bitmap, const rectangle *cliprect,
sy = 255 - missile_ram[offs + 1*interleave];
sx = 255 - missile_ram[offs + 3*interleave];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy + missile_y_adjust_flip_screen;
@@ -708,7 +708,7 @@ VIDEO_UPDATE( decocass )
}
tilemap_draw(bitmap,cliprect, fg_tilemap, 0, 0);
draw_sprites(screen->machine,bitmap,cliprect, (color_center_bot >> 1) & 1, 0, 0, decocass_fgvideoram, 0x20);
- draw_missiles(bitmap,cliprect, 1, 0, decocass_colorram, 0x20);
+ draw_missiles(screen->machine,bitmap,cliprect, 1, 0, decocass_colorram, 0x20);
return 0;
}
diff --git a/src/mame/video/dietgo.c b/src/mame/video/dietgo.c
index cda376b577a..b3d87b895e7 100644
--- a/src/mame/video/dietgo.c
+++ b/src/mame/video/dietgo.c
@@ -41,7 +41,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -80,7 +80,7 @@ VIDEO_START(dietgo)
VIDEO_UPDATE(dietgo)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,256); /* not verified */
diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c
index 162867b0a98..6649a160e1d 100644
--- a/src/mame/video/digdug.c
+++ b/src/mame/video/digdug.c
@@ -134,9 +134,9 @@ static TILE_GET_INFO( tx_get_tile_info )
characters when screen is flipped, we have to flip them back. */
SET_TILE_INFO(
0,
- (code & 0x7f) | (flip_screen_get() ? 0x80 : 0),
+ (code & 0x7f) | (flip_screen_get(machine) ? 0x80 : 0),
color,
- flip_screen_get() ? TILE_FLIPX : 0);
+ flip_screen_get(machine) ? TILE_FLIPX : 0);
}
@@ -235,7 +235,7 @@ WRITE8_HANDLER( digdug_PORT_w )
break;
case 7: /* FLIP */
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
break;
}
}
@@ -280,7 +280,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
sy -= 16 * size;
sy = (sy & 0xff) - 32; // fix wraparound
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
diff --git a/src/mame/video/docastle.c b/src/mame/video/docastle.c
index 96033ba8d2d..61a116647d8 100644
--- a/src/mame/video/docastle.c
+++ b/src/mame/video/docastle.c
@@ -77,27 +77,27 @@ WRITE8_HANDLER( docastle_colorram_w )
READ8_HANDLER( docastle_flipscreen_off_r )
{
- flip_screen_set(0);
+ flip_screen_set(space->machine, 0);
tilemap_mark_all_tiles_dirty(docastle_tilemap);
return 0;
}
READ8_HANDLER( docastle_flipscreen_on_r )
{
- flip_screen_set(1);
+ flip_screen_set(space->machine, 1);
tilemap_mark_all_tiles_dirty(docastle_tilemap);
return 1;
}
WRITE8_HANDLER( docastle_flipscreen_off_w )
{
- flip_screen_set(0);
+ flip_screen_set(space->machine, 0);
tilemap_mark_all_tiles_dirty(docastle_tilemap);
}
WRITE8_HANDLER( docastle_flipscreen_on_w )
{
- flip_screen_set(1);
+ flip_screen_set(space->machine, 1);
tilemap_mark_all_tiles_dirty(docastle_tilemap);
}
@@ -188,7 +188,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = spriteram[offs + 2] & 0x80;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c
index 45e9a31fb66..c5554e6599f 100644
--- a/src/mame/video/dogfgt.c
+++ b/src/mame/video/dogfgt.c
@@ -128,7 +128,7 @@ static WRITE8_HANDLER( internal_bitmapram_w )
for (i = 0;i < 3;i++)
color |= ((bitmapram[offset + BITMAPRAM_SIZE/3 * i] >> subx) & 1) << i;
- if (flip_screen_get())
+ if (flip_screen_get(space->machine))
*BITMAP_ADDR16(pixbitmap, y^0xff, (x+subx)^0xff) = PIXMAP_COLOR_BASE + 8*pixcolor + color;
else
*BITMAP_ADDR16(pixbitmap, y, x+subx) = PIXMAP_COLOR_BASE + 8*pixcolor + color;
@@ -172,7 +172,7 @@ WRITE8_HANDLER( dogfgt_1800_w )
coin_counter_w(1,data & 0x20);
/* bit 7 is screen flip */
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
/* other bits unused? */
logerror("PC %04x: 1800 = %02x\n",cpu_get_pc(space->cpu),data);
@@ -199,7 +199,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sy = (240 - spriteram[offs+2]) & 0xff;
flipx = spriteram[offs] & 0x04;
flipy = spriteram[offs] & 0x02;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -224,11 +224,11 @@ VIDEO_UPDATE( dogfgt )
int offs;
- if (lastflip != flip_screen_get() || lastpixcolor != pixcolor)
+ if (lastflip != flip_screen_get(screen->machine) || lastpixcolor != pixcolor)
{
const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
- lastflip = flip_screen_get();
+ lastflip = flip_screen_get(screen->machine);
lastpixcolor = pixcolor;
for (offs = 0;offs < BITMAPRAM_SIZE;offs++)
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index d0c69bd6a5b..d3b9a6e7975 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -141,13 +141,13 @@ WRITE8_HANDLER( lastday_ctrl_w )
sprites_disabled = data & 0x10;
/* bit 6 is flip screen */
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
}
WRITE8_HANDLER( pollux_ctrl_w )
{
/* bit 0 is flip screen */
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
/* bits 6 and 7 are coin counters */
coin_counter_w(0, data & 0x80);
@@ -169,7 +169,7 @@ WRITE8_HANDLER( primella_ctrl_w )
tx_pri = data & 0x08;
/* bit 4 flips screen */
- flip_screen_set(data & 0x10);
+ flip_screen_set(space->machine, data & 0x10);
/* bit 5 used but unknown */
@@ -179,7 +179,7 @@ WRITE8_HANDLER( primella_ctrl_w )
WRITE8_HANDLER( flytiger_ctrl_w )
{
/* bit 0 is flip screen */
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
/* bits 1, 2, 3 used but unknown */
@@ -192,7 +192,7 @@ WRITE16_HANDLER( rshark_ctrl_w )
if (ACCESSING_BITS_0_7)
{
/* bit 0 flips screen */
- flip_screen_set(data & 0x0001);
+ flip_screen_set(space->machine, data & 0x0001);
/* bit 4 changes tilemaps priority */
rshark_pri = data & 0x0010;
@@ -414,7 +414,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 498 - sx;
sy = 240 - (16 * height) - sy;
@@ -476,7 +476,7 @@ static void rshark_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
width = buffered_spriteram16[offs+1] & 0x000f;
height = (buffered_spriteram16[offs+1] & 0x00f0) >> 4;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 498 - (16 * width) - sx;
sy = 240 - (16 * height) - sy;
diff --git a/src/mame/video/drmicro.c b/src/mame/video/drmicro.c
index afebf0cc6f8..d0baebde7ee 100644
--- a/src/mame/video/drmicro.c
+++ b/src/mame/video/drmicro.c
@@ -17,10 +17,10 @@ static tilemap *drmicro_bg2;
/****************************************************************************/
-void drmicro_flip_w( int flip )
+void drmicro_flip_w( running_machine *machine, int flip )
{
flipscreen = flip ? 1 : 0;
- flip_screen_set(flip);
+ flip_screen_set(machine, flip);
}
WRITE8_HANDLER( drmicro_videoram_w )
diff --git a/src/mame/video/dynduke.c b/src/mame/video/dynduke.c
index ca4bdb9f3f3..bdd5c120b21 100644
--- a/src/mame/video/dynduke.c
+++ b/src/mame/video/dynduke.c
@@ -127,7 +127,7 @@ WRITE16_HANDLER( dynduke_control_w )
if (data&0x4) txt_enable = 0; else txt_enable = 1;
if (data&0x8) sprite_enable=0; else sprite_enable=1;
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
}
}
@@ -154,7 +154,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sprite = buffered_spriteram16[offs+1];
sprite &= 0x3fff;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
x=240-x;
y=240-y;
if (fx) fx=0; else fx=1;
diff --git a/src/mame/video/equites.c b/src/mame/video/equites.c
index f5f79e641e9..552aaacd0bf 100644
--- a/src/mame/video/equites.c
+++ b/src/mame/video/equites.c
@@ -212,18 +212,18 @@ WRITE16_HANDLER(splndrbt_selchar1_w)
WRITE16_HANDLER(equites_flip0_w)
{
- flip_screen_set(0);
+ flip_screen_set(space->machine, 0);
}
WRITE16_HANDLER(equites_flip1_w)
{
- flip_screen_set(1);
+ flip_screen_set(space->machine, 1);
}
WRITE16_HANDLER(splndrbt_flip0_w)
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(0);
+ flip_screen_set(space->machine, 0);
if (ACCESSING_BITS_8_15)
bgcolor = data >> 8;
@@ -232,7 +232,7 @@ WRITE16_HANDLER(splndrbt_flip0_w)
WRITE16_HANDLER(splndrbt_flip1_w)
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(1);
+ flip_screen_set(space->machine, 1);
}
WRITE16_HANDLER(splndrbt_bg_scrollx_w)
@@ -269,7 +269,7 @@ static void equites_draw_sprites_block(running_machine *machine, bitmap_t *bitma
int sy = (spriteram16[offs] & 0x00ff);
int transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -357,7 +357,7 @@ static void splndrbt_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
sy += 16;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
// sx NOT inverted
fx = fx ^ 1;
@@ -409,11 +409,11 @@ static void splndrbt_copy_bg(running_machine *machine, bitmap_t *dst_bitmap, con
const UINT8 * const yrom = xrom + 0x2000;
int scroll_x = splndrbt_bg_scrollx;
int scroll_y = splndrbt_bg_scrolly;
- int const dinvert = flip_screen_get() ? 0xff : 0x00;
+ int const dinvert = flip_screen_get(machine) ? 0xff : 0x00;
int src_y = 0;
int dst_y;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
scroll_x = -scroll_x - 8;
scroll_y = -scroll_y;
diff --git a/src/mame/video/esd16.c b/src/mame/video/esd16.c
index d8e0b2117a5..ae37edd8e4e 100644
--- a/src/mame/video/esd16.c
+++ b/src/mame/video/esd16.c
@@ -130,7 +130,7 @@ WRITE16_HANDLER( esd16_tilemap0_color_w )
esd16_tilemap0_color = data & 3;
tilemap_mark_all_tiles_dirty(esdtilemap_0);
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
@@ -233,7 +233,7 @@ static void esd16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
sy = 0x100 - ((sy & 0xff) - (sy & 0x100));
sy -= dimy*16;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{ flipx = !flipx; sx = max_x - sx - 1 * 16 + 2; // small offset
flipy = !flipy; sy = max_y - sy - dimy * 16; }
@@ -292,7 +292,7 @@ static void hedpanic_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
sy = 0x1ff-sy;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{ flipx = !flipx; sx = max_x - sx - 1 * 16 + 2; // small offset
flipy = !flipy; sy = max_y - sy - dimy * 16; }
diff --git a/src/mame/video/exprraid.c b/src/mame/video/exprraid.c
index 2a84f119897..103b5c3a1f2 100644
--- a/src/mame/video/exprraid.c
+++ b/src/mame/video/exprraid.c
@@ -18,9 +18,9 @@ WRITE8_HANDLER( exprraid_colorram_w )
WRITE8_HANDLER( exprraid_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -106,7 +106,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = ((248 - spriteram[offs + 2]) & 0xff) - 8;
int sy = spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -127,7 +127,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[1],
code + 1, color,
flipx, flipy,
- sx, sy + (flip_screen_get() ? -16 : 16),
+ sx, sy + (flip_screen_get(machine) ? -16 : 16),
cliprect, TRANSPARENCY_PEN, 0);
}
}
diff --git a/src/mame/video/exzisus.c b/src/mame/video/exzisus.c
index f5f741cfb9a..484a9eef48c 100644
--- a/src/mame/video/exzisus.c
+++ b/src/mame/video/exzisus.c
@@ -138,7 +138,7 @@ VIDEO_UPDATE( exzisus )
x = (sx + (xc << 3)) & 0xff;
y = (sy + (yc << 3)) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
x = 248 - x;
y = 248 - y;
@@ -147,7 +147,7 @@ VIDEO_UPDATE( exzisus )
drawgfx(bitmap, screen->machine->gfx[0],
code & 0x3fff,
color,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(screen->machine), flip_screen_get(screen->machine),
x, y,
cliprect, TRANSPARENCY_PEN, 15);
goffs += 2;
@@ -208,7 +208,7 @@ VIDEO_UPDATE( exzisus )
x = (sx + (xc << 3)) & 0xff;
y = (sy + (yc << 3)) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
x = 248 - x;
y = 248 - y;
@@ -217,7 +217,7 @@ VIDEO_UPDATE( exzisus )
drawgfx(bitmap, screen->machine->gfx[1],
code & 0x3fff,
color,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(screen->machine), flip_screen_get(screen->machine),
x, y,
cliprect, TRANSPARENCY_PEN, 15);
goffs += 2;
diff --git a/src/mame/video/fastfred.c b/src/mame/video/fastfred.c
index 83af5dedffa..0425d49f3d0 100644
--- a/src/mame/video/fastfred.c
+++ b/src/mame/video/fastfred.c
@@ -219,21 +219,21 @@ WRITE8_HANDLER( fastfred_colorbank2_w )
WRITE8_HANDLER( fastfred_flip_screen_x_w )
{
- if (flip_screen_x_get() != (data & 0x01))
+ if (flip_screen_x_get(space->machine) != (data & 0x01))
{
- flip_screen_x_set(data & 0x01);
+ flip_screen_x_set(space->machine, data & 0x01);
- tilemap_set_flip(bg_tilemap, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | (flip_screen_y_get() ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip(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 )
{
- if (flip_screen_y_get() != (data & 0x01))
+ if (flip_screen_y_get(space->machine) != (data & 0x01))
{
- flip_screen_y_set(data & 0x01);
+ flip_screen_y_set(space->machine, data & 0x01);
- tilemap_set_flip(bg_tilemap, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | (flip_screen_y_get() ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip(bg_tilemap, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0));
}
}
@@ -287,12 +287,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
@@ -303,7 +303,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
colorbank | (fastfred_spriteram[offs + 2] & 0x07),
flipx,flipy,
sx,sy,
- flip_screen_x_get() ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0);
+ flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0);
}
}
diff --git a/src/mame/video/finalizr.c b/src/mame/video/finalizr.c
index 3815eea0c01..be52faa2c46 100644
--- a/src/mame/video/finalizr.c
+++ b/src/mame/video/finalizr.c
@@ -127,7 +127,7 @@ VIDEO_UPDATE( finalizr )
if (size >= 0x10) /* 32x32 */
{
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 256 - sx;
sy = 224 - sy;
@@ -162,7 +162,7 @@ VIDEO_UPDATE( finalizr )
}
else
{
- if (flip_screen_get())
+ 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 e8382399e29..c42694f40dd 100644
--- a/src/mame/video/firetrap.c
+++ b/src/mame/video/firetrap.c
@@ -227,7 +227,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color = ((spriteram[offs + 1] & 0x08) >> 2) | (spriteram[offs + 1] & 0x01);
flipx = spriteram[offs + 1] & 0x04;
flipy = spriteram[offs + 1] & 0x02;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -237,7 +237,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (spriteram[offs + 1] & 0x10) /* double width */
{
- if (flip_screen_get()) sy -= 16;
+ if (flip_screen_get(machine)) sy -= 16;
drawgfx(bitmap,machine->gfx[3],
code & ~1,
diff --git a/src/mame/video/flower.c b/src/mame/video/flower.c
index 1ccafdfb7cf..0d167132835 100644
--- a/src/mame/video/flower.c
+++ b/src/mame/video/flower.c
@@ -80,7 +80,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
code |= ((source[2] & 0x01) << 6);
code |= ((source[2] & 0x08) << 4);
- if(flip_screen_get())
+ if(flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
@@ -174,7 +174,7 @@ VIDEO_UPDATE( flower )
draw_sprites(screen->machine,bitmap,cliprect);
- if(flip_screen_get())
+ if(flip_screen_get(screen->machine))
{
myclip.min_x = cliprect->min_x;
myclip.max_x = cliprect->min_x + 15;
@@ -211,5 +211,5 @@ WRITE8_HANDLER( flower_bg1ram_w )
WRITE8_HANDLER( flower_flipscreen_w )
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
}
diff --git a/src/mame/video/flstory.c b/src/mame/video/flstory.c
index ce3120b7822..a4c086f33db 100644
--- a/src/mame/video/flstory.c
+++ b/src/mame/video/flstory.c
@@ -102,7 +102,7 @@ WRITE8_HANDLER( flstory_gfxctrl_w )
}
palette_bank = (data & 0x20) >> 5;
- flip_screen_set(flipscreen);
+ flip_screen_set(space->machine, flipscreen);
//popmessage("%04x: gfxctrl = %02x\n",cpu_get_pc(space->cpu),data);
@@ -124,7 +124,7 @@ WRITE8_HANDLER( victnine_gfxctrl_w )
if (data & 0x04)
{
flipscreen = (data & 0x01);
- flip_screen_set(flipscreen);
+ flip_screen_set(space->machine, flipscreen);
}
//popmessage("%04x: gfxctrl = %02x\n",cpu_get_pc(space->cpu),data);
diff --git a/src/mame/video/freekick.c b/src/mame/video/freekick.c
index ddb01e5aeeb..73ce9468266 100644
--- a/src/mame/video/freekick.c
+++ b/src/mame/video/freekick.c
@@ -44,12 +44,12 @@ static void gigas_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
int flipy = 0;
int color = spriteram[offs + 1] & 0x1f;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
xpos = 240 - xpos;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
ypos = 256 - ypos;
flipy = !flipy;
@@ -79,12 +79,12 @@ static void pbillrd_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
int flipy = 0;//spriteram[offs + 0] & 0x40;
int color = spriteram[offs + 1] & 0x0f;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
xpos = 240 - xpos;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
ypos = 256 - ypos;
flipy = !flipy;
@@ -115,12 +115,12 @@ static void freekick_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
int flipy = spriteram[offs + 2] & 0x40;
int color = spriteram[offs + 2] & 0x1f;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
xpos = 240 - xpos;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
ypos = 256 - ypos;
flipy = !flipy;
diff --git a/src/mame/video/funkybee.c b/src/mame/video/funkybee.c
index 4525b2969fe..2d71964313a 100644
--- a/src/mame/video/funkybee.c
+++ b/src/mame/video/funkybee.c
@@ -65,12 +65,12 @@ WRITE8_HANDLER( funkybee_gfx_bank_w )
WRITE8_HANDLER( funkybee_scroll_w )
{
- tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? -data : data);
+ tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get(space->machine) ? -data : data);
}
WRITE8_HANDLER( funkybee_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -107,7 +107,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = videoram[offs2 + 0x10];
int sy = 224 - colorram[offs2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy += 32;
flipx = !flipx;
@@ -127,7 +127,7 @@ static void draw_columns(running_machine *machine, bitmap_t *bitmap, const recta
for (offs = 0x1f;offs >= 0;offs--)
{
- int const flip = flip_screen_get();
+ int const flip = flip_screen_get(machine);
int code = videoram[0x1c00 + offs];
int color = colorram[0x1f10] & 0x03;
int sx = flip ? videoram[0x1f1f] : videoram[0x1f10];
diff --git a/src/mame/video/funkyjet.c b/src/mame/video/funkyjet.c
index 32dfa6d5af0..2fd18a0ea48 100644
--- a/src/mame/video/funkyjet.c
+++ b/src/mame/video/funkyjet.c
@@ -53,7 +53,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -79,7 +79,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( funkyjet )
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,768);
diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c
index e8f8b854a4a..b524086174c 100644
--- a/src/mame/video/fuukifg2.c
+++ b/src/mame/video/fuukifg2.c
@@ -187,7 +187,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re
sx = (sx & 0x1ff) - (sx & 0x200);
sy = (sy & 0x1ff) - (sy & 0x200);
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{ flipx = !flipx; sx = max_x - sx - xnum * 16;
flipy = !flipy; sy = max_y - sy - ynum * 16; }
@@ -310,12 +310,12 @@ VIDEO_UPDATE( fuuki16 )
tm_middle = pri_table[ fuuki16_priority[0] & 0x0f ][1];
tm_back = pri_table[ fuuki16_priority[0] & 0x0f ][2];
- flip_screen_set(fuuki16_vregs[0x1e/2] & 1);
+ flip_screen_set(screen->machine, fuuki16_vregs[0x1e/2] & 1);
/* Layers scrolling */
- scrolly_offs = fuuki16_vregs[0xc/2] - (flip_screen_get() ? 0x103 : 0x1f3);
- scrollx_offs = fuuki16_vregs[0xe/2] - (flip_screen_get() ? 0x2a7 : 0x3f6);
+ scrolly_offs = fuuki16_vregs[0xc/2] - (flip_screen_get(screen->machine) ? 0x103 : 0x1f3);
+ scrollx_offs = fuuki16_vregs[0xe/2] - (flip_screen_get(screen->machine) ? 0x2a7 : 0x3f6);
layer0_scrolly = fuuki16_vregs[0x0/2] + scrolly_offs;
layer0_scrollx = fuuki16_vregs[0x2/2] + scrollx_offs;
diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c
index bb2c9195dc1..6cbff95dabe 100644
--- a/src/mame/video/fuukifg3.c
+++ b/src/mame/video/fuukifg3.c
@@ -211,7 +211,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re
sx = (sx & 0x1ff) - (sx & 0x200);
sy = (sy & 0x1ff) - (sy & 0x200);
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{ flipx = !flipx; sx = max_x - sx - xnum * 16;
flipy = !flipy; sy = max_y - sy - ynum * 16; }
@@ -341,12 +341,12 @@ VIDEO_UPDATE( fuuki32 )
tm_middle = pri_table[ (fuuki32_priority[0]>>16) & 0x0f ][1];
tm_back = pri_table[ (fuuki32_priority[0]>>16) & 0x0f ][2];
- flip_screen_set((fuuki32_vregs[0x1e/4]&0x0000ffff) & 1);
+ flip_screen_set(screen->machine, (fuuki32_vregs[0x1e/4]&0x0000ffff) & 1);
/* Layers scrolling */
- scrolly_offs = ((fuuki32_vregs[0xc/4]&0xffff0000)>>16) - (flip_screen_get() ? 0x103 : 0x1f3);
- scrollx_offs = (fuuki32_vregs[0xc/4]&0x0000ffff) - (flip_screen_get() ? 0x2c7 : 0x3f6);
+ scrolly_offs = ((fuuki32_vregs[0xc/4]&0xffff0000)>>16) - (flip_screen_get(screen->machine) ? 0x103 : 0x1f3);
+ scrollx_offs = (fuuki32_vregs[0xc/4]&0x0000ffff) - (flip_screen_get(screen->machine) ? 0x2c7 : 0x3f6);
layer0_scrolly = ((fuuki32_vregs[0x0/4]&0xffff0000)>>16) + scrolly_offs;
layer0_scrollx = ((fuuki32_vregs[0x0/4]&0x0000ffff)) + scrollx_offs;
diff --git a/src/mame/video/gaiden.c b/src/mame/video/gaiden.c
index 2daefdd4f9a..1b05af24ccc 100644
--- a/src/mame/video/gaiden.c
+++ b/src/mame/video/gaiden.c
@@ -180,7 +180,7 @@ WRITE16_HANDLER( gaiden_videoram3_w )
WRITE16_HANDLER( gaiden_flip_w )
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
@@ -330,7 +330,7 @@ static void gaiden_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
if (ypos >= 256)
ypos -= 512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
@@ -426,7 +426,7 @@ static void raiga_draw_sprites(running_machine *machine, bitmap_t *bitmap_bg, bi
if (ypos >= 256)
ypos -= 512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
diff --git a/src/mame/video/galaga.c b/src/mame/video/galaga.c
index 8653d224d32..49d9c134603 100644
--- a/src/mame/video/galaga.c
+++ b/src/mame/video/galaga.c
@@ -424,9 +424,9 @@ static TILE_GET_INFO( get_tile_info )
int color = galaga_videoram[tile_index + 0x400] & 0x3f;
SET_TILE_INFO(
0,
- (galaga_videoram[tile_index] & 0x7f) | (flip_screen_get() ? 0x80 : 0) | (galaga_gfxbank << 8),
+ (galaga_videoram[tile_index] & 0x7f) | (flip_screen_get(machine) ? 0x80 : 0) | (galaga_gfxbank << 8),
color,
- flip_screen_get() ? TILE_FLIPX : 0);
+ flip_screen_get(machine) ? TILE_FLIPX : 0);
tileinfo->group = color;
}
@@ -519,7 +519,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy -= 16 * sizey;
sy = (sy & 0xff) - 32; // fix wraparound
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
diff --git a/src/mame/video/galaxold.c b/src/mame/video/galaxold.c
index 0f28a577c27..734245b270d 100644
--- a/src/mame/video/galaxold.c
+++ b/src/mame/video/galaxold.c
@@ -1245,7 +1245,7 @@ static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, co
{
int i, color;
- if (flip_screen_x_get()) x++;
+ if (flip_screen_x_get(machine)) x++;
x = x - 6;
@@ -1416,7 +1416,7 @@ static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap,
int col1 = base + dambustr_bg_color_1;
int col2 = base + dambustr_bg_color_2;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
plot_box(bitmap, 0, 0, 256-dambustr_bg_split_line, 256, col2);
plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col1);
@@ -1429,11 +1429,11 @@ static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap,
}
-static void dambustr_draw_upper_background(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 };
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
clip.min_x = 254 - dambustr_bg_split_line;
clip.max_x = dambustr_bg_split_line;
@@ -1892,7 +1892,7 @@ VIDEO_UPDATE( dambustr )
if (dambustr_bg_priority)
{
/* draw the upper part of the background, as it has priority */
- dambustr_draw_upper_background(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/gaplus.c b/src/mame/video/gaplus.c
index ceedecd652b..e440ec0e1c0 100644
--- a/src/mame/video/gaplus.c
+++ b/src/mame/video/gaplus.c
@@ -290,7 +290,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int duplicate = spriteram_3[offs] & 0x80;
int x,y;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
@@ -319,7 +319,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( gaplus )
{
/* flip screen control is embedded in RAM */
- flip_screen_set(gaplus_spriteram[0x1f7f-0x800] & 1);
+ flip_screen_set(screen->machine, gaplus_spriteram[0x1f7f-0x800] & 1);
bitmap_fill(bitmap, cliprect, 0);
diff --git a/src/mame/video/gberet.c b/src/mame/video/gberet.c
index d7549eb1934..64777cf8a41 100644
--- a/src/mame/video/gberet.c
+++ b/src/mame/video/gberet.c
@@ -153,7 +153,7 @@ static void gberet_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
int flipx = attr & 0x10;
int flipy = attr & 0x20;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -205,7 +205,7 @@ static void gberetb_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
int flipx = attr & 0x10;
int flipy = attr & 0x20;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/gladiatr.c b/src/mame/video/gladiatr.c
index ce7dabdefb6..cf9250446a5 100644
--- a/src/mame/video/gladiatr.c
+++ b/src/mame/video/gladiatr.c
@@ -221,7 +221,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int color = src[1] & 0x1f;
int x,y;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
xflip = !xflip;
yflip = !yflip;
@@ -291,9 +291,9 @@ VIDEO_UPDATE( gladiatr )
int scroll;
scroll = bg_scrollx + ((video_attributes & 0x04) << 6);
- tilemap_set_scrollx(bg_tilemap, 0, scroll ^ (flip_screen_get() ? 0x0f : 0));
+ tilemap_set_scrollx(bg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine) ? 0x0f : 0));
scroll = fg_scrollx + ((video_attributes & 0x08) << 5);
- tilemap_set_scrollx(fg_tilemap, 0, scroll ^ (flip_screen_get() ? 0x0f : 0));
+ tilemap_set_scrollx(fg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine) ? 0x0f : 0));
// always 0 anyway
tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
diff --git a/src/mame/video/gng.c b/src/mame/video/gng.c
index 9bb40a9aa62..be2d123cd24 100644
--- a/src/mame/video/gng.c
+++ b/src/mame/video/gng.c
@@ -103,7 +103,7 @@ WRITE8_HANDLER( gng_bgscrolly_w )
WRITE8_HANDLER( gng_flipscreen_w )
{
- flip_screen_set(~data & 1);
+ flip_screen_set(space->machine, ~data & 1);
}
@@ -128,7 +128,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = attributes & 0x04;
int flipy = attributes & 0x08;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/goindol.c b/src/mame/video/goindol.c
index 4b77f158411..7062f9c0ede 100644
--- a/src/mame/video/goindol.c
+++ b/src/mame/video/goindol.c
@@ -100,7 +100,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = sprite_ram[offs];
sy = 240-sprite_ram[offs+1];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 248 - sx;
sy = 248 - sy;
@@ -115,15 +115,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[gfxbank],
tile,
palette,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy,
cliprect,
TRANSPARENCY_PEN, 0);
drawgfx(bitmap,machine->gfx[gfxbank],
tile+1,
palette,
- flip_screen_get(),flip_screen_get(),
- sx,sy + (flip_screen_get() ? -8 : 8),
+ flip_screen_get(machine),flip_screen_get(machine),
+ sx,sy + (flip_screen_get(machine) ? -8 : 8),
cliprect,
TRANSPARENCY_PEN, 0);
}
diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c
index 87cfc7d716f..069fe6b2a93 100644
--- a/src/mame/video/gottlieb.c
+++ b/src/mame/video/gottlieb.c
@@ -64,16 +64,16 @@ WRITE8_HANDLER( gottlieb_video_control_w )
background_priority = data & 0x01;
/* bit 1 controls horizonal flip screen */
- if (flip_screen_x_get() != (data & 0x02))
+ if (flip_screen_x_get(space->machine) != (data & 0x02))
{
- flip_screen_x_set(data & 0x02);
+ flip_screen_x_set(space->machine, data & 0x02);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
/* bit 2 controls horizonal flip screen */
- if (flip_screen_y_get() != (data & 0x04))
+ if (flip_screen_y_get(space->machine) != (data & 0x04))
{
- flip_screen_y_set(data & 0x04);
+ flip_screen_y_set(space->machine, data & 0x04);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -194,12 +194,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sy = (spriteram[offs]) - 13;
int code = (255 ^ spriteram[offs + 2]) + 256 * spritebank;
- if (flip_screen_x_get()) sx = 233 - sx;
- if (flip_screen_y_get()) sy = 244 - sy;
+ if (flip_screen_x_get(machine)) sx = 233 - sx;
+ if (flip_screen_y_get(machine)) sy = 244 - sy;
drawgfx(bitmap, machine->gfx[2],
code, 0,
- flip_screen_x_get(), flip_screen_y_get(),
+ flip_screen_x_get(machine), flip_screen_y_get(machine),
sx,sy,
&clip,
TRANSPARENCY_PEN, 0);
diff --git a/src/mame/video/gotya.c b/src/mame/video/gotya.c
index 3ca61bcbd54..523a67db533 100644
--- a/src/mame/video/gotya.c
+++ b/src/mame/video/gotya.c
@@ -87,9 +87,9 @@ WRITE8_HANDLER( gotya_video_control_w )
scroll_bit_8 = data & 0x01;
- if (flip_screen_get() != (data & 0x02))
+ if (flip_screen_get(space->machine) != (data & 0x02))
{
- flip_screen_set(data & 0x02);
+ flip_screen_set(space->machine, data & 0x02);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -120,7 +120,7 @@ static void draw_status_row(running_machine *machine, bitmap_t *bitmap, const re
{
int row;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 35 - sx;
}
@@ -129,7 +129,7 @@ static void draw_status_row(running_machine *machine, bitmap_t *bitmap, const re
{
int sy;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = row;
}
@@ -141,7 +141,7 @@ static void draw_status_row(running_machine *machine, bitmap_t *bitmap, const re
drawgfx(bitmap,machine->gfx[0],
gotya_videoram2[row * 32 + col],
gotya_videoram2[row * 32 + col + 0x10] & 0x0f,
- flip_screen_x_get(), flip_screen_y_get(),
+ flip_screen_x_get(machine), flip_screen_y_get(machine),
8 * sx, 8 * sy,
cliprect,
TRANSPARENCY_NONE, 0);
@@ -159,14 +159,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = 256 - spriteram[offs + 0x10] + (spriteram[offs + 0x01] & 0x01) * 256;
int sy = spriteram[offs + 0x00];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = 240 - sy;
}
drawgfx(bitmap,machine->gfx[1],
code, color,
- flip_screen_x_get(), flip_screen_y_get(),
+ flip_screen_x_get(machine), flip_screen_y_get(machine),
sx, sy,
cliprect,
TRANSPARENCY_PEN, 0);
diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c
index 404a626ec29..e09052e46e8 100644
--- a/src/mame/video/gtia.c
+++ b/src/mame/video/gtia.c
@@ -227,7 +227,7 @@ READ8_HANDLER( atari_gtia_r )
case 30: return gtia.r.gtia1e;
case 31:
- gtia.r.cons = gtia.intf.console_read ? (gtia.intf.console_read() & 0x0F) : 0x00;
+ gtia.r.cons = gtia.intf.console_read ? (gtia.intf.console_read(space) & 0x0F) : 0x00;
return gtia.r.cons;
}
return 0xff;
@@ -752,7 +752,7 @@ WRITE8_HANDLER( atari_gtia_w )
break;
gtia.w.cons = data;
if (gtia.intf.console_write)
- gtia.intf.console_write(gtia.w.cons);
+ gtia.intf.console_write(space, gtia.w.cons);
break;
}
}
diff --git a/src/mame/video/gtia.h b/src/mame/video/gtia.h
index d9d3ac58d4a..9555349156d 100644
--- a/src/mame/video/gtia.h
+++ b/src/mame/video/gtia.h
@@ -16,8 +16,8 @@
typedef struct _gtia_interface gtia_interface;
struct _gtia_interface
{
- UINT8 (*console_read)(void);
- void (*console_write)(UINT8 data);
+ UINT8 (*console_read)(const address_space *space);
+ void (*console_write)(const address_space *space, UINT8 data);
};
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index 73fcf8faaf1..a7711f0f3d3 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -1,5 +1,4 @@
#include "driver.h"
-#include "deprecat.h"
#include "cpu/sharc/sharc.h"
#include "machine/konppc.h"
#include "video/poly.h"
@@ -482,11 +481,13 @@ static void draw_scanline(void *dest, INT32 scanline, const poly_extent *extent,
}
}
+static UINT8 *gfxrom;
+
static void draw_scanline_tex(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
const poly_extra_data *extra = extradata;
bitmap_t *destmap = dest;
- UINT8 *texrom = memory_region(Machine, "gfx1") + (extra->texture_page * 0x40000);
+ UINT8 *texrom = gfxrom + (extra->texture_page * 0x40000);
int pal_chip = (extra->texture_palette & 0x8) ? 1 : 0;
int palette_index = (extra->texture_palette & 0x7) * 256;
float z = extent->param[0].start;
@@ -978,6 +979,7 @@ VIDEO_START( gticlub )
tick = 0;
debug_tex_page = 0;
debug_tex_palette = 0;
+ gfxrom = memory_region(machine, "gfx1");
K001006_init(machine);
K001005_init(machine);
diff --git a/src/mame/video/gunsmoke.c b/src/mame/video/gunsmoke.c
index d62b27d50d8..6ecb0a75ebd 100644
--- a/src/mame/video/gunsmoke.c
+++ b/src/mame/video/gunsmoke.c
@@ -88,7 +88,7 @@ WRITE8_HANDLER( gunsmoke_c804_w )
/* bit 5 resets the sound CPU? - we ignore it */
/* bit 6 flips screen */
- flip_screen_set(data & 0x40);
+ flip_screen_set(space->machine, data & 0x40);
/* bit 7 enables characters? */
chon = data & 0x80;
@@ -167,7 +167,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (bank == 3) bank += sprite3bank;
code += 256 * bank;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/hanaawas.c b/src/mame/video/hanaawas.c
index 43dea05dd0d..915916835a0 100644
--- a/src/mame/video/hanaawas.c
+++ b/src/mame/video/hanaawas.c
@@ -75,15 +75,15 @@ WRITE8_HANDLER( hanaawas_colorram_w )
/* dirty both current and next offsets */
tilemap_mark_tile_dirty(bg_tilemap, offset);
- tilemap_mark_tile_dirty(bg_tilemap, (offset + (flip_screen_get() ? -1 : 1)) & 0x03ff);
+ tilemap_mark_tile_dirty(bg_tilemap, (offset + (flip_screen_get(space->machine) ? -1 : 1)) & 0x03ff);
}
WRITE8_HANDLER( hanaawas_portB_w )
{
/* bit 7 is flip screen */
- if (flip_screen_get() != (~data & 0x80))
+ if (flip_screen_get(space->machine) != (~data & 0x80))
{
- flip_screen_set(~data & 0x80);
+ flip_screen_set(space->machine, ~data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -91,7 +91,7 @@ WRITE8_HANDLER( hanaawas_portB_w )
static TILE_GET_INFO( get_bg_tile_info )
{
/* the color is determined by the current color byte, but the bank is via the previous one!!! */
- int offset = (tile_index + (flip_screen_get() ? 1 : -1)) & 0x3ff;
+ int offset = (tile_index + (flip_screen_get(machine) ? 1 : -1)) & 0x3ff;
int attr = colorram[offset];
int gfxbank = (attr & 0x40) >> 6;
int code = videoram[tile_index] + ((attr & 0x20) << 3);
diff --git a/src/mame/video/hexa.c b/src/mame/video/hexa.c
index b93abcc3e08..d2f6e03f016 100644
--- a/src/mame/video/hexa.c
+++ b/src/mame/video/hexa.c
@@ -23,16 +23,16 @@ WRITE8_HANDLER( hexa_d008_w )
int bankaddress;
/* bit 0 = flipx (or y?) */
- if (flip_screen_x_get() != (data & 0x01))
+ if (flip_screen_x_get(space->machine) != (data & 0x01))
{
- flip_screen_x_set(data & 0x01);
+ flip_screen_x_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
/* bit 1 = flipy (or x?) */
- if (flip_screen_y_get() != (data & 0x02))
+ if (flip_screen_y_get(space->machine) != (data & 0x02))
{
- flip_screen_y_set(data & 0x02);
+ flip_screen_y_set(space->machine, data & 0x02);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
diff --git a/src/mame/video/higemaru.c b/src/mame/video/higemaru.c
index e89b9408073..f301c16a56d 100644
--- a/src/mame/video/higemaru.c
+++ b/src/mame/video/higemaru.c
@@ -80,9 +80,9 @@ WRITE8_HANDLER( higemaru_c800_w )
coin_counter_w(1,data & 1);
/* bit 7 flips screen */
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
}
@@ -114,7 +114,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = spriteram[offs + 8];
flipx = spriteram[offs + 4] & 0x10;
flipy = spriteram[offs + 4] & 0x20;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/holeland.c b/src/mame/video/holeland.c
index 6c1d60f431a..c89aa31dd27 100644
--- a/src/mame/video/holeland.c
+++ b/src/mame/video/holeland.c
@@ -97,8 +97,8 @@ WRITE8_HANDLER( holeland_scroll_w )
WRITE8_HANDLER( holeland_flipscreen_w )
{
- if (offset) flip_screen_y_set(data);
- else flip_screen_x_set(data);
+ if (offset) flip_screen_y_set(space->machine, data);
+ else flip_screen_x_set(space->machine, data);
}
@@ -120,13 +120,13 @@ static void holeland_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
flipx = spriteram[offs+3] & 0x04;
flipy = spriteram[offs+3] & 0x08;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
sy = 240 - sy;
@@ -158,13 +158,13 @@ static void crzrally_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
flipx = spriteram[offs+3] & 0x04;
flipy = spriteram[offs+3] & 0x08;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
sy = 240 - sy;
diff --git a/src/mame/video/hyperspt.c b/src/mame/video/hyperspt.c
index 46ceccb73b0..31944fd1dcd 100644
--- a/src/mame/video/hyperspt.c
+++ b/src/mame/video/hyperspt.c
@@ -105,9 +105,9 @@ WRITE8_HANDLER( hyperspt_colorram_w )
WRITE8_HANDLER( hyperspt_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -141,13 +141,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = ~spriteram[offs] & 0x40;
int flipy = spriteram[offs] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
}
- /* Note that this adjustment must be done AFTER handling flip_screen_get(), thus */
+ /* Note that this adjustment must be done AFTER handling flip_screen_get(machine), thus */
/* proving that this is a hardware related "feature" */
sy += 1;
@@ -179,7 +179,7 @@ VIDEO_UPDATE( hyperspt )
for (row = 0; row < 32; row++)
{
int scrollx = hyperspt_scroll[row * 2] + (hyperspt_scroll[(row * 2) + 1] & 0x01) * 256;
- if (flip_screen_get()) scrollx = -scrollx;
+ if (flip_screen_get(screen->machine)) scrollx = -scrollx;
tilemap_set_scrollx(bg_tilemap, row, scrollx);
}
diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c
index 444a30d681b..8f8de2e39b6 100644
--- a/src/mame/video/hyprduel.c
+++ b/src/mame/video/hyprduel.c
@@ -460,7 +460,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
gfxdata = base_gfx + (8*8*4/8) * (((attr & 0x000f) << 16) + code);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx; x = max_x - x - width;
flipy = !flipy; y = max_y - y - height;
@@ -652,7 +652,7 @@ VIDEO_UPDATE( hyprduel )
---- ---- ---- --1- ? Blank Screen
---- ---- ---- ---0 Flip Screen */
if (screenctrl & 2) return 0;
- flip_screen_set(screenctrl & 1);
+ flip_screen_set(screen->machine, screenctrl & 1);
/* If the game supports 16x16 tiles, make sure that the
16x16 and 8x8 tilemaps of a given layer are not simultaneously
diff --git a/src/mame/video/ironhors.c b/src/mame/video/ironhors.c
index 9ce37f137a8..7c9f56eb475 100644
--- a/src/mame/video/ironhors.c
+++ b/src/mame/video/ironhors.c
@@ -124,9 +124,9 @@ WRITE8_HANDLER( ironhors_palettebank_w )
WRITE8_HANDLER( ironhors_flipscreen_w )
{
- if (flip_screen_get() != (~data & 0x08))
+ if (flip_screen_get(space->machine) != (~data & 0x08))
{
- flip_screen_set(~data & 0x08);
+ flip_screen_set(space->machine, ~data & 0x08);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -170,9 +170,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipy = sr[offs+4] & 0x40;
int code = (sr[offs] << 2) + ((sr[offs+1] & 0x03) << 10) + ((sr[offs+1] & 0x0c) >> 2);
int color = ((sr[offs+1] & 0xf0)>>4) + 16 * palettebank;
- // int mod = flip_screen_get() ? -8 : 8;
+ // int mod = flip_screen_get(machine) ? -8 : 8;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -193,7 +193,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
case 0x04: /* 16x8 */
{
- if (flip_screen_get()) sy += 8; // this fixes the train wheels' position
+ if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position
drawgfx(bitmap,machine->gfx[2],
code & ~1,
diff --git a/src/mame/video/jack.c b/src/mame/video/jack.c
index 1b332ca3783..f5a7d8a6df0 100644
--- a/src/mame/video/jack.c
+++ b/src/mame/video/jack.c
@@ -30,13 +30,13 @@ WRITE8_HANDLER( jack_paletteram_w )
READ8_HANDLER( jack_flipscreen_r )
{
- flip_screen_set(offset);
+ flip_screen_set(space->machine, offset);
return 0;
}
WRITE8_HANDLER( jack_flipscreen_w )
{
- flip_screen_set(offset);
+ flip_screen_set(space->machine, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -73,7 +73,7 @@ static void jack_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
flipx = (spriteram[offs + 3] & 0x80);
flipy = (spriteram[offs + 3] & 0x40);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 248 - sx;
sy = 248 - sy;
@@ -154,7 +154,7 @@ static void joinem_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
flipx = (spriteram[offs + 3] & 0x80);
flipy = (spriteram[offs + 3] & 0x40);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 248 - sx;
sy = 248 - sy;
diff --git a/src/mame/video/jackal.c b/src/mame/video/jackal.c
index 561baebd62e..bb94c6043e1 100644
--- a/src/mame/video/jackal.c
+++ b/src/mame/video/jackal.c
@@ -138,7 +138,7 @@ static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, cons
if (attr & 0x01) sx = sx - 256;
if (sy > 0xf0) sy = sy - 256;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -151,7 +151,7 @@ static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, cons
int spritenum = sn1*4 + ((sn2 & (8+4)) >> 2) + ((sn2 & (2+1)) << 10);
int mod = -8;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx += 8;
sy -= 8;
@@ -160,7 +160,7 @@ static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, cons
if ((attr & 0x0C) == 0x0C)
{
- if (flip_screen_get()) sy += 16;
+ if (flip_screen_get(machine)) sy += 16;
DRAW_SPRITE(bank + 1, spritenum, sx, sy)
}
@@ -183,7 +183,7 @@ static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, cons
if (attr & 0x10)
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx -= 16;
sy -= 16;
diff --git a/src/mame/video/jagblit.c b/src/mame/video/jagblit.c
index 64b0c81cea9..ffaa93438d2 100644
--- a/src/mame/video/jagblit.c
+++ b/src/mame/video/jagblit.c
@@ -130,7 +130,7 @@
} while (0)
#endif
-static void FUNCNAME(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);
@@ -165,8 +165,8 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags)
UINT8 a1_phrase_mode = 0;
UINT8 a2_phrase_mode = 0;
- void *a1_base_mem = get_jaguar_memory(a1_base);
- void *a2_base_mem = get_jaguar_memory(a2_base);
+ void *a1_base_mem = get_jaguar_memory(machine, a1_base);
+ void *a2_base_mem = get_jaguar_memory(machine, a2_base);
void *asrc_base_mem = (COMMAND & 0x00000800) ? a1_base_mem : a2_base_mem;
UINT32 asrcflags = (COMMAND & 0x00000800) ? A1FIXED : A2FIXED;
@@ -195,7 +195,7 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags)
{
if (LOG_BAD_BLITS)
{
- logerror("%s:Blit!\n", cpuexec_describe_context(Machine));
+ logerror("%s:Blit!\n", cpuexec_describe_context(machine));
logerror(" a1_base = %08X\n", a1_base);
logerror(" a2_base = %08X\n", a2_base);
}
@@ -275,7 +275,7 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags)
if (LOG_BLITS)
{
- logerror("%s:Blit!\n", cpuexec_describe_context(Machine));
+ logerror("%s:Blit!\n", cpuexec_describe_context(machine));
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 eab17a54c0d..4c4665a70eb 100644
--- a/src/mame/video/jagobj.c
+++ b/src/mame/video/jagobj.c
@@ -489,7 +489,7 @@ INLINE UINT8 lookup_pixel(const UINT32 *src, int i, int pitch, int depth)
*
*************************************/
-static UINT32 *process_bitmap(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];
@@ -498,7 +498,7 @@ static UINT32 *process_bitmap(UINT32 *objdata, int vc, int logit)
UINT32 height = (lower >> 14) & 0x3ff;
UINT32 link = (lower >> 24) | ((upper & 0x7ff) << 8);
UINT32 data = (upper >> 11);
- UINT32 *src = (UINT32 *)get_jaguar_memory(data << 3);
+ UINT32 *src = (UINT32 *)get_jaguar_memory(machine, data << 3);
if (logit)
{
@@ -651,7 +651,7 @@ static UINT32 *process_bitmap(UINT32 *objdata, int vc, int logit)
objdata[1] = lower - (1 << 14);
}
- return (UINT32 *)get_jaguar_memory(link << 3);
+ return (UINT32 *)get_jaguar_memory(machine, link << 3);
}
@@ -662,7 +662,7 @@ static UINT32 *process_bitmap(UINT32 *objdata, int vc, int logit)
*
*************************************/
-static UINT32 *process_scaled_bitmap(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];
@@ -671,7 +671,7 @@ static UINT32 *process_scaled_bitmap(UINT32 *objdata, int vc, int logit)
UINT32 height = (lower >> 14) & 0x3ff;
UINT32 link = (lower >> 24) | ((upper & 0x7ff) << 8);
UINT32 data = (upper >> 11);
- UINT32 *src = (UINT32 *)get_jaguar_memory(data << 3);
+ UINT32 *src = (UINT32 *)get_jaguar_memory(machine, data << 3);
/* third phrase */
UINT32 lower3 = objdata[5];
@@ -824,7 +824,7 @@ static UINT32 *process_scaled_bitmap(UINT32 *objdata, int vc, int logit)
objdata[5] = (lower3 & ~0xff0000) | ((remainder & 0xff) << 16);
}
- return (UINT32 *)get_jaguar_memory(link << 3);
+ return (UINT32 *)get_jaguar_memory(machine, link << 3);
}
@@ -835,7 +835,7 @@ static UINT32 *process_scaled_bitmap(UINT32 *objdata, int vc, int logit)
*
*************************************/
-static UINT32 *process_branch(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];
@@ -889,7 +889,7 @@ static UINT32 *process_branch(UINT32 *objdata, int vc, int logit)
}
/* handle the branch */
- return taken ? (UINT32 *)get_jaguar_memory(link << 3) : (objdata + 2);
+ return taken ? (UINT32 *)get_jaguar_memory(machine, link << 3) : (objdata + 2);
}
@@ -915,7 +915,7 @@ static void process_object_list(running_machine *machine, int vc, UINT16 *_scanl
logit = LOG_OBJECTS;
/* fetch the object pointer */
- objdata = (UINT32 *)get_jaguar_memory((gpu_regs[OLP_H] << 16) | gpu_regs[OLP_L]);
+ objdata = (UINT32 *)get_jaguar_memory(machine, (gpu_regs[OLP_H] << 16) | gpu_regs[OLP_L]);
while (!done && objdata && count++ < 100)
{
/* the low 3 bits determine the command */
@@ -925,21 +925,21 @@ static void process_object_list(running_machine *machine, int vc, UINT16 *_scanl
case 0:
if (logit)
logerror("bitmap = %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3]);
- objdata = process_bitmap(objdata, vc, logit);
+ objdata = process_bitmap(machine, objdata, vc, logit);
break;
/* scaled bitmap object */
case 1:
if (logit)
logerror("scaled = %08X-%08X %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3], objdata[4], objdata[5]);
- objdata = process_scaled_bitmap(objdata, vc, logit);
+ objdata = process_scaled_bitmap(machine, objdata, vc, logit);
break;
/* branch */
case 3:
if (logit)
logerror("branch = %08X-%08X\n", objdata[0], objdata[1]);
- objdata = process_branch(objdata, vc, logit);
+ objdata = process_branch(machine, objdata, vc, logit);
break;
/* stop */
diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c
index 74e5437f4fb..eae5356e67e 100644
--- a/src/mame/video/jaguar.c
+++ b/src/mame/video/jaguar.c
@@ -135,7 +135,6 @@
****************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "memconv.h"
#include "profiler.h"
#include "machine/atarigen.h"
@@ -214,17 +213,17 @@ static void jagobj_init(void);
static void process_object_list(running_machine *machine, int vc, UINT16 *_scanline);
/* from jagblit.c */
-static void generic_blitter(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_09800001_010020_010020(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_09800009_000020_000020(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01800009_000028_000028(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01800001_000018_000018(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01c00001_000018_000018(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(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01800001_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_x1800x01_xxxxxx_xxxxxx(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
@@ -478,9 +477,9 @@ static void jaguar_set_palette(UINT16 vmode)
*
*************************************/
-static UINT8 *get_jaguar_memory(UINT32 offset)
+static UINT8 *get_jaguar_memory(running_machine *machine, UINT32 offset)
{
- return memory_get_read_ptr(cpu_get_address_space(Machine->cpu[1], ADDRESS_SPACE_PROGRAM), offset);
+ return memory_get_read_ptr(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), offset);
}
@@ -491,7 +490,7 @@ static UINT8 *get_jaguar_memory(UINT32 offset)
*
*************************************/
-static void blitter_run(void)
+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;
@@ -503,29 +502,29 @@ static void blitter_run(void)
{
if (command == 0x09800001 && a1flags == 0x010020)
{
- blitter_09800001_010020_010020(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_09800001_010020_010020(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
if (command == 0x09800009 && a1flags == 0x000020)
{
- blitter_09800009_000020_000020(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_09800009_000020_000020(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
if (command == 0x01800009 && a1flags == 0x000028)
{
- blitter_01800009_000028_000028(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_01800009_000028_000028(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
if (command == 0x01800001 && a1flags == 0x000018)
{
- blitter_01800001_000018_000018(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_01800001_000018_000018(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
if (command == 0x01c00001 && a1flags == 0x000018)
{
- blitter_01c00001_000018_000018(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_01c00001_000018_000018(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
}
@@ -533,19 +532,19 @@ static void blitter_run(void)
#ifdef MESS
if (command == 0x00010000)
{
- blitter_00010000_xxxxxx_xxxxxx(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_00010000_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
if (command == 0x01800001)
{
- blitter_01800001_xxxxxx_xxxxxx(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_01800001_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
if ((command & 0x0ffff0ff) == 0x01800001)
{
- blitter_x1800x01_xxxxxx_xxxxxx(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ blitter_x1800x01_xxxxxx_xxxxxx(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
return;
}
#endif
@@ -585,7 +584,7 @@ if (++reps % 100 == 99)
}
}
- generic_blitter(blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
+ generic_blitter(machine, blitter_regs[B_CMD], blitter_regs[A1_FLAGS], blitter_regs[A2_FLAGS]);
profiler_mark(PROFILER_END);
}
@@ -608,7 +607,7 @@ WRITE32_HANDLER( jaguar_blitter_w )
{
COMBINE_DATA(&blitter_regs[offset]);
if (offset == B_CMD)
- blitter_run();
+ blitter_run(space->machine);
if (LOG_BLITTER_WRITE)
logerror("%08X:Blitter write register @ F022%02X = %08X\n", cpu_get_previouspc(space->cpu), offset * 4, data);
diff --git a/src/mame/video/jailbrek.c b/src/mame/video/jailbrek.c
index 9ae22c6e310..80d7cbd731c 100644
--- a/src/mame/video/jailbrek.c
+++ b/src/mame/video/jailbrek.c
@@ -80,7 +80,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
int sy = spriteram[i + 3];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/kan_panb.c b/src/mame/video/kan_panb.c
index 96fb982dd0f..5a19e78a1ed 100644
--- a/src/mame/video/kan_panb.c
+++ b/src/mame/video/kan_panb.c
@@ -30,7 +30,7 @@ VIDEO_UPDATE( honeydol )
x = dx;
y = dy;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 240 - x;
sy = 240 - y;
@@ -62,7 +62,7 @@ VIDEO_UPDATE( honeydol )
x = dx;
y = dy;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 240 - x;
sy = 240 - y;
@@ -117,7 +117,7 @@ VIDEO_UPDATE( twinadv )
x = dx;
y = dy;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 240 - x;
sy = 240 - y;
@@ -165,7 +165,7 @@ VIDEO_UPDATE( wintbob )
if (wrapr == 8) xpos -= 256;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
xpos = 240 - xpos;
ypos = 240 - ypos;
@@ -245,7 +245,7 @@ VIDEO_UPDATE( snowbro3 )
if (x > 511) x &= 0x1ff;
if (y > 511) y &= 0x1ff;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 240 - x;
sy = 240 - y;
diff --git a/src/mame/video/kan_pand.c b/src/mame/video/kan_pand.c
index b1dfe501a0f..aac400de824 100644
--- a/src/mame/video/kan_pand.c
+++ b/src/mame/video/kan_pand.c
@@ -119,7 +119,7 @@ static void pandora_draw(running_machine *machine, bitmap_t *bitmap, const recta
y = dy;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - x;
sy = 240 - y;
diff --git a/src/mame/video/kchamp.c b/src/mame/video/kchamp.c
index ef821a4b2f9..ef9c0a2c221 100644
--- a/src/mame/video/kchamp.c
+++ b/src/mame/video/kchamp.c
@@ -38,7 +38,7 @@ WRITE8_HANDLER( kchamp_colorram_w )
WRITE8_HANDLER( kchamp_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -80,7 +80,7 @@ static void kchamp_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
int sx = spriteram[offs + 3] - 8;
int sy = 247 - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -108,7 +108,7 @@ static void kchampvs_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
int sx = spriteram[offs + 3];
int sy = 240 - spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/kingobox.c b/src/mame/video/kingobox.c
index c7cdbda8eeb..db0d35011a8 100644
--- a/src/mame/video/kingobox.c
+++ b/src/mame/video/kingobox.c
@@ -174,9 +174,9 @@ WRITE8_HANDLER( kingofb_f800_w )
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -229,7 +229,7 @@ static void kingofb_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
sx = spriteram[roffs+1];
sy = spriteram[roffs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -289,7 +289,7 @@ static void ringking_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
int sx = spriteram[offs+2];
int sy = spriteram[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c
index db477eca418..70d6880ef91 100644
--- a/src/mame/video/ladybug.c
+++ b/src/mame/video/ladybug.c
@@ -161,9 +161,9 @@ WRITE8_HANDLER( ladybug_colorram_w )
WRITE8_HANDLER( ladybug_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -250,9 +250,9 @@ WRITE8_HANDLER( sraider_io_w )
// bit3 = enable stars
// bit210 = stars speed/dir
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -370,7 +370,7 @@ VIDEO_UPDATE( ladybug )
int sx = offs % 4;
int sy = offs / 4;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
tilemap_set_scrollx(bg_tilemap, offs, -videoram[32 * sx + sy]);
else
tilemap_set_scrollx(bg_tilemap, offs, videoram[32 * sx + sy]);
@@ -399,7 +399,7 @@ VIDEO_UPDATE( sraider )
int sx = offs % 4;
int sy = offs / 4;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
tilemap_set_scrollx(bg_tilemap, offs, -videoram[32 * sx + sy]);
else
tilemap_set_scrollx(bg_tilemap, offs, videoram[32 * sx + sy]);
@@ -409,7 +409,7 @@ VIDEO_UPDATE( sraider )
bitmap_fill(bitmap,cliprect,0);
// draw the stars
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
redclash_draw_stars(bitmap,cliprect,0x60,1,0x27,0xff);
else
redclash_draw_stars(bitmap,cliprect,0x60,1,0x00,0xd8);
@@ -418,7 +418,7 @@ VIDEO_UPDATE( sraider )
colortable_palette_set_color(screen->machine->colortable, 0x40, MAKE_RGB(sraider_grid_color & 0x40 ? 0xff : 0,
sraider_grid_color & 0x20 ? 0xff : 0,
sraider_grid_color & 0x10 ? 0xff : 0));
- tilemap_draw(bitmap, cliprect, grid_tilemap, 0, flip_screen_get());
+ tilemap_draw(bitmap, cliprect, grid_tilemap, 0, flip_screen_get(screen->machine));
for (i = 0; i < 0x100; i++)
{
@@ -428,7 +428,7 @@ VIDEO_UPDATE( sraider )
int height = cliprect->max_y - cliprect->min_y + 1;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
x = ~x;
plot_box(bitmap, x, cliprect->min_y, 1, height, 0x81);
@@ -436,7 +436,7 @@ VIDEO_UPDATE( sraider )
}
// now the chars
- tilemap_draw(bitmap, cliprect, bg_tilemap, 0, flip_screen_get());
+ tilemap_draw(bitmap, cliprect, bg_tilemap, 0, flip_screen_get(screen->machine));
// now the sprites
draw_sprites(screen->machine, bitmap, cliprect);
diff --git a/src/mame/video/lasso.c b/src/mame/video/lasso.c
index 66fe217942b..c970d0dcb70 100644
--- a/src/mame/video/lasso.c
+++ b/src/mame/video/lasso.c
@@ -231,11 +231,11 @@ 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(data & 0x01);
- flip_screen_y_set( data & 0x02);
+ flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_y_set(space->machine, data & 0x02);
- tilemap_set_flip(ALL_TILEMAPS, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) |
- (flip_screen_y_get() ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip(ALL_TILEMAPS, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) |
+ (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0));
}
@@ -309,13 +309,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = source[1] & 0x40;
flipy = source[1] & 0x80;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
}
@@ -340,7 +340,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_lasso(bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_lasso(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
offs_t offs;
pen_t pen = 0x3f;
@@ -352,7 +352,7 @@ static void draw_lasso(bitmap_t *bitmap, const rectangle *cliprect)
UINT8 x;
UINT8 y = offs >> 5;
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
y = ~y;
if ((y < cliprect->min_y) || (y > cliprect->max_y))
@@ -361,7 +361,7 @@ static void draw_lasso(bitmap_t *bitmap, const rectangle *cliprect)
x = (offs & 0x1f) << 3;
data = lasso_bitmap_ram[offs];
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
x = ~x;
for (bit = 0; bit < 8; bit++)
@@ -369,7 +369,7 @@ static void draw_lasso(bitmap_t *bitmap, const rectangle *cliprect)
if ((data & 0x80) && (x >= cliprect->min_x) && (x <= cliprect->max_x))
*BITMAP_ADDR16(bitmap, y, x) = pen;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
x = x - 1;
else
x = x + 1;
@@ -386,7 +386,7 @@ VIDEO_UPDATE( lasso )
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
- draw_lasso(bitmap, cliprect);
+ draw_lasso(screen->machine, bitmap, cliprect);
draw_sprites(screen->machine, bitmap, cliprect, 0);
return 0;
diff --git a/src/mame/video/lastduel.c b/src/mame/video/lastduel.c
index 37b3afef29e..d2d345f6928 100644
--- a/src/mame/video/lastduel.c
+++ b/src/mame/video/lastduel.c
@@ -128,7 +128,7 @@ WRITE16_HANDLER( lastduel_flip_w )
{
if (ACCESSING_BITS_0_7)
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
coin_lockout_w(0,~data & 0x10);
coin_lockout_w(1,~data & 0x20);
@@ -234,7 +234,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = attr & sprite_flipy_mask; /* 0x40 for lastduel, 0x80 for madgear */
color = attr & 0x0f;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 496 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/liberate.c b/src/mame/video/liberate.c
index 39d06a6da50..fbbebf50556 100644
--- a/src/mame/video/liberate.c
+++ b/src/mame/video/liberate.c
@@ -93,7 +93,7 @@ WRITE8_HANDLER( deco16_io_w )
tilemap_mark_all_tiles_dirty(background_tilemap);
}
background_disable=data&0x4;
- flip_screen_set(data&0x1);
+ flip_screen_set(space->machine, data&0x1);
break;
case 7: /* Background palette resistors? */
/* Todo */
@@ -214,7 +214,7 @@ static void liberate_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
if (multi && fy==0) sy-=16;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sy=240-sy;
sx=240-sx;
if (fy)
@@ -275,7 +275,7 @@ static void prosport_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
// if (multi) sy-=16;
if (fy && multi) { code2=code; code++; }
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sy=240-sy;
sx=240-sx;
if (fx) fx=0; else fx=1;
@@ -331,7 +331,7 @@ static void boomrang_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
// if (multi) sy-=16;
if (fy && multi) { code2=code; code++; }
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sy=240-sy;
sx=240-sx;
if (fx) fx=0; else fx=1;
diff --git a/src/mame/video/lkage.c b/src/mame/video/lkage.c
index c3233eedfdb..80c1ee6694e 100644
--- a/src/mame/video/lkage.c
+++ b/src/mame/video/lkage.c
@@ -128,12 +128,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
priority_mask = (0xf0);
}
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 239 - sx - 24;
flipx = !flipx;
}
- if( flip_screen_y_get() )
+ if( flip_screen_y_get(machine) )
{
sy = 254 - 16*height - sy;
flipy = !flipy;
@@ -165,8 +165,8 @@ VIDEO_UPDATE( lkage )
{
int bank;
- flip_screen_x_set(~lkage_vreg[2] & 0x01);
- flip_screen_y_set(~lkage_vreg[2] & 0x02);
+ flip_screen_x_set(screen->machine, ~lkage_vreg[2] & 0x01);
+ flip_screen_y_set(screen->machine, ~lkage_vreg[2] & 0x02);
bank = lkage_vreg[1]&0x08;
if( bg_tile_bank != bank )
diff --git a/src/mame/video/lsasquad.c b/src/mame/video/lsasquad.c
index 8bd2a514376..c39ef5cc4fc 100644
--- a/src/mame/video/lsasquad.c
+++ b/src/mame/video/lsasquad.c
@@ -19,7 +19,7 @@ static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectang
base = 64 * scrollram[offs+1];
sx = 8*(offs/4) + scrollx;
- if (flip_screen_get()) sx = 248 - sx;
+ if (flip_screen_get(machine)) sx = 248 - sx;
sx &= 0xff;
for (y = 0;y < 32;y++)
@@ -27,7 +27,7 @@ static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectang
int attr;
sy = 8*y + scrolly;
- if (flip_screen_get()) sy = 248 - sy;
+ if (flip_screen_get(machine)) sy = 248 - sy;
sy &= 0xff;
attr = videoram[base + 2*y + 1];
@@ -37,14 +37,14 @@ static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectang
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,15);
if (sx > 248) /* wraparound */
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx-256,sy,
cliprect,TRANSPARENCY_PEN,15);
}
@@ -104,7 +104,7 @@ static int draw_layer_daikaiju(running_machine *machine, bitmap_t *bitmap, const
base = 64 * lsasquad_scrollram[offs+1];
sx = scrollx+stepx;
- if (flip_screen_get()) sx = 248 - sx;
+ if (flip_screen_get(machine)) sx = 248 - sx;
sx &= 0xff;
for (y = 0;y < 32;y++)
@@ -112,7 +112,7 @@ static int draw_layer_daikaiju(running_machine *machine, bitmap_t *bitmap, const
int attr;
sy = 8*y + scrolly;
- if (flip_screen_get()) sy = 248 - sy;
+ if (flip_screen_get(machine)) sy = 248 - sy;
sy &= 0xff;
attr = videoram[base + 2*y + 1];
@@ -125,14 +125,14 @@ static int draw_layer_daikaiju(running_machine *machine, bitmap_t *bitmap, const
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,15);
if (sx > 248) /* wraparound */
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx-256,sy,
cliprect,TRANSPARENCY_PEN,15);
}
@@ -176,7 +176,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = attr & 0x40;
flipy = attr & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/lwings.c b/src/mame/video/lwings.c
index 3f61dbe0051..b7328532c84 100644
--- a/src/mame/video/lwings.c
+++ b/src/mame/video/lwings.c
@@ -203,7 +203,7 @@ static void lwings_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
flipx = buffered_spriteram[offs + 1] & 0x02;
flipy = buffered_spriteram[offs + 1] & 0x04;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -252,7 +252,7 @@ static void trojan_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
flipy = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c
index 80647a5625e..9ee343a71d6 100644
--- a/src/mame/video/m52.c
+++ b/src/mame/video/m52.c
@@ -279,7 +279,7 @@ WRITE8_HANDLER( m52_bgcontrol_w )
WRITE8_HANDLER( m52_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flip_screen_set((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(0, data & 0x02);
coin_counter_w(1, data & 0x20);
@@ -287,7 +287,7 @@ WRITE8_HANDLER( m52_flipscreen_w )
WRITE8_HANDLER( alpha1v_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
@@ -303,7 +303,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
rectangle rect;
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
xpos = 255 - xpos;
ypos = 255 - ypos - BGHEIGHT;
@@ -316,8 +316,8 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
drawgfx(bitmap, machine->gfx[image],
0, 0,
- flip_screen_get(),
- flip_screen_get(),
+ flip_screen_get(machine),
+ flip_screen_get(machine),
xpos,
ypos,
cliprect,
@@ -325,8 +325,8 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
drawgfx(bitmap, machine->gfx[image],
0, 0,
- flip_screen_get(),
- flip_screen_get(),
+ flip_screen_get(machine),
+ flip_screen_get(machine),
xpos - 256,
ypos,
cliprect,
@@ -335,7 +335,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
rect.min_x = visarea->min_x;
rect.max_x = visarea->max_x;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
rect.min_y = ypos - BGHEIGHT;
rect.max_y = ypos - 1;
@@ -375,7 +375,7 @@ VIDEO_UPDATE( m52 )
draw_background(screen->machine, bitmap, cliprect, bg1xpos, bg1ypos, 4); /* cityscape */
}
- tilemap_set_flip(bg_tilemap, flip_screen_get() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ tilemap_set_flip(bg_tilemap, flip_screen_get(screen->machine) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
@@ -399,7 +399,7 @@ VIDEO_UPDATE( m52 )
clip.min_y = 128, clip.max_y = 255;
/* adjust for flipping */
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
int temp = clip.min_y;
clip.min_y = 255 - clip.max_y;
diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c
index e8ca2672231..566aa64a9a6 100644
--- a/src/mame/video/m58.c
+++ b/src/mame/video/m58.c
@@ -202,7 +202,7 @@ VIDEO_START( yard )
WRITE8_HANDLER( yard_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flip_screen_set((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(0, data & 0x02);
coin_counter_w(1, data & 0x20);
@@ -246,7 +246,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
code2 = code1 + 0x40;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy2 = 192 - sy1;
@@ -286,15 +286,15 @@ static void draw_panel( running_machine *machine, bitmap_t *bitmap, const rectan
0*8, 6*8-1,
1*8, 31*8-1
};
- rectangle clip = flip_screen_get() ? clippanelflip : clippanel;
+ rectangle clip = flip_screen_get(machine) ? clippanelflip : clippanel;
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
- int sx = flip_screen_get() ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
- int yoffs = flip_screen_get() ? -40 : -16;
+ 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;
clip.min_y += visarea->min_y + yoffs;
clip.max_y += visarea->max_y + yoffs;
- copybitmap(bitmap, scroll_panel_bitmap, flip_screen_get(), flip_screen_get(),
+ copybitmap(bitmap, scroll_panel_bitmap, flip_screen_get(machine), flip_screen_get(machine),
sx, visarea->min_y + yoffs, &clip);
}
}
diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c
index 224cc6da7f2..b98ca12d8e5 100644
--- a/src/mame/video/m72.c
+++ b/src/mame/video/m72.c
@@ -348,7 +348,7 @@ WRITE16_HANDLER( m72_port02_w )
coin_counter_w(1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((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 */
video_off = data & 0x08;
@@ -374,7 +374,7 @@ WRITE16_HANDLER( rtype2_port02_w )
coin_counter_w(1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((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 */
video_off = data & 0x08;
@@ -424,7 +424,7 @@ static void m72_draw_sprites(running_machine *machine, bitmap_t *bitmap,const re
h = 1 << ((m72_spriteram[offs+2] & 0x3000) >> 12);
sy -= 16 * h;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 512 - 16*w - sx;
sy = 284 - 16*h - sy;
@@ -476,7 +476,7 @@ static void majtitle_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
h = 1 << ((spriteram16_2[offs+2] & 0x3000) >> 12);
sy -= 16 * h;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 512 - 16*w - sx;
sy = 256 - 16*h - sy;
diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c
index b73cb96d155..912e5197e65 100644
--- a/src/mame/video/m92.c
+++ b/src/mame/video/m92.c
@@ -339,7 +339,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
x &= 0x1ff;
for (i=0; i<y_multi; i++)
{
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
pdrawgfx(bitmap,machine->gfx[1],
sprite + s_ptr,
colour,
@@ -463,8 +463,8 @@ VIDEO_UPDATE( m92 )
/* Flipscreen appears hardwired to the dipswitch - strange */
if (input_port_read(screen->machine, "DSW") & 0x100)
- flip_screen_set(0);
+ flip_screen_set(screen->machine, 0);
else
- flip_screen_set(1);
+ flip_screen_set(screen->machine, 1);
return 0;
}
diff --git a/src/mame/video/mainsnk.c b/src/mame/video/mainsnk.c
index fbedff3b0eb..ce08a4111a6 100644
--- a/src/mame/video/mainsnk.c
+++ b/src/mame/video/mainsnk.c
@@ -56,7 +56,7 @@ WRITE8_HANDLER(mainsnk_c600_w)
{
int bank;
- flip_screen_set(~data & 0x80);
+ flip_screen_set(space->machine, ~data & 0x80);
tilemap_set_palette_offset(bg_tilemap, (data & 0x07) << 4);
tilemap_set_palette_offset(tx_tilemap, (data & 0x07) << 4);
@@ -107,7 +107,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = 288-16 - sx;
sy += 8;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 288-16 - sx;
sy = 224-16 - sy;
diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c
index 9822a2dfcbf..fa5257843f2 100644
--- a/src/mame/video/mappy.c
+++ b/src/mame/video/mappy.c
@@ -377,12 +377,12 @@ WRITE8_HANDLER( mappy_videoram_w )
WRITE8_HANDLER( superpac_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
READ8_HANDLER( superpac_flipscreen_r )
{
- flip_screen_set(1);
+ flip_screen_set(space->machine, 1);
return 0xff;
}
@@ -430,7 +430,7 @@ void mappy_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectan
sy -= 16 * sizey;
sy = (sy & 0xff) - 32; // fix wraparound
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
@@ -506,7 +506,7 @@ static void phozon_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
sy -= 8 * sizey;
sy = (sy & 0xff) - 32; // fix wraparound
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
@@ -562,7 +562,7 @@ VIDEO_UPDATE( superpac )
VIDEO_UPDATE( phozon )
{
/* flip screen control is embedded in RAM */
- flip_screen_set(mappy_spriteram[0x1f7f-0x800] & 1);
+ flip_screen_set(screen->machine, mappy_spriteram[0x1f7f-0x800] & 1);
tilemap_set_scrolldx(bg_tilemap, 0, 96);
tilemap_set_scrolldy(bg_tilemap, 0, 0);
diff --git a/src/mame/video/markham.c b/src/mame/video/markham.c
index 206ad98cae9..fbe88d6229a 100644
--- a/src/mame/video/markham.c
+++ b/src/mame/video/markham.c
@@ -51,9 +51,9 @@ WRITE8_HANDLER( markham_videoram_w )
WRITE8_HANDLER( markham_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -84,15 +84,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int chr = spriteram[offs+1];
int col = spriteram[offs+2];
- int fx = flip_screen_get();
- int fy = flip_screen_get();
+ int fx = flip_screen_get(machine);
+ int fy = flip_screen_get(machine);
int x = spriteram[offs+3];
int y = spriteram[offs+0];
int px,py;
col &= 0x3f ;
- if (flip_screen_get()==0)
+ if (flip_screen_get(machine)==0)
{
px = x-2;
py = 240-y;
diff --git a/src/mame/video/mermaid.c b/src/mame/video/mermaid.c
index 398e66387cb..a94914a4286 100644
--- a/src/mame/video/mermaid.c
+++ b/src/mame/video/mermaid.c
@@ -74,12 +74,12 @@ WRITE8_HANDLER( mermaid_colorram_w )
WRITE8_HANDLER( mermaid_flip_screen_x_w )
{
- flip_screen_x_set(data & 0x01);
+ flip_screen_x_set(space->machine, data & 0x01);
}
WRITE8_HANDLER( mermaid_flip_screen_y_w )
{
- flip_screen_y_set(data & 0x01);
+ flip_screen_y_set(space->machine, data & 0x01);
}
WRITE8_HANDLER( mermaid_bg_scroll_w )
@@ -187,20 +187,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
code |= rougien_gfxbank1 * 0x2800;
code |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
sy = 240 - sy;
}
drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
- (flip_screen_x_get() ? &flip_spritevisiblearea : &spritevisiblearea),
+ (flip_screen_x_get(machine) ? &flip_spritevisiblearea : &spritevisiblearea),
TRANSPARENCY_PEN, 0);
}
}
@@ -266,13 +266,13 @@ VIDEO_EOF( mermaid )
code |= rougien_gfxbank1 * 0x2800;
code |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
sy = 240 - sy;
@@ -338,13 +338,13 @@ VIDEO_EOF( mermaid )
code2 |= rougien_gfxbank1 * 0x2800;
code2 |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx2 = !flipx2;
sx2 = 240 - sx2;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy2 = !flipy2;
sy2 = 240 - sy2;
@@ -380,13 +380,13 @@ VIDEO_EOF( mermaid )
code |= rougien_gfxbank1 * 0x2800;
code |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
sy = 240 - sy;
@@ -428,13 +428,13 @@ VIDEO_EOF( mermaid )
code2 |= rougien_gfxbank1 * 0x2800;
code2 |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx2 = !flipx2;
sx2 = 240 - sx2;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy2 = !flipy2;
sy2 = 240 - sy2;
@@ -470,13 +470,13 @@ VIDEO_EOF( mermaid )
code |= rougien_gfxbank1 * 0x2800;
code |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy = !flipy;
sy = 240 - sy;
@@ -518,13 +518,13 @@ VIDEO_EOF( mermaid )
code2 |= rougien_gfxbank1 * 0x2800;
code2 |= rougien_gfxbank2 * 0x2400;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
flipx2 = !flipx2;
sx2 = 240 - sx2;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
flipy2 = !flipy2;
sy2 = 240 - sy2;
diff --git a/src/mame/video/metlclsh.c b/src/mame/video/metlclsh.c
index d5a42b618b5..3649d840c3f 100644
--- a/src/mame/video/metlclsh.c
+++ b/src/mame/video/metlclsh.c
@@ -194,7 +194,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (sx < -7) sx += 256;
sy = 240 - spriteram[offs+2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx; flipx = !flipx;
sy = 240 - sy; flipy = !flipy; if (sizey) sy+=16;
@@ -243,7 +243,7 @@ VIDEO_UPDATE( metlclsh )
if (metlclsh_scrollx[0] & 0x08) // background (if enabled)
{
/* The background seems to be always flipped along x */
- tilemap_set_flip(bg_tilemap, (flip_screen_get() ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX);
+ tilemap_set_flip(bg_tilemap, (flip_screen_get(screen->machine) ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX);
tilemap_set_scrollx(bg_tilemap, 0,metlclsh_scrollx[1] + ((metlclsh_scrollx[0]&0x02)<<7) );
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
}
diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c
index c1471ebf38f..658575d18cf 100644
--- a/src/mame/video/metro.c
+++ b/src/mame/video/metro.c
@@ -681,7 +681,7 @@ void metro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectan
gfxdata = base_gfx + (8*8*4/8) * (((attr & 0x000f) << 16) + code);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx; x = max_x - x - width;
flipy = !flipy; y = max_y - y - height;
@@ -931,7 +931,7 @@ VIDEO_UPDATE( metro )
---- ---- ---- --1- ? Blank Screen
---- ---- ---- ---0 Flip Screen */
if (screenctrl & 2) return 0;
- flip_screen_set(screenctrl & 1);
+ flip_screen_set(screen->machine, screenctrl & 1);
/* If the game supports 16x16 tiles, make sure that the
16x16 and 8x8 tilemaps of a given layer are not simultaneously
diff --git a/src/mame/video/mikie.c b/src/mame/video/mikie.c
index 0111662d0f7..99c0e21bc3a 100644
--- a/src/mame/video/mikie.c
+++ b/src/mame/video/mikie.c
@@ -113,9 +113,9 @@ WRITE8_HANDLER( mikie_palettebank_w )
WRITE8_HANDLER( mikie_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -149,7 +149,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = ~spriteram[offs] & 0x10;
int flipy = spriteram[offs] & 0x20;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = 242 - sy;
flipy = !flipy;
diff --git a/src/mame/video/mjkjidai.c b/src/mame/video/mjkjidai.c
index 059475a838e..009b928f7b3 100644
--- a/src/mame/video/mjkjidai.c
+++ b/src/mame/video/mjkjidai.c
@@ -59,7 +59,7 @@ WRITE8_HANDLER( mjkjidai_ctrl_w )
interrupt_enable_w(space,0,data & 1);
/* bit 1 = flip screen */
- flip_screen_set(data & 0x02);
+ flip_screen_set(space->machine, data & 0x02);
/* bit 2 =display enable */
display_enable = data & 0x04;
@@ -104,7 +104,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sx += (spriteram_2[offs] & 0x20) >> 5; // not sure about this
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 496 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c
index 440d4eb328b..2ed46846253 100644
--- a/src/mame/video/model1.c
+++ b/src/mame/video/model1.c
@@ -724,7 +724,7 @@ static float compute_specular(struct vector *normal, struct vector *light,float
return 0;
}
-static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
+static void push_object(running_machine *machine, UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
{
int i;
UINT32 flags;
@@ -889,8 +889,8 @@ static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
{
/*float dif=mult_vector(&vn, &view.light);
float ln=lightparams[lightmode].a + lightparams[lightmode].d*MAX(0.0,dif);
- cquad.col = scale_color(Machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
- cquad.col = scale_color(Machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
+ cquad.col = scale_color(machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
+ cquad.col = scale_color(machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
*/
float dif=mult_vector(&vn, &view.light);
float spec=compute_specular(&vn,&view.light,dif,lightmode);
@@ -1065,7 +1065,7 @@ static UINT16 *push_direct(UINT16 *list)
b=(model1_color_xlat[(b<<8)|lumval|0x4000]>>3)&0x1f;
cquad.col=(r<<10)|(g<<5)|(b<<0);
}
- //cquad.col = scale_color(Machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)],((float) (lum>>24)) / 128.0);
+ //cquad.col = scale_color(machine->pens[0x1000|(tgp_ram[tex_adr-0x40000] & 0x3ff)],((float) (lum>>24)) / 128.0);
if(flags & 0x00002000)
cquad.col |= MOIRE;
@@ -1173,7 +1173,7 @@ WRITE16_HANDLER( model1_listctl_w )
LOG_TGP(("VIDEO: control=%08x\n", (listctl[1]<<16)|listctl[0]));
}
-static void tgp_render(bitmap_t *bitmap, const rectangle *cliprect)
+static void tgp_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
render_done = 1;
if((listctl[1] & 0x1f) == 0x1f) {
@@ -1202,7 +1202,7 @@ static void tgp_render(bitmap_t *bitmap, const rectangle *cliprect)
// 6 = ?? draw object (57bd4, 387460, 2ad)
if(1 || zz >= 666)
- push_object(readi(list+2), readi(list+4), readi(list+6));
+ push_object(machine, readi(list+2), readi(list+4), readi(list+6));
list += 8;
break;
case 2:
@@ -1515,7 +1515,7 @@ VIDEO_UPDATE(model1)
sys24_tile_draw(screen->machine, bitmap, cliprect, 2, 0, 0);
sys24_tile_draw(screen->machine, bitmap, cliprect, 0, 0, 0);
- tgp_render(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);
diff --git a/src/mame/video/mole.c b/src/mame/video/mole.c
index cadee350f07..08af79419e1 100644
--- a/src/mame/video/mole.c
+++ b/src/mame/video/mole.c
@@ -48,7 +48,7 @@ WRITE8_HANDLER( mole_tilebank_w )
WRITE8_HANDLER( mole_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
VIDEO_UPDATE( mole )
diff --git a/src/mame/video/mouser.c b/src/mame/video/mouser.c
index e646598f8c4..c1e1e4775c8 100644
--- a/src/mame/video/mouser.c
+++ b/src/mame/video/mouser.c
@@ -45,12 +45,12 @@ PALETTE_INIT( mouser )
WRITE8_HANDLER( mouser_flip_screen_x_w )
{
- flip_screen_x_set(~data & 1);
+ flip_screen_x_set(space->machine, ~data & 1);
}
WRITE8_HANDLER( mouser_flip_screen_y_w )
{
- flip_screen_y_set(~data & 1);
+ flip_screen_y_set(space->machine, ~data & 1);
}
VIDEO_UPDATE( mouser )
@@ -68,12 +68,12 @@ VIDEO_UPDATE( mouser )
sx = offs % 32;
sy = offs / 32;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(screen->machine))
{
sx = 31 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(screen->machine))
{
sy = 31 - sy;
}
@@ -90,7 +90,7 @@ VIDEO_UPDATE( mouser )
drawgfx(bitmap,screen->machine->gfx[0],
videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512,
colorram[color_offs]%16,
- flip_screen_x_get(),flip_screen_y_get(),
+ flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine),
8*sx,scrolled_y_position,
cliprect,TRANSPARENCY_NONE,0);
}
@@ -106,13 +106,13 @@ VIDEO_UPDATE( mouser )
flipx = (spriteram[offs]&0x40)>>6;
flipy = (spriteram[offs]&0x80)>>7;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(screen->machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(screen->machine))
{
flipy = !flipy;
sy = 238 - sy;
@@ -136,13 +136,13 @@ VIDEO_UPDATE( mouser )
flipx = (spriteram[offs]&0x40)>>6;
flipy = (spriteram[offs]&0x80)>>7;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(screen->machine))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(screen->machine))
{
flipy = !flipy;
sy = 238 - sy;
diff --git a/src/mame/video/mrjong.c b/src/mame/video/mrjong.c
index bf3e2f1f4dd..19533f1c157 100644
--- a/src/mame/video/mrjong.c
+++ b/src/mame/video/mrjong.c
@@ -80,9 +80,9 @@ WRITE8_HANDLER( mrjong_colorram_w )
WRITE8_HANDLER( mrjong_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -119,7 +119,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = 224 - spriteram[offs + 2];
sy = spriteram[offs + 0];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 208 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/mustache.c b/src/mame/video/mustache.c
index 78753e09cd5..b086aea6ad5 100644
--- a/src/mame/video/mustache.c
+++ b/src/mame/video/mustache.c
@@ -52,9 +52,9 @@ WRITE8_HANDLER( mustache_videoram_w )
WRITE8_HANDLER (mustache_video_control_w)
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -116,12 +116,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if ((control_byte & 0xa))
clip.max_y = visarea->max_y;
else
- if (flip_screen_get())
+ if (flip_screen_get(machine))
clip.min_y = visarea->min_y + 56;
else
clip.max_y = visarea->max_y - 56;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -130,7 +130,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,gfx,
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy,
&clip,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/video/n64.c b/src/mame/video/n64.c
index 4d5d30e4c31..d9109089b4d 100644
--- a/src/mame/video/n64.c
+++ b/src/mame/video/n64.c
@@ -3,7 +3,6 @@
*/
#include "driver.h"
-#include "deprecat.h"
#include "includes/n64.h"
#define LOG_RDP_EXECUTION 0
@@ -2866,71 +2865,74 @@ static int rdp_dasm(char *buffer)
// RDP COMMANDS
////////////////////////
-static void rdp_invalid(UINT32 w1, UINT32 w2)
+typedef void (*rdp_command_func)(running_machine *machine, UINT32 w1, UINT32 w2);
+#define RDP_COMMAND(name) void name(running_machine *machine, UINT32 w1, UINT32 w2)
+
+static RDP_COMMAND( rdp_invalid )
{
fatalerror("RDP: invalid command %d, %08X %08X\n", (w1 >> 24) & 0x3f, w1, w2);
}
-static void rdp_noop(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_noop )
{
}
-static void rdp_tri_noshade(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_noshade )
{
//fatalerror("RDP: unhandled command tri_noshade, %08X %08X\n", w1, w2);
triangle(w1, w2, 0, 0, 0);
}
-static void rdp_tri_noshade_z(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_noshade_z )
{
//fatalerror("RDP: unhandled command tri_noshade_z, %08X %08X\n", w1, w2);
triangle(w1, w2, 0, 0, 1);
}
-static void rdp_tri_tex(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_tex )
{
//osd_die("RDP: unhandled command tri_tex, %08X %08X\n", w1, w2);
triangle(w1, w2, 0, 1, 0);
}
-static void rdp_tri_tex_z(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_tex_z )
{
//osd_die("RDP: unhandled command tri_tex_z, %08X %08X\n", w1, w2);
triangle(w1, w2, 0, 1, 1);
}
-static void rdp_tri_shade(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_shade )
{
//osd_die("RDP: unhandled command tri_shade, %08X %08X\n", w1, w2);
triangle(w1, w2, 1, 0, 0);
}
-static void rdp_tri_shade_z(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_shade_z )
{
//osd_die("RDP: unhandled command tri_shade_z, %08X %08X\n", w1, w2);
triangle(w1, w2, 1, 0, 1);
}
-static void rdp_tri_texshade(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_texshade )
{
//osd_die("RDP: unhandled command tri_texshade, %08X %08X\n", w1, w2);
triangle(w1, w2, 1, 1, 0);
}
-static void rdp_tri_texshade_z(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tri_texshade_z )
{
//osd_die("RDP: unhandled command tri_texshade_z, %08X %08X\n", w1, w2);
triangle(w1, w2, 1, 1, 1);
}
-static void rdp_tex_rect(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tex_rect )
{
UINT32 w3, w4;
TEX_RECTANGLE rect;
@@ -2955,7 +2957,7 @@ static void rdp_tex_rect(UINT32 w1, UINT32 w2)
}
}
-static void rdp_tex_rect_flip(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_tex_rect_flip )
{
UINT32 w3, w4;
TEX_RECTANGLE rect;
@@ -2980,42 +2982,42 @@ static void rdp_tex_rect_flip(UINT32 w1, UINT32 w2)
}
}
-static void rdp_sync_load(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_sync_load )
{
// Nothing to do?
}
-static void rdp_sync_pipe(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_sync_pipe )
{
// Nothing to do?
}
-static void rdp_sync_tile(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_sync_tile )
{
// Nothing to do?
}
-static void rdp_sync_full(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_sync_full )
{
- dp_full_sync(Machine);
+ dp_full_sync(machine);
}
-static void rdp_set_key_gb(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_key_gb )
{
//osd_die("RDP: unhandled command set_key_gb, %08X %08X\n", w1, w2);
}
-static void rdp_set_key_r(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_key_r )
{
//osd_die("RDP: unhandled command set_key_r, %08X %08X\n", w1, w2);
}
-static void rdp_set_convert(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_convert )
{
//osd_die("RDP: unhandled command set_convert, %08X %08X\n", w1, w2);
}
-static void rdp_set_scissor(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_scissor )
{
clip.xh = (w1 >> 12) & 0xfff;
clip.yh = (w1 >> 0) & 0xfff;
@@ -3025,13 +3027,13 @@ static void rdp_set_scissor(UINT32 w1, UINT32 w2)
// TODO: handle f & o?
}
-static void rdp_set_prim_depth(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_prim_depth )
{
primitive_z = (UINT16)(w2 >> 16);
primitive_delta_z = (UINT16)(w1);
}
-static void rdp_set_other_modes(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_other_modes )
{
other_modes.cycle_type = (w1 >> 20) & 0x3;
other_modes.persp_tex_en = (w1 & 0x80000) ? 1 : 0;
@@ -3090,7 +3092,7 @@ static void rdp_set_other_modes(UINT32 w1, UINT32 w2)
}
}
-static void rdp_load_tlut(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_load_tlut )
{
int i;
UINT16 sl, sh;
@@ -3127,7 +3129,7 @@ static void rdp_load_tlut(UINT32 w1, UINT32 w2)
}
-static void rdp_set_tile_size(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_tile_size )
{
int tilenum = (w2 >> 24) & 0x7;
@@ -3137,7 +3139,7 @@ static void rdp_set_tile_size(UINT32 w1, UINT32 w2)
tile[tilenum].th = (w2 >> 0) & 0xfff;
}
-static void rdp_load_block(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_load_block )
{
int i, width;
UINT16 sl, sh, tl, dxt;
@@ -3190,7 +3192,7 @@ static void rdp_load_block(UINT32 w1, UINT32 w2)
}
}
-static void rdp_load_tile(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_load_tile )
{
int i, j;
UINT16 sl, sh, tl, th;
@@ -3285,7 +3287,7 @@ static void rdp_load_tile(UINT32 w1, UINT32 w2)
}
-static void rdp_set_tile(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_tile )
{
int tilenum = (w2 >> 24) & 0x7;
@@ -3305,7 +3307,7 @@ static void rdp_set_tile(UINT32 w1, UINT32 w2)
// TODO: clamp & mirror parameters
}
-static void rdp_fill_rect(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_fill_rect )
{
RECTANGLE rect;
rect.xl = (w1 >> 12) & 0xfff;
@@ -3320,12 +3322,12 @@ static void rdp_fill_rect(UINT32 w1, UINT32 w2)
}
}
-static void rdp_set_fill_color(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_fill_color )
{
fill_color = w2;
}
-static void rdp_set_fog_color(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_fog_color )
{
fog_color.r = (w2 >> 24) & 0xff;
fog_color.g = (w2 >> 16) & 0xff;
@@ -3333,7 +3335,7 @@ static void rdp_set_fog_color(UINT32 w1, UINT32 w2)
fog_color.a = (w2 >> 0) & 0xff;
}
-static void rdp_set_blend_color(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_blend_color )
{
blend_color.r = (w2 >> 24) & 0xff;
blend_color.g = (w2 >> 16) & 0xff;
@@ -3341,7 +3343,7 @@ static void rdp_set_blend_color(UINT32 w1, UINT32 w2)
blend_color.a = (w2 >> 0) & 0xff;
}
-static void rdp_set_prim_color(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_prim_color )
{
// TODO: prim min level, prim_level
prim_color.r = (w2 >> 24) & 0xff;
@@ -3350,7 +3352,7 @@ static void rdp_set_prim_color(UINT32 w1, UINT32 w2)
prim_color.a = (w2 >> 0) & 0xff;
}
-static void rdp_set_env_color(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_env_color )
{
env_color.r = (w2 >> 24) & 0xff;
env_color.g = (w2 >> 16) & 0xff;
@@ -3358,7 +3360,7 @@ static void rdp_set_env_color(UINT32 w1, UINT32 w2)
env_color.a = (w2 >> 0) & 0xff;
}
-static void rdp_set_combine(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_combine )
{
combine.sub_a_rgb0 = (w1 >> 20) & 0xf;
combine.mul_rgb0 = (w1 >> 15) & 0x1f;
@@ -3397,7 +3399,7 @@ static void rdp_set_combine(UINT32 w1, UINT32 w2)
SET_SUB_ALPHA_INPUT(&combiner_alphaadd[1], combine.add_a1);
}
-static void rdp_set_texture_image(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_texture_image )
{
ti_format = (w1 >> 21) & 0x7;
ti_size = (w1 >> 19) & 0x3;
@@ -3405,12 +3407,12 @@ static void rdp_set_texture_image(UINT32 w1, UINT32 w2)
ti_address = w2 & 0x01ffffff;
}
-static void rdp_set_mask_image(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_mask_image )
{
zb_address = w2 & 0x01ffffff;
}
-static void rdp_set_color_image(UINT32 w1, UINT32 w2)
+static RDP_COMMAND( rdp_set_color_image )
{
fb_format = (w1 >> 21) & 0x7;
fb_size = (w1 >> 19) & 0x3;
@@ -3423,7 +3425,7 @@ static void rdp_set_color_image(UINT32 w1, UINT32 w2)
/*****************************************************************************/
-static void (*const rdp_command_table[64])(UINT32 w1, UINT32 w2) =
+static const rdp_command_func rdp_command_table[64] =
{
/* 0x00 */
rdp_noop, rdp_invalid, rdp_invalid, rdp_invalid,
@@ -3447,7 +3449,7 @@ static void (*const rdp_command_table[64])(UINT32 w1, UINT32 w2) =
rdp_set_combine, rdp_set_texture_image, rdp_set_mask_image, rdp_set_color_image
};
-void rdp_process_list(void)
+void rdp_process_list(running_machine *machine)
{
int i;
UINT32 cmd, length, cmd_length;
@@ -3498,7 +3500,7 @@ void rdp_process_list(void)
}
// execute the command
- rdp_command_table[cmd](rdp_cmd_data[rdp_cmd_cur+0], rdp_cmd_data[rdp_cmd_cur+1]);
+ rdp_command_table[cmd](machine, rdp_cmd_data[rdp_cmd_cur+0], rdp_cmd_data[rdp_cmd_cur+1]);
rdp_cmd_cur += rdp_command_length[cmd] / 4;
};
diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c
index 9a8d1a26a73..514c830bb62 100644
--- a/src/mame/video/n8080.c
+++ b/src/mame/video/n8080.c
@@ -28,7 +28,7 @@ WRITE8_HANDLER( n8080_video_control_w )
sheriff_color_mode = (data >> 3) & 3;
sheriff_color_data = (data >> 0) & 7;
- flip_screen_set_no_update(data & 0x20);
+ flip_screen_set_no_update(space->machine, data & 0x20);
}
@@ -76,7 +76,7 @@ static TIMER_CALLBACK( spacefev_stop_red_cannon )
}
-static void helifire_next_line(void)
+static void helifire_next_line(running_machine *machine)
{
helifire_mv++;
@@ -86,7 +86,7 @@ static void helifire_next_line(void)
}
else
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
helifire_mv %= 255;
}
@@ -107,7 +107,7 @@ VIDEO_START( spacefev )
{
cannon_timer = timer_alloc(machine, spacefev_stop_red_cannon, NULL);
- flip_screen_set_no_update(0);
+ flip_screen_set_no_update(machine, 0);
spacefev_red_screen = 0;
spacefev_red_cannon = 0;
@@ -116,7 +116,7 @@ VIDEO_START( spacefev )
VIDEO_START( sheriff )
{
- flip_screen_set_no_update(0);
+ flip_screen_set_no_update(machine, 0);
sheriff_color_mode = 0;
sheriff_color_data = 0;
@@ -143,7 +143,7 @@ VIDEO_START( helifire )
helifire_LSFR[i] = data;
}
- flip_screen_set_no_update(0);
+ flip_screen_set_no_update(machine, 0);
helifire_flash = 0;
}
@@ -151,7 +151,7 @@ VIDEO_START( helifire )
VIDEO_UPDATE( spacefev )
{
- UINT8 mask = flip_screen_get() ? 0xff : 0x00;
+ UINT8 mask = flip_screen_get(screen->machine) ? 0xff : 0x00;
int x;
int y;
@@ -222,7 +222,7 @@ VIDEO_UPDATE( spacefev )
VIDEO_UPDATE( sheriff )
{
- UINT8 mask = flip_screen_get() ? 0xff : 0x00;
+ UINT8 mask = flip_screen_get(screen->machine) ? 0xff : 0x00;
const UINT8* pPROM = memory_region(screen->machine, "proms");
@@ -339,7 +339,7 @@ VIDEO_UPDATE( helifire )
for (n = 0; n < 8; n++)
{
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
if ((videoram[offset ^ 0x1fff] << n) & 0x80)
{
@@ -358,7 +358,7 @@ VIDEO_UPDATE( helifire )
/* next line */
- helifire_next_line();
+ helifire_next_line(screen->machine);
}
helifire_mv = saved_mv;
@@ -400,6 +400,6 @@ VIDEO_EOF( helifire )
for (i = 0; i < 256; i++)
{
- helifire_next_line();
+ helifire_next_line(machine);
}
}
diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c
index bf31e8246f7..841cf159952 100644
--- a/src/mame/video/namcos1.c
+++ b/src/mame/video/namcos1.c
@@ -308,7 +308,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx += sprite_xoffs;
sy -= sprite_yoffs;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = -sx - sizex;
sy = -sy - sizey;
@@ -343,9 +343,9 @@ VIDEO_UPDATE( namcos1 )
rectangle new_clip = *cliprect;
/* flip screen is embedded in the sprite control registers */
- /* can't use flip_screen_set() because the visible area is asymmetrical */
- flip_screen_set_no_update(spriteram[0x07f6] & 1);
- tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (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, spriteram[0x07f6] & 1);
+ tilemap_set_flip(ALL_TILEMAPS,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* background color */
@@ -377,7 +377,7 @@ VIDEO_UPDATE( namcos1 )
scrollx = ( namcos1_playfield_control[j+1] + (namcos1_playfield_control[j+0]<<8) ) - disp_x[i];
scrolly = ( namcos1_playfield_control[j+3] + (namcos1_playfield_control[j+2]<<8) ) + 8;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
scrollx = -scrollx;
scrolly = -scrolly;
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index c37f03c4f80..27171d6252a 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -34,7 +34,6 @@ SPOT TABLE test
*/
#include "driver.h"
-#include "deprecat.h"
#include "eminline.h"
#include "video/rgbutil.h"
#include "namcos22.h"
@@ -253,7 +252,7 @@ struct _poly_extra_data
{
rgbint fogColor;
rgbint fadeColor;
- int color;
+ const pen_t *pens;
int bn;
UINT16 flags;
int cmode;
@@ -280,7 +279,7 @@ static void renderscanline_uvi_full(void *dest, INT32 scanline, const poly_exten
bitmap_t *bitmap = dest;
const poly_extra_data *extra = extradata;
int bn = extra->bn * 0x1000;
- const pen_t *pens = &Machine->pens[(extra->color&0x7f)<<8];
+ const pen_t *pens = extra->pens;
int fogFactor = 0xff - extra->fogFactor;
int fadeFactor = 0xff - extra->fadeFactor;
int transFactor = 0xff;
@@ -437,7 +436,7 @@ static void poly3d_DrawQuad(running_machine *machine, bitmap_t *bitmap, int text
extra = poly_get_extra_data(poly);
- extra->color = color;
+ extra->pens = &machine->pens[(color&0x7f)<<8];
extra->bn = textureBank;
extra->flags = flags;
extra->cmode = cmode;
@@ -491,7 +490,7 @@ static void renderscanline_sprite(void *destbase, INT32 scanline, const poly_ext
int dx = extent->param[0].dpdx * 65536.0f;
const poly_extra_data *extra = extradata;
bitmap_t *destmap = destbase;
- const pen_t *pal = &Machine->pens[extra->color];
+ const pen_t *pal = extra->pens;
int prioverchar = extra->prioverchar;
int z = extra->z;
int alpha = extra->alpha;
@@ -597,7 +596,7 @@ mydrawgfxzoom(
extra->alpha = alpha;
extra->prioverchar = prioverchar;
extra->line_modulo = gfx->line_modulo;
- extra->color = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
+ extra->pens = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
extra->source = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
#ifdef RENDER_AS_QUADS
poly_render_quad_fan(poly, dest_bmp, clip, renderscanline_sprite, 2, 4, &vert[0]);
diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c
index 10c4c96649e..d8eb7d8b81f 100644
--- a/src/mame/video/namcos86.c
+++ b/src/mame/video/namcos86.c
@@ -300,7 +300,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx += sprite_xoffs;
sy -= sprite_yoffs;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = -sx - sizex;
sy = -sy - sizey;
@@ -328,14 +328,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void set_scroll(int layer)
+static void set_scroll(running_machine *machine, int layer)
{
static const int xdisp[4] = { 47, 49, 46, 48 };
int scrollx,scrolly;
scrollx = xscroll[layer] - xdisp[layer];
scrolly = yscroll[layer] + 9;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
scrollx = -scrollx;
scrolly = -scrolly;
@@ -350,13 +350,13 @@ VIDEO_UPDATE( namcos86 )
int layer;
/* flip screen is embedded in the sprite control registers */
- /* can't use flip_screen_set() because the visible area is asymmetrical */
- flip_screen_set_no_update(spriteram[0x07f6] & 1);
- tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- set_scroll(0);
- set_scroll(1);
- set_scroll(2);
- set_scroll(3);
+ /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */
+ flip_screen_set_no_update(screen->machine, spriteram[0x07f6] & 1);
+ tilemap_set_flip(ALL_TILEMAPS,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(priority_bitmap, cliprect, 0);
diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c
index ea38dbd9e03..ee787d8e337 100644
--- a/src/mame/video/ninjakd2.c
+++ b/src/mame/video/ninjakd2.c
@@ -368,7 +368,7 @@ static void draw_sprites(running_machine* const machine, bitmap_t* const bitmap)
int const big = (sprptr[2] & 0x04) >> 2;
int x,y;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - 16*big - sx;
sy = 240 - 16*big - sy;
diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c
index d6bfce614e5..3577101e814 100644
--- a/src/mame/video/nmk16.c
+++ b/src/mame/video/nmk16.c
@@ -370,7 +370,7 @@ WRITE16_HANDLER( manybloc_scroll_w )
WRITE16_HANDLER( nmk_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
WRITE16_HANDLER( nmk_tilebank_w )
@@ -434,7 +434,7 @@ static void nmk16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
if(pri != priority)
continue;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 368 - sx;
sy = 240 - sy;
@@ -451,7 +451,7 @@ static void nmk16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
drawgfx(bitmap,machine->gfx[2],
code,
color,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(machine), flip_screen_get(machine),
((x + 16) & 0x1ff) - 16,sy & 0x1ff,
cliprect,TRANSPARENCY_PEN,15);
code++;
@@ -488,10 +488,10 @@ static void nmk16_draw_sprites_flipsupported(running_machine *machine, bitmap_t
if(pri != priority)
continue;
- flipx ^= flip_screen_get();
- flipy ^= flip_screen_get();
+ flipx ^= flip_screen_get(machine);
+ flipy ^= flip_screen_get(machine);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 368 - sx;
sy = 240 - sy;
@@ -1068,8 +1068,8 @@ static void video_update(running_machine *machine, bitmap_t *bitmap, const recta
if (dsw_flipscreen)
{
- flip_screen_x_set(~input_port_read(machine, "DSW1") & 0x0100);
- flip_screen_y_set(~input_port_read(machine, "DSW1") & 0x0200);
+ flip_screen_x_set(machine, ~input_port_read(machine, "DSW1") & 0x0100);
+ flip_screen_y_set(machine, ~input_port_read(machine, "DSW1") & 0x0200);
}
tilemap_set_scrollx(tilemap_0, 0, afega_scroll_0[1] + xoffset);
diff --git a/src/mame/video/nova2001.c b/src/mame/video/nova2001.c
index 43204d187a5..8fd9a55661c 100644
--- a/src/mame/video/nova2001.c
+++ b/src/mame/video/nova2001.c
@@ -241,12 +241,12 @@ WRITE8_HANDLER( nova2001_scroll_y_w )
WRITE8_HANDLER( nova2001_flipscreen_w )
{
// inverted
- flip_screen_set(~data & 1);
+ flip_screen_set(space->machine, ~data & 1);
}
WRITE8_HANDLER( pkunwar_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
@@ -277,7 +277,7 @@ static void nova2001_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
continue;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -314,7 +314,7 @@ static void pkunwar_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
continue;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/othldrby.c b/src/mame/video/othldrby.c
index 681e182221f..7ce34dceb63 100644
--- a/src/mame/video/othldrby.c
+++ b/src/mame/video/othldrby.c
@@ -153,7 +153,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sizex = (buf_spriteram[offs+2] & 0x000f) + 1;
sizey = (buf_spriteram[offs+3] & 0x000f) + 1;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
@@ -181,11 +181,11 @@ VIDEO_UPDATE( othldrby )
int layer;
- flip_screen_set(vreg[0x0f] & 0x80);
+ flip_screen_set(screen->machine, vreg[0x0f] & 0x80);
for (layer = 0;layer < 3;layer++)
{
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
tilemap_set_scrollx(bg_tilemap[layer],0,vreg[2*layer]+59);
tilemap_set_scrolly(bg_tilemap[layer],0,vreg[2*layer+1]+248);
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index a85ce04e668..c029035440b 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -309,7 +309,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sprite &= ~sizex;
sprite &= ~(sizey << 1);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
@@ -379,8 +379,8 @@ VIDEO_UPDATE( pacland )
int row;
for (row = 5; row < 29; row++)
- tilemap_set_scrollx(fg_tilemap, row, flip_screen_get() ? scroll0-7 : scroll0);
- tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? scroll1-4 : scroll1-3);
+ tilemap_set_scrollx(fg_tilemap, row, flip_screen_get(screen->machine) ? scroll0-7 : scroll0);
+ tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get(screen->machine) ? scroll1-4 : 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
diff --git a/src/mame/video/paradise.c b/src/mame/video/paradise.c
index 5fc2c301c67..0df0626890a 100644
--- a/src/mame/video/paradise.c
+++ b/src/mame/video/paradise.c
@@ -39,12 +39,12 @@ static UINT8 paradise_palbank, paradise_priority;
WRITE8_HANDLER( paradise_flipscreen_w )
{
- flip_screen_set(data ? 0 : 1);
+ flip_screen_set(space->machine, data ? 0 : 1);
}
WRITE8_HANDLER( tgtball_flipscreen_w )
{
- flip_screen_set(data ? 1 : 0);
+ flip_screen_set(space->machine, data ? 1 : 0);
}
@@ -192,7 +192,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int flipx = 0; // ?
int flipy = 0;
- if (flip_screen_get()) { x = 0xf0 - x; flipx = !flipx;
+ if (flip_screen_get(machine)) { x = 0xf0 - x; flipx = !flipx;
y = 0xf0 - y; flipy = !flipy; }
drawgfx(bitmap,machine->gfx[0],
@@ -253,7 +253,7 @@ if (input_code_pressed(KEYCODE_Z))
if (layers_ctrl&1) tilemap_draw(bitmap,cliprect, tilemap_0, 0,0);
if (layers_ctrl&2) tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
- if (layers_ctrl&4) copybitmap_trans(bitmap,tmpbitmap,flip_screen_get(),flip_screen_get(),0,0,cliprect, 0x80f);
+ if (layers_ctrl&4) copybitmap_trans(bitmap,tmpbitmap,flip_screen_get(screen->machine),flip_screen_get(screen->machine),0,0,cliprect, 0x80f);
if (paradise_priority & 2)
{
diff --git a/src/mame/video/pbaction.c b/src/mame/video/pbaction.c
index d96a944906c..b7562e5c3c3 100644
--- a/src/mame/video/pbaction.c
+++ b/src/mame/video/pbaction.c
@@ -41,14 +41,14 @@ WRITE8_HANDLER( pbaction_colorram2_w )
WRITE8_HANDLER( pbaction_scroll_w )
{
scroll = data - 3;
- if (flip_screen_get()) scroll = -scroll;
+ if (flip_screen_get(space->machine)) scroll = -scroll;
tilemap_set_scrollx(bg_tilemap, 0, scroll);
tilemap_set_scrollx(fg_tilemap, 0, scroll);
}
WRITE8_HANDLER( pbaction_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -100,7 +100,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = 241-spriteram[offs+2];
flipx = spriteram[offs+1] & 0x40;
flipy = spriteram[offs+1] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
if (spriteram[offs] & 0x80)
{
@@ -120,7 +120,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
spriteram[offs],
spriteram[offs + 1] & 0x0f,
flipx,flipy,
- sx + (flip_screen_get() ? scroll : -scroll), sy,
+ sx + (flip_screen_get(machine) ? scroll : -scroll), sy,
cliprect,TRANSPARENCY_PEN,0);
}
}
diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c
index 94366da688a..8107ee827b5 100644
--- a/src/mame/video/pcktgal.c
+++ b/src/mame/video/pcktgal.c
@@ -38,9 +38,9 @@ WRITE8_HANDLER( pcktgal_videoram_w )
WRITE8_HANDLER( pcktgal_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -75,7 +75,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = spriteram[offs+1] & 0x04;
flipy = spriteram[offs+1] & 0x02;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sx=240-sx;
sy=240-sy;
if (flipx) flipx=0; else flipx=1;
diff --git a/src/mame/video/pitnrun.c b/src/mame/video/pitnrun.c
index d1b10205bba..aece136d18f 100644
--- a/src/mame/video/pitnrun.c
+++ b/src/mame/video/pitnrun.c
@@ -202,12 +202,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = (spriteram[offs+1]&0x80)>>7;
flipx = (spriteram[offs+1]&0x40)>>6;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 256 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
@@ -257,10 +257,10 @@ VIDEO_UPDATE( pitnrun )
dx=128-pitnrun_h_heed+((pitnrun_ha&8)<<5)+3;
dy=128-pitnrun_v_heed+((pitnrun_ha&0x10)<<4);
- if (flip_screen_x_get())
+ if (flip_screen_x_get(screen->machine))
dx=128-dx+16;
- if (flip_screen_y_get())
+ if (flip_screen_y_get(screen->machine))
dy=128-dy;
myclip.min_x=dx;
@@ -281,7 +281,7 @@ VIDEO_UPDATE( pitnrun )
draw_sprites(screen->machine,bitmap,&myclip);
if(pitnrun_ha&4)
- copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x_get(),flip_screen_y_get(),dx,dy,&myclip, 1);
+ copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine),dx,dy,&myclip, 1);
tilemap_draw(bitmap,cliprect,fg, 0,0);
return 0;
}
diff --git a/src/mame/video/pktgaldx.c b/src/mame/video/pktgaldx.c
index c44d190f1e7..937de5182bf 100644
--- a/src/mame/video/pktgaldx.c
+++ b/src/mame/video/pktgaldx.c
@@ -8,7 +8,7 @@ UINT16* pcktgaldb_sprites;
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
{
int offs;
- int flipscreen=!flip_screen_get();
+ int flipscreen=!flip_screen_get(machine);
for (offs = 0;offs < 0x400;offs += 4)
{
@@ -85,7 +85,7 @@ VIDEO_START(pktgaldx)
VIDEO_UPDATE(pktgaldx)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,0); /* not Confirmed */
diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c
index 872e589f316..24cca74d446 100644
--- a/src/mame/video/playch10.c
+++ b/src/mame/video/playch10.c
@@ -1,5 +1,4 @@
#include "driver.h"
-#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "includes/playch10.h"
@@ -58,9 +57,9 @@ PALETTE_INIT( playch10 )
ppu2c0x_init_palette(machine, 256 );
}
-static void ppu_irq( int num, int *ppu_regs )
+static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
{
- cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
+ cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
pc10_int_detect = 1;
}
diff --git a/src/mame/video/pokechmp.c b/src/mame/video/pokechmp.c
index e51a812f51a..cf2b151f8c6 100644
--- a/src/mame/video/pokechmp.c
+++ b/src/mame/video/pokechmp.c
@@ -12,9 +12,9 @@ WRITE8_HANDLER( pokechmp_videoram_w )
WRITE8_HANDLER( pokechmp_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -49,7 +49,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = spriteram[offs+1] & 0x04;
flipy = spriteram[offs+1] & 0x02;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sx=240-sx;
sy=240-sy;
if (flipx) flipx=0; else flipx=1;
diff --git a/src/mame/video/pooyan.c b/src/mame/video/pooyan.c
index bab14dd7ff4..920ff2bc54a 100644
--- a/src/mame/video/pooyan.c
+++ b/src/mame/video/pooyan.c
@@ -147,7 +147,7 @@ WRITE8_HANDLER( pooyan_colorram_w )
WRITE8_HANDLER( pooyan_flipscreen_w )
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
}
diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c
index b9a99592b31..3f727dfda6e 100644
--- a/src/mame/video/popeye.c
+++ b/src/mame/video/popeye.c
@@ -193,7 +193,7 @@ WRITE8_HANDLER( popeye_bitmap_w )
sx = 8 * (offset % 128);
sy = 8 * (offset / 128);
- if (flip_screen_get())
+ if (flip_screen_get(space->machine))
sy = 512-8 - sy;
colour = data & 0x0f;
@@ -210,7 +210,7 @@ WRITE8_HANDLER( popeye_bitmap_w )
sx = 8 * (offset % 64);
sy = 4 * (offset / 64);
- if (flip_screen_get())
+ if (flip_screen_get(space->machine))
sy = 512-4 - sy;
colour = data & 0x0f;
@@ -269,12 +269,12 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
static int lastflip = 0;
const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
- if (lastflip != flip_screen_get())
+ if (lastflip != flip_screen_get(machine))
{
for (offs = 0;offs < popeye_bitmapram_size;offs++)
popeye_bitmap_w(space,offs,popeye_bitmapram[offs]);
- lastflip = flip_screen_get();
+ lastflip = flip_screen_get(machine);
}
set_background_palette(machine, (*popeye_palettebank & 0x08) >> 3);
@@ -290,7 +290,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
if (bitmap_type == TYPE_SKYSKIPR)
scrollx = 2*scrollx - 512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
if (bitmap_type == TYPE_POPEYE)
scrollx = -scrollx;
@@ -336,7 +336,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = 2*(spriteram[offs])-8;
sy = 2*(256-spriteram[offs + 1]);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
diff --git a/src/mame/video/powerins.c b/src/mame/video/powerins.c
index 808235ea5d5..f273413dad8 100644
--- a/src/mame/video/powerins.c
+++ b/src/mame/video/powerins.c
@@ -59,7 +59,7 @@ static int tile_bank;
WRITE16_HANDLER( powerins_flipscreen_w )
{
- if (ACCESSING_BITS_0_7) flip_screen_set( data & 1 );
+ if (ACCESSING_BITS_0_7) flip_screen_set(space->machine, data & 1 );
}
WRITE16_HANDLER( powerins_tilebank_w )
@@ -298,7 +298,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
/* Handle flip_screen. Apply a global offset of 32 pixels along x too */
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{ sx = screen_w - sx - dimx*16 - 32; flipx = !flipx;
sy = screen_h - sy - dimy*16; flipy = !flipy;
code += dimx*dimy-1; inc = -1; }
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index 06ea5e9c19f..4b82974021a 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -25,7 +25,6 @@ NES-specific:
******************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "profiler.h"
#include "video/ppu2c0x.h"
@@ -113,7 +112,7 @@ static ppu2c0x_interface *intf;
/* chips state - allocated at init time */
static ppu2c0x_chip *chips = 0;
-static void update_scanline(int num );
+static void update_scanline(running_machine *machine, int num );
static TIMER_CALLBACK( scanline_callback );
static TIMER_CALLBACK( hblank_callback );
@@ -382,10 +381,10 @@ static TIMER_CALLBACK( hblank_callback )
int blanked = ( ppu_regs[PPU_CONTROL1] & ( PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES ) ) == 0;
int vblank = ((this_ppu->scanline >= PPU_VBLANK_FIRST_SCANLINE-1) && (this_ppu->scanline < this_ppu->scanlines_per_frame-1)) ? 1 : 0;
-// update_scanline (num);
+// update_scanline (machine, num);
if (this_ppu->hblank_callback_proc)
- (*this_ppu->hblank_callback_proc) (num, this_ppu->scanline, vblank, blanked);
+ (*this_ppu->hblank_callback_proc) (machine, num, this_ppu->scanline, vblank, blanked);
timer_adjust_oneshot(chips[num].hblank_timer, attotime_never, num);
}
@@ -397,12 +396,12 @@ static TIMER_CALLBACK( nmi_callback )
// Actually fire the VMI
if (intf->nmi_handler[num])
- (*intf->nmi_handler[num]) (num, ppu_regs);
+ (*intf->nmi_handler[num]) (machine, num, ppu_regs);
timer_adjust_oneshot(chips[num].nmi_timer, attotime_never, num);
}
-static void draw_background(const int num, UINT8 *line_priority )
+static void draw_background(running_machine *machine, int num, UINT8 *line_priority )
{
/* cache some values locally */
bitmap_t *bitmap = chips[num].bitmap;
@@ -541,7 +540,7 @@ static void draw_background(const int num, UINT8 *line_priority )
}
}
-static void draw_sprites(const int num, UINT8 *line_priority )
+static void draw_sprites(running_machine *machine, int num, UINT8 *line_priority )
{
/* cache some values locally */
bitmap_t *bitmap = chips[num].bitmap;
@@ -727,7 +726,7 @@ static void draw_sprites(const int num, UINT8 *line_priority )
* Scanline Rendering and Update
*
*************************************/
-static void render_scanline(int num)
+static void render_scanline(running_machine *machine, int num)
{
UINT8 line_priority[VISIBLE_SCREEN_WIDTH];
int *ppu_regs = &chips[num].regs[0];
@@ -743,7 +742,7 @@ static void render_scanline(int num)
/* see if we need to render the background */
if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_BACKGROUND )
- draw_background(num, line_priority );
+ draw_background(machine, num, line_priority );
else
{
bitmap_t *bitmap = chips[num].bitmap;
@@ -768,13 +767,13 @@ static void render_scanline(int num)
/* if sprites are on, draw them */
if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_SPRITES )
- draw_sprites( num, line_priority );
+ draw_sprites( machine, num, line_priority );
/* done updating, whew */
profiler_mark(PROFILER_END);
}
-static void update_scanline(int num )
+static void update_scanline(running_machine *machine, int num )
{
ppu2c0x_chip* this_ppu;
int scanline = chips[num].scanline;
@@ -793,7 +792,7 @@ static void update_scanline(int num )
this_ppu->refresh_data |= ( this_ppu->refresh_latch & 0x041f );
//logerror(" updating refresh_data: %04x (scanline: %d)\n", this_ppu->refresh_data, this_ppu->scanline);
- render_scanline( num );
+ render_scanline( machine, num );
}
else
{
@@ -867,10 +866,10 @@ static TIMER_CALLBACK( scanline_callback )
/* if a callback is available, call it */
if ( this_ppu->scanline_callback_proc )
- (*this_ppu->scanline_callback_proc)( num, this_ppu->scanline, vblank, blanked );
+ (*this_ppu->scanline_callback_proc)( machine, num, this_ppu->scanline, vblank, blanked );
/* update the scanline that just went by */
- update_scanline( num );
+ update_scanline( machine, num );
/* increment our scanline count */
this_ppu->scanline++;
@@ -1027,7 +1026,7 @@ void ppu2c0x_reset(running_machine *machine, int num, int scan_scale)
* PPU Registers Read
*
*************************************/
-int ppu2c0x_r( int num, offs_t offset )
+int ppu2c0x_r( const address_space *space, offs_t offset, int num )
{
ppu2c0x_chip* this_ppu;
@@ -1100,7 +1099,7 @@ int ppu2c0x_r( int num, offs_t offset )
* PPU Registers Write
*
*************************************/
-void ppu2c0x_w( int num, offs_t offset, UINT8 data )
+void ppu2c0x_w( const address_space *space, offs_t offset, UINT8 data, int num )
{
ppu2c0x_chip* this_ppu;
int color_base;
@@ -1123,7 +1122,10 @@ void ppu2c0x_w( int num, offs_t offset, UINT8 data )
#ifdef MAME_DEBUG
if (this_ppu->scanline <= PPU_BOTTOM_VISIBLE_SCANLINE)
- logerror(" PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, this_ppu->scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
+ {
+ const device_config *screen = space->machine->primary_screen;
+ logerror(" PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, this_ppu->scanline, video_screen_get_vpos(screen), video_screen_get_hpos(screen));
+ }
#endif
switch( offset & 7 )
@@ -1225,7 +1227,7 @@ void ppu2c0x_w( int num, offs_t offset, UINT8 data )
/* if there's a callback, call it now */
if ( this_ppu->vidaccess_callback_proc )
- data = (*this_ppu->vidaccess_callback_proc)( num, tempAddr, data );
+ data = (*this_ppu->vidaccess_callback_proc)( space->machine, num, tempAddr, data );
/* see if it's on the chargen portion */
if ( tempAddr < 0x2000 )
@@ -1329,7 +1331,7 @@ void ppu2c0x_spriteram_dma (const address_space *space, int num, const UINT8 pag
for (i = 0; i < SPRITERAM_SIZE; i++)
{
UINT8 spriteData = memory_read_byte(space, address + i);
- ppu2c0x_w (num, PPU_SPRITE_DATA, spriteData);
+ ppu2c0x_w (space, PPU_SPRITE_DATA, spriteData, num);
}
// should last 513 CPU cycles.
@@ -1415,7 +1417,7 @@ void ppu2c0x_set_videorom_bank( int num, int start_page, int num_pages, int bank
int count = num_pages * 0x400;
int rom_start = bank * bank_size * 16;
- memcpy( &chips[num].videomem[vram_start], &memory_region( Machine, intf->vrom_region[num] )[rom_start], count );
+ memcpy( &chips[num].videomem[vram_start], &memory_region( chips[num].machine, intf->vrom_region[num] )[rom_start], count );
}
}
@@ -1644,20 +1646,20 @@ void ppu2c0x_set_scanlines_per_frame( int num, int scanlines )
READ8_HANDLER( ppu2c0x_0_r )
{
- return ppu2c0x_r( 0, offset );
+ return ppu2c0x_r( space, offset, 0 );
}
READ8_HANDLER( ppu2c0x_1_r )
{
- return ppu2c0x_r( 1, offset );
+ return ppu2c0x_r( space, offset, 1 );
}
WRITE8_HANDLER( ppu2c0x_0_w )
{
- ppu2c0x_w( 0, offset, data );
+ ppu2c0x_w( space, offset, data, 0 );
}
WRITE8_HANDLER( ppu2c0x_1_w )
{
- ppu2c0x_w( 1, offset, data );
+ ppu2c0x_w( space, offset, data, 1 );
}
diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h
index 1cac122c16f..92564401b8f 100644
--- a/src/mame/video/ppu2c0x.h
+++ b/src/mame/video/ppu2c0x.h
@@ -79,10 +79,10 @@ typedef enum
} ppu_t;
/* callback datatypes */
-typedef void (*ppu2c0x_scanline_cb)( int num, int scanline, int vblank, int blanked );
-typedef void (*ppu2c0x_hblank_cb)( int num, int scanline, int vblank, int blanked );
-typedef void (*ppu2c0x_nmi_cb)( int num, int *ppu_regs );
-typedef int (*ppu2c0x_vidaccess_cb)( int num, int address, int data );
+typedef void (*ppu2c0x_scanline_cb)( running_machine *machine, int num, int scanline, int vblank, int blanked );
+typedef void (*ppu2c0x_hblank_cb)( running_machine *machine, int num, int scanline, int vblank, int blanked );
+typedef void (*ppu2c0x_nmi_cb)( running_machine *machine, int num, int *ppu_regs );
+typedef int (*ppu2c0x_vidaccess_cb)( running_machine *machine, int num, int address, int data );
typedef struct _ppu2c0x_interface ppu2c0x_interface;
struct _ppu2c0x_interface
@@ -118,8 +118,8 @@ void ppu2c0x_set_scanlines_per_frame( int num, int scanlines );
//27/12/2002
extern void (*ppu_latch)( offs_t offset );
-void ppu2c0x_w( int num, offs_t offset, UINT8 data );
-int ppu2c0x_r( int num, offs_t offset );
+void ppu2c0x_w( const address_space *space, offs_t offset, UINT8 data, int num );
+int ppu2c0x_r( const address_space *space, offs_t offset, int num );
/* accesors */
READ8_HANDLER( ppu2c0x_0_r );
diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c
index 4e1d964d36c..93e0e5b89de 100644
--- a/src/mame/video/prehisle.c
+++ b/src/mame/video/prehisle.c
@@ -56,7 +56,7 @@ WRITE16_HANDLER( prehisle_control16_w )
case 0x23: invert_controls = data ? 0x00ff : 0x0000; break;
case 0x28: coin_counter_w(0, data & 1); break;
case 0x29: coin_counter_w(1, data & 1); break;
- case 0x30: flip_screen_set(data & 0x01); break;
+ case 0x30: flip_screen_set(space->machine, data & 0x01); break;
}
}
@@ -127,7 +127,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (sx & 0x200) sx = -(0xff - (sx & 0xff)); // wraparound
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c
index 1ef3a40784c..887b32af011 100644
--- a/src/mame/video/psikyo.c
+++ b/src/mame/video/psikyo.c
@@ -359,7 +359,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
zoomy = 32 - zoomy;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = width - x - (nx * zoomx)/2;
y = height - y - (ny * zoomy)/2;
@@ -434,7 +434,7 @@ VIDEO_UPDATE( psikyo )
tilemap *tmptilemap0, *tmptilemap1;
- flip_screen_set(~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) */
diff --git a/src/mame/video/psx.c b/src/mame/video/psx.c
index 1113505fe26..84a96e2b1c3 100644
--- a/src/mame/video/psx.c
+++ b/src/mame/video/psx.c
@@ -18,7 +18,6 @@
***************************************************************************/
#include "driver.h"
-#include "deprecat.h"
#include "includes/psx.h"
#define STOP_ON_ERROR ( 0 )
@@ -946,10 +945,8 @@ f e| d c| b| a 9| 8 7| 6 5| 4| 3 2 1 0
|iy|ix|ty| | tp| abr|ty| tx
*/
-INLINE void decode_tpage( struct PSXGPU *p_psxgpu, UINT32 tpage )
+INLINE void decode_tpage( running_machine *machine, struct PSXGPU *p_psxgpu, UINT32 tpage )
{
- running_machine *machine = Machine;
-
if( m_n_gputype == 2 )
{
m_n_gpustatus = ( m_n_gpustatus & 0xfffff800 ) | ( tpage & 0x7ff );
@@ -1451,9 +1448,8 @@ INLINE void decode_tpage( struct PSXGPU *p_psxgpu, UINT32 tpage )
} \
}
-static void FlatPolygon( int n_points )
+static void FlatPolygon( running_machine *machine, int n_points )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
@@ -1607,9 +1603,8 @@ static void FlatPolygon( int n_points )
}
}
-static void FlatTexturedPolygon( int n_points )
+static void FlatTexturedPolygon( running_machine *machine, int n_points )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
int n_tx;
@@ -1686,7 +1681,7 @@ static void FlatTexturedPolygon( int n_points )
n_cu2.d = 0;
n_cv2.d = 0;
- decode_tpage( &psxgpu, m_packet.FlatTexturedPolygon.vertex[ 1 ].n_texture.w.h );
+ decode_tpage( machine, &psxgpu, m_packet.FlatTexturedPolygon.vertex[ 1 ].n_texture.w.h );
TEXTURESETUP
switch( n_cmd & 0x01 )
@@ -1830,9 +1825,8 @@ static void FlatTexturedPolygon( int n_points )
}
}
-static void GouraudPolygon( int n_points )
+static void GouraudPolygon( running_machine *machine, int n_points )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
@@ -2044,9 +2038,8 @@ static void GouraudPolygon( int n_points )
}
}
-static void GouraudTexturedPolygon( int n_points )
+static void GouraudTexturedPolygon( running_machine *machine, int n_points )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
int n_tx;
@@ -2141,7 +2134,7 @@ static void GouraudTexturedPolygon( int n_points )
n_cu2.d = 0;
n_cv2.d = 0;
- decode_tpage( &psxgpu, m_packet.GouraudTexturedPolygon.vertex[ 1 ].n_texture.w.h );
+ decode_tpage( machine, &psxgpu, m_packet.GouraudTexturedPolygon.vertex[ 1 ].n_texture.w.h );
TEXTURESETUP
if( n_points == 4 )
@@ -2615,9 +2608,8 @@ static void FrameBufferRectangleDraw( void )
}
}
-static void FlatRectangle( void )
+static void FlatRectangle( running_machine *machine )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
@@ -2681,9 +2673,8 @@ static void FlatRectangle( void )
}
}
-static void FlatRectangle8x8( void )
+static void FlatRectangle8x8( running_machine *machine )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
@@ -2747,9 +2738,8 @@ static void FlatRectangle8x8( void )
}
}
-static void FlatRectangle16x16( void )
+static void FlatRectangle16x16( running_machine *machine )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
@@ -2813,9 +2803,8 @@ static void FlatRectangle16x16( void )
}
}
-static void FlatTexturedRectangle( void )
+static void FlatTexturedRectangle( running_machine *machine )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
int n_tx;
@@ -2912,9 +2901,8 @@ static void FlatTexturedRectangle( void )
}
}
-static void Sprite8x8( void )
+static void Sprite8x8( running_machine *machine )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
int n_tx;
@@ -3011,9 +2999,8 @@ static void Sprite8x8( void )
}
}
-static void Sprite16x16( void )
+static void Sprite16x16( running_machine *machine )
{
- running_machine *machine = Machine;
INT16 n_y;
INT16 n_x;
int n_tx;
@@ -3192,10 +3179,8 @@ static void MoveImage( void )
}
}
-void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
+void psx_gpu_write( running_machine *machine, UINT32 *p_ram, INT32 n_size )
{
- running_machine *machine = Machine;
-
while( n_size > 0 )
{
UINT32 data = *( p_ram );
@@ -3234,7 +3219,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: monochrome 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- FlatPolygon( 3 );
+ FlatPolygon( machine, 3 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3249,7 +3234,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: textured 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- FlatTexturedPolygon( 3 );
+ FlatTexturedPolygon( machine, 3 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3264,7 +3249,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: monochrome 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- FlatPolygon( 4 );
+ FlatPolygon( machine, 4 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3279,7 +3264,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: textured 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- FlatTexturedPolygon( 4 );
+ FlatTexturedPolygon( machine, 4 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3294,7 +3279,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: gouraud 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- GouraudPolygon( 3 );
+ GouraudPolygon( machine, 3 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3309,7 +3294,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: gouraud textured 3 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- GouraudTexturedPolygon( 3 );
+ GouraudTexturedPolygon( machine, 3 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3324,7 +3309,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: gouraud 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- GouraudPolygon( 4 );
+ GouraudPolygon( machine, 4 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3339,7 +3324,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
else
{
verboselog( machine, 1, "%02x: gouraud textured 4 point polygon\n", m_packet.n_entry[ 0 ] >> 24 );
- GouraudTexturedPolygon( 4 );
+ GouraudTexturedPolygon( machine, 4 );
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3433,7 +3418,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
m_packet.n_entry[ 0 ] >> 24,
(INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ),
(INT16)( m_packet.n_entry[ 2 ] & 0xffff ), (INT16)( m_packet.n_entry[ 2 ] >> 16 ) );
- FlatRectangle();
+ FlatRectangle(machine);
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3452,7 +3437,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
(INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ),
m_packet.n_entry[ 3 ] & 0xffff, m_packet.n_entry[ 3 ] >> 16,
m_packet.n_entry[ 0 ], m_packet.n_entry[ 2 ] );
- FlatTexturedRectangle();
+ FlatTexturedRectangle(machine);
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3483,7 +3468,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
{
verboselog( machine, 1, "%02x: 16x16 rectangle %08x %08x\n", m_packet.n_entry[ 0 ] >> 24,
m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ] );
- FlatRectangle8x8();
+ FlatRectangle8x8(machine);
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3499,7 +3484,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
{
verboselog( machine, 1, "%02x: 8x8 sprite %08x %08x %08x\n", m_packet.n_entry[ 0 ] >> 24,
m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ], m_packet.n_entry[ 2 ] );
- Sprite8x8();
+ Sprite8x8(machine);
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3514,7 +3499,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
{
verboselog( machine, 1, "%02x: 16x16 rectangle %08x %08x\n", m_packet.n_entry[ 0 ] >> 24,
m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ] );
- FlatRectangle16x16();
+ FlatRectangle16x16(machine);
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3530,7 +3515,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
{
verboselog( machine, 1, "%02x: 16x16 sprite %08x %08x %08x\n", m_packet.n_entry[ 0 ] >> 24,
m_packet.n_entry[ 0 ], m_packet.n_entry[ 1 ], m_packet.n_entry[ 2 ] );
- Sprite16x16();
+ Sprite16x16(machine);
m_n_gpu_buffer_offset = 0;
}
break;
@@ -3599,7 +3584,7 @@ void psx_gpu_write( UINT32 *p_ram, INT32 n_size )
case 0xe1:
verboselog( machine, 1, "%02x: draw mode %06x\n", m_packet.n_entry[ 0 ] >> 24,
m_packet.n_entry[ 0 ] & 0xffffff );
- decode_tpage( &psxgpu, m_packet.n_entry[ 0 ] & 0xffffff );
+ decode_tpage( machine, &psxgpu, m_packet.n_entry[ 0 ] & 0xffffff );
break;
case 0xe2:
m_n_twy = ( ( ( m_packet.n_entry[ 0 ] >> 15 ) & 0x1f ) << 3 );
@@ -3682,7 +3667,7 @@ WRITE32_HANDLER( psx_gpu_w )
switch( offset )
{
case 0x00:
- psx_gpu_write( &data, 1 );
+ psx_gpu_write( machine, &data, 1 );
break;
case 0x01:
switch( data >> 24 )
@@ -3841,10 +3826,8 @@ WRITE32_HANDLER( psx_gpu_w )
}
-void psx_gpu_read( UINT32 *p_ram, INT32 n_size )
+void psx_gpu_read( running_machine *machine, UINT32 *p_ram, INT32 n_size )
{
- running_machine *machine = Machine;
-
while( n_size > 0 )
{
if( ( m_n_gpustatus & ( 1L << 0x1b ) ) != 0 )
@@ -3898,7 +3881,7 @@ READ32_HANDLER( psx_gpu_r )
switch( offset )
{
case 0x00:
- psx_gpu_read( &data, 1 );
+ psx_gpu_read( space->machine, &data, 1 );
break;
case 0x01:
verboselog( space->machine, 1, "read GPU status (%08x)\n", m_n_gpustatus );
diff --git a/src/mame/video/psychic5.c b/src/mame/video/psychic5.c
index 6092ef80848..7ace37e6a03 100644
--- a/src/mame/video/psychic5.c
+++ b/src/mame/video/psychic5.c
@@ -341,7 +341,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (attr & 0x01) sx -= 256;
if (attr & 0x04) sy -= 256;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 224 - sx;
sy = 224 - sy;
@@ -366,7 +366,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
else
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
DRAW_SPRITE(code, sx + 16, sy + 16)
else
DRAW_SPRITE(code, sx, sy)
@@ -423,7 +423,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
case 11: case 13: clip.max_x = sx1; break;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
int min_x,max_x,min_y,max_y;
min_x = 255 - clip.max_x;
diff --git a/src/mame/video/pushman.c b/src/mame/video/pushman.c
index 39de2af84a2..9879e8ff671 100644
--- a/src/mame/video/pushman.c
+++ b/src/mame/video/pushman.c
@@ -99,7 +99,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipx=spriteram16[offs+1]&2;
flipy=spriteram16[offs+1]&1; /* flip y untested */
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 240 - x;
y = 240 - y;
diff --git a/src/mame/video/quizdna.c b/src/mame/video/quizdna.c
index 0853cf3f8d9..6a308c41f31 100644
--- a/src/mame/video/quizdna.c
+++ b/src/mame/video/quizdna.c
@@ -119,7 +119,7 @@ WRITE8_HANDLER( quizdna_screen_ctrl_w )
quizdna_flipscreen = tmp;
- flip_screen_set(tmp);
+ flip_screen_set(space->machine, tmp);
tilemap_set_scrolldx( quizdna_fg_tilemap, 64, -64 +16);
}
diff --git a/src/mame/video/rallyx.c b/src/mame/video/rallyx.c
index 41407021419..772fccb5dba 100644
--- a/src/mame/video/rallyx.c
+++ b/src/mame/video/rallyx.c
@@ -504,10 +504,10 @@ static void plot_star(running_machine *machine, bitmap_t *bitmap, const rectangl
x > cliprect->max_x)
return;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
x = 255 - x;
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
y = 255 - y;
if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x) % 0x144) == 0)
@@ -540,7 +540,7 @@ static void rallyx_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
int color = spriteram_2[offs + 1] & 0x3f;
int flipx = spriteram[offs] & 1;
int flipy = spriteram[offs] & 2;
- if (flip_screen_get()) sx -= 2*displacement;
+ if (flip_screen_get(machine)) sx -= 2*displacement;
pdrawgfx(bitmap,machine->gfx[1],
(spriteram[offs] & 0xfc) >> 2,
@@ -585,7 +585,7 @@ static void rallyx_draw_bullets(running_machine *machine, bitmap_t *bitmap, cons
x = rallyx_radarx[offs] + ((~rallyx_radarattr[offs & 0x0f] & 0x01) << 8);
y = 253 - rallyx_radary[offs];
- if (flip_screen_get()) x -= 3;
+ if (flip_screen_get(machine)) x -= 3;
drawgfx(bitmap,machine->gfx[2],
((rallyx_radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07,
@@ -651,7 +651,7 @@ VIDEO_UPDATE( rallyx )
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())
+ if (flip_screen_get(screen->machine))
{
bg_clip.min_x = 8*8;
fg_clip.max_x = 8*8-1;
@@ -683,7 +683,7 @@ VIDEO_UPDATE( jungler )
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())
+ if (flip_screen_get(screen->machine))
{
bg_clip.min_x = 8*8;
fg_clip.max_x = 8*8-1;
@@ -719,7 +719,7 @@ VIDEO_UPDATE( locomotn )
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())
+ if (flip_screen_get(screen->machine))
{
/* handle reduced visible area in some games */
if (video_screen_get_visible_area(screen)->max_x == 32*8-1)
diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c
index b0374b02845..12611b1c177 100644
--- a/src/mame/video/realbrk.c
+++ b/src/mame/video/realbrk.c
@@ -36,7 +36,7 @@ WRITE16_HANDLER( realbrk_flipscreen_w )
coin_counter_w(0, data & 0x0001);
coin_counter_w(1, data & 0x0004);
- flip_screen_set( data & 0x0080);
+ flip_screen_set(space->machine, data & 0x0080);
}
if (ACCESSING_BITS_8_15)
@@ -262,8 +262,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
xdim = ((zoom & 0x00ff) >> 0) << (16-6+4);
ydim = ((zoom & 0xff00) >> 8) << (16-6+4);
- if (flip_screen_x_get()) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; }
- if (flip_screen_y_get()) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; }
+ if (flip_screen_x_get(machine)) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; }
+ if (flip_screen_y_get(machine)) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; }
if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; }
else { xstart = 0; xend = xnum; xinc = +1; }
@@ -424,8 +424,8 @@ static void dai2kaku_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
xdim = ((zoom & 0x00ff) >> 0) << (16-6+4);
ydim = ((zoom & 0xff00) >> 8) << (16-6+4);
- if (flip_screen_x_get()) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; }
- if (flip_screen_y_get()) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; }
+ if (flip_screen_x_get(machine)) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; }
+ if (flip_screen_y_get(machine)) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; }
if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; }
else { xstart = 0; xend = xnum; xinc = +1; }
diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c
index dc6fd57bb18..519dd258f61 100644
--- a/src/mame/video/redclash.c
+++ b/src/mame/video/redclash.c
@@ -119,7 +119,7 @@ WRITE8_HANDLER( redclash_gfxbank_w )
WRITE8_HANDLER( redclash_flipscreen_w )
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
}
void redclash_set_stars_enable( UINT8 on ); //temp
@@ -260,7 +260,7 @@ popmessage("unknown sprite size 0");
}
}
-static void draw_bullets(bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
int offs;
@@ -270,7 +270,7 @@ static void draw_bullets(bitmap_t *bitmap, const rectangle *cliprect )
int sx = 8 * offs + (videoram[offs] & 0x07); /* ?? */
int sy = 0xff - videoram[offs + 0x20];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
}
@@ -424,7 +424,7 @@ VIDEO_UPDATE( redclash )
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
redclash_draw_stars(bitmap, cliprect, 0x60, 0, 0x00, 0xff);
draw_sprites(screen->machine, bitmap, cliprect);
- draw_bullets(bitmap, cliprect);
+ draw_bullets(screen->machine, bitmap, cliprect);
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/renegade.c b/src/mame/video/renegade.c
index 0e69e3eb24e..a4161624b58 100644
--- a/src/mame/video/renegade.c
+++ b/src/mame/video/renegade.c
@@ -27,7 +27,7 @@ WRITE8_HANDLER( renegade_videoram2_w )
WRITE8_HANDLER( renegade_flipscreen_w )
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
}
WRITE8_HANDLER( renegade_scroll0_w )
@@ -94,7 +94,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (sx > 248)
sx -= 256;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -107,18 +107,18 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap, machine->gfx[sprite_bank],
sprite_number + 1,
color,
- xflip, flip_screen_get(),
- sx, sy + (flip_screen_get() ? -16 : 16),
+ xflip, flip_screen_get(machine),
+ sx, sy + (flip_screen_get(machine) ? -16 : 16),
cliprect, TRANSPARENCY_PEN, 0);
}
else
{
- sy += (flip_screen_get() ? -16 : 16);
+ sy += (flip_screen_get(machine) ? -16 : 16);
}
drawgfx(bitmap, machine->gfx[sprite_bank],
sprite_number,
color,
- xflip, flip_screen_get(),
+ xflip, flip_screen_get(machine),
sx, sy,
cliprect, TRANSPARENCY_PEN, 0);
}
diff --git a/src/mame/video/retofinv.c b/src/mame/video/retofinv.c
index 529d1b9c025..d2551b2da37 100644
--- a/src/mame/video/retofinv.c
+++ b/src/mame/video/retofinv.c
@@ -147,7 +147,7 @@ WRITE8_HANDLER( retofinv_gfx_ctrl_w )
switch (offset)
{
case 0:
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
break;
case 1:
@@ -206,7 +206,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
sprite &= ~sizex;
sprite &= ~(sizey << 1);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
diff --git a/src/mame/video/rockola.c b/src/mame/video/rockola.c
index a275b2e4fd2..4295e7bad2f 100644
--- a/src/mame/video/rockola.c
+++ b/src/mame/video/rockola.c
@@ -140,9 +140,9 @@ WRITE8_HANDLER( rockola_flipscreen_w )
/* bit 7 flips screen */
- if (flip_screen_get() != (data & 0x80))
+ if (flip_screen_get(space->machine) != (data & 0x80))
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -248,9 +248,9 @@ WRITE8_HANDLER( satansat_b002_w )
{
/* bit 0 flips screen */
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
diff --git a/src/mame/video/rocnrope.c b/src/mame/video/rocnrope.c
index 4680b301e07..0d695f76a60 100644
--- a/src/mame/video/rocnrope.c
+++ b/src/mame/video/rocnrope.c
@@ -96,9 +96,9 @@ WRITE8_HANDLER( rocnrope_colorram_w )
WRITE8_HANDLER( rocnrope_flipscreen_w )
{
- if (flip_screen_get() != (~data & 0x01))
+ if (flip_screen_get(space->machine) != (~data & 0x01))
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c
index 25bb1bab800..668344a401a 100644
--- a/src/mame/video/rohga.c
+++ b/src/mame/video/rohga.c
@@ -123,7 +123,7 @@ static void rohga_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
x=304-x;
y=240-y;
if (fx) fx=0; else fx=1;
@@ -216,7 +216,7 @@ static void wizdfire_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
inc = 1;
}
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
x=304-x;
y=240-y;
if (fx) fx=0; else fx=1;
@@ -394,7 +394,7 @@ sprite 2:
fx = (spriteptr[offs+0]&0x4000);
fy = (spriteptr[offs+0]&0x8000);
- if (!flip_screen_get()) { /* Inverted from Mutant Fighter! */
+ if (!flip_screen_get(machine)) { /* Inverted from Mutant Fighter! */
if (fx) fx=0; else fx=1;
if (fy) fy=0; else fy=1;
@@ -439,7 +439,7 @@ sprite 2:
static void update_rohga(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr)
{
/* Update playfields */
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
@@ -496,7 +496,7 @@ VIDEO_UPDATE( schmeisr )
VIDEO_UPDATE( wizdfire )
{
/* Update playfields */
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
@@ -525,7 +525,7 @@ VIDEO_UPDATE( wizdfire )
VIDEO_UPDATE( nitrobal )
{
/* Update playfields */
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
diff --git a/src/mame/video/sauro.c b/src/mame/video/sauro.c
index ee10994eaf4..0fcf2b9f47e 100644
--- a/src/mame/video/sauro.c
+++ b/src/mame/video/sauro.c
@@ -78,7 +78,7 @@ WRITE8_HANDLER( sauro_palette_bank_w )
WRITE8_HANDLER( sauro_scroll_fg_w )
{
- const int *map = (flip_screen_get() ? scroll2_map_flip : scroll2_map);
+ const int *map = (flip_screen_get(space->machine) ? scroll2_map_flip : scroll2_map);
int scroll = (data & 0xf8) | map[data & 7];
tilemap_set_scrollx(fg_tilemap, 0, scroll);
@@ -126,7 +126,7 @@ static void sauro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
flipx = spriteram[offs+3] & 0x04;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
sx = (235 - sx) & 0xff; // The &0xff is not 100% percent correct
@@ -136,7 +136,7 @@ static void sauro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
drawgfx(bitmap, machine->gfx[2],
code,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -201,7 +201,7 @@ static void trckydoc_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
flipx = spriteram[offs+3] & 0x04;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
sx = (235 - sx) & 0xff; /* The &0xff is not 100% percent correct */
@@ -211,7 +211,7 @@ static void trckydoc_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
drawgfx(bitmap, machine->gfx[1],
code,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/video/sbasketb.c b/src/mame/video/sbasketb.c
index d8228e74dce..221b648c9e6 100644
--- a/src/mame/video/sbasketb.c
+++ b/src/mame/video/sbasketb.c
@@ -112,9 +112,9 @@ WRITE8_HANDLER( sbasketb_colorram_w )
WRITE8_HANDLER( sbasketb_flipscreen_w )
{
- if (flip_screen_get() != data)
+ if (flip_screen_get(space->machine) != data)
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -152,7 +152,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = spriteram[offs + 1] & 0x40;
int flipy = spriteram[offs + 1] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/scotrsht.c b/src/mame/video/scotrsht.c
index 404a67f68ab..90ee5382cb3 100644
--- a/src/mame/video/scotrsht.c
+++ b/src/mame/video/scotrsht.c
@@ -108,7 +108,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
int sy = spriteram[i + 3];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/segag80v.c b/src/mame/video/segag80v.c
index 17f713876f3..c9556aa664c 100644
--- a/src/mame/video/segag80v.c
+++ b/src/mame/video/segag80v.c
@@ -179,7 +179,7 @@ static void sega_generate_vector_list(running_machine *machine)
/* Add a starting point to the vector list. */
clipped = adjust_xy(curx, cury, &adjx, &adjy);
if (!clipped)
- vector_add_point(adjx, adjy, 0, 0);
+ vector_add_point(machine, adjx, adjy, 0, 0);
/* Loop until we run out of time. */
while (total_time > 0)
@@ -287,11 +287,11 @@ static void sega_generate_vector_list(running_machine *machine)
{
/* if we're just becoming unclipped, add an empty point */
if (!newclip)
- vector_add_point(adjx, adjy, 0, 0);
+ vector_add_point(machine, adjx, adjy, 0, 0);
/* otherwise, add a colored point */
else
- vector_add_point(adjx, adjy, color, intensity);
+ vector_add_point(machine, adjx, adjy, color, intensity);
}
clipped = newclip;
@@ -301,7 +301,7 @@ static void sega_generate_vector_list(running_machine *machine)
/* We're done; if we are not clipped, add a final point. */
if (!clipped)
- vector_add_point(adjx, adjy, color, intensity);
+ vector_add_point(machine, adjx, adjy, color, intensity);
/* if the high bit of the attribute is set, we break out of */
/* this loop and fetch another symbol */
diff --git a/src/mame/video/senjyo.c b/src/mame/video/senjyo.c
index b91aa5898e5..9bd4a6cd252 100644
--- a/src/mame/video/senjyo.c
+++ b/src/mame/video/senjyo.c
@@ -181,11 +181,11 @@ static void draw_bgbitmap(running_machine *machine, bitmap_t *bitmap,const recta
count = 0;
strwid = senjyo_bgstripes;
if (strwid == 0) strwid = 0x100;
- if (flip_screen_get()) strwid ^= 0xff;
+ if (flip_screen_get(machine)) strwid ^= 0xff;
for (x = 0;x < 256;x++)
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
for (y = 0;y < 256;y++)
*BITMAP_ADDR16(bitmap, y, 255 - x) = 384 + pen;
else
@@ -202,7 +202,7 @@ static void draw_bgbitmap(running_machine *machine, bitmap_t *bitmap,const recta
}
}
-static void draw_radar(bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_radar(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect)
{
int offs,x;
@@ -215,7 +215,7 @@ static void draw_radar(bitmap_t *bitmap,const rectangle *cliprect)
sx = (8 * (offs % 8) + x) + 256-64;
sy = ((offs & 0x1ff) / 8) + 96;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 255 - sx;
sy = 255 - sy;
@@ -250,7 +250,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipx = spriteram[offs+1] & 0x40;
flipy = spriteram[offs+1] & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
@@ -295,7 +295,7 @@ VIDEO_UPDATE( senjyo )
scrollx = senjyo_scrollx1[0];
scrolly = senjyo_scrolly1[0] + 256 * senjyo_scrolly1[1];
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
scrollx = -scrollx;
tilemap_set_scrollx(bg1_tilemap,0,scrollx);
tilemap_set_scrolly(bg1_tilemap,0,scrolly);
@@ -307,14 +307,14 @@ VIDEO_UPDATE( senjyo )
scrollx = senjyo_scrollx1[0];
scrolly = senjyo_scrolly1[0] + 256 * senjyo_scrolly1[1];
}
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
scrollx = -scrollx;
tilemap_set_scrollx(bg2_tilemap,0,scrollx);
tilemap_set_scrolly(bg2_tilemap,0,scrolly);
scrollx = senjyo_scrollx3[0];
scrolly = senjyo_scrolly3[0] + 256 * senjyo_scrolly3[1];
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
scrollx = -scrollx;
tilemap_set_scrollx(bg3_tilemap,0,scrollx);
tilemap_set_scrolly(bg3_tilemap,0,scrolly);
@@ -329,7 +329,7 @@ VIDEO_UPDATE( senjyo )
tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
draw_sprites(screen->machine, bitmap,cliprect,3);
tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
- draw_radar(bitmap,cliprect);
+ draw_radar(screen->machine,bitmap,cliprect);
#if 0
{
diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c
index 8bd06b9235e..74fb9394285 100644
--- a/src/mame/video/seta2.c
+++ b/src/mame/video/seta2.c
@@ -128,15 +128,15 @@ WRITE16_HANDLER( seta2_vregs_w )
switch( offset*2 )
{
case 0x1c: // FLIP SCREEN (myangel) <- this is actually zoom
- flip_screen_set( 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( 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( 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;
diff --git a/src/mame/video/sf.c b/src/mame/video/sf.c
index 758e33822d1..ecf2bed5d51 100644
--- a/src/mame/video/sf.c
+++ b/src/mame/video/sf.c
@@ -109,7 +109,7 @@ WRITE16_HANDLER( sf_gfxctrl_w )
if (ACCESSING_BITS_0_7)
{
sf_active = data & 0xff;
- flip_screen_set(data & 0x04);
+ flip_screen_set(space->machine, data & 0x04);
tilemap_set_enable(tx_tilemap,data & 0x08);
tilemap_set_enable(bg_tilemap,data & 0x20);
tilemap_set_enable(fg_tilemap,data & 0x40);
@@ -148,7 +148,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
int c1,c2,c3,c4,t;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 480 - sx;
sy = 224 - sy;
@@ -203,7 +203,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
else
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 496 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/shangha3.c b/src/mame/video/shangha3.c
index 866703a1a3a..a8c16e08b50 100644
--- a/src/mame/video/shangha3.c
+++ b/src/mame/video/shangha3.c
@@ -96,7 +96,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(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
if ((data & 0x7f) != 0x7e) popmessage("flipscreen_w %02x",data);
}
@@ -133,7 +133,7 @@ WRITE16_HANDLER( shangha3_blitter_go_w )
zoomx = shangha3_ram[offs+10];
zoomy = shangha3_ram[offs+13];
- if (flip_screen_get())
+ if (flip_screen_get(space->machine))
{
sx = 383 - sx - sizex;
sy = 255 - sy - sizey;
diff --git a/src/mame/video/shaolins.c b/src/mame/video/shaolins.c
index 2a6410ab4f6..971958c7949 100644
--- a/src/mame/video/shaolins.c
+++ b/src/mame/video/shaolins.c
@@ -124,9 +124,9 @@ WRITE8_HANDLER( shaolins_nmi_w )
{
shaolins_nmi_enable = data;
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -164,7 +164,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = 240 - spriteram[offs + 6];
int sy = 248 - spriteram[offs + 4];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 248 - sy;
diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c
index 18ec47ce182..d6c0b7374b0 100644
--- a/src/mame/video/shisen.c
+++ b/src/mame/video/shisen.c
@@ -63,7 +63,7 @@ VIDEO_UPDATE( sichuan2 )
// 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(~input_port_read(screen->machine, "DSW2") & 1);
+ flip_screen_set(screen->machine, ~input_port_read(screen->machine, "DSW2") & 1);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c
index 5ce58b3dc54..f20bbace5a7 100644
--- a/src/mame/video/shootout.c
+++ b/src/mame/video/shootout.c
@@ -106,7 +106,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipx = (attributes & 0x04);
int flipy = 0;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
flipx = !flipx;
flipy = !flipy;
}
@@ -117,7 +117,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
vx = sx;
vy = sy;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
vx = 240 - vx;
vy = 240 - vy;
}
@@ -136,7 +136,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
vx = sx;
vy = sy;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
vx = 240 - vx;
vy = 240 - vy;
}
diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c
index ef1126aee87..1f7c41b34dc 100644
--- a/src/mame/video/sidearms.c
+++ b/src/mame/video/sidearms.c
@@ -70,7 +70,7 @@ WRITE8_HANDLER( sidearms_c804_w )
if (flipon != (data & 0x80))
{
flipon = data & 0x80;
- flip_screen_set(flipon);
+ flip_screen_set(space->machine, flipon);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
diff --git a/src/mame/video/simpl156.c b/src/mame/video/simpl156.c
index 5ffdd568e7f..46ec8712a80 100644
--- a/src/mame/video/simpl156.c
+++ b/src/mame/video/simpl156.c
@@ -40,7 +40,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int offs;
//FIXME: flip_screen_x should not be written!
- flip_screen_set_no_update(1);
+ flip_screen_set_no_update(machine, 1);
for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
{
@@ -86,7 +86,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
diff --git a/src/mame/video/skykid.c b/src/mame/video/skykid.c
index ccf864f82dc..6d6f7f58e70 100644
--- a/src/mame/video/skykid.c
+++ b/src/mame/video/skykid.c
@@ -83,9 +83,9 @@ static TILE_GET_INFO( tx_get_tile_info )
characters when screen is flipped, we have to flip them back. */
SET_TILE_INFO(
0,
- skykid_textram[tile_index] | (flip_screen_get() ? 0x100 : 0),
+ skykid_textram[tile_index] | (flip_screen_get(machine) ? 0x100 : 0),
skykid_textram[tile_index + 0x400] & 0x3f,
- flip_screen_get() ? (TILE_FLIPY | TILE_FLIPX) : 0);
+ flip_screen_get(machine) ? (TILE_FLIPY | TILE_FLIPX) : 0);
}
@@ -124,7 +124,7 @@ VIDEO_START( skykid )
state_save_register_global(machine, scroll_x);
state_save_register_global(machine, scroll_y);
//FIXME: flip_screen
- //state_save_register_global(machine, flip_screen_x_get());
+ //state_save_register_global(machine, flip_screen_x_get(machine));
}
@@ -170,7 +170,7 @@ WRITE8_HANDLER( skykid_scroll_y_w )
WRITE8_HANDLER( skykid_flipscreen_priority_w )
{
priority = data;
- flip_screen_set(offset & 1);
+ flip_screen_set(space->machine, offset & 1);
}
@@ -206,7 +206,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sprite &= ~sizex;
sprite &= ~(sizey << 1);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx ^= 1;
flipy ^= 1;
@@ -234,7 +234,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
VIDEO_UPDATE( skykid )
{
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
tilemap_set_scrollx(bg_tilemap, 0, 189 - (scroll_x ^ 1));
tilemap_set_scrolly(bg_tilemap, 0, 7 - scroll_y);
diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c
index 564b311e82f..03383fafb32 100644
--- a/src/mame/video/snk.c
+++ b/src/mame/video/snk.c
@@ -424,14 +424,14 @@ WRITE8_HANDLER( marvins_palette_bank_w )
WRITE8_HANDLER( marvins_flipscreen_w )
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
// other bits unknown
}
WRITE8_HANDLER( sgladiat_flipscreen_w )
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4);
@@ -440,7 +440,7 @@ WRITE8_HANDLER( sgladiat_flipscreen_w )
WRITE8_HANDLER( hal21_flipscreen_w )
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4);
tilemap_set_pen_data_offset(bg_tilemap, ((data & 0x20) << 3) * space->machine->gfx[1]->char_modulo);
@@ -483,7 +483,7 @@ WRITE8_HANDLER( aso_videoattrs_w )
-------X scrollx MSB (sprites)
*/
- flip_screen_set(data & 0x20);
+ flip_screen_set(space->machine, data & 0x20);
bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4);
sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
@@ -505,7 +505,7 @@ WRITE8_HANDLER( tnk3_videoattrs_w )
-------X scrollx MSB (sprites)
*/
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
tilemap_set_pen_data_offset(tx_tilemap, ((data & 0x40) << 2) * space->machine->gfx[0]->char_modulo);
@@ -560,7 +560,7 @@ WRITE8_HANDLER( gwar_tx_bank_w )
WRITE8_HANDLER( gwar_videoattrs_w )
{
- flip_screen_set(data & 0x04);
+ flip_screen_set(space->machine, data & 0x04);
sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x80) << 1);
sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x40) << 2);
@@ -572,7 +572,7 @@ WRITE8_HANDLER( gwar_videoattrs_w )
WRITE8_HANDLER( gwara_videoattrs_w )
{
- flip_screen_set(data & 0x10);
+ flip_screen_set(space->machine, data & 0x10);
bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7);
bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8);
@@ -627,7 +627,7 @@ static void marvins_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
int flipy = (attributes&0x20);
int flipx = 0;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 89 - 16 - sx;
sy = 262 - 16 - sy;
@@ -692,7 +692,7 @@ static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
yflip = attributes & 0x20;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 89 - size - sx; // this causes slight misalignment in tnk3 but is correct for athena and fitegolf
sy = 262 - size - sy;
@@ -825,7 +825,7 @@ static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
if (hw_xflip)
sx = 495 - size - sx;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 495 - size - sx;
sy = 258 - size - sy;
diff --git a/src/mame/video/solomon.c b/src/mame/video/solomon.c
index 5594b987049..d13932d671d 100644
--- a/src/mame/video/solomon.c
+++ b/src/mame/video/solomon.c
@@ -31,9 +31,9 @@ WRITE8_HANDLER( solomon_colorram2_w )
WRITE8_HANDLER( solomon_flipscreen_w )
{
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -81,7 +81,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs + 3];
int sy = 241 - spriteram[offs + 2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 242 - sy;
diff --git a/src/mame/video/sonson.c b/src/mame/video/sonson.c
index c01510fc4ed..18f55c28673 100644
--- a/src/mame/video/sonson.c
+++ b/src/mame/video/sonson.c
@@ -116,7 +116,7 @@ WRITE8_HANDLER( sonson_scrollx_w )
WRITE8_HANDLER( sonson_flipscreen_w )
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -148,7 +148,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs + 3];
int sy = spriteram[offs + 0];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/spcforce.c b/src/mame/video/spcforce.c
index 1986474347a..5c2198dd526 100644
--- a/src/mame/video/spcforce.c
+++ b/src/mame/video/spcforce.c
@@ -14,7 +14,7 @@ UINT8 *spcforce_scrollram;
WRITE8_HANDLER( spcforce_flip_screen_w )
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
}
@@ -39,7 +39,7 @@ VIDEO_UPDATE( spcforce )
code = videoram[offs] + ((colorram[offs] & 0x01) << 8);
col = (~colorram[offs] >> 4) & 0x07;
- if (flip_screen_get())
+ if (flip_screen_get(screen->machine))
{
sx = 248 - sx;
sy = 248 - sy;
@@ -47,7 +47,7 @@ VIDEO_UPDATE( spcforce )
drawgfx(bitmap,screen->machine->gfx[0],
code, col,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(screen->machine), flip_screen_get(screen->machine),
sx, sy,
cliprect,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 72471ecd96d..846ccaa89d1 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -118,7 +118,7 @@ WRITE8_HANDLER( spdodgeb_ctrl_w )
UINT8 *rom = memory_region(space->machine, "main");
/* bit 0 = flip screen */
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
/* bit 1 = ROM bank switch */
memory_set_bankptr(space->machine, 1,rom + 0x10000 + 0x4000 * ((~data & 0x02) >> 1));
@@ -179,7 +179,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int dy = -16;
int cy;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -198,7 +198,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
break;
case 1: /* double y */
- if (flip_screen_get()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; }
+ if (flip_screen_get(machine)) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; }
cy = sy + dy;
which &= ~1;
DRAW_SPRITE(0,sx,cy);
diff --git a/src/mame/video/speedatk.c b/src/mame/video/speedatk.c
index ed4f0178ceb..48f5bbc1b64 100644
--- a/src/mame/video/speedatk.c
+++ b/src/mame/video/speedatk.c
@@ -97,7 +97,7 @@ WRITE8_HANDLER( speedatk_videoregs_w )
{
/*temporary hook-up.*/
case 0x0d:
- flip_screen_set(data & 8);
+ flip_screen_set(space->machine, data & 8);
tilemap_set_scrolldx(bg_tilemap,0,data & 0x40);
break;
default:
diff --git a/src/mame/video/speedbal.c b/src/mame/video/speedbal.c
index 4fb19d6e66f..a932bd64e04 100644
--- a/src/mame/video/speedbal.c
+++ b/src/mame/video/speedbal.c
@@ -102,7 +102,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = flipy = 0;
- if(flip_screen_get())
+ if(flip_screen_get(machine))
{
x = 246 - x;
y = 238 - y;
diff --git a/src/mame/video/srumbler.c b/src/mame/video/srumbler.c
index c6c34ecadbf..1db6d5f7ef1 100644
--- a/src/mame/video/srumbler.c
+++ b/src/mame/video/srumbler.c
@@ -84,7 +84,7 @@ WRITE8_HANDLER( srumbler_background_w )
WRITE8_HANDLER( srumbler_4009_w )
{
/* bit 0 flips screen */
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
/* bits 4-5 used during attract mode, unknown */
@@ -142,7 +142,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = buffered_spriteram[offs + 3] + 0x100 * ( attr & 0x01);
flipy = attr & 0x02;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 496 - sx;
sy = 240 - sy;
@@ -152,7 +152,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[2],
code,
colour,
- flip_screen_get(),flipy,
+ flip_screen_get(machine),flipy,
sx, sy,
cliprect,TRANSPARENCY_PEN,15);
}
diff --git a/src/mame/video/sshangha.c b/src/mame/video/sshangha.c
index b26acd3e140..78d54c224d8 100644
--- a/src/mame/video/sshangha.c
+++ b/src/mame/video/sshangha.c
@@ -86,7 +86,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sprite &= ~multi;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -187,8 +187,8 @@ VIDEO_UPDATE( sshangha )
static int last_pf1_bank,last_pf2_bank;
int offs;
- flip_screen_set_no_update(sshangha_control_0[0]&0x80);
- tilemap_set_flip(ALL_TILEMAPS,flip_screen_x_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ flip_screen_set_no_update(screen->machine, sshangha_control_0[0]&0x80);
+ tilemap_set_flip(ALL_TILEMAPS,flip_screen_x_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
tilemap_set_enable( pf2_tilemap, sshangha_control_0[5]&0x8000);
tilemap_set_enable( pf1_8x8_tilemap, sshangha_control_0[5]&0x0080);
diff --git a/src/mame/video/ssozumo.c b/src/mame/video/ssozumo.c
index 9e78b0907df..a47ba258a18 100644
--- a/src/mame/video/ssozumo.c
+++ b/src/mame/video/ssozumo.c
@@ -108,7 +108,7 @@ WRITE8_HANDLER( ssozumo_scroll_w )
WRITE8_HANDLER( ssozumo_flipscreen_w )
{
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -154,7 +154,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = 239 - spriteram[offs + 3];
int sy = (240 - spriteram[offs + 2]) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/stfight.c b/src/mame/video/stfight.c
index 9ac541efb95..09254669d04 100644
--- a/src/mame/video/stfight.c
+++ b/src/mame/video/stfight.c
@@ -235,7 +235,7 @@ WRITE8_HANDLER( stfight_vh_latch_w )
/* 0x40 = sprites */
tilemap_set_enable(bg_tilemap,data & 0x20);
tilemap_set_enable(fg_tilemap,data & 0x10);
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
break;
}
}
@@ -272,7 +272,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx -= 0x100;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -284,7 +284,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
pdrawgfx(bitmap,machine->gfx[4],
code,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0x0f,
pri ? 0x02 : 0);
diff --git a/src/mame/video/strnskil.c b/src/mame/video/strnskil.c
index 57b1b1ddd8a..5d63c188a6c 100644
--- a/src/mame/video/strnskil.c
+++ b/src/mame/video/strnskil.c
@@ -56,9 +56,9 @@ WRITE8_HANDLER( strnskil_scrl_ctrl_w )
{
strnskil_scrl_ctrl = data >> 5;
- if (flip_screen_get() != (data & 0x08))
+ if (flip_screen_get(space->machine) != (data & 0x08))
{
- flip_screen_set(data & 0x08);
+ flip_screen_set(space->machine, data & 0x08);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -88,14 +88,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
int code = spriteram[offs + 1];
int color = spriteram[offs + 2] & 0x3f;
- int flipx = flip_screen_x_get();
- int flipy = flip_screen_y_get();
+ int flipx = flip_screen_x_get(machine);
+ int flipy = flip_screen_y_get(machine);
int sx = spriteram[offs + 3];
int sy = spriteram[offs];
int px, py;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
px = 240 - sx + 0; /* +2 or +0 ? */
py = sy;
diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c
index 424fa74cf55..2ded01f4691 100644
--- a/src/mame/video/stvvdp1.c
+++ b/src/mame/video/stvvdp1.c
@@ -17,7 +17,6 @@ Framebuffer todo:
#include "driver.h"
-#include "deprecat.h"
#include "sound/scsp.h"
#include "includes/stv.h"
@@ -186,7 +185,7 @@ struct shaded_point
-static void stv_vdp1_process_list(void);
+static void stv_vdp1_process_list(running_machine *machine);
READ32_HANDLER( stv_vdp1_regs_r )
{
@@ -314,7 +313,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( );
+ stv_vdp1_process_list( space->machine );
}
}
else if ( ACCESSING_BITS_0_15 )
@@ -856,14 +855,14 @@ static UINT8* gfxdata;
static UINT16 sprite_colorbank;
-static void (*drawpixel)(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(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(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;
@@ -874,7 +873,7 @@ static void drawpixel_8bpp_trans(int x, int y, int patterndata, int offsetcnt)
}
}
-static void drawpixel_4bpp_notrans(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;
@@ -883,7 +882,7 @@ static void drawpixel_4bpp_notrans(int x, int y, int patterndata, int offsetcnt)
stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank;
}
-static void drawpixel_4bpp_trans(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;
@@ -893,7 +892,7 @@ static void drawpixel_4bpp_trans(int x, int y, int patterndata, int offsetcnt)
stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank;
}
-static void drawpixel_generic(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;
@@ -964,7 +963,7 @@ static void drawpixel_generic(int x, int y, int patterndata, int offsetcnt)
pix = pix+(stv2_current_sprite.CMDCOLR&0xff80);
transmask = 0x7f;
mode = 3;
- // pix = mame_rand(Machine);
+ // pix = mame_rand(machine);
break;
case 0x0020: // mode 4 256 colour bank mode (8bits) (hanagumi title)
pix = gfxdata[patterndata+offsetcnt];
@@ -978,7 +977,7 @@ static void drawpixel_generic(int x, int y, int patterndata, int offsetcnt)
transmask = 0xffff;
break;
default: // other settings illegal
- pix = mame_rand(Machine);
+ pix = mame_rand(machine);
mode = 0;
transmask = 0xff;
}
@@ -1083,7 +1082,7 @@ static void stv_vdp1_set_drawpixel(void)
}
-static void vdp1_fill_slope(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,
@@ -1173,7 +1172,7 @@ static void vdp1_fill_slope(const rectangle *cliprect, int patterndata, int xsiz
xx2 = cliprect->max_x;
while(xx1 <= xx2) {
- drawpixel(xx1,_y1,
+ drawpixel(machine,xx1,_y1,
patterndata,
(v>>FRAC_SHIFT)*xsize+(u>>FRAC_SHIFT));
xx1++;
@@ -1199,7 +1198,7 @@ static void vdp1_fill_slope(const rectangle *cliprect, int patterndata, int xsiz
*nv2 = v2;
}
-static void vdp1_fill_line(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;
@@ -1227,7 +1226,7 @@ static void vdp1_fill_line(const rectangle *cliprect, int patterndata, int xsize
xx2 = cliprect->max_x;
while(xx1 <= xx2) {
- drawpixel(xx1,y,
+ drawpixel(machine,xx1,y,
patterndata,
(v>>FRAC_SHIFT)*xsize+(u>>FRAC_SHIFT));
xx1++;
@@ -1237,7 +1236,7 @@ static void vdp1_fill_line(const rectangle *cliprect, int patterndata, int xsize
}
}
-static void vdp1_fill_quad(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;
@@ -1277,7 +1276,7 @@ static void vdp1_fill_quad(const rectangle *cliprect, int patterndata, int xsize
v2 = p[i].v;
}
}
- vdp1_fill_line(cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2);
+ vdp1_fill_line(machine, cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2);
return;
}
@@ -1296,7 +1295,7 @@ static void vdp1_fill_quad(const rectangle *cliprect, int patterndata, int xsize
for(;;) {
if(p[ps1-1].y == p[ps2+1].y) {
- vdp1_fill_slope(cliprect, patterndata, xsize,
+ vdp1_fill_slope(machine, cliprect, patterndata, xsize,
x1, x2, sl1, sl2, &x1, &x2,
u1, u2, slu1, slu2, &u1, &u2,
v1, v2, slv1, slv2, &v1, &v2,
@@ -1329,7 +1328,7 @@ static void vdp1_fill_quad(const rectangle *cliprect, int patterndata, int xsize
slu2 = (u2-p[ps2+1].u)/delta;
slv2 = (v2-p[ps2+1].v)/delta;
} else if(p[ps1-1].y < p[ps2+1].y) {
- vdp1_fill_slope(cliprect, patterndata, xsize,
+ vdp1_fill_slope(machine, cliprect, patterndata, xsize,
x1, x2, sl1, sl2, &x1, &x2,
u1, u2, slu1, slu2, &u1, &u2,
v1, v2, slv1, slv2, &v1, &v2,
@@ -1349,7 +1348,7 @@ static void vdp1_fill_quad(const rectangle *cliprect, int patterndata, int xsize
slu1 = (u1-p[ps1-1].u)/delta;
slv1 = (v1-p[ps1-1].v)/delta;
} else {
- vdp1_fill_slope(cliprect, patterndata, xsize,
+ vdp1_fill_slope(machine, cliprect, patterndata, xsize,
x1, x2, sl1, sl2, &x1, &x2,
u1, u2, slu1, slu2, &u1, &u2,
v1, v2, slv1, slv2, &v1, &v2,
@@ -1371,7 +1370,7 @@ static void vdp1_fill_quad(const rectangle *cliprect, int patterndata, int xsize
}
}
if(cury == limy)
- vdp1_fill_line(cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2);
+ vdp1_fill_line(machine, cliprect, patterndata, xsize, cury, x1, x2, u1, u2, v1, v2);
}
static int x2s(int v)
@@ -1384,7 +1383,7 @@ static int y2s(int v)
return (INT32)(INT16)v + stvvdp1_local_y;
}
-static void stv_vdp1_draw_line( const rectangle *cliprect)
+static void stv_vdp1_draw_line(running_machine *machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1400,10 +1399,10 @@ static void stv_vdp1_draw_line( const rectangle *cliprect)
q[0].u = q[3].u = q[1].u = q[2].u = 0;
q[0].v = q[1].v = q[2].v = q[3].v = 0;
- vdp1_fill_quad(cliprect, 0, 1, q);
+ vdp1_fill_quad(machine, cliprect, 0, 1, q);
}
-static void stv_vdp1_draw_poly_line( const rectangle *cliprect)
+static void stv_vdp1_draw_poly_line(running_machine *machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1419,7 +1418,7 @@ static void stv_vdp1_draw_poly_line( const rectangle *cliprect)
q[0].u = q[3].u = q[1].u = q[2].u = 0;
q[0].v = q[1].v = q[2].v = q[3].v = 0;
- vdp1_fill_quad(cliprect, 0, 1, q);
+ vdp1_fill_quad(machine, cliprect, 0, 1, q);
q[0].x = x2s(stv2_current_sprite.CMDXB);
q[0].y = y2s(stv2_current_sprite.CMDYB);
@@ -1433,7 +1432,7 @@ static void stv_vdp1_draw_poly_line( const rectangle *cliprect)
q[0].u = q[3].u = q[1].u = q[2].u = 0;
q[0].v = q[1].v = q[2].v = q[3].v = 0;
- vdp1_fill_quad(cliprect, 0, 1, q);
+ vdp1_fill_quad(machine, cliprect, 0, 1, q);
q[0].x = x2s(stv2_current_sprite.CMDXC);
q[0].y = y2s(stv2_current_sprite.CMDYC);
@@ -1447,7 +1446,7 @@ static void stv_vdp1_draw_poly_line( const rectangle *cliprect)
q[0].u = q[3].u = q[1].u = q[2].u = 0;
q[0].v = q[1].v = q[2].v = q[3].v = 0;
- vdp1_fill_quad(cliprect, 0, 1, q);
+ vdp1_fill_quad(machine, cliprect, 0, 1, q);
q[0].x = x2s(stv2_current_sprite.CMDXD);
q[0].y = y2s(stv2_current_sprite.CMDYD);
@@ -1462,11 +1461,11 @@ static void stv_vdp1_draw_poly_line( const rectangle *cliprect)
q[0].v = q[1].v = q[2].v = q[3].v = 0;
stv_vdp1_setup_shading(q, cliprect);
- vdp1_fill_quad(cliprect, 0, 1, q);
+ vdp1_fill_quad(machine, cliprect, 0, 1, q);
}
-static void stv_vpd1_draw_distorted_sprite(const rectangle *cliprect)
+static void stv_vpd1_draw_distorted_sprite(running_machine *machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1521,10 +1520,10 @@ static void stv_vpd1_draw_distorted_sprite(const rectangle *cliprect)
}
stv_vdp1_setup_shading(q, cliprect);
- vdp1_fill_quad(cliprect, patterndata, xsize, q);
+ vdp1_fill_quad(machine, cliprect, patterndata, xsize, q);
}
-static void stv_vpd1_draw_scaled_sprite(const rectangle *cliprect)
+static void stv_vpd1_draw_scaled_sprite(running_machine *machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1668,11 +1667,11 @@ static void stv_vpd1_draw_scaled_sprite(const rectangle *cliprect)
}
stv_vdp1_setup_shading(q, cliprect);
- vdp1_fill_quad(cliprect, patterndata, xsize, q);
+ vdp1_fill_quad(machine, cliprect, patterndata, xsize, q);
}
-static void stv_vpd1_draw_normal_sprite(const rectangle *cliprect, int sprite_type)
+static void stv_vpd1_draw_normal_sprite(running_machine *machine, const rectangle *cliprect, int sprite_type)
{
UINT16 *destline;
@@ -1751,14 +1750,14 @@ static void stv_vpd1_draw_normal_sprite(const rectangle *cliprect, int sprite_ty
su = u;
for (drawxpos = x; drawxpos <= maxdrawxpos; drawxpos++ )
{
- drawpixel( drawxpos, drawypos, patterndata, u );
+ drawpixel( machine, drawxpos, drawypos, patterndata, u );
u += dux;
}
u = su + duy;
}
}
-static void stv_vdp1_process_list()
+static void stv_vdp1_process_list(running_machine *machine)
{
int position;
int spritecount;
@@ -1913,37 +1912,37 @@ static void stv_vdp1_process_list()
case 0x0000:
if (vdp1_sprite_log) logerror ("Sprite List Normal Sprite\n");
stv2_current_sprite.ispoly = 0;
- stv_vpd1_draw_normal_sprite(cliprect, 0);
+ stv_vpd1_draw_normal_sprite(machine, cliprect, 0);
break;
case 0x0001:
if (vdp1_sprite_log) logerror ("Sprite List Scaled Sprite\n");
stv2_current_sprite.ispoly = 0;
- stv_vpd1_draw_scaled_sprite(cliprect);
+ stv_vpd1_draw_scaled_sprite(machine, cliprect);
break;
case 0x0002:
if (vdp1_sprite_log) logerror ("Sprite List Distorted Sprite\n");
stv2_current_sprite.ispoly = 0;
- stv_vpd1_draw_distorted_sprite(cliprect);
+ stv_vpd1_draw_distorted_sprite(machine, cliprect);
break;
case 0x0004:
if (vdp1_sprite_log) logerror ("Sprite List Polygon\n");
stv2_current_sprite.ispoly = 1;
- stv_vpd1_draw_distorted_sprite(cliprect);
+ stv_vpd1_draw_distorted_sprite(machine, cliprect);
break;
case 0x0005:
if (vdp1_sprite_log) logerror ("Sprite List Polyline\n");
stv2_current_sprite.ispoly = 1;
- stv_vdp1_draw_poly_line(cliprect);
+ stv_vdp1_draw_poly_line(machine, cliprect);
break;
case 0x0006:
if (vdp1_sprite_log) logerror ("Sprite List Line\n");
stv2_current_sprite.ispoly = 1;
- stv_vdp1_draw_line(cliprect);
+ stv_vdp1_draw_line(machine, cliprect);
break;
case 0x0008:
@@ -1989,7 +1988,7 @@ static void stv_vdp1_process_list()
/* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */
// if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/
-// cpu_set_input_line_and_vector(Machine->cpu[0], 2, HOLD_LINE , 0x4d);
+// cpu_set_input_line_and_vector(machine->cpu[0], 2, HOLD_LINE , 0x4d);
if (vdp1_sprite_log) logerror ("End of list processing!\n");
}
@@ -2064,7 +2063,7 @@ void video_update_vdp1(running_machine *machine)
break;
case 2:/*Automatic Draw*/
if ( framebufer_changed )
- stv_vdp1_process_list();
+ stv_vdp1_process_list(machine);
break;
case 3: /*<invalid>*/
logerror("Warning: Invalid PTM mode set for VDP1!\n");
diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c
index 94ba77192bd..9f27340a8b9 100644
--- a/src/mame/video/suna16.c
+++ b/src/mame/video/suna16.c
@@ -65,7 +65,7 @@ WRITE16_HANDLER( suna16_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
{
- flip_screen_set( data & 1 );
+ flip_screen_set(space->machine, data & 1 );
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( data & 0x10 );
+ flip_screen_set(space->machine, data & 0x10 );
// color_bank = ( data & 0x07 );
}
if (data & ~(0x10)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(space->cpu), data);
@@ -182,7 +182,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (flipx) tile_flipx = !tile_flipx;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = max_x - sx;
sy = max_y - sy;
diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c
index f6c54333dde..0e0aa0a133d 100644
--- a/src/mame/video/suna8.c
+++ b/src/mame/video/suna8.c
@@ -318,7 +318,7 @@ static void draw_normal_sprites(running_machine *machine, bitmap_t *bitmap,const
if (flipx) tile_flipx = !tile_flipx;
if (flipy) tile_flipy = !tile_flipy;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{ sx = max_x - sx; tile_flipx = !tile_flipx;
sy = max_y - sy; tile_flipy = !tile_flipy; }
@@ -383,7 +383,7 @@ static void draw_text_sprites(running_machine *machine, bitmap_t *bitmap,const r
int sx = x + tx * 8;
int sy = (y + real_ty * 8) & 0xff;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{ sx = max_x - sx; flipx = !flipx;
sy = max_y - sy; flipy = !flipy; }
diff --git a/src/mame/video/supbtime.c b/src/mame/video/supbtime.c
index 3299f02e7a3..eaa7c18e391 100644
--- a/src/mame/video/supbtime.c
+++ b/src/mame/video/supbtime.c
@@ -57,7 +57,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -90,7 +90,7 @@ VIDEO_START(supbtime)
VIDEO_UPDATE(supbtime)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,768);
diff --git a/src/mame/video/superqix.c b/src/mame/video/superqix.c
index 647931a5d2a..5a14e0e1d4f 100644
--- a/src/mame/video/superqix.c
+++ b/src/mame/video/superqix.c
@@ -138,7 +138,7 @@ WRITE8_HANDLER( pbillian_0410_w )
memory_set_bank(space->machine, 1, (data & 0x08) >> 3);
interrupt_enable_w(space,0,data & 0x10);
- flip_screen_set(data & 0x20);
+ flip_screen_set(space->machine, data & 0x20);
}
WRITE8_HANDLER( superqix_0410_w )
@@ -180,7 +180,7 @@ static void pbillian_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
int sx = spriteram[offs + 1] + 256 * (spriteram[offs] & 0x01);
int sy = spriteram[offs + 2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -189,7 +189,7 @@ static void pbillian_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
drawgfx(bitmap,machine->gfx[1],
code,
color,
- flip_screen_get(), flip_screen_get(),
+ flip_screen_get(machine), flip_screen_get(machine),
sx, sy,
cliprect, TRANSPARENCY_PEN, 0);
}
@@ -209,7 +209,7 @@ static void superqix_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
int sx = spriteram[offs + 1];
int sy = spriteram[offs + 2];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -255,7 +255,7 @@ VIDEO_UPDATE( pbillian )
VIDEO_UPDATE( superqix )
{
tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- copybitmap_trans(bitmap,fg_bitmap[show_bitmap],flip_screen_get(),flip_screen_get(),0,0,cliprect,0);
+ copybitmap_trans(bitmap,fg_bitmap[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, bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c
index e33af8a9433..d4bb09e2cb7 100644
--- a/src/mame/video/suprloco.c
+++ b/src/mame/video/suprloco.c
@@ -119,7 +119,7 @@ WRITE8_HANDLER( suprloco_videoram_w )
WRITE8_HANDLER( suprloco_scrollram_w )
{
- int adj = flip_screen_get() ? -8 : 8;
+ int adj = flip_screen_get(space->machine) ? -8 : 8;
suprloco_scrollram[offset] = data;
tilemap_set_scrollx(bg_tilemap,offset, data - adj);
@@ -145,7 +145,7 @@ WRITE8_HANDLER( suprloco_control_w )
coin_counter_w(0, data & 0x01);
coin_counter_w(1, data & 0x02);
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
control = data;
}
@@ -158,9 +158,9 @@ READ8_HANDLER( suprloco_control_r )
-INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color)
+INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color,int flip)
{
- if (flip_screen_get())
+ if (flip)
{
x = bitmap->width - x - 1;
y = bitmap->height - y - 1;
@@ -178,6 +178,7 @@ 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)
{
+ int flip = flip_screen_get(machine);
int sx,sy,col,row,height,src,adjy,dy;
UINT8 *spr_reg;
UINT8 *gfx2;
@@ -195,7 +196,7 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectang
sx = spr_reg[SPR_X];
sy = spr_reg[SPR_Y_TOP] + 1;
- if (!flip_screen_get())
+ if (!flip_screen_get(machine))
{
adjy = sy;
dy = 1;
@@ -238,11 +239,11 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectang
if (color1 == 15) break;
if (color1)
- draw_pixel(bitmap,cliprect,sx+col, adjy,pen_base + color1);
+ draw_pixel(bitmap,cliprect,sx+col, adjy,pen_base + color1, flip);
if (color2 == 15) break;
if (color2)
- draw_pixel(bitmap,cliprect,sx+col+1,adjy,pen_base + color2);
+ draw_pixel(bitmap,cliprect,sx+col+1,adjy,pen_base + color2, flip);
col += 2;
}
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index 33bb856bc8d..b3510b21afd 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -164,7 +164,7 @@ if (data & 0x6e) logerror("videomode = %02x\n",data);
system1_video_mode = data;
/* bit 7 is flip screen */
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
READ8_HANDLER( system1_videomode_r )
@@ -289,7 +289,7 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,int spr_numbe
x_flipped = x;
y = y_flipped = sy+row;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y_flipped = 258 - sy - height + row;
x_flipped = (252*2) - x;
@@ -323,13 +323,13 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,int spr_numbe
if (color1)
draw_pixel(machine,bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color1);
x++;
- x_flipped += flip_screen_get() ? -1 : 1;
+ x_flipped += flip_screen_get(machine) ? -1 : 1;
if (color2 == 15) break;
if (color2)
draw_pixel(machine,bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color2);
x++;
- x_flipped += flip_screen_get() ? -1 : 1;
+ x_flipped += flip_screen_get(machine) ? -1 : 1;
}
}
}
@@ -383,7 +383,7 @@ static int system1_draw_fg(running_machine *machine, bitmap_t *bitmap, const rec
sx = (offs/2) % 32;
sy = (offs/2) / 32;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 31 - sx;
sy = 31 - sy;
@@ -397,7 +397,7 @@ static int system1_draw_fg(running_machine *machine, bitmap_t *bitmap, const rec
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
8*sx + blockgal_kludgeoffset,8*sy,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -442,7 +442,7 @@ static void system1_draw_bg(running_machine *machine, bitmap_t *bitmap, const re
sx = (offs/2) % 32;
sy = (offs/2) / 32;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 31 - sx;
sy = 31 - sy;
@@ -451,14 +451,14 @@ static void system1_draw_bg(running_machine *machine, bitmap_t *bitmap, const re
drawgfx(tmp_bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
8*sx,8*sy,
0,TRANSPARENCY_NONE,0);
}
}
/* copy the temporary bitmap to the screen */
- if (flip_screen_get())
+ if (flip_screen_get(machine))
copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx_flip,1,&background_scrolly_flip,cliprect);
else
copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx,1,&background_scrolly,cliprect);
@@ -480,7 +480,7 @@ static void system1_draw_bg(running_machine *machine, bitmap_t *bitmap, const re
sx = (offs/2) % 32;
sy = (offs/2) / 32;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 8*(31-sx) + background_scrollx_flip;
sy = 8*(31-sy) + background_scrolly_flip;
@@ -495,25 +495,25 @@ static void system1_draw_bg(running_machine *machine, bitmap_t *bitmap, const re
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx-256,sy,
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,sy-256,
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx-256,sy-256,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -584,7 +584,7 @@ static void chplft_draw_bg(running_machine *machine, bitmap_t *bitmap, const rec
sx = (offs/2) % 32;
sy = (offs/2) / 32;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 31 - sx;
sy = 31 - sy;
@@ -593,7 +593,7 @@ static void chplft_draw_bg(running_machine *machine, bitmap_t *bitmap, const rec
drawgfx(tmp_bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
8*sx,8*sy,
0,TRANSPARENCY_NONE,0);
}
@@ -602,7 +602,7 @@ static void chplft_draw_bg(running_machine *machine, bitmap_t *bitmap, const rec
/* copy the temporary bitmap to the screen */
if (choplifter_scroll_x_on)
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
int scrollx_row_flip[32],i;
@@ -634,7 +634,7 @@ static void chplft_draw_bg(running_machine *machine, bitmap_t *bitmap, const rec
sx = (offs/2) % 32;
sy = (offs/2) / 32;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 8*(31-sx);
@@ -654,7 +654,7 @@ static void chplft_draw_bg(running_machine *machine, bitmap_t *bitmap, const rec
drawgfx(bitmap,machine->gfx[0],
code,
color,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx,8*sy,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -737,7 +737,7 @@ static void wbml_draw_bg(running_machine *machine, bitmap_t *bitmap, const recta
if (x > 256) x -= 512;
if (y > 224) y -= 512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 248 - x;
y = 248 - y;
@@ -751,14 +751,14 @@ static void wbml_draw_bg(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[0],
code,
((code >> 5) & 0x3f) + 64,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
x,y,
cliprect, TRANSPARENCY_NONE, 0);
else if (priority)
drawgfx(bitmap,machine->gfx[0],
code,
((code >> 5) & 0x3f) + 64,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
x,y,
cliprect, TRANSPARENCY_PEN, 0);
@@ -783,7 +783,7 @@ static void wbml_draw_fg(running_machine *machine, bitmap_t *bitmap, const recta
code = wbml_paged_videoram[offs] | (wbml_paged_videoram[offs+1] << 8);
code = ((code >> 4) & 0x800) | (code & 0x7ff);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 31 - sx;
sy = 31 - sy;
@@ -792,7 +792,7 @@ static void wbml_draw_fg(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx(bitmap,machine->gfx[0],
code,
(code >> 5) & 0x3f,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
8*sx,8*sy,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -838,7 +838,7 @@ static void ufosensi_draw_bg(running_machine *machine, bitmap_t *bitmap, const r
if (x > 256) x -= 512;
if (y > 224) y -= 512;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 248 - x;
y = 248 - y;
@@ -852,14 +852,14 @@ static void ufosensi_draw_bg(running_machine *machine, bitmap_t *bitmap, const r
drawgfx(bitmap,machine->gfx[0],
code,
((code >> 5) & 0x3f) + 64,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
x,y,
cliprect, TRANSPARENCY_NONE, 0);
else if (priority)
drawgfx(bitmap,machine->gfx[0],
code,
((code >> 5) & 0x3f) + 64,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
x,y,
cliprect, TRANSPARENCY_PEN, 0);
diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c
index 86bcb4974e4..16612dff0bb 100644
--- a/src/mame/video/tagteam.c
+++ b/src/mame/video/tagteam.c
@@ -112,9 +112,9 @@ logerror("%04x: control = %02x\n",cpu_get_pc(space->cpu),data);
WRITE8_HANDLER( tagteam_flipscreen_w )
{
- if (flip_screen_get() != (data &0x01))
+ if (flip_screen_get(space->machine) != (data &0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -149,7 +149,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (!(videoram[offs] & 0x01)) continue;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -168,7 +168,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
code = videoram[offs + 0x20] + 256 * spritebank;
color = palettebank;
- sy += (flip_screen_get() ? -256 : 256);
+ sy += (flip_screen_get(machine) ? -256 : 256);
drawgfx(bitmap, machine->gfx[1],
code, color,
diff --git a/src/mame/video/tecmo.c b/src/mame/video/tecmo.c
index d42c5979bac..ce8285dc133 100644
--- a/src/mame/video/tecmo.c
+++ b/src/mame/video/tecmo.c
@@ -151,7 +151,7 @@ WRITE8_HANDLER( tecmo_bgscroll_w )
WRITE8_HANDLER( tecmo_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
@@ -201,7 +201,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipx = bank & 1;
flipy = bank & 2;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
xpos = 256 - (8 * size) - xpos;
ypos = 256 - (8 * size) - ypos;
diff --git a/src/mame/video/tecmo16.c b/src/mame/video/tecmo16.c
index 3e3e9067eb3..dc3398f0d35 100644
--- a/src/mame/video/tecmo16.c
+++ b/src/mame/video/tecmo16.c
@@ -170,7 +170,7 @@ WRITE16_HANDLER( tecmo16_charram_w )
WRITE16_HANDLER( tecmo16_flipscreen_w )
{
flipscreen = data & 0x01;
- flip_screen_set(flipscreen);
+ flip_screen_set(space->machine, flipscreen);
}
/******************************************************************************/
diff --git a/src/mame/video/tehkanwc.c b/src/mame/video/tehkanwc.c
index cb2bdeff056..c889955d931 100644
--- a/src/mame/video/tehkanwc.c
+++ b/src/mame/video/tehkanwc.c
@@ -49,12 +49,12 @@ WRITE8_HANDLER( tehkanwc_scroll_y_w )
WRITE8_HANDLER( tehkanwc_flipscreen_x_w )
{
- flip_screen_x_set(data & 0x40);
+ flip_screen_x_set(space->machine, data & 0x40);
}
WRITE8_HANDLER( tehkanwc_flipscreen_y_w )
{
- flip_screen_y_set(data & 0x40);
+ flip_screen_y_set(space->machine, data & 0x40);
}
WRITE8_HANDLER( gridiron_led0_w )
@@ -139,13 +139,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
int sy = spriteram[offs + 3];
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
diff --git a/src/mame/video/terracre.c b/src/mame/video/terracre.c
index bfefb1dfe7f..7646fd2e1bf 100644
--- a/src/mame/video/terracre.c
+++ b/src/mame/video/terracre.c
@@ -78,7 +78,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color += 16 * (spritepalettebank[(tile>>1)&0xff] & 0x0f);
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx=240-sx;
sy=240-sy;
@@ -169,7 +169,7 @@ WRITE16_HANDLER( amazon_flipscreen_w )
{
coin_counter_w( 0, data&0x01 );
coin_counter_w( 1, (data&0x02)>>1 );
- flip_screen_set(data&0x04);
+ flip_screen_set(space->machine, data&0x04);
}
}
diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c
index a8c970d8a13..f4731c77c10 100644
--- a/src/mame/video/thedeep.c
+++ b/src/mame/video/thedeep.c
@@ -176,7 +176,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (color & 1) sx -= 256;
if (attr & 1) sy -= 256;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
diff --git a/src/mame/video/tigeroad.c b/src/mame/video/tigeroad.c
index c61a4598e52..d0de5288794 100644
--- a/src/mame/video/tigeroad.c
+++ b/src/mame/video/tigeroad.c
@@ -19,9 +19,9 @@ WRITE16_HANDLER( tigeroad_videoctrl_w )
/* bit 1 flips screen */
- if (flip_screen_get() != (data & 0x02))
+ if (flip_screen_get(space->machine) != (data & 0x02))
{
- flip_screen_set(data & 0x02);
+ flip_screen_set(space->machine, data & 0x02);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -88,7 +88,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (sx > 0x100) sx -= 0x200;
if (sy > 0x100) sy -= 0x200;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/timeplt.c b/src/mame/video/timeplt.c
index c45498f1e3b..821e2e0f46a 100644
--- a/src/mame/video/timeplt.c
+++ b/src/mame/video/timeplt.c
@@ -140,7 +140,7 @@ WRITE8_HANDLER( timeplt_colorram_w )
WRITE8_HANDLER( timeplt_flipscreen_w )
{
- flip_screen_set(~data & 1);
+ flip_screen_set(space->machine, ~data & 1);
}
diff --git a/src/mame/video/toki.c b/src/mame/video/toki.c
index a6fbc5e13d1..a9ab57b49f2 100644
--- a/src/mame/video/toki.c
+++ b/src/mame/video/toki.c
@@ -201,7 +201,7 @@ static void toki_draw_sprites(running_machine *machine, bitmap_t *bitmap,const r
flipy = 0;
tile = (sprite_word[1] & 0xfff) + ((sprite_word[2] & 0x8000) >> 3);
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
x=240-x;
y=240-y;
if (flipx) flipx=0; else flipx=1;
@@ -283,7 +283,7 @@ VIDEO_UPDATE( toki )
tilemap_set_scrollx( foreground_layer, 0, foreground_x_scroll );
tilemap_set_scrolly( foreground_layer, 0, foreground_y_scroll );
- flip_screen_set((toki_scrollram16[0x28]&0x8000)==0);
+ flip_screen_set(screen->machine, (toki_scrollram16[0x28]&0x8000)==0);
if (toki_scrollram16[0x28]&0x100) {
tilemap_draw(bitmap,cliprect,background_layer,TILEMAP_DRAW_OPAQUE,0);
diff --git a/src/mame/video/trackfld.c b/src/mame/video/trackfld.c
index 0844443af1b..aac9778a16b 100644
--- a/src/mame/video/trackfld.c
+++ b/src/mame/video/trackfld.c
@@ -107,9 +107,9 @@ WRITE8_HANDLER( trackfld_colorram_w )
WRITE8_HANDLER( trackfld_flipscreen_w )
{
- if (flip_screen_get() != data)
+ if (flip_screen_get(space->machine) != data)
{
- flip_screen_set(data);
+ flip_screen_set(space->machine, data);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -202,7 +202,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sx = spriteram[offs] - 1;
int sy = 240 - spriteram_2[offs + 1];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
@@ -238,7 +238,7 @@ VIDEO_UPDATE( trackfld )
for (row = 0; row < 32; row++)
{
scrollx = trackfld_scroll[row] + 256 * (trackfld_scroll2[row] & 0x01);
- if (flip_screen_get()) scrollx = -scrollx;
+ if (flip_screen_get(screen->machine)) scrollx = -scrollx;
tilemap_set_scrollx(bg_tilemap, row, scrollx);
}
diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c
index 292f7152f75..e94ee0670f6 100644
--- a/src/mame/video/travrusa.c
+++ b/src/mame/video/travrusa.c
@@ -276,7 +276,7 @@ WRITE8_HANDLER( travrusa_flipscreen_w )
/* screen flip is handled both by software and hardware */
data ^= ~input_port_read(space->machine, "DSW2") & 1;
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
coin_counter_w(0,data & 0x02);
coin_counter_w(1,data & 0x20);
@@ -304,7 +304,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
8*8, 32*8-1
};
rectangle clip = *cliprect;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
sect_rect(&clip, &spritevisibleareaflip);
else
sect_rect(&clip, &spritevisiblearea);
@@ -319,7 +319,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int flipx = attr & 0x40;
int flipy = attr & 0x80;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c
index 4f0c3ad80cb..e11814f2b08 100644
--- a/src/mame/video/tryout.c
+++ b/src/mame/video/tryout.c
@@ -151,7 +151,7 @@ WRITE8_HANDLER( tryout_vram_bankswitch_w )
WRITE8_HANDLER( tryout_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
static TILEMAP_MAPPER( get_fg_memory_offset )
@@ -199,7 +199,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
fy = 0;
inc = 16;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
x = 240 - x;
fx = !fx;
@@ -239,7 +239,7 @@ VIDEO_UPDATE( tryout )
int scrollx;
- if (!flip_screen_get())
+ if (!flip_screen_get(screen->machine))
tilemap_set_scrollx(fg_tilemap, 0, 16); /* Assumed hard-wired */
else
tilemap_set_scrollx(fg_tilemap, 0, -8); /* Assumed hard-wired */
diff --git a/src/mame/video/tsamurai.c b/src/mame/video/tsamurai.c
index 14fef195268..6bb56533199 100644
--- a/src/mame/video/tsamurai.c
+++ b/src/mame/video/tsamurai.c
@@ -173,7 +173,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
/* So I'm using this specific check. -kal 11 jul 2002 */
// if(sprite_type == 1) sy=sy+2;
- if( flip_screen_get() )
+ if( flip_screen_get(machine) )
{
drawgfx( bitmap,gfx,
sprite_number&0x7f,
diff --git a/src/mame/video/tumblep.c b/src/mame/video/tumblep.c
index 46cdf806a56..25612da4dcf 100644
--- a/src/mame/video/tumblep.c
+++ b/src/mame/video/tumblep.c
@@ -56,7 +56,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@@ -87,7 +87,7 @@ VIDEO_START(tumblep)
VIDEO_UPDATE(tumblep)
{
- flip_screen_set( deco16_pf12_control[0]&0x80 );
+ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,256); /* not verified */
diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c
index f7445da08fb..7f26df52e77 100644
--- a/src/mame/video/twin16.c
+++ b/src/mame/video/twin16.c
@@ -59,12 +59,12 @@ WRITE16_HANDLER( twin16_video_register_w )
case 0:
COMBINE_DATA( &video_register );
- flip_screen_x_set(video_register & TWIN16_SCREEN_FLIPX);
+ flip_screen_x_set(space->machine, video_register & TWIN16_SCREEN_FLIPX);
if (twin16_custom_video)
- flip_screen_y_set(video_register & TWIN16_SCREEN_FLIPY);
+ flip_screen_y_set(space->machine, video_register & TWIN16_SCREEN_FLIPY);
else
- flip_screen_y_set(~video_register & TWIN16_SCREEN_FLIPY);
+ flip_screen_y_set(space->machine, ~video_register & TWIN16_SCREEN_FLIPY);
break;
diff --git a/src/mame/video/vaportra.c b/src/mame/video/vaportra.c
index 65271d41a77..357202ddd8c 100644
--- a/src/mame/video/vaportra.c
+++ b/src/mame/video/vaportra.c
@@ -121,7 +121,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
inc = 1;
}
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
y=240-y;
x=240-x;
@@ -150,7 +150,7 @@ VIDEO_UPDATE( vaportra )
{
int pri=vaportra_priority[0] & 0x03;
- flip_screen_set( !(deco16_pf12_control[0]&0x80) );
+ flip_screen_set(screen->machine, !(deco16_pf12_control[0]&0x80) );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
diff --git a/src/mame/video/vastar.c b/src/mame/video/vastar.c
index 8f874337c9c..9707825e40f 100644
--- a/src/mame/video/vastar.c
+++ b/src/mame/video/vastar.c
@@ -146,7 +146,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipx = spriteram_3[offs] & 0x02;
flipy = spriteram_3[offs] & 0x01;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
@@ -154,7 +154,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (spriteram_2[offs] & 0x08) /* double width */
{
- if (!flip_screen_get())
+ if (!flip_screen_get(machine))
sy = 224 - sy;
drawgfx(bitmap,machine->gfx[2],
@@ -173,7 +173,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
else
{
- if (!flip_screen_get())
+ if (!flip_screen_get(machine))
sy = 240 - sy;
drawgfx(bitmap,machine->gfx[1],
diff --git a/src/mame/video/vball.c b/src/mame/video/vball.c
index b5070c294cf..a076d778ce9 100644
--- a/src/mame/video/vball.c
+++ b/src/mame/video/vball.c
@@ -136,7 +136,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flipy = 0;
int dy = -16;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
diff --git a/src/mame/video/vertigo.c b/src/mame/video/vertigo.c
index 48a82349f05..2926526bc45 100644
--- a/src/mame/video/vertigo.c
+++ b/src/mame/video/vertigo.c
@@ -57,8 +57,8 @@
#define MC_LENGTH 512
-#define V_ADDPOINT(h,v,c,i) \
- vector_add_point (((h) & 0x7ff) << 14, (0x6ff - ((v) & 0x7ff)) << 14, VECTOR_COLOR444(c), (i))
+#define V_ADDPOINT(m,h,v,c,i) \
+ vector_add_point (m, ((h) & 0x7ff) << 14, (0x6ff - ((v) & 0x7ff)) << 14, VECTOR_COLOR444(c), (i))
#define ADD(r,s,c) (((r) + (s) + (c)) & 0xffff)
#define SUBR(r,s,c) ((~(r) + (s) + (c)) & 0xffff)
@@ -140,6 +140,7 @@ typedef struct _am2901
typedef struct _vector_generator
{
+ running_machine *machine;
UINT32 sreg; /* shift register */
UINT32 l1; /* latch 1 adder operand only */
UINT32 l2; /* latch 2 adder operand only */
@@ -242,6 +243,7 @@ void vertigo_vproc_init(running_machine *machine)
memset(&vs, 0, sizeof(vs));
memset(&bsp, 0, sizeof(bsp));
memset(&vgen, 0, sizeof(vgen));
+ vgen.machine = machine;
state_save_register_item_array(machine, "vector_proc", NULL, 0, vs.sram);
state_save_register_item(machine, "vector_proc", NULL, 0, vs.ramlatch);
@@ -456,9 +458,9 @@ static void vertigo_vgen (vector_generator *vg)
if (vg->brez ^ vg->ven)
{
if (vg->brez)
- V_ADDPOINT (vg->c_h, vg->c_v, 0, 0);
+ V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, 0, 0);
else
- V_ADDPOINT (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;
}
}
diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c
index 23cbffb23e1..6d682e707c5 100644
--- a/src/mame/video/vsnes.c
+++ b/src/mame/video/vsnes.c
@@ -1,5 +1,4 @@
#include "driver.h"
-#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "includes/vsnes.h"
@@ -15,9 +14,9 @@ PALETTE_INIT( vsdual )
ppu2c0x_init_palette(machine, 8*4*16 );
}
-static void ppu_irq( int num, int *ppu_regs )
+static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
{
- cpu_set_input_line(Machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
+ cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
}
/* our ppu interface */
diff --git a/src/mame/video/vulgus.c b/src/mame/video/vulgus.c
index 191c64b1919..d04754405b5 100644
--- a/src/mame/video/vulgus.c
+++ b/src/mame/video/vulgus.c
@@ -150,7 +150,7 @@ WRITE8_HANDLER( vulgus_c804_w )
coin_counter_w(1, data & 0x02);
/* bit 7 flips screen */
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
}
@@ -185,7 +185,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sx = spriteram[offs + 3];
sy = spriteram[offs + 2];
dir = 1;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;
@@ -200,7 +200,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
drawgfx(bitmap,machine->gfx[2],
code + i,
col,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx, sy + 16 * i * dir,
cliprect,TRANSPARENCY_PEN,15);
@@ -208,7 +208,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
drawgfx(bitmap,machine->gfx[2],
code + i,
col,
- flip_screen_get(),flip_screen_get(),
+ flip_screen_get(machine),flip_screen_get(machine),
sx, sy + 16 * i * dir - dir * 256,
cliprect,TRANSPARENCY_PEN,15);
i--;
diff --git a/src/mame/video/welltris.c b/src/mame/video/welltris.c
index e2746336f5e..7d44287ba6a 100644
--- a/src/mame/video/welltris.c
+++ b/src/mame/video/welltris.c
@@ -175,7 +175,7 @@ WRITE16_HANDLER( welltris_palette_bank_w )
tilemap_mark_all_tiles_dirty(char_tilemap);
}
- flip_screen_set(data & 0x80);
+ flip_screen_set(space->machine, data & 0x80);
spritepalettebank = (data & 0x20) >> 5;
pixelpalettebank = (data & 0x08) >> 3;
diff --git a/src/mame/video/wrally.c b/src/mame/video/wrally.c
index e2213367301..3742b9462b9 100644
--- a/src/mame/video/wrally.c
+++ b/src/mame/video/wrally.c
@@ -126,7 +126,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (high_priority != priority) continue;
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
sy = sy + 248;
}
@@ -181,7 +181,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( wrally )
{
/* set scroll registers */
- if (!flip_screen_get()) {
+ if (!flip_screen_get(screen->machine)) {
tilemap_set_scrolly(wrally_pant[0], 0, wrally_vregs[0]);
tilemap_set_scrollx(wrally_pant[0], 0, wrally_vregs[1]+4);
tilemap_set_scrolly(wrally_pant[1], 0, wrally_vregs[2]);
diff --git a/src/mame/video/wwfsstar.c b/src/mame/video/wwfsstar.c
index 0fc46bccdd5..9e3c28c72ff 100644
--- a/src/mame/video/wwfsstar.c
+++ b/src/mame/video/wwfsstar.c
@@ -154,7 +154,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
number &= ~(chain - 1);
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipy = !flipy;
flipx = !flipx;
@@ -164,7 +164,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (count=0;count<chain;count++)
{
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
if (!flipy)
{
diff --git a/src/mame/video/wwfwfest.c b/src/mame/video/wwfwfest.c
index bdc2c53e5b8..76e0e251a69 100644
--- a/src/mame/video/wwfwfest.c
+++ b/src/mame/video/wwfwfest.c
@@ -189,7 +189,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8;
colourbank = (source[4] & 0x000f);
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
if (flipy) flipy=0; else flipy=1;
if (flipx) flipx=0; else flipx=1;
ypos=240-ypos-sprite_xoff;
@@ -197,7 +197,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
for (count=0;count<chain;count++) {
- if (flip_screen_get()) {
+ if (flip_screen_get(machine)) {
if (!flipy) {
drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),cliprect,TRANSPARENCY_PEN,0);
} else {
diff --git a/src/mame/video/xain.c b/src/mame/video/xain.c
index 14c90bfa098..05695c940d4 100644
--- a/src/mame/video/xain.c
+++ b/src/mame/video/xain.c
@@ -158,7 +158,7 @@ WRITE8_HANDLER( xain_scrollyP1_w )
WRITE8_HANDLER( xain_flipscreen_w )
{
- flip_screen_set(data & 1);
+ flip_screen_set(space->machine, data & 1);
}
@@ -184,7 +184,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sy = 240 - spriteram[offs];
if (sy <= -7) sy += 256;
flipx = attr & 0x40;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sx = 239 - sx;
sy = 240 - sy;
@@ -196,13 +196,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
drawgfx(bitmap,machine->gfx[3],
numtile,
color,
- flipx,flip_screen_get(),
- sx-1,flip_screen_get() ? sy+16:sy-16,
+ flipx,flip_screen_get(machine),
+ sx-1,flip_screen_get(machine) ? sy+16:sy-16,
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[3],
numtile+1,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx-1,sy,
cliprect,TRANSPARENCY_PEN,0);
}
@@ -211,7 +211,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
drawgfx(bitmap,machine->gfx[3],
numtile,
color,
- flipx,flip_screen_get(),
+ flipx,flip_screen_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c
index 71c40869a21..16f92442425 100644
--- a/src/mame/video/xevious.c
+++ b/src/mame/video/xevious.c
@@ -194,9 +194,9 @@ static TILE_GET_INFO( get_fg_tile_info )
UINT8 color = ((attr & 0x03) << 4) | ((attr & 0x3c) >> 2);
SET_TILE_INFO(
0,
- xevious_fg_videoram[tile_index] | (flip_screen_get() ? 0x100 : 0),
+ xevious_fg_videoram[tile_index] | (flip_screen_get(machine) ? 0x100 : 0),
color,
- TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen_get() ? TILE_FLIPX : 0));
+ TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen_get(machine) ? TILE_FLIPX : 0));
}
static TILE_GET_INFO( get_bg_tile_info )
@@ -311,7 +311,7 @@ WRITE8_HANDLER( xevious_vh_latch_w )
tilemap_set_scrolly(fg_tilemap,0,scroll);
break;
case 7:
- flip_screen_set(scroll & 1);
+ flip_screen_set(space->machine, scroll & 1);
break;
default:
logerror("CRTC WRITE REG: %x Data: %03x\n",reg, scroll);
@@ -454,7 +454,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sx = spriteram_2[offs + 1] - 40 + 0x100*(spriteram_3[offs + 1] & 1);
sy = 28*8-spriteram_2[offs]-1;
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
flipx = !flipx;
flipy = !flipy;
diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c
index 53ceeffd9eb..f0ffc353407 100644
--- a/src/mame/video/ygv608.c
+++ b/src/mame/video/ygv608.c
@@ -30,7 +30,6 @@
*/
#include "driver.h"
-#include "deprecat.h"
#include "namcond1.h" // only while debugging
#include "video/ygv608.h"
@@ -51,10 +50,10 @@ static tilemap *tilemap_A = NULL;
static tilemap *tilemap_B = NULL;
static bitmap_t *work_bitmap = NULL;
-static void HandleYGV608Reset( void );
-static void HandleRomTransfers( void );
+static void HandleYGV608Reset( running_machine *machine );
+static void HandleRomTransfers( running_machine *machine );
static void SetPreShortcuts( int reg, int data );
-static void SetPostShortcuts( int reg );
+static void SetPostShortcuts( running_machine *machine, int reg );
#ifdef MAME_DEBUG
static void ShowYGV608Registers( void );
@@ -482,7 +481,7 @@ static STATE_POSTLOAD( ygv608_postload )
ygv608.tilemap_resize = 1;
for(i = 0; i < 50; i++)
- SetPostShortcuts(i);
+ SetPostShortcuts(machine, i);
}
static void ygv608_register_state_save(running_machine *machine)
@@ -1238,7 +1237,7 @@ WRITE16_HANDLER( ygv608_w )
#endif
SetPreShortcuts (regNum, data);
ygv608.regs.b[regNum] = data;
- SetPostShortcuts (regNum);
+ SetPostShortcuts (space->machine, regNum);
if (ygv608.ports.s.p5 & p5_rwai)
{
regNum ++;
@@ -1265,9 +1264,9 @@ WRITE16_HANDLER( ygv608_w )
case 0x07: /* P#7 - system control port */
ygv608.ports.b[7] = data;
if (ygv608.ports.b[7] & 0x3e)
- HandleRomTransfers();
+ HandleRomTransfers(space->machine);
if (ygv608.ports.b[7] & 0x01)
- HandleYGV608Reset();
+ HandleYGV608Reset(space->machine);
break;
default:
@@ -1276,7 +1275,7 @@ WRITE16_HANDLER( ygv608_w )
}
}
-static void HandleYGV608Reset( void )
+static void HandleYGV608Reset( running_machine *machine )
{
int i;
@@ -1297,7 +1296,7 @@ static void HandleYGV608Reset( void )
/* should set shortcuts here too */
for( i=0; i<50; i++ ) {
//SetPreShortcuts( i );
- SetPostShortcuts( i );
+ SetPostShortcuts( machine, i );
}
}
@@ -1308,14 +1307,14 @@ static void HandleYGV608Reset( void )
- So leave it in!
*/
-static void HandleRomTransfers(void)
+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 ) +
@@ -1420,7 +1419,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( int reg )
+static void SetPostShortcuts( running_machine *machine, int reg )
{
int plane, addr;
@@ -1431,7 +1430,7 @@ static void SetPostShortcuts( int reg )
UINT8 yTile = ygv608.regs.s.r0 & r0_pny;
if (yTile >= ygv608.page_y)
- logerror ("%s:setting pny(%d) >= page_y(%d)\n", cpuexec_describe_context(Machine),
+ logerror ("%s:setting pny(%d) >= page_y(%d)\n", cpuexec_describe_context(machine),
yTile, ygv608.page_y );
yTile &= (ygv608.page_y - 1);
ygv608.regs.s.r0 &= ~r0_pny;
@@ -1444,7 +1443,7 @@ static void SetPostShortcuts( int reg )
UINT8 xTile = ygv608.regs.s.r1 & r1_pnx;
if (xTile >= ygv608.page_x)
- logerror ("%s:setting pnx(%d) >= page_x(%d)\n", cpuexec_describe_context(Machine),
+ logerror ("%s:setting pnx(%d) >= page_x(%d)\n", cpuexec_describe_context(machine),
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 46868984d8c..74e3881462d 100644
--- a/src/mame/video/yiear.c
+++ b/src/mame/video/yiear.c
@@ -71,9 +71,9 @@ WRITE8_HANDLER( yiear_control_w )
{
/* bit 0 flips screen */
- if (flip_screen_get() != (data & 0x01))
+ if (flip_screen_get(space->machine) != (data & 0x01))
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(space->machine, data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
@@ -122,7 +122,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int sy = 240 - spriteram[offs + 1];
int sx = spriteram_2[offs];
- if (flip_screen_get())
+ if (flip_screen_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
diff --git a/src/mame/video/yunsun16.c b/src/mame/video/yunsun16.c
index 2aa816e02f0..783c8df3b53 100644
--- a/src/mame/video/yunsun16.c
+++ b/src/mame/video/yunsun16.c
@@ -176,7 +176,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
x += sprites_scrolldx;
y += sprites_scrolldy;
- if (flip_screen_get()) // not used?
+ if (flip_screen_get(machine)) // not used?
{
flipx = !flipx; x = max_x - x - 16;
flipy = !flipy; y = max_y - y - 16;
diff --git a/src/mame/video/zaccaria.c b/src/mame/video/zaccaria.c
index 16447c6e90c..a2befba31fb 100644
--- a/src/mame/video/zaccaria.c
+++ b/src/mame/video/zaccaria.c
@@ -188,12 +188,12 @@ WRITE8_HANDLER( zaccaria_attributes_w )
WRITE8_HANDLER( zaccaria_flip_screen_x_w )
{
- flip_screen_x_set(data & 1);
+ flip_screen_x_set(space->machine, data & 1);
}
WRITE8_HANDLER( zaccaria_flip_screen_y_w )
{
- flip_screen_y_set(data & 1);
+ flip_screen_y_set(space->machine, data & 1);
}
@@ -209,7 +209,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int offs;
rectangle clip = *cliprect;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
sect_rect(&clip, &spritevisiblearea_flipx);
else
sect_rect(&clip, &spritevisiblearea);
@@ -235,12 +235,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int flipx = spriteram_2[offs + 2] & 0x40;
int flipy = spriteram_2[offs + 2] & 0x80;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
@@ -261,12 +261,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
int flipx = spriteram[offs + 1] & 0x40;
int flipy = spriteram[offs + 1] & 0x80;
- if (flip_screen_x_get())
+ if (flip_screen_x_get(machine))
{
sx = 240 - sx;
flipx = !flipx;
}
- if (flip_screen_y_get())
+ if (flip_screen_y_get(machine))
{
sy = 240 - sy;
flipy = !flipy;
diff --git a/src/mame/video/zaxxon.c b/src/mame/video/zaxxon.c
index c8b922f3fa8..f284a7a6d84 100644
--- a/src/mame/video/zaxxon.c
+++ b/src/mame/video/zaxxon.c
@@ -189,8 +189,8 @@ VIDEO_START( congo )
WRITE8_HANDLER( zaxxon_flipscreen_w )
{
/* low bit controls flip; background and sprite flip are handled at render time */
- flip_screen_set_no_update(~data & 1);
- tilemap_set_flip(fg_tilemap, flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ flip_screen_set_no_update(space->machine, ~data & 1);
+ tilemap_set_flip(fg_tilemap, flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
@@ -313,13 +313,13 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
int colorbase = bg_color + (congo_color_bank << 8);
int xmask = pixmap->width - 1;
int ymask = pixmap->height - 1;
- int flipmask = flip_screen_get() ? 0xff : 0x00;
- int flipoffs = flip_screen_get() ? 0x38 : 0x40;
+ int flipmask = flip_screen_get(machine) ? 0xff : 0x00;
+ int flipoffs = flip_screen_get(machine) ? 0x38 : 0x40;
int x, y;
/* the starting X value is offset by 1 pixel (normal) or 7 pixels */
/* (flipped) due to a delay in the loading */
- if (!flip_screen_get())
+ if (!flip_screen_get(machine))
flipoffs -= 1;
else
flipoffs += 7;
@@ -375,10 +375,10 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
*
*************************************/
-INLINE int find_minimum_y(UINT8 value)
+INLINE int find_minimum_y(UINT8 value, int flip)
{
- int flipmask = flip_screen_get() ? 0xff : 0x00;
- int flipconst = flip_screen_get() ? 0xef : 0xf1;
+ int flipmask = flip ? 0xff : 0x00;
+ int flipconst = flip ? 0xef : 0xf1;
int y;
/* the sum of the Y position plus a constant based on the flip state */
@@ -406,9 +406,9 @@ INLINE int find_minimum_y(UINT8 value)
}
-INLINE int find_minimum_x(UINT8 value)
+INLINE int find_minimum_x(UINT8 value, int flip)
{
- int flipmask = flip_screen_get() ? 0xff : 0x00;
+ int flipmask = flip ? 0xff : 0x00;
int x;
/* the sum of the X position plus a constant specifies the address within */
@@ -422,18 +422,19 @@ INLINE int find_minimum_x(UINT8 value)
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 flipxmask, UINT16 flipymask)
{
- int flipmask = flip_screen_get() ? 0xff : 0x00;
+ int flip = flip_screen_get(machine);
+ int flipmask = flip ? 0xff : 0x00;
int offs;
/* only the lower half of sprite RAM is read during rendering */
for (offs = 0x7c; offs >= 0; offs -= 4)
{
- int sy = find_minimum_y(spriteram[offs]);
+ int sy = find_minimum_y(spriteram[offs], flip);
int flipy = (spriteram[offs + (flipymask >> 8)] ^ flipmask) & flipymask;
int flipx = (spriteram[offs + (flipxmask >> 8)] ^ flipmask) & flipxmask;
int code = spriteram[offs + 1];
int color = (spriteram[offs + 2] & 0x1f) + (congo_color_bank << 5);
- int sx = find_minimum_x(spriteram[offs + 3]);
+ int sx = find_minimum_x(spriteram[offs + 3], flip);
/* draw with 256 pixel offsets to ensure we wrap properly */
drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
diff --git a/src/mame/video/zodiack.c b/src/mame/video/zodiack.c
index 0acd20341ae..5b547b822b6 100644
--- a/src/mame/video/zodiack.c
+++ b/src/mame/video/zodiack.c
@@ -46,9 +46,9 @@ WRITE8_HANDLER( zodiack_attributes_w )
WRITE8_HANDLER( zodiack_flipscreen_w )
{
- if (flip_screen_get() != (~data & 0x01))
+ if (flip_screen_get(space->machine) != (~data & 0x01))
{
- flip_screen_set(~data & 0x01);
+ flip_screen_set(space->machine, ~data & 0x01);
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
}
}
@@ -131,7 +131,7 @@ VIDEO_START( zodiack )
tilemap_set_scroll_cols(fg_tilemap, 32);
/* FIXME: flip_screen_x should not be written. */
- flip_screen_set_no_update(0);
+ flip_screen_set_no_update(machine, 0);
}
static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
@@ -145,7 +145,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
x = zodiack_bulletsram[offs + 3] + 7;
y = 255 - zodiack_bulletsram[offs + 1];
- if (flip_screen_get() && percuss_hardware)
+ if (flip_screen_get(machine) && percuss_hardware)
{
y = 255 - y;
}
@@ -175,7 +175,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = spriteram[offs + 1] & 0x80;
spritecode = spriteram[offs + 1] & 0x3f;
- if (flip_screen_get() && percuss_hardware)
+ if (flip_screen_get(machine) && percuss_hardware)
{
sy = 240 - sy;
flipy = !flipy;
diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c
index 963138391f4..7943730d18d 100644
--- a/src/osd/windows/input.c
+++ b/src/osd/windows/input.c
@@ -29,7 +29,6 @@
#include "osdepend.h"
#include "driver.h"
#include "ui.h"
-#include "deprecat.h"
// MAMEOS headers
#include "winmain.h"
@@ -145,6 +144,7 @@ struct _device_info
void (*poll)(device_info *info);
// MAME information
+ running_machine * machine;
input_device * device;
// device state
@@ -226,7 +226,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(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);
@@ -243,7 +243,7 @@ static void win32_lightgun_poll(device_info *devinfo);
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(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 const char *dinput_device_item_name(device_info *devinfo, int offset, const TCHAR *defstring, const TCHAR *suffix);
static HRESULT dinput_device_poll(device_info *devinfo);
@@ -258,12 +258,12 @@ static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_int
// RawInput-specific code
static void rawinput_init(running_machine *machine);
static void rawinput_exit(running_machine *machine);
-static device_info *rawinput_device_create(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(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(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);
@@ -742,7 +742,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
#ifdef MESS
case IPT_OSD_2:
- if (ui_mess_use_new_ui(Machine))
+ if (ui_mess_use_new_ui())
{
typedesc->token = "TOGGLE_MENUBAR";
typedesc->name = "Toggle Menubar";
@@ -789,7 +789,7 @@ static void device_list_reset_devices(device_info *devlist_head)
// generic_device_alloc
//============================================================
-static device_info *generic_device_alloc(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;
@@ -798,6 +798,7 @@ static device_info *generic_device_alloc(device_info **devlist_head_ptr, const T
devinfo = malloc_or_die(sizeof(*devinfo));
memset(devinfo, 0, sizeof(*devinfo));
devinfo->head = devlist_head_ptr;
+ devinfo->machine = machine;
// allocate a UTF8 copy of the name
devinfo->name = utf8_from_tstring(name);
@@ -889,10 +890,11 @@ static void generic_device_reset(device_info *devinfo)
static INT32 generic_button_get_state(void *device_internal, void *item_internal)
{
+ device_info *devinfo = device_internal;
BYTE *itemdata = item_internal;
// return the current state
- poll_if_necessary(Machine);
+ poll_if_necessary(devinfo->machine);
return *itemdata >> 7;
}
@@ -903,10 +905,11 @@ static INT32 generic_button_get_state(void *device_internal, void *item_internal
static INT32 generic_axis_get_state(void *device_internal, void *item_internal)
{
+ device_info *devinfo = device_internal;
LONG *axisdata = item_internal;
// return the current state
- poll_if_necessary(Machine);
+ poll_if_necessary(devinfo->machine);
return *axisdata;
}
@@ -934,7 +937,7 @@ static void win32_init(running_machine *machine)
int axisnum, butnum;
// allocate a device
- devinfo = generic_device_alloc(&lightgun_list, gun_names[gunnum]);
+ devinfo = generic_device_alloc(machine, &lightgun_list, gun_names[gunnum]);
if (devinfo == NULL)
break;
@@ -1098,7 +1101,7 @@ static void dinput_init(running_machine *machine)
if (keyboard_list == NULL)
{
// enumerate the ones we have
- result = IDirectInput_EnumDevices(dinput, didevtype_keyboard, dinput_keyboard_enum, 0, 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);
}
@@ -1107,13 +1110,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, 0, 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, 0, 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);
}
@@ -1164,13 +1167,13 @@ static HRESULT dinput_set_dword_property(LPDIRECTINPUTDEVICE device, REFGUID pro
// dinput_device_create
//============================================================
-static device_info *dinput_device_create(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;
// allocate memory for the device object
- devinfo = generic_device_alloc(devlist_head_ptr, instance->tszInstanceName);
+ devinfo = generic_device_alloc(machine, devlist_head_ptr, instance->tszInstanceName);
// attempt to create a device
result = IDirectInput_CreateDevice(dinput, &instance->guidInstance, &devinfo->dinput.device, NULL);
@@ -1308,16 +1311,17 @@ static HRESULT dinput_device_poll(device_info *devinfo)
static BOOL CALLBACK dinput_keyboard_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref)
{
+ running_machine *machine = ref;
device_info *devinfo;
int keynum;
// allocate and link in a new device
- devinfo = dinput_device_create(&keyboard_list, instance, &c_dfDIKeyboard, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);
+ devinfo = dinput_device_create(machine, &keyboard_list, instance, &c_dfDIKeyboard, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);
if (devinfo == NULL)
goto exit;
// add the device
- devinfo->device = input_device_add(Machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
+ devinfo->device = input_device_add(machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
devinfo->poll = dinput_keyboard_poll;
// populate it
@@ -1363,11 +1367,12 @@ 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 = ref;
int axisnum, butnum;
HRESULT result;
// allocate and link in a new device
- devinfo = dinput_device_create(&mouse_list, instance, &c_dfDIMouse2, &c_dfDIMouse, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);
+ devinfo = dinput_device_create(machine, &mouse_list, instance, &c_dfDIMouse2, &c_dfDIMouse, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);
if (devinfo == NULL)
goto exit;
@@ -1375,7 +1380,7 @@ static BOOL CALLBACK dinput_mouse_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref)
// we only support a single gun in dinput mode, so only add one
if (!lightgun_shared_axis_mode && devinfo == mouse_list)
{
- guninfo = generic_device_alloc(&lightgun_list, instance->tszInstanceName);
+ guninfo = generic_device_alloc(machine, &lightgun_list, instance->tszInstanceName);
if (guninfo == NULL)
goto exit;
}
@@ -1389,11 +1394,11 @@ static BOOL CALLBACK dinput_mouse_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref)
}
// add the device
- devinfo->device = input_device_add(Machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
+ devinfo->device = input_device_add(machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
devinfo->poll = dinput_mouse_poll;
if (guninfo != NULL)
{
- guninfo->device = input_device_add(Machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
+ guninfo->device = input_device_add(machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
guninfo->poll = win32_lightgun_poll;
}
@@ -1464,11 +1469,12 @@ static BOOL CALLBACK dinput_joystick_enum(LPCDIDEVICEINSTANCE instance, LPVOID r
{
DWORD cooperative_level = (HAS_WINDOW_MENU ? DISCL_BACKGROUND : DISCL_FOREGROUND) | DISCL_EXCLUSIVE;
int axisnum, axiscount, povnum, butnum;
+ running_machine *machine = ref;
device_info *devinfo;
HRESULT result;
// allocate and link in a new device
- devinfo = dinput_device_create(&joystick_list, instance, &c_dfDIJoystick, NULL, cooperative_level);
+ devinfo = dinput_device_create(machine, &joystick_list, instance, &c_dfDIJoystick, NULL, cooperative_level);
if (devinfo == NULL)
goto exit;
@@ -1493,7 +1499,7 @@ static BOOL CALLBACK dinput_joystick_enum(LPCDIDEVICEINSTANCE instance, LPVOID r
devinfo->dinput.caps.dwButtons = MIN(devinfo->dinput.caps.dwButtons, 128);
// add the device
- devinfo->device = input_device_add(Machine, DEVICE_CLASS_JOYSTICK, devinfo->name, devinfo);
+ devinfo->device = input_device_add(machine, DEVICE_CLASS_JOYSTICK, devinfo->name, devinfo);
devinfo->poll = dinput_joystick_poll;
// populate the axes
@@ -1593,7 +1599,7 @@ static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_int
DWORD pov;
// get the current state
- poll_if_necessary(Machine);
+ poll_if_necessary(devinfo->machine);
pov = devinfo->joystick.state.rgdwPOV[povnum];
// if invalid, return 0
@@ -1656,11 +1662,11 @@ static void rawinput_init(running_machine *machine)
// handle keyboards
if (device->dwType == RIM_TYPEKEYBOARD && !FORCE_DIRECTINPUT)
- rawinput_keyboard_enum(device);
+ rawinput_keyboard_enum(machine, device);
// handle mice
else if (device->dwType == RIM_TYPEMOUSE && !FORCE_DIRECTINPUT)
- rawinput_mouse_enum(device);
+ rawinput_mouse_enum(machine, device);
}
// finally, register to recieve raw input WM_INPUT messages
@@ -1716,7 +1722,7 @@ static void rawinput_exit(running_machine *machine)
// rawinput_device_create
//============================================================
-static device_info *rawinput_device_create(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;
@@ -1735,7 +1741,7 @@ static device_info *rawinput_device_create(device_info **devlist_head_ptr, PRAWI
// improve the name and then allocate a device
tname = rawinput_device_improve_name(tname);
- devinfo = generic_device_alloc(devlist_head_ptr, tname);
+ devinfo = generic_device_alloc(machine, devlist_head_ptr, tname);
free(tname);
// copy the handle
@@ -1915,18 +1921,18 @@ exit:
// rawinput_keyboard_enum
//============================================================
-static void rawinput_keyboard_enum(PRAWINPUTDEVICELIST device)
+static void rawinput_keyboard_enum(running_machine *machine, PRAWINPUTDEVICELIST device)
{
device_info *devinfo;
int keynum;
// allocate and link in a new device
- devinfo = rawinput_device_create(&keyboard_list, device);
+ devinfo = rawinput_device_create(machine, &keyboard_list, device);
if (devinfo == NULL)
return;
// add the device
- devinfo->device = input_device_add(Machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
+ devinfo->device = input_device_add(machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
// populate it
for (keynum = 0; keynum < MAX_KEYS; keynum++)
@@ -1980,13 +1986,13 @@ static void rawinput_keyboard_update(HANDLE device, RAWKEYBOARD *data)
// rawinput_mouse_enum
//============================================================
-static void rawinput_mouse_enum(PRAWINPUTDEVICELIST device)
+static void rawinput_mouse_enum(running_machine *machine, PRAWINPUTDEVICELIST device)
{
device_info *devinfo, *guninfo = NULL;
int axisnum, butnum;
// allocate and link in a new mouse device
- devinfo = rawinput_device_create(&mouse_list, device);
+ devinfo = rawinput_device_create(machine, &mouse_list, device);
if (devinfo == NULL)
return;
devinfo->poll = rawinput_mouse_poll;
@@ -1994,15 +2000,15 @@ static void rawinput_mouse_enum(PRAWINPUTDEVICELIST device)
// allocate a second device for the gun (unless we are using the shared axis mode)
if (!lightgun_shared_axis_mode)
{
- guninfo = rawinput_device_create(&lightgun_list, device);
+ guninfo = rawinput_device_create(machine, &lightgun_list, device);
assert(guninfo != NULL);
}
// add the device
- devinfo->device = input_device_add(Machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
+ devinfo->device = input_device_add(machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
if (guninfo != NULL)
{
- guninfo->device = input_device_add(Machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
+ guninfo->device = input_device_add(machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
guninfo->poll = (guninfo == lightgun_list) ? win32_lightgun_poll : NULL;
guninfo->mouse.partner = &devinfo->mouse;
}
@@ -2094,7 +2100,7 @@ static void rawinput_mouse_update(HANDLE device, RAWMOUSE *data)
static void rawinput_mouse_poll(device_info *devinfo)
{
- poll_if_necessary(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/output.c b/src/osd/windows/output.c
index ca52b8d1e5d..96093969590 100644
--- a/src/osd/windows/output.c
+++ b/src/osd/windows/output.c
@@ -14,7 +14,6 @@
// MAME headers
#include "osdepend.h"
#include "driver.h"
-#include "deprecat.h"
// MAMEOS headers
#include "output.h"
@@ -111,6 +110,9 @@ void winoutput_init(running_machine *machine)
NULL);
assert(output_hwnd != NULL);
+ // set a pointer to the running machine
+ SetWindowLongPtr(output_hwnd, GWLP_USERDATA, (LONG_PTR)machine);
+
// allocate message ids
om_mame_start = RegisterWindowMessage(OM_MAME_START);
assert(om_mame_start != 0);
@@ -187,6 +189,9 @@ 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;
+
// register a new client
if (message == om_mame_register_client)
return register_client((HWND)wparam, lparam);
@@ -197,7 +202,7 @@ static LRESULT CALLBACK output_window_proc(HWND wnd, UINT message, WPARAM wparam
// get a string for an ID
else if (message == om_mame_get_id_string)
- return send_id_string(Machine, (HWND)wparam, lparam);
+ return send_id_string(machine, (HWND)wparam, lparam);
else
return DefWindowProc(wnd, message, wparam, lparam);
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index 11e681c1fb0..8e75c833a6a 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -34,7 +34,7 @@
#include "strconv.h"
#include "winutf8.h"
#include "winutil.h"
-#include "debug/debugcpu.h"
+#include "debugger.h"
#define ENABLE_PROFILER 0
#define DEBUG_SLOW_LOCKS 0
@@ -455,11 +455,7 @@ static LONG CALLBACK exception_filter(struct _EXCEPTION_POINTERS *info)
already_hit = 1;
// flush any debugging traces that were live
- {
- extern running_machine *Machine;
- if (Machine != NULL)
- debug_cpu_flush_traces(Machine);
- }
+ debugger_flush_all_traces_on_abnormal_exit();
// find our man
for (i = 0; exception_table[i].code != 0; i++)