Previous 15994 Revisions Next

r8582 Thursday 22nd July, 2010 at 11:40:17 UTC by Nathan Woods
Updated to MAME 0.138u4 core
[docs]messnew.txt
[src/emu]devcpu.h devimage.c devintrf.h diimage.c emu.mak mame.c softlist.c ui.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/h83002]h8_8.c h8periph.c
[src/emu/cpu/m37710]m37710.c
[src/emu/cpu/mb88xx]mb88xx.c
[src/emu/cpu/mcs51]mcs51dasm.c
[src/emu/cpu/mn10200]mn10200.c
[src/emu/cpu/powerpc]ppc_dasm.c
[src/emu/cpu/rsp]rsp.c rsp.h rspdrc.c
[src/emu/cpu/sh2]sh2.c sh2comn.h
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms32010]tms32010.c tms32010.h
[src/emu/debug]debugcmd.c dvstate.c
[src/emu/machine]6840ptm.c at28c16.c at28c16.h i2cmem.c mb3773.c mb3773.h tmp68301.c
[src/emu/sound]cdp1864.c discrete.c mos6560.c sound.mak tms5220.c
[src/lib/util]options.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]blockade.c carnival.c cchasm.c cclimber.c cinemat.c cyberbal.c dcs.c depthch.c exidy.c gorf.c gottlieb.c gridlee.c invinco.c irem.c jaguar.c jedi.c leland.c mario.c mcr.c meadows.c micro3d.c n8080.c namco52.c namco54.c namcoc7x.c phoenix.c pleiads.c polyplay.c pulsar.c qix.c redalert.c scramble.c segag80r.c segag80v.c segasnd.c seibu.c senjyo.c snk6502.c spacefb.c spiders.c starwars.c t5182.c taito_en.c taitosnd.c targ.c timeplt.c turbo.c tx1.c vicdual.c williams.c wow.c zaxxon.c
[src/mame/drivers]1942.c 20pacgal.c 2mindril.c 40love.c 5clown.c 86lions.c 88games.c acommand.c actfancr.c adp.c aerofgt.c airbustr.c alg.c aliens.c alpha68k.c amspdwy.c angelkds.c appoooh.c aquarium.c arcadecl.c aristmk4.c aristmk5.c arkanoid.c artmagic.c ashnojoe.c asterix.c astinvad.c astrocde.c astrocorp.c astrof.c asuka.c atarifb.c atarig1.c atarigt.c atarisy1.c atarisy2.c aztarac.c backfire.c badlands.c battlane.c battlnts.c beaminv.c berzerk.c bfm_sc1.c bfm_sc2.c bfmsys85.c bigevglf.c bishi.c bking.c blackt96.c bladestl.c blktiger.c blockhl.c blockout.c blueprnt.c bmcbowl.c bnstars.c bogeyman.c bottom9.c boxer.c brkthru.c btime.c btoads.c bublbobl.c buggychl.c bwing.c calchase.c capbowl.c cave.c cb2001.c cball.c cbuster.c ccastles.c cclimber.c cdi.c centiped.c cham24.c champbas.c chanbara.c changela.c cheekyms.c chihiro.c chinagat.c chqflag.c cidelsa.c cinemat.c circus.c circusc.c citycon.c cliffhgr.c cloud9.c cntsteer.c cojag.c combatsc.c commando.c contra.c coolpool.c cosmic.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crimfght.c crospang.c crshrace.c crystal.c cshooter.c cubeqst.c cubocd32.c cvs.c cyberbal.c dacholer.c darius.c dblewing.c dbz.c dcheese.c dday.c ddayjlc.c ddenlovr.c ddragon.c ddragon3.c ddribble.c dec8.c deco32.c deco_ld.c deco_mlc.c deniam.c destroyr.c dietgo.c discoboy.c diverboy.c djboy.c djmain.c dkong.c dogfgt.c dorachan.c dragrace.c drgnmst.c dribling.c drmicro.c drw80pkr.c dynax.c egghunt.c enigma2.c eolith.c eprom.c equites.c esd16.c esh.c espial.c esripsys.c ettrivia.c exerion.c exprraid.c exterm.c f1gp.c fantland.c fastlane.c fcombat.c fcrash.c fgoal.c finalizr.c firebeat.c firefox.c firetrap.c firetrk.c flkatck.c flstory.c flyball.c foodf.c fromanc2.c fromance.c funkyjet.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaiden.c galaga.c galastrm.c galaxia.c galaxian.c galpani2.c galpani3.c galpanic.c galspnbl.c gamecstl.c gameplan.c gaplus.c gauntlet.c gbusters.c gei.c ghosteo.c gijoe.c ginganin.c go2000.c goal92.c goldstar.c gotcha.c gotya.c gpworld.c gradius3.c grchamp.c gstriker.c gsword.c gticlub.c guab.c gunbustr.c hcastle.c himesiki.c hnayayoi.c hng64.c homedata.c hornet.c hvyunit.c hyperspt.c hyprduel.c imolagp.c inufuku.c ironhors.c istellar.c itech32.c itech8.c jackal.c jackpool.c jangou.c jpmimpct.c jrpacman.c junofrst.c kaneko16.c karnov.c kchamp.c kingobox.c kinst.c klax.c kncljoe.c konamigq.c konamigv.c konamigx.c konamim2.c kongambl.c kopunch.c ksys573.c kungfur.c kyugo.c labyrunr.c ladybug.c ladyfrog.c laserbat.c lasso.c lastduel.c lastfght.c lazercmd.c lemmings.c lethal.c lethalj.c lgp.c liberate.c limenko.c lkage.c lockon.c lordgun.c lsasquad.c m10.c m107.c m14.c m63.c m72.c m92.c macrossp.c madmotor.c magicfly.c magmax.c mainevt.c malzak.c mappy.c marineb.c mario.c mastboy.c matmania.c maxaflex.c maygay1b.c maygayv1.c mazerbla.c mcatadv.c mcr.c mediagx.c megadriv.c megasys1.c megatech.c megazone.c merit.c meritm.c mermaid.c metalmx.c metlclsh.c metro.c mexico86.c mgolf.c mhavoc.c midas.c midxunit.c midyunit.c midzeus.c mirax.c missb2.c missile.c mitchell.c mjsister.c mlanding.c model1.c model2.c model3.c mogura.c moo.c mouser.c mpoker.c mpu4.c mpu4drvr.c mquake.c mrflea.c ms32.c msisaac.c mugsmash.c multigam.c munchmo.c mw8080bw.c mystston.c mystwarr.c n8080.c namcona1.c namcos1.c namcos10.c namcos11.c namcos12.c namcos2.c namcos21.c namcos22.c namcos86.c naomi.c nbmj8688.c nbmj8891.c nbmj9195.c nemesis.c neodrvr.c neogeo.c nightgal.c ninjakd2.c ninjaw.c niyanpai.c nmg5.c nmk16.c norautp.c nwk-tr.c nycaptor.c nyny.c ojankohs.c omegrace.c oneshot.c onetwo.c opwolf.c orbit.c othello.c othunder.c overdriv.c pacland.c pacman.c paradise.c parodius.c pasha2.c pbaction.c pcat_dyn.c pcat_nit.c pcxt.c peplus.c pgm.c photon.c photon2.c photoply.c pipedrm.c pipeline.c pirates.c pktgaldx.c playch10.c playmark.c plygonet.c polepos.c policetr.c popper.c ppmast93.c psikyo.c psikyo4.c psikyosh.c puckpkmn.c punchout.c pushman.c qdrmfgp.c quakeat.c r2dtank.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c rcorsair.c redclash.c retofinv.c rockrage.c rollerg.c royalmah.c rungun.c safarir.c sandscrp.c sbasketb.c sbrkout.c scramble.c scregg.c seattle.c segac2.c segae.c segag80v.c segahang.c segald.c segamsys.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segaxbd.c segaybd.c seibuspi.c seicross.c sf.c sfbonus.c shanghai.c sigmab52.c sigmab98.c skeetsht.c skimaxx.c skullxbo.c skydiver.c skyfox.c skykid.c slapshot.c slotcarn.c snowbros.c sonson.c spbactn.c spcforce.c spdodgeb.c speglsht.c spiders.c spool99.c sprint2.c spy.c ssfindo.c ssingles.c sslam.c ssv.c statriv2.c stfight.c stv.c stvinit.c suna8.c supbtime.c superchs.c superdq.c superqix.c suprnova.c suprslam.c surpratk.c system1.c system16.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_o.c taito_z.c taitoair.c taitogn.c taitosj.c taitowlf.c tankbatt.c tatsumi.c tbowl.c thayers.c thedeep.c thunderx.c tickee.c tmaster.c tmmjprd.c tmnt.c toaplan2.c tomcat.c topshoot.c topspeed.c toratora.c toypop.c tp84.c trackfld.c triforce.c triplhnt.c trucocl.c trvquest.c ttchamp.c tugboat.c tumbleb.c tumblep.c turbo.c twinkle.c ultraman.c ultrsprt.c undrfire.c vamphalf.c vaportra.c vcombat.c vegas.c vendetta.c videopin.c viper.c volfied.c vsnes.c warpwarp.c warriorb.c wecleman.c wgp.c wheelfir.c williams.c wiz.c wolfpack.c xain.c xexex.c xmen.c xtheball.c xybots.c yiear.c yunsun16.c yunsung8.c zaccaria.c zerozone.c zn.c zr107.c
[src/mame/includes]coolpool.h* gaiden.h midyunit.h polepos.h
[src/mame/layout]topracer.lay*
[src/mame/machine]ajax.c amiga.c archimds.c asic65.c atari.c atarifb.c atarigen.c beezer.c carpolo.c cps2crpt.c dc.c deco102.c decocass.c decoprot.c fd1089.c galaxold.c gaplus.c konppc.c leland.c mcr.c mhavoc.c micro3d.c midwayic.c midyunit.c model1.c mw8080bw.c n64.c namco06.c namcos1.c namcos2.c naomibd.c nitedrvr.c nmk004.c playch10.c qix.c s16fd.c s24fd.c scramble.c simpsons.c slikshot.c snes.c starwars.c stvcd.c taitosj.c tnzs.c tx1.c vertigo.c vsnes.c williams.c
[src/mame/video]antic.c astrocde.c atari.c atarisy1.c beezer.c blstroid.c cidelsa.c cinemat.c cps1.c cyberbal.c djmain.c exterm.c fuukifg2.c fuukifg3.c gaelco2.c gaiden.c galastrm.c galpanic.c genesis.c groundfx.c gticlub.c gunbustr.c irobot.c jaguar.c kan_pand.c kan_pand.h kaneko16.c konamigx.c konicdev.c megasys1.c nbmj8688.c playch10.c plygonet.c polepos.c psikyo4.c punchout.c qdrmfgp.c qix.c sega16sp.c segahang.c segaic16.c segaic16.h segas32.c seta.c skydiver.c sprint4.c starcrus.c subs.c superchs.c tbowl.c tceptor.c tetrisp2.c thief.c tia.c toaplan2.c triplhnt.c tx1.c ultratnk.c undrfire.c vindictr.c vrender0.c vsnes.c wecleman.c
[src/mess/drivers]pasopia.c
[src/osd/sdl]sound.c
[src/osd/sdl/man]chdman.1* jedutil.1* ldplayer.1* ldverify.1* mame.1* romcmp.1* testkeys.1*
[src/tools]jedutil.c

src/mame/audio/micro3d.c
r8581r8582
185185
186186   if (~data & 8)
187187   {
188      running_device *device = devtag_get_device(machine, data & 4 ? "noise_2" : "noise_1");
188      running_device *device = machine->device(data & 4 ? "noise_2" : "noise_1");
189189      noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token();
190190
191191      if (state->dac_data != nstate->dac[data & 3])
r8581r8582
397397      }
398398      case 0x03:
399399      {
400         running_device *upd = devtag_get_device(space->machine, "upd7759");
400         running_device *upd = space->machine->device("upd7759");
401401         upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0);
402402         upd7759_reset_w(upd, (data & 0x10) ? 0 : 1);
403403         break;
r8581r8582
412412   switch (offset)
413413   {
414414      case 0x01:   return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine, "SOUND_SW");
415      case 0x03:   return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(devtag_get_device(space->machine, "upd7759")) ? 0x08 : 0);
415      case 0x03:   return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine->device("upd7759")) ? 0x08 : 0);
416416      default:   return 0;
417417   }
418418}
src/mame/audio/spacefb.c
r8581r8582
3636
3737WRITE8_HANDLER( spacefb_port_1_w )
3838{
39   running_device *samples = devtag_get_device(space->machine, "samples");
39   running_device *samples = space->machine->device("samples");
4040
4141   cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
4242
src/mame/audio/jaguar.c
r8581r8582
339339static WRITE32_HANDLER( dsp_flags_w )
340340{
341341   /* write the data through */
342   jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), offset, data, mem_mask);
342   jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
343343
344344   /* if they were clearing the A2S interrupt, see if we are headed for the spin */
345345   /* loop with R22 != 0; if we are, just start spinning again */
346   if (space->cpu == devtag_get_device(space->machine, "audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
346   if (space->cpu == space->machine->device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
347347   {
348348      /* see if we're going back to the spin loop */
349349      if (!(data & 0x04000) && cpu_get_reg(space->cpu, JAGUAR_R22) != 0)
r8581r8582
416416   {
417417      /* right DAC */
418418      case 2:
419         dac_signed_data_16_w(devtag_get_device(space->machine, "dac2"), (data & 0xffff) ^ 0x8000);
419         dac_signed_data_16_w(space->machine->device("dac2"), (data & 0xffff) ^ 0x8000);
420420         break;
421421
422422      /* left DAC */
423423      case 3:
424         dac_signed_data_16_w(devtag_get_device(space->machine, "dac1"), (data & 0xffff) ^ 0x8000);
424         dac_signed_data_16_w(space->machine->device("dac1"), (data & 0xffff) ^ 0x8000);
425425         break;
426426
427427      /* frequency register */
src/mame/audio/phoenix.c
r8581r8582
511511   discrete_sound_w(device, PHOENIX_EFFECT_1_FREQ, data & 0x10);
512512
513513   /* update the tune that the MM6221AA is playing */
514   mm6221aa_tune_w(devtag_get_device(device->machine, "tms"), data >> 6);
514   mm6221aa_tune_w(device->machine->device("tms"), data >> 6);
515515}
516516
517517static DEVICE_START( phoenix_sound )
src/mame/audio/n8080.c
r8581r8582
159159
160160static TIMER_CALLBACK( stop_mono_flop_callback )
161161{
162   stop_mono_flop(devtag_get_device(machine, "snsnd"), param);
162   stop_mono_flop(machine->device("snsnd"), param);
163163}
164164
165165
166166static void spacefev_sound_pins_changed( running_machine *machine )
167167{
168   running_device *sn = devtag_get_device(machine, "snsnd");
168   running_device *sn = machine->device("snsnd");
169169   n8080_state *state = (n8080_state *)machine->driver_data;
170170   UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
171171
r8581r8582
191191   }
192192   if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
193193   {
194      generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
194      generic_pulse_irq_line(machine->device("audiocpu"), 0);
195195   }
196196}
197197
198198
199199static void sheriff_sound_pins_changed( running_machine *machine )
200200{
201   running_device *sn = devtag_get_device(machine, "snsnd");
201   running_device *sn = machine->device("snsnd");
202202   n8080_state *state = (n8080_state *)machine->driver_data;
203203   UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
204204
r8581r8582
216216   }
217217   if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
218218   {
219      generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
219      generic_pulse_irq_line(machine->device("audiocpu"), 0);
220220   }
221221}
222222
r8581r8582
232232
233233   if (changes & (1 << 6))
234234   {
235      generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
235      generic_pulse_irq_line(machine->device("audiocpu"), 0);
236236   }
237237}
238238
r8581r8582
403403
404404static WRITE8_HANDLER( n8080_dac_w )
405405{
406   dac_data_w(devtag_get_device(space->machine, "dac"), data & 0x80);
406   dac_data_w(space->machine->device("dac"), data & 0x80);
407407}
408408
409409
410410static WRITE8_HANDLER( helifire_dac_w )
411411{
412412   n8080_state *state = (n8080_state *)space->machine->driver_data;
413   dac_data_w(devtag_get_device(space->machine, "dac"), data * state->helifire_dac_volume);
413   dac_data_w(space->machine->device("dac"), data * state->helifire_dac_volume);
414414}
415415
416416
r8581r8582
437437
438438static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
439439{
440   running_device *sn = devtag_get_device(timer.machine, "snsnd");
440   running_device *sn = timer.machine->device("snsnd");
441441   n8080_state *state = (n8080_state *)timer.machine->driver_data;
442442   double voltage = 0;
443443
src/mame/audio/cyberbal.c
r8581r8582
154154WRITE16_HANDLER( cyberbal_sound_68k_dac_w )
155155{
156156   cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
157   running_device *dac = devtag_get_device(space->machine, (offset & 8) ? "dac2" : "dac1");
157   running_device *dac = space->machine->device((offset & 8) ? "dac2" : "dac1");
158158   dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
159159
160160   if (state->fast_68k_int)
src/mame/audio/turbo.c
r8581r8582
4040
4141static TIMER_CALLBACK( update_sound_a )
4242{
43   running_device *discrete = devtag_get_device(machine, "discrete");
43   running_device *discrete = machine->device("discrete");
4444   int data = param;
4545
4646   /* missing short crash sample, but I've never seen it triggered */
r8581r8582
7373WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
7474{
7575#if (!DISCRETE_TEST)
76   running_device *samples = devtag_get_device(device->machine, "samples");
76   running_device *samples = device->machine->device("samples");
7777#endif
7878   turbo_state *state = (turbo_state *)device->machine->driver_data;
7979   UINT8 diff = data ^ state->sound_state[0];
r8581r8582
123123
124124WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
125125{
126   running_device *samples = devtag_get_device(device->machine, "samples");
126   running_device *samples = device->machine->device("samples");
127127   turbo_state *state = (turbo_state *)device->machine->driver_data;
128128   UINT8 diff = data ^ state->sound_state[1];
129129   state->sound_state[1] = data;
r8581r8582
146146
147147WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
148148{
149   running_device *samples = devtag_get_device(device->machine, "samples");
149   running_device *samples = device->machine->device("samples");
150150   turbo_state *state = (turbo_state *)device->machine->driver_data;
151151
152152   /* OSEL1-2 */
r8581r8582
327327
328328WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
329329{
330   running_device *samples = devtag_get_device(device->machine, "samples");
330   running_device *samples = device->machine->device("samples");
331331   turbo_state *state = (turbo_state *)device->machine->driver_data;
332332   UINT8 diff = data ^ state->sound_state[1];
333333   state->sound_state[1] = data;
r8581r8582
383383
384384WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
385385{
386   running_device *samples = devtag_get_device(device->machine, "samples");
386   running_device *samples = device->machine->device("samples");
387387   turbo_state *state = (turbo_state *)device->machine->driver_data;
388388   UINT8 diff = data ^ state->sound_state[2];
389389   state->sound_state[2] = data;
r8581r8582
508508
509509WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
510510{
511   running_device *samples = devtag_get_device(device->machine, "samples");
511   running_device *samples = device->machine->device("samples");
512512   turbo_state *state = (turbo_state *)device->machine->driver_data;
513513   UINT8 diff = data ^ state->sound_state[0];
514514   state->sound_state[0] = data;
r8581r8582
534534
535535WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
536536{
537   running_device *samples = devtag_get_device(device->machine, "samples");
537   running_device *samples = device->machine->device("samples");
538538   turbo_state *state = (turbo_state *)device->machine->driver_data;
539539   UINT8 diff = data ^ state->sound_state[1];
540540   state->sound_state[1] = data;
src/mame/audio/gorf.c
r8581r8582
116116
117117READ8_HANDLER( gorf_speech_r )
118118{
119   running_device *samples = devtag_get_device(space->machine, "samples");
119   running_device *samples = space->machine->device("samples");
120120    int Phoneme,Intonation;
121121    int i = 0;
122122
r8581r8582
182182
183183CUSTOM_INPUT( gorf_speech_status_r )
184184{
185   running_device *samples = devtag_get_device(field->port->machine, "samples");
185   running_device *samples = field->port->machine->device("samples");
186186   return !sample_playing(samples, 0);
187187}
src/mame/audio/namco52.c
r8581r8582
210210
211211   /* find the attached discrete sound device */
212212   assert(intf->discrete != NULL);
213   state->discrete = devtag_get_device(device->machine, intf->discrete);
213   state->discrete = device->machine->device(intf->discrete);
214214   assert(state->discrete != NULL);
215215   state->basenode = intf->firstnode;
216216
src/mame/audio/senjyo.c
r8581r8582
5959
6060static TIMER_CALLBACK( senjyo_sh_update )
6161{
62   running_device *samples = devtag_get_device(machine, "samples");
62   running_device *samples = machine->device("samples");
6363
6464   /* ctc2 timer single tone generator frequency */
6565   z80ctc_device *ctc = machine->device<z80ctc_device>("z80ctc");
src/mame/audio/depthch.c
r8581r8582
5656WRITE8_HANDLER( depthch_audio_w )
5757{
5858   static int port1State = 0;
59   running_device *samples = devtag_get_device(space->machine, "samples");
59   running_device *samples = space->machine->device("samples");
6060   int bitsChanged;
6161   int bitsGoneHigh;
6262   int bitsGoneLow;
src/mame/audio/segasnd.c
r8581r8582
645645   int tchan, tgroup;
646646
647647   /* find the CPU we are associated with */
648   usb.cpu = devtag_get_device(machine, "usbcpu");
648   usb.cpu = machine->device("usbcpu");
649649   assert(usb.cpu != NULL);
650650
651651   /* allocate work RAM */
src/mame/audio/taitosnd.c
r8581r8582
290290   const tc0140syt_interface *intf = get_interface(device);
291291
292292   /* use the given gfx set */
293   tc0140syt->mastercpu = devtag_get_device(device->machine, intf->master);
294   tc0140syt->slavecpu = devtag_get_device(device->machine, intf->slave);
293   tc0140syt->mastercpu = device->machine->device(intf->master);
294   tc0140syt->slavecpu = device->machine->device(intf->slave);
295295
296296   state_save_register_device_item(device, 0, tc0140syt->mainmode);
297297   state_save_register_device_item(device, 0, tc0140syt->submode);
src/mame/audio/carnival.c
r8581r8582
127127WRITE8_HANDLER( carnival_audio_1_w )
128128{
129129   static int port1State = 0;
130   running_device *samples = devtag_get_device(space->machine, "samples");
130   running_device *samples = space->machine->device("samples");
131131   int bitsChanged;
132132   int bitsGoneHigh;
133133   int bitsGoneLow;
r8581r8582
206206
207207WRITE8_HANDLER( carnival_audio_2_w )
208208{
209   running_device *samples = devtag_get_device(space->machine, "samples");
209   running_device *samples = space->machine->device("samples");
210210   int bitsChanged;
211211   int bitsGoneHigh;
212212   int bitsGoneLow;
src/mame/audio/leland.c
r8581r8582
518518   int i;
519519
520520   /* determine which sound hardware is installed */
521   has_ym2151 = (devtag_get_device(device->machine, "ymsnd") != NULL);
521   has_ym2151 = (device->machine->device("ymsnd") != NULL);
522522
523523   /* allocate separate streams for the DMA and non-DMA DACs */
524524   dma_stream = stream_create(device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update);
r8581r8582
20492049         if (!has_ym2151)
20502050            return pit8254_r(space, offset | 0x40, mem_mask);
20512051         else
2052            return ym2151_r(devtag_get_device(space->machine, "ymsnd"), offset);
2052            return ym2151_r(space->machine->device("ymsnd"), offset);
20532053
20542054      case 4:
20552055         if (is_redline)
r8581r8582
20852085         if (!has_ym2151)
20862086            pit8254_w(space, offset | 0x40, data, mem_mask);
20872087         else
2088            ym2151_w(devtag_get_device(space->machine, "ymsnd"), offset, data);
2088            ym2151_w(space->machine->device("ymsnd"), offset, data);
20892089         break;
20902090
20912091      case 4:
src/mame/audio/taito_en.c
r8581r8582
4848
4949   /* mask out unused bits */
5050   data &= max_banks_this_game;
51   es5505_voice_bank_w(devtag_get_device(space->machine, "ensoniq"),offset,data<<20);
51   es5505_voice_bank_w(space->machine->device("ensoniq"),offset,data<<20);
5252}
5353
5454static WRITE16_HANDLER( f3_volume_w )
r8581r8582
7474   /* Only cause IRQ if the mask is set to allow it */
7575   if (m68681_imr & 0x08)
7676   {
77      cpu_set_input_line_vector(devtag_get_device(timer.machine, "audiocpu"), 6, vector_reg);
77      cpu_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg);
7878      cputag_set_input_line(timer.machine, "audiocpu", 6, ASSERT_LINE);
7979      imr_status |= 0x08;
8080   }
src/mame/audio/blockade.c
r8581r8582
4444
4545WRITE8_HANDLER( blockade_env_on_w )
4646{
47   running_device *samples = devtag_get_device(space->machine, "samples");
47   running_device *samples = space->machine->device("samples");
4848   if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n");
4949   sample_start(samples, 0,0,0);
5050   return;
src/mame/audio/seibu.c
r8581r8582
334334   int romlength = memory_region_length(machine, "audiocpu");
335335   UINT8 *rom = memory_region(machine, "audiocpu");
336336
337   sound_cpu = devtag_get_device(machine, "audiocpu");
337   sound_cpu = machine->device("audiocpu");
338338   update_irq_lines(machine, VECTOR_INIT);
339339   if (romlength > 0x10000)
340340      memory_configure_bank(machine, "bank1", 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
src/mame/audio/gridlee.c
r8581r8582
9191WRITE8_HANDLER( gridlee_sound_w )
9292{
9393   static UINT8 sound_data[24];
94   running_device *samples = devtag_get_device(space->machine, "samples");
94   running_device *samples = space->machine->device("samples");
9595
9696   stream_update(gridlee_stream);
9797
src/mame/audio/namcoc7x.c
r8581r8582
8888   memset(pROM, 0, 4);
8989
9090   // install speedup cheat
91   for (cpu = devtag_get_device(machine, "maincpu"); cpu != NULL; cpu = cpu->typenext())
91   for (cpu = machine->device("maincpu"); cpu != NULL; cpu = cpu->typenext())
9292      if (cpu->type() == M37702)
9393         memory_install_readwrite16_handler(cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w);
9494}
src/mame/audio/segag80r.c
r8581r8582
246246   {
247247      120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f
248248   };
249   running_device *samples = devtag_get_device(space->machine, "samples");
249   running_device *samples = space->machine->device("samples");
250250   float freq_factor;
251251
252252   UINT8 diff = data ^ sound_state[offset];
r8581r8582
478478
479479static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
480480{
481   running_device *samples = devtag_get_device(device->machine, "samples");
481   running_device *samples = device->machine->device("samples");
482482   UINT8 diff = data ^ sound_state[0];
483483   sound_state[0] = data;
484484
r8581r8582
706706
707707WRITE8_HANDLER( spaceod_sound_w )
708708{
709   running_device *samples = devtag_get_device(space->machine, "samples");
709   running_device *samples = space->machine->device("samples");
710710   UINT8 diff = data ^ sound_state[offset];
711711   sound_state[offset] = data;
712712
r8581r8582
891891
892892static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
893893{
894   running_device *tms = devtag_get_device(device->machine, "music");
894   running_device *tms = device->machine->device("music");
895895   int enable_val;
896896
897897   /* Lower four data lines get decoded into 13 control lines */
r8581r8582
912912
913913static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
914914{
915   running_device *samples = devtag_get_device(device->machine, "samples");
915   running_device *samples = device->machine->device("samples");
916916   UINT8 diff = data ^ sound_state[1];
917917   sound_state[1] = data;
918918
src/mame/audio/segag80v.c
r8581r8582
137137
138138WRITE8_HANDLER( elim1_sh_w )
139139{
140   running_device *samples = devtag_get_device(space->machine, "samples");
140   running_device *samples = space->machine->device("samples");
141141   data ^= 0xff;
142142
143143   /* Play fireball sample */
r8581r8582
171171
172172WRITE8_HANDLER( elim2_sh_w )
173173{
174   running_device *samples = devtag_get_device(space->machine, "samples");
174   running_device *samples = space->machine->device("samples");
175175   data ^= 0xff;
176176
177177   /* Play thrust sample */
r8581r8582
198198
199199WRITE8_HANDLER( zektor1_sh_w )
200200{
201   running_device *samples = devtag_get_device(space->machine, "samples");
201   running_device *samples = space->machine->device("samples");
202202
203203   data ^= 0xff;
204204
r8581r8582
233233
234234WRITE8_HANDLER( zektor2_sh_w )
235235{
236   running_device *samples = devtag_get_device(space->machine, "samples");
236   running_device *samples = space->machine->device("samples");
237237   data ^= 0xff;
238238
239239   /* Play thrust sample */
r8581r8582
261261
262262WRITE8_HANDLER( spacfury1_sh_w )
263263{
264   running_device *samples = devtag_get_device(space->machine, "samples");
264   running_device *samples = space->machine->device("samples");
265265   data ^= 0xff;
266266
267267   /* craft growing */
r8581r8582
298298
299299WRITE8_HANDLER( spacfury2_sh_w )
300300{
301   running_device *samples = devtag_get_device(space->machine, "samples");
301   running_device *samples = space->machine->device("samples");
302302   data ^= 0xff;
303303
304304   /* craft joining */
src/mame/audio/scramble.c
r8581r8582
7979
8080WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
8181{
82   running_device *target = devtag_get_device(device->machine, "konami_7474");
82   running_device *target = device->machine->device("konami_7474");
8383
8484   /* the complement of bit 3 is connected to the flip-flop's clock */
8585   ttl7474_clock_w(target, (~data & 0x08) >> 3);
r8581r8582
9090
9191WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
9292{
93   running_device *target = devtag_get_device(device->machine, "konami_7474");
93   running_device *target = device->machine->device("konami_7474");
9494
9595   /* the complement of bit 3 is connected to the flip-flop's clock */
9696   ttl7474_clock_w(target, (~data & 0x08) >> 3);
r8581r8582
9898
9999static IRQ_CALLBACK(scramble_sh_irq_callback)
100100{
101   running_device *target = devtag_get_device(device->machine, "konami_7474");
101   running_device *target = device->machine->device("konami_7474");
102102
103103   /* interrupt acknowledge clears the flip-flop --
104104       we need to pulse the CLR line because MAME's core never clears this
r8581r8582
144144
145145WRITE8_HANDLER( scramble_filter_w )
146146{
147   filter_w(devtag_get_device(space->machine, "filter.1.0"), (offset >>  0) & 3);
148   filter_w(devtag_get_device(space->machine, "filter.1.1"), (offset >>  2) & 3);
149   filter_w(devtag_get_device(space->machine, "filter.1.2"), (offset >>  4) & 3);
150   filter_w(devtag_get_device(space->machine, "filter.0.0"), (offset >>  6) & 3);
151   filter_w(devtag_get_device(space->machine, "filter.0.1"), (offset >>  8) & 3);
152   filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3);
147   filter_w(space->machine->device("filter.1.0"), (offset >>  0) & 3);
148   filter_w(space->machine->device("filter.1.1"), (offset >>  2) & 3);
149   filter_w(space->machine->device("filter.1.2"), (offset >>  4) & 3);
150   filter_w(space->machine->device("filter.0.0"), (offset >>  6) & 3);
151   filter_w(space->machine->device("filter.0.1"), (offset >>  8) & 3);
152   filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
153153}
154154
155155WRITE8_HANDLER( frogger_filter_w )
156156{
157   filter_w(devtag_get_device(space->machine, "filter.0.0"), (offset >>  6) & 3);
158   filter_w(devtag_get_device(space->machine, "filter.0.1"), (offset >>  8) & 3);
159   filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3);
157   filter_w(space->machine->device("filter.0.0"), (offset >>  6) & 3);
158   filter_w(space->machine->device("filter.0.1"), (offset >>  8) & 3);
159   filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
160160}
161161
162162void scramble_sh_init(running_machine *machine)
163163{
164   cpu_set_irq_callback(devtag_get_device(machine, "audiocpu"), scramble_sh_irq_callback);
164   cpu_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback);
165165
166166   /* PR is always 0, D is always 1 */
167   ttl7474_d_w(devtag_get_device(machine, "konami_7474"), 1);
167   ttl7474_d_w(machine->device("konami_7474"), 1);
168168}
169169
170170
r8581r8582
352352   MDRV_SPEAKER_STANDARD_MONO("mono")
353353   MDRV_SOUND_ADD("ay1", AY8910, 14318000/8)
354354   MDRV_SOUND_CONFIG(ad2083_ay8910_interface_1)
355   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
355   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
356356
357357   MDRV_SOUND_ADD("ay2", AY8910, 14318000/8)
358358   MDRV_SOUND_CONFIG(ad2083_ay8910_interface_2)
359   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
359   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
360360
361361   MDRV_SOUND_ADD("tms", TMS5110A, AD2083_TMS5110_CLOCK)
362362   MDRV_SOUND_CONFIG(ad2083_tms5110_interface)
src/mame/audio/dcs.c
r8581r8582
19941994   /* calculate how long until we generate an interrupt */
19951995
19961996   /* frequency the time per each bit sent */
1997   attotime sample_period = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(dcs.cpu)), 2 * (dcs.control_regs[S1_SCLKDIV_REG] + 1));
1997   attotime sample_period = attotime_mul(ATTOTIME_IN_HZ(dcs.cpu->unscaled_clock()), 2 * (dcs.control_regs[S1_SCLKDIV_REG] + 1));
19981998
19991999   /* now put it down to samples, so we know what the channel frequency has to be */
20002000   sample_period = attotime_mul(sample_period, 16 * dcs.channels);
src/mame/audio/gottlieb.c
r8581r8582
5555
5656WRITE8_HANDLER( gottlieb_sh_w )
5757{
58   running_device *riot = devtag_get_device(space->machine, "riot");
58   running_device *riot = space->machine->device("riot");
5959
6060   /* identify rev1 boards by the presence of a 6532 RIOT device */
6161   if (riot != NULL)
r8581r8582
7474
7575static void gottlieb1_sh_w(running_device *riot, UINT8 data)
7676{
77   running_device *samples = devtag_get_device(riot->machine, "samples");
77   running_device *samples = riot->machine->device("samples");
7878   int pa7 = (data & 0x0f) != 0xf;
7979   int pa0_5 = ~data & 0x3f;
8080
r8581r8582
196196#ifdef UNUSED_FUNCTION
197197void gottlieb_knocker(running_machine *machine)
198198{
199   running_device *samples = devtag_get_device(space->machine, "samples");
199   running_device *samples = space->machine->device("samples");
200200   if (!strcmp(machine->gamedrv->name,"reactor"))   /* reactor */
201201   {
202202   }
r8581r8582
244244   {
245245      if (votrax_queuepos > 1)
246246      {
247         running_device *samples = devtag_get_device(space->machine, "samples");
247         running_device *samples = space->machine->device("samples");
248248         int last = -1;
249249         int i;
250250         char phonemes[200];
r8581r8582
469469
470470static CUSTOM_INPUT( speech_drq_custom_r )
471471{
472   return sp0250_drq_r(devtag_get_device(field->port->machine, "spsnd"));
472   return sp0250_drq_r(field->port->machine->device("spsnd"));
473473}
474474
475475
r8581r8582
497497   {
498498      /* bit 3 selects which of the two 8913 to enable */
499499      /* bit 4 goes to the 8913 BC1 pin */
500      running_device *ay = devtag_get_device(space->machine, (data & 0x08) ? "ay1" : "ay2");
500      running_device *ay = space->machine->device((data & 0x08) ? "ay1" : "ay2");
501501      ay8910_data_address_w(ay, data >> 4, *psg_latch);
502502   }
503503
r8581r8582
506506   /* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */
507507   if ((previous & 0x40) == 0 && (data & 0x40) != 0)
508508   {
509      running_device *sp = devtag_get_device(space->machine, "spsnd");
509      running_device *sp = space->machine->device("spsnd");
510510      sp0250_w(sp, 0, *sp0250_latch);
511511   }
512512
src/mame/audio/jedi.c
r8581r8582
147147
148148   if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)
149149   {
150      running_device *tms = devtag_get_device(space->machine, "tms");
150      running_device *tms = space->machine->device("tms");
151151      tms5220_data_w(tms, 0, *state->speech_data);
152152   }
153153   state->speech_strobe_state = new_speech_strobe_state;
r8581r8582
156156
157157static READ8_HANDLER( speech_ready_r )
158158{
159   return (tms5220_readyq_r(devtag_get_device(space->machine, "tms"))) << 7;
159   return (tms5220_readyq_r(space->machine->device("tms"))) << 7;
160160}
161161
162162
src/mame/audio/exidy.c
r8581r8582
114114
115115static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
116116{
117   running_device *pia = devtag_get_device(device->machine, "pia1");
117   running_device *pia = device->machine->device("pia1");
118118   cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
119119}
120120
r8581r8582
462462
463463   if (has_tms5220)
464464   {
465      running_device *tms = devtag_get_device(device->machine, "tms");
465      running_device *tms = device->machine->device("tms");
466466      logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
467467      tms5220_data_w(tms, 0, data);
468468   }
r8581r8582
472472{
473473   if (has_tms5220)
474474   {
475      running_device *tms = devtag_get_device(device->machine, "tms");
475      running_device *tms = device->machine->device("tms");
476476      logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0));
477477      return tms5220_status_r(tms, 0);
478478   }
r8581r8582
484484{
485485   if (has_tms5220)
486486   {
487      running_device *tms = devtag_get_device(device->machine, "tms");
487      running_device *tms = device->machine->device("tms");
488488
489489      tms5220_rsq_w(tms, data & 0x01);
490490      tms5220_wsq_w(tms, (data >> 1) & 0x01);
r8581r8582
497497   UINT8 newdata = riot6532_portb_in_get(device);
498498   if (has_tms5220)
499499   {
500      running_device *tms = devtag_get_device(device->machine, "tms");
500      running_device *tms = device->machine->device("tms");
501501      newdata &= ~0x0c;
502502      if (tms5220_readyq_r(tms)) newdata |= 0x04;
503503      if (tms5220_intq_r(tms)) newdata |= 0x08;
r8581r8582
734734   DEVCB_NULL,      /* line CB2 in */
735735   DEVCB_DEVICE_HANDLER("pia1", pia6821_portb_w),      /* port A out */
736736   DEVCB_DEVICE_HANDLER("pia1", pia6821_porta_w),      /* port B out */
737   DEVCB_DEVICE_HANDLER("pia1", pia6821_cb1_w),      /* line CA2 out */
738   DEVCB_DEVICE_HANDLER("pia1", pia6821_ca1_w),      /* port CB2 out */
737   DEVCB_DEVICE_LINE("pia1", pia6821_cb1_w),      /* line CA2 out */
738   DEVCB_DEVICE_LINE("pia1", pia6821_ca1_w),      /* port CB2 out */
739739   DEVCB_NULL,      /* IRQA */
740740   DEVCB_NULL      /* IRQB */
741741};
r8581r8582
751751   DEVCB_NULL,      /* line CB2 in */
752752   DEVCB_DEVICE_HANDLER("pia0", pia6821_portb_w),      /* port A out */
753753   DEVCB_DEVICE_HANDLER("pia0", pia6821_porta_w),      /* port B out */
754   DEVCB_DEVICE_HANDLER("pia0", pia6821_cb1_w),      /* line CA2 out */
755   DEVCB_DEVICE_HANDLER("pia0", pia6821_ca1_w),      /* port CB2 out */
754   DEVCB_DEVICE_LINE("pia0", pia6821_cb1_w),      /* line CA2 out */
755   DEVCB_DEVICE_LINE("pia0", pia6821_ca1_w),      /* port CB2 out */
756756   DEVCB_NULL,      /* IRQA */
757757   DEVCB_LINE(update_irq_state)      /* IRQB */
758758};
r8581r8582
764764
765765   DEVICE_START_CALL(common_sh_start);
766766
767   riot = devtag_get_device(machine, "riot");
767   riot = machine->device("riot");
768768
769769   has_sh8253  = TRUE;
770770   has_tms5220 = FALSE;
771771
772772   /* determine which sound hardware is installed */
773   has_mc3417 = (devtag_get_device(device->machine, "cvsd") != NULL);
773   has_mc3417 = (device->machine->device("cvsd") != NULL);
774774
775775   /* 8253 */
776776   freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK;
r8581r8582
860860static WRITE8_HANDLER( mtrap_voiceio_w )
861861{
862862   if (!(offset & 0x10))
863      hc55516_digit_w(devtag_get_device(space->machine, "cvsd"), data & 1);
863      hc55516_digit_w(space->machine->device("cvsd"), data & 1);
864864
865865   if (!(offset & 0x20))
866866      riot6532_portb_in_set(riot, data & 1, 0xff);
r8581r8582
879879   }
880880
881881   if (!(offset & 0x40))
882      return hc55516_clock_state_r(devtag_get_device(space->machine, "cvsd")) << 7;
882      return hc55516_clock_state_r(space->machine->device("cvsd")) << 7;
883883
884884   return 0;
885885}
r8581r8582
925925
926926READ8_HANDLER( victory_sound_response_r )
927927{
928   running_device *pia1 = devtag_get_device(space->machine, "pia1");
928   running_device *pia1 = space->machine->device("pia1");
929929   UINT8 ret = pia6821_get_output_b(pia1);
930930
931931   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret);
932932
933   pia6821_cb1_w(pia1, 0, 0);
933   pia6821_cb1_w(pia1, 0);
934934
935935   return ret;
936936}
r8581r8582
938938
939939READ8_HANDLER( victory_sound_status_r )
940940{
941   running_device *pia1 = devtag_get_device(space->machine, "pia1");
942   UINT8 ret = (pia6821_ca1_r(pia1, 0) << 7) | (pia6821_cb1_r(pia1, 0) << 6);
941   running_device *pia1 = space->machine->device("pia1");
942   UINT8 ret = (pia6821_ca1_r(pia1) << 7) | (pia6821_cb1_r(pia1) << 6);
943943
944944   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret);
945945
r8581r8582
949949
950950static TIMER_CALLBACK( delayed_command_w )
951951{
952   running_device *pia1 = devtag_get_device(machine, "pia1");
952   running_device *pia1 = machine->device("pia1");
953953   pia6821_set_input_a(pia1, param, 0);
954   pia6821_ca1_w(pia1, 0, 0);
954   pia6821_ca1_w(pia1, 0);
955955}
956956
957957WRITE8_HANDLER( victory_sound_command_w )
r8581r8582
966966{
967967   if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", cpuexec_describe_context(device->machine), data);
968968
969   if (!data) pia6821_ca1_w(device, 0, 1);
969   if (!data) pia6821_ca1_w(device, 1);
970970}
971971
972972
r8581r8582
975975   if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", cpuexec_describe_context(device->machine), data);
976976
977977   if (victory_sound_response_ack_clk && !data)
978      pia6821_cb1_w(device, 0, 1);
978      pia6821_cb1_w(device, 1);
979979
980980   victory_sound_response_ack_clk = data;
981981}
r8581r8582
10101010
10111011static DEVICE_RESET( victory_sound )
10121012{
1013   running_device *pia1 = devtag_get_device(device->machine, "pia1");
1013   running_device *pia1 = device->machine->device("pia1");
10141014
10151015   DEVICE_RESET_CALL(common_sh_reset);
10161016   pia1->reset();
r8581r8582
10191019
10201020   /* the flip-flop @ F4 is reset */
10211021   victory_sound_response_ack_clk = 0;
1022   pia6821_cb1_w(pia1, 0, 1);
1022   pia6821_cb1_w(pia1, 1);
10231023
10241024   /* these two lines shouldn't be needed, but it avoids the log entry
10251025       as the sound CPU checks port A before the main CPU ever writes to it */
10261026   pia6821_set_input_a(pia1, 0, 0);
1027   pia6821_ca1_w(pia1, 0, 1);
1027   pia6821_ca1_w(pia1, 1);
10281028}
10291029
10301030
src/mame/audio/targ.c
r8581r8582
6161
6262WRITE8_HANDLER( targ_audio_1_w )
6363{
64   running_device *samples = devtag_get_device(space->machine, "samples");
64   running_device *samples = space->machine->device("samples");
6565
6666   /* CPU music */
6767   if ((data & 0x01) != (port_1_last & 0x01))
68      dac_data_w(devtag_get_device(space->machine, "dac"),(data & 0x01) * 0xff);
68      dac_data_w(space->machine->device("dac"),(data & 0x01) * 0xff);
6969
7070   /* shot */
7171   if (FALLING_EDGE(0x02) && !sample_playing(samples, 0))  sample_start(samples, 0,1,0);
r8581r8582
114114{
115115   if ((data & 0x01) && !(port_2_last & 0x01))
116116   {
117      running_device *samples = devtag_get_device(space->machine, "samples");
117      running_device *samples = space->machine->device("samples");
118118      UINT8 *prom = memory_region(space->machine, "targ");
119119
120120      tone_pointer = (tone_pointer + 1) & 0x0f;
r8581r8582
128128
129129WRITE8_HANDLER( spectar_audio_2_w )
130130{
131   running_device *samples = devtag_get_device(space->machine, "samples");
131   running_device *samples = space->machine->device("samples");
132132   adjust_sample(samples, data);
133133}
134134
r8581r8582
147147
148148static void common_audio_start(running_machine *machine, int freq)
149149{
150   running_device *samples = devtag_get_device(machine, "samples");
150   running_device *samples = machine->device("samples");
151151   max_freq = freq;
152152
153153   tone_freq = 0;
src/mame/audio/cchasm.c
r8581r8582
108108   {
109109      output[0] ^= 0x7f;
110110      channel_active[0] = 1;
111      dac_data_w(devtag_get_device(device->machine, "dac1"), output[0]);
111      dac_data_w(device->machine->device("dac1"), output[0]);
112112   }
113113}
114114
r8581r8582
118118   {
119119      output[1] ^= 0x7f;
120120      channel_active[1] = 1;
121      dac_data_w(devtag_get_device(device->machine, "dac2"), output[0]);
121      dac_data_w(device->machine->device("dac2"), output[0]);
122122   }
123123}
124124
r8581r8582
137137    sound_flags = 0;
138138    output[0] = 0; output[1] = 0;
139139
140   ctc = devtag_get_device(machine, "ctc");
140   ctc = machine->device("ctc");
141141}
src/mame/audio/qix.c
r8581r8582
4141/* qix Sound System Analog emulation                                    */
4242/************************************************************************/
4343/*
44 * This hardware is capable of independant L/R volume control,
44 * This hardware is capable of independent L/R volume control,
4545 * but only sdungeon uses it for a stereo effect.
4646 * Other games just use it for fixed L/R volume control.
4747 *
r8581r8582
177177   DEVCB_NULL,      /* line CB2 in */
178178   DEVCB_DEVICE_HANDLER("sndpia1", sync_sndpia1_porta_w),         /* port A out */
179179   DEVCB_DEVICE_HANDLER("discrete", qix_vol_w),               /* port B out */
180   DEVCB_DEVICE_HANDLER("sndpia1", pia6821_ca1_w),                  /* line CA2 out */
180   DEVCB_DEVICE_LINE("sndpia1", pia6821_ca1_w),                  /* line CA2 out */
181181   DEVCB_HANDLER(qix_flip_screen_w),                        /* port CB2 out */
182182   DEVCB_LINE(qix_pia_dint),                              /* IRQA */
183183   DEVCB_LINE(qix_pia_dint)                              /* IRQB */
r8581r8582
193193   DEVCB_NULL,      /* line CB2 in */
194194   DEVCB_DEVICE_HANDLER("sndpia0", pia6821_porta_w),         /* port A out */
195195   DEVCB_DEVICE_HANDLER("discrete", qix_dac_w),         /* port B out */
196   DEVCB_DEVICE_HANDLER("sndpia0", pia6821_ca1_w),            /* line CA2 out */
196   DEVCB_DEVICE_LINE("sndpia0", pia6821_ca1_w),            /* line CA2 out */
197197   DEVCB_NULL,      /* line CB2 out */
198198   DEVCB_LINE(qix_pia_sint),                        /* IRQA */
199199   DEVCB_LINE(qix_pia_sint)                        /* IRQB */
src/mame/audio/invinco.c
r8581r8582
6666WRITE8_HANDLER( invinco_audio_w )
6767{
6868   static int port2State = 0;
69   running_device *samples = devtag_get_device(space->machine, "samples");
69   running_device *samples = space->machine->device("samples");
7070   int bitsChanged;
7171   //int bitsGoneHigh;
7272   int bitsGoneLow;
src/mame/audio/pulsar.c
r8581r8582
8888
8989WRITE8_HANDLER( pulsar_audio_1_w )
9090{
91   running_device *samples = devtag_get_device(space->machine, "samples");
91   running_device *samples = space->machine->device("samples");
9292   int bitsChanged;
9393   //int bitsGoneHigh;
9494   int bitsGoneLow;
r8581r8582
139139
140140WRITE8_HANDLER( pulsar_audio_2_w )
141141{
142   running_device *samples = devtag_get_device(space->machine, "samples");
142   running_device *samples = space->machine->device("samples");
143143   static int port2State = 0;
144144   int bitsChanged;
145145   int bitsGoneHigh;
src/mame/audio/spiders.c
r8581r8582
175175WRITE8_DEVICE_HANDLER( spiders_audio_command_w )
176176{
177177   pia6821_set_input_a(device, data & 0xf8, 0);
178   pia6821_ca1_w(device, 0, data & 0x80 ? 1 : 0);
178   pia6821_ca1_w(device, data & 0x80 ? 1 : 0);
179179}
180180
181181
src/mame/audio/wow.c
r8581r8582
108108
109109READ8_HANDLER( wow_speech_r )
110110{
111   running_device *samples = devtag_get_device(space->machine, "samples");
111   running_device *samples = space->machine->device("samples");
112112   int Phoneme/*, Intonation*/;
113113   int i = 0;
114114
r8581r8582
177177
178178CUSTOM_INPUT( wow_speech_status_r )
179179{
180   running_device *samples = devtag_get_device(field->port->machine, "samples");
180   running_device *samples = field->port->machine->device("samples");
181181   return !sample_playing(samples, 0);
182182}
src/mame/audio/timeplt.c
r8581r8582
3131   timeplt_state *state = (timeplt_state *)machine->driver_data;
3232
3333   state->soundcpu = machine->device<cpu_device>("tpsound");
34   state->filter_0_0 = devtag_get_device(machine, "filter.0.0");
35   state->filter_0_1 = devtag_get_device(machine, "filter.0.1");
36   state->filter_0_2 = devtag_get_device(machine, "filter.0.2");
37   state->filter_1_0 = devtag_get_device(machine, "filter.1.0");
38   state->filter_1_1 = devtag_get_device(machine, "filter.1.1");
39   state->filter_1_2 = devtag_get_device(machine, "filter.1.2");
34   state->filter_0_0 = machine->device("filter.0.0");
35   state->filter_0_1 = machine->device("filter.0.1");
36   state->filter_0_2 = machine->device("filter.0.2");
37   state->filter_1_0 = machine->device("filter.1.0");
38   state->filter_1_1 = machine->device("filter.1.1");
39   state->filter_1_2 = machine->device("filter.1.2");
4040
4141   state->last_irq_state = 0;
4242   state_save_register_global(machine, state->last_irq_state);
src/mame/audio/cinemat.c
r8581r8582
165165
166166static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
167167{
168   running_device *samples = devtag_get_device(machine, "samples");
168   running_device *samples = machine->device("samples");
169169
170170   /* Explosion - rising edge */
171171   if (SOUNDVAL_RISING_EDGE(0x01))
r8581r8582
245245
246246static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
247247{
248   running_device *samples = devtag_get_device(machine, "samples");
248   running_device *samples = machine->device("samples");
249249
250250   /* Player die - rising edge */
251251   if (SOUNDVAL_RISING_EDGE(0x01))
r8581r8582
299299
300300static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
301301{
302   running_device *samples = devtag_get_device(machine, "samples");
302   running_device *samples = machine->device("samples");
303303
304304   /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
305305   if (SOUNDVAL_FALLING_EDGE(0x08))
r8581r8582
365365
366366static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
367367{
368   running_device *samples = devtag_get_device(machine, "samples");
368   running_device *samples = machine->device("samples");
369369
370370   /* explosion - falling edge */
371371   if (SOUNDVAL_FALLING_EDGE(0x01))
r8581r8582
442442
443443static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
444444{
445   running_device *samples = devtag_get_device(machine, "samples");
445   running_device *samples = machine->device("samples");
446446
447447   /* bong - falling edge */
448448   if (SOUNDVAL_FALLING_EDGE(0x01))
r8581r8582
516516   /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
517517   if (SOUNDVAL_FALLING_EDGE(0x10))
518518   {
519      running_device *samples = devtag_get_device(machine, "samples");
519      running_device *samples = machine->device("samples");
520520
521521      /* update the shift register (actually just a simple mux) */
522522      current_shift = (current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7));
r8581r8582
602602
603603static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
604604{
605   running_device *samples = devtag_get_device(machine, "samples");
605   running_device *samples = machine->device("samples");
606606
607607   /* normal level - 0=on, 1=off */
608608   if (SOUNDVAL_FALLING_EDGE(0x01))
r8581r8582
674674
675675static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
676676{
677   running_device *samples = devtag_get_device(machine, "samples");
677   running_device *samples = machine->device("samples");
678678
679679   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
680680   if (SOUNDVAL_RISING_EDGE(0x10))
r8581r8582
776776
777777static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
778778{
779   running_device *samples = devtag_get_device(machine, "samples");
779   running_device *samples = machine->device("samples");
780780
781781   /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
782782   if (SOUNDVAL_RISING_EDGE(0x02))
r8581r8582
864864
865865static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
866866{
867   running_device *samples = devtag_get_device(machine, "samples");
867   running_device *samples = machine->device("samples");
868868   UINT32 target_pitch;
869869
870870   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r8581r8582
978978
979979static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
980980{
981   running_device *samples = devtag_get_device(machine, "samples");
981   running_device *samples = machine->device("samples");
982982   static float target_volume, current_volume;
983983
984984   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r8581r8582
11191119
11201120static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
11211121{
1122   running_device *samples = devtag_get_device(machine, "samples");
1122   running_device *samples = machine->device("samples");
11231123
11241124   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
11251125   if (SOUNDVAL_RISING_EDGE(0x10))
r8581r8582
12511251
12521252static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
12531253{
1254   running_device *samples = devtag_get_device(machine, "samples");
1254   running_device *samples = machine->device("samples");
12551255   UINT32 target_pitch;
12561256
12571257   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r8581r8582
13651365
13661366static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
13671367{
1368   running_device *samples = devtag_get_device(machine, "samples");
1368   running_device *samples = machine->device("samples");
13691369   UINT32 target_pitch;
13701370
13711371   /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
r8581r8582
15541554   last_portb_write = 0xff;
15551555
15561556   /* turn off channel A on AY8910 #0 because it is used as a low-pass filter */
1557   ay8910_set_volume(devtag_get_device(machine, "ay1"), 0, 0);
1557   ay8910_set_volume(machine->device("ay1"), 0, 0);
15581558}
15591559
15601560
r8581r8582
16231623
16241624static WRITE8_HANDLER( qb3_sound_w )
16251625{
1626   UINT16 rega = cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_A);
1626   UINT16 rega = cpu_get_reg(space->machine->device("maincpu"), CCPU_A);
16271627   demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
16281628}
16291629
src/mame/audio/zaxxon.c
r8581r8582
114114WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
115115{
116116   zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
117   running_device *samples = devtag_get_device(device->machine, "samples");
117   running_device *samples = device->machine->device("samples");
118118   UINT8 diff = data ^ state->sound_state[0];
119119   state->sound_state[0] = data;
120120
r8581r8582
150150WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
151151{
152152   zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
153   running_device *samples = devtag_get_device(device->machine, "samples");
153   running_device *samples = device->machine->device("samples");
154154   UINT8 diff = data ^ state->sound_state[1];
155155   state->sound_state[1] = data;
156156
r8581r8582
168168WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
169169{
170170   zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
171   running_device *samples = devtag_get_device(device->machine, "samples");
171   running_device *samples = device->machine->device("samples");
172172   UINT8 diff = data ^ state->sound_state[2];
173173   state->sound_state[2] = data;
174174
r8581r8582
226226WRITE8_DEVICE_HANDLER( congo_sound_b_w )
227227{
228228   zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
229   running_device *samples = devtag_get_device(device->machine, "samples");
229   running_device *samples = device->machine->device("samples");
230230   UINT8 diff = data ^ state->sound_state[1];
231231   state->sound_state[1] = data;
232232
r8581r8582
240240WRITE8_DEVICE_HANDLER( congo_sound_c_w )
241241{
242242   zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
243   running_device *samples = devtag_get_device(device->machine, "samples");
243   running_device *samples = device->machine->device("samples");
244244   UINT8 diff = data ^ state->sound_state[2];
245245   state->sound_state[2] = data;
246246
src/mame/audio/namco54.c
r8581r8582
174174
175175   /* find the attached discrete sound device */
176176   assert(config->discrete != NULL);
177   state->discrete = devtag_get_device(device->machine, config->discrete);
177   state->discrete = device->machine->device(config->discrete);
178178   assert(state->discrete != NULL);
179179   state->basenode = config->firstnode;
180180}
src/mame/audio/snk6502.c
r8581r8582
652652
653653WRITE8_HANDLER( sasuke_sound_w )
654654{
655   running_device *samples = devtag_get_device(space->machine, "samples");
655   running_device *samples = space->machine->device("samples");
656656   switch (offset)
657657   {
658658   case 0:
r8581r8582
718718
719719WRITE8_HANDLER( satansat_sound_w )
720720{
721   running_device *samples = devtag_get_device(space->machine, "samples");
721   running_device *samples = space->machine->device("samples");
722722   switch (offset)
723723   {
724724   case 0:
r8581r8582
781781
782782WRITE8_HANDLER( vanguard_sound_w )
783783{
784   running_device *samples = devtag_get_device(space->machine, "samples");
784   running_device *samples = space->machine->device("samples");
785785   switch (offset)
786786   {
787787   case 0:
r8581r8582
827827      }
828828
829829      /* SHOT B */
830      sn76477_enable_w(devtag_get_device(space->machine, "sn76477.2"), (data & 0x40) ? 0 : 1);
830      sn76477_enable_w(space->machine->device("sn76477.2"), (data & 0x40) ? 0 : 1);
831831
832832      LastPort1 = data;
833833      break;
r8581r8582
917917      }
918918
919919      /* BOMB */
920      discrete_sound_w(devtag_get_device(space->machine, "discrete"), FANTASY_BOMB_EN, data & 0x80);
920      discrete_sound_w(space->machine->device("discrete"), FANTASY_BOMB_EN, data & 0x80);
921921
922922      LastPort1 = data;
923923      break;
r8581r8582
10341034
10351035   if ((data & HD38880_CTP) && (data & HD38880_CMV))
10361036   {
1037      running_device *samples = devtag_get_device(machine, "samples");
1037      running_device *samples = machine->device("samples");
10381038      data &= HD68880_SYBS;
10391039
10401040      switch (hd38880_cmd)
r8581r8582
10531053               {
10541054                  if (table[i] && table[i] == hd38880_addr)
10551055                  {
1056                     running_device *samples = devtag_get_device(machine, "samples");
1056                     running_device *samples = machine->device("samples");
10571057                     sample_start(samples, 0, start + i, 0);
10581058                     break;
10591059                  }
src/mame/audio/polyplay.c
r8581r8582
4848
4949void polyplay_play_channel1(running_machine *machine, int data)
5050{
51   running_device *samples = devtag_get_device(machine, "samples");
51   running_device *samples = machine->device("samples");
5252   if (data) {
5353      freq1 = 2457600 / 16 / data / 8;
5454      sample_set_volume(samples, 0, channel_playing1 * 1.0);
r8581r8582
6262
6363void polyplay_play_channel2(running_machine *machine, int data)
6464{
65   running_device *samples = devtag_get_device(machine, "samples");
65   running_device *samples = machine->device("samples");
6666   if (data) {
6767      freq2 = 2457600 / 16 / data / 8;
6868      sample_set_volume(samples, 1, channel_playing2 * 1.0);
src/mame/audio/tx1.c
r8581r8582
412412
413413WRITE8_DEVICE_HANDLER( bb_ym2_b_w )
414414{
415   running_device *ym1 = devtag_get_device(device->machine, "ym1");
416   running_device *ym2 = devtag_get_device(device->machine, "ym2");
415   running_device *ym1 = device->machine->device("ym1");
416   running_device *ym2 = device->machine->device("ym2");
417417   double gain;
418418
419419   stream_update(stream);
src/mame/audio/cclimber.c
r8581r8582
2727   int len;
2828   int romlen = memory_region_length(machine, "samples");
2929   const UINT8 *rom = memory_region(machine, "samples");
30   running_device *samples = devtag_get_device(machine, "samples");
30   running_device *samples = machine->device("samples");
3131
3232
3333   if (!rom) return;
src/mame/audio/mcr.c
r8581r8582
108108   /* SSIO */
109109   if (mcr_sound_config & MCR_SSIO)
110110   {
111      ssio_sound_cpu = devtag_get_device(machine, "ssiocpu");
111      ssio_sound_cpu = machine->device("ssiocpu");
112112      ssio_compute_ay8910_modulation(machine);
113113      state_save_register_global_array(machine, ssio_data);
114114      state_save_register_global(machine, ssio_status);
r8581r8582
121121   /* Turbo Chip Squeak */
122122   if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
123123   {
124      turbocs_sound_cpu = devtag_get_device(machine, "tcscpu");
124      turbocs_sound_cpu = machine->device("tcscpu");
125125      state_save_register_global(machine, turbocs_status);
126126   }
127127
128128   /* Chip Squeak Deluxe */
129129   if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
130130   {
131      csdeluxe_sound_cpu = devtag_get_device(machine, "csdcpu");
131      csdeluxe_sound_cpu = machine->device("csdcpu");
132132      state_save_register_global(machine, csdeluxe_status);
133133   }
134134
135135   /* Sounds Good */
136136   if (mcr_sound_config & MCR_SOUNDS_GOOD)
137137   {
138      soundsgood_sound_cpu = devtag_get_device(machine, "sgcpu");
138      soundsgood_sound_cpu = machine->device("sgcpu");
139139      state_save_register_global(machine, soundsgood_status);
140140   }
141141
142142   /* Squawk n Talk */
143143   if (mcr_sound_config & MCR_SQUAWK_N_TALK)
144144   {
145      squawkntalk_sound_cpu = devtag_get_device(machine, "sntcpu");
145      squawkntalk_sound_cpu = machine->device("sntcpu");
146146      state_save_register_global(machine, squawkntalk_tms_command);
147147      state_save_register_global(machine, squawkntalk_tms_strobes);
148148   }
r8581r8582
316316
317317static void ssio_update_volumes(running_machine *machine)
318318{
319   running_device *ay0 = devtag_get_device(machine, "ssio.1");
320   running_device *ay1 = devtag_get_device(machine, "ssio.2");
319   running_device *ay0 = machine->device("ssio.1");
320   running_device *ay1 = machine->device("ssio.2");
321321   ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]);
322322   ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]);
323323   ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]);
r8581r8582
491491static WRITE8_DEVICE_HANDLER( csdeluxe_porta_w )
492492{
493493   dacval = (dacval & ~0x3fc) | (data << 2);
494   dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6);
494   dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
495495}
496496
497497static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
r8581r8582
499499   UINT8 z_mask = pia6821_get_port_b_z_mask(device);
500500
501501   dacval = (dacval & ~0x003) | (data >> 6);
502   dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6);
502   dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
503503
504504   if (~z_mask & 0x10)  csdeluxe_status = (csdeluxe_status & ~1) | ((data >> 4) & 1);
505505   if (~z_mask & 0x20)  csdeluxe_status = (csdeluxe_status & ~2) | ((data >> 4) & 2);
r8581r8582
514514
515515static TIMER_CALLBACK( csdeluxe_delayed_data_w )
516516{
517   running_device *pia = devtag_get_device(machine, "csdpia");
517   running_device *pia = machine->device("csdpia");
518518
519519   pia6821_portb_w(pia, 0, param & 0x0f);
520   pia6821_ca1_w(pia, 0, ~param & 0x10);
520   pia6821_ca1_w(pia, ~param & 0x10);
521521
522522   /* oftentimes games will write one nibble at a time; the sync on this is very */
523523   /* important, so we boost the interleave briefly while this happens */
r8581r8582
629629static WRITE8_DEVICE_HANDLER( soundsgood_porta_w )
630630{
631631   dacval = (dacval & ~0x3fc) | (data << 2);
632   dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6);
632   dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
633633}
634634
635635static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
r8581r8582
637637   UINT8 z_mask = pia6821_get_port_b_z_mask(device);
638638
639639   dacval = (dacval & ~0x003) | (data >> 6);
640   dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6);
640   dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
641641
642642   if (~z_mask & 0x10)  soundsgood_status = (soundsgood_status & ~1) | ((data >> 4) & 1);
643643   if (~z_mask & 0x20)  soundsgood_status = (soundsgood_status & ~2) | ((data >> 4) & 2);
r8581r8582
652652
653653static TIMER_CALLBACK( soundsgood_delayed_data_w )
654654{
655   running_device *pia = devtag_get_device(machine, "sgpia");
655   running_device *pia = machine->device("sgpia");
656656
657657   pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
658   pia6821_ca1_w(pia, 0, ~param & 0x01);
658   pia6821_ca1_w(pia, ~param & 0x01);
659659
660660   /* oftentimes games will write one nibble at a time; the sync on this is very */
661661   /* important, so we boost the interleave briefly while this happens */
r8581r8582
737737static WRITE8_DEVICE_HANDLER( turbocs_porta_w )
738738{
739739   dacval = (dacval & ~0x3fc) | (data << 2);
740   dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6);
740   dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
741741}
742742
743743static WRITE8_DEVICE_HANDLER( turbocs_portb_w )
744744{
745745   dacval = (dacval & ~0x003) | (data >> 6);
746   dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6);
746   dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
747747   turbocs_status = (data >> 4) & 3;
748748}
749749
r8581r8582
756756
757757static TIMER_CALLBACK( turbocs_delayed_data_w )
758758{
759   running_device *pia = devtag_get_device(machine, "tcspia");
759   running_device *pia = machine->device("tcspia");
760760
761761   pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
762   pia6821_ca1_w(pia, 0, ~param & 0x01);
762   pia6821_ca1_w(pia, ~param & 0x01);
763763
764764   /* oftentimes games will write one nibble at a time; the sync on this is very */
765765   /* important, so we boost the interleave briefly while this happens */
r8581r8582
853853
854854static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
855855{
856   running_device *tms = devtag_get_device(device->machine, "sntspeech");
856   running_device *tms = device->machine->device("sntspeech");
857857
858858   /* bits 0-1 select read/write strobes on the TMS5200 */
859859   data &= 0x03;
r8581r8582
864864      tms5220_data_w(tms, offset, squawkntalk_tms_command);
865865
866866      /* DoT expects the ready line to transition on a command/write here, so we oblige */
867      pia6821_ca2_w(device, 0, 1);
868      pia6821_ca2_w(device, 0, 0);
867      pia6821_ca2_w(device, 1);
868      pia6821_ca2_w(device, 0);
869869   }
870870
871871   /* read strobe -- read the current status from the TMS5200 */
r8581r8582
874874      pia6821_porta_w(device, 0, tms5220_status_r(tms, offset));
875875
876876      /* DoT expects the ready line to transition on a command/write here, so we oblige */
877      pia6821_ca2_w(device, 0, 1);
878      pia6821_ca2_w(device, 0, 0);
877      pia6821_ca2_w(device, 1);
878      pia6821_ca2_w(device, 0);
879879   }
880880
881881   /* remember the state */
r8581r8582
884884
885885static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
886886{
887   running_device *pia0 = devtag_get_device(device->machine, "sntpia0");
888   running_device *pia1 = devtag_get_device(device->machine, "sntpia1");
887   running_device *pia0 = device->machine->device("sntpia0");
888   running_device *pia1 = device->machine->device("sntpia1");
889889   int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
890890
891891   cpu_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
r8581r8582
893893
894894static TIMER_CALLBACK( squawkntalk_delayed_data_w )
895895{
896   running_device *pia0 = devtag_get_device(machine, "sntpia0");
896   running_device *pia0 = machine->device("sntpia0");
897897
898898   pia6821_porta_w(pia0, 0, ~param & 0x0f);
899   pia6821_cb1_w(pia0, 0, ~param & 0x10);
899   pia6821_cb1_w(pia0, ~param & 0x10);
900900}
901901
902902
src/mame/audio/t5182.c
r8581r8582
191191         break;
192192   }
193193
194   cpu = devtag_get_device(machine, CPUTAG_T5182);
194   cpu = machine->device(CPUTAG_T5182);
195195
196196   if (cpu == NULL)
197197      return;
src/mame/audio/vicdual.c
r8581r8582
132132
133133static TIMER_CALLBACK( frogs_croak_callback )
134134{
135   running_device *samples = devtag_get_device(machine, "samples");
135   running_device *samples = machine->device("samples");
136136   sample_stop(samples, 2);
137137}
138138
r8581r8582
145145
146146WRITE8_HANDLER( frogs_audio_w )
147147{
148   running_device *samples = devtag_get_device(space->machine, "samples");
149   running_device *discrete = devtag_get_device(space->machine, "discrete");
148   running_device *samples = space->machine->device("samples");
149   running_device *discrete = space->machine->device("discrete");
150150   static int last_croak = 0;
151151   static int last_buzzz = 0;
152152   int new_croak = data & 0x08;
r8581r8582
462462
463463WRITE8_HANDLER( headon_audio_w )
464464{
465   running_device *discrete = devtag_get_device(space->machine, "discrete");
465   running_device *discrete = space->machine->device("discrete");
466466   if (discrete == NULL)
467467      return;
468468   discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01);
r8581r8582
477477
478478WRITE8_HANDLER( invho2_audio_w )
479479{
480   running_device *discrete = devtag_get_device(space->machine, "discrete");
480   running_device *discrete = space->machine->device("discrete");
481481   if (discrete == NULL)
482482      return;
483483   discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10);
src/mame/audio/irem.c
r8581r8582
2222{
2323   irem_z80_state *state = (irem_z80_state *)machine->driver_data;
2424
25   state->adpcm1 = devtag_get_device(machine, "msm1");
26   state->adpcm2 = devtag_get_device(machine, "msm2");
27   state->ay1 = devtag_get_device(machine, "ay1");
28   state->ay2 = devtag_get_device(machine, "ay2");
25   state->adpcm1 = machine->device("msm1");
26   state->adpcm2 = machine->device("msm2");
27   state->ay1 = machine->device("ay1");
28   state->ay2 = machine->device("ay2");
2929
3030   state_save_register_global(machine, state->port1);
3131   state_save_register_global(machine, state->port2);
src/mame/audio/meadows.c
r8581r8582
6060/************************************/
6161void meadows_sh_update(running_machine *machine)
6262{
63   running_device *samples = devtag_get_device(machine, "samples");
63   running_device *samples = machine->device("samples");
6464   int preset, amp;
6565
6666   if (latched_0c01 != meadows_0c01 || latched_0c03 != meadows_0c03)
r8581r8582
6868      /* amplitude is a combination of the upper 4 bits of 0c01 */
6969      /* and bit 4 merged from S2650's flag output */
7070      amp = ((meadows_0c03 & ENABLE_CTR1) == 0) ? 0 : (meadows_0c01 & 0xf0) >> 1;
71      if( cpu_get_reg(devtag_get_device(machine, "maincpu"), S2650_FO) )
71      if( cpu_get_reg(machine->device("maincpu"), S2650_FO) )
7272         amp += 0x80;
7373      /* calculate frequency for counter #1 */
7474      /* bit 0..3 of 0c01 are ctr preset */
r8581r8582
104104      dac_enable = meadows_0c03 & ENABLE_DAC;
105105
106106      if (dac_enable)
107         dac_data_w(devtag_get_device(machine, "dac"), meadows_dac);
107         dac_data_w(machine->device("dac"), meadows_dac);
108108      else
109         dac_data_w(devtag_get_device(machine, "dac"), 0);
109         dac_data_w(machine->device("dac"), 0);
110110   }
111111
112112   latched_0c01 = meadows_0c01;
r8581r8582
121121{
122122   meadows_dac = data;
123123   if (dac_enable)
124      dac_data_w(devtag_get_device(machine, "dac"), meadows_dac);
124      dac_data_w(machine->device("dac"), meadows_dac);
125125   else
126      dac_data_w(devtag_get_device(machine, "dac"), 0);
126      dac_data_w(machine->device("dac"), 0);
127127}
128128
129129
src/mame/audio/pleiads.c
r8581r8582
436436   if (pitch == 3)
437437      pitch = 2;   /* 2 and 3 are the same */
438438
439   tms36xx_note_w(devtag_get_device(space->machine, "tms"), pitch, note);
439   tms36xx_note_w(space->machine->device("tms"), pitch, note);
440440
441441   stream_update(channel);
442442   sound_latch_b = data;
src/mame/audio/williams.c
r8581r8582
270270   int bank;
271271
272272   /* configure the CPU */
273   sound_cpu = devtag_get_device(machine, "cvsdcpu");
273   sound_cpu = machine->device("cvsdcpu");
274274   soundalt_cpu = NULL;
275275
276276   /* configure master CPU banks */
r8581r8582
288288   memory_set_bank(machine, "bank5", 0);
289289
290290   /* reset the IRQ state */
291   pia6821_ca1_w(devtag_get_device(machine, "cvsdpia"), 0, 1);
291   pia6821_ca1_w(machine->device("cvsdpia"), 1);
292292
293293   /* register for save states */
294294   state_save_register_global(machine, williams_sound_int_state);
r8581r8582
302302   int bank;
303303
304304   /* configure the CPU */
305   sound_cpu = devtag_get_device(machine, "narc1cpu");
306   soundalt_cpu = devtag_get_device(machine, "narc2cpu");
305   sound_cpu = machine->device("narc1cpu");
306   soundalt_cpu = machine->device("narc2cpu");
307307
308308   /* configure master CPU banks */
309309   ROM = memory_region(machine, "narc1cpu");
r8581r8582
345345   UINT8 *ROM;
346346
347347   /* configure the CPU */
348   sound_cpu = devtag_get_device(machine, "adpcm");
348   sound_cpu = machine->device("adpcm");
349349   soundalt_cpu = NULL;
350350
351351   /* configure banks */
r8581r8582
407407
408408static void cvsd_ym2151_irq(running_device *device, int state)
409409{
410   pia6821_ca1_w(devtag_get_device(device->machine, "cvsdpia"), 0, !state);
410   pia6821_ca1_w(device->machine->device("cvsdpia"), !state);
411411}
412412
413413
r8581r8582
471471
472472static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
473473{
474   running_device *pia = devtag_get_device(machine, "cvsdpia");
474   running_device *pia = machine->device("cvsdpia");
475475   pia6821_portb_w(pia, 0, param & 0xff);
476   pia6821_cb1_w(pia, 0, (param >> 8) & 1);
477   pia6821_cb2_w(pia, 0, (param >> 9) & 1);
476   pia6821_cb1_w(pia, (param >> 8) & 1);
477   pia6821_cb2_w(pia, (param >> 9) & 1);
478478}
479479
480480
src/mame/audio/redalert.c
r8581r8582
170170
171171static WRITE_LINE_DEVICE_HANDLER( sod_callback )
172172{
173   hc55516_digit_w(devtag_get_device(device->machine, "cvsd"), state);
173   hc55516_digit_w(device->machine->device("cvsd"), state);
174174}
175175
176176
177177static READ_LINE_DEVICE_HANDLER( sid_callback )
178178{
179   return hc55516_clock_state_r(devtag_get_device(device->machine, "cvsd"));
179   return hc55516_clock_state_r(device->machine->device("cvsd"));
180180}
181181
182182
r8581r8582
309309
310310static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
311311{
312   running_device *ay1 = devtag_get_device(device->machine, "ay1");
313   running_device *ay2 = devtag_get_device(device->machine, "ay2");
312   running_device *ay1 = device->machine->device("ay1");
313   running_device *ay2 = device->machine->device("ay2");
314314
315315   switch (ay8910_latch_1 & 0x03)
316316   {
src/mame/audio/starwars.c
r8581r8582
2121
2222SOUND_START( starwars )
2323{
24   riot = devtag_get_device(machine, "riot");
24   riot = machine->device("riot");
2525}
2626
2727
r8581r8582
4646   /* Note: bit 4 is always set to avoid sound self test */
4747   UINT8 olddata = riot6532_porta_in_get(device);
4848
49   return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(devtag_get_device(device->machine, "tms")) << 2);
49   return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine->device("tms")) << 2);
5050}
5151
5252
src/mame/audio/mario.c
r8581r8582
466466static SOUND_START( mario )
467467{
468468   mario_state   *state = (mario_state *)machine->driver_data;
469   running_device *audiocpu = devtag_get_device(machine, "audiocpu");
469   running_device *audiocpu = machine->device("audiocpu");
470470#if USE_8039
471471   UINT8 *SND = memory_region(machine, "audiocpu");
472472
r8581r8582
629629         I8035_P1_W_AH(space,3,data & 1);
630630         break;
631631      case 7: /* skid */
632         discrete_sound_w(devtag_get_device(space->machine, "discrete"),DS_SOUND7_INP,data & 1);
632         discrete_sound_w(space->machine->device("discrete"),DS_SOUND7_INP,data & 1);
633633         break;
634634   }
635635}
src/mame/machine/micro3d.c
r8581r8582
349349
350350READ16_HANDLER( micro3d_tms_host_r )
351351{
352   return tms34010_host_r(devtag_get_device(space->machine, "vgb"), offset);
352   return tms34010_host_r(space->machine->device("vgb"), offset);
353353}
354354
355355WRITE16_HANDLER( micro3d_tms_host_w )
356356{
357   tms34010_host_w(devtag_get_device(space->machine, "vgb"), offset, data);
357   tms34010_host_w(space->machine->device("vgb"), offset, data);
358358}
359359
360360
r8581r8582
748748   micro3d_state *state = (micro3d_state*)machine->driver_data;
749749   const address_space *space = cputag_get_address_space(machine, "drmath", ADDRESS_SPACE_DATA);
750750
751   i8051_set_serial_tx_callback(devtag_get_device(machine, "audiocpu"), data_from_i8031);
752   i8051_set_serial_rx_callback(devtag_get_device(machine, "audiocpu"), data_to_i8031);
751   i8051_set_serial_tx_callback(machine->device("audiocpu"), data_from_i8031);
752   i8051_set_serial_rx_callback(machine->device("audiocpu"), data_to_i8031);
753753
754   state->duart68681 = devtag_get_device(machine, "duart68681");
754   state->duart68681 = machine->device("duart68681");
755755
756756   /* The Am29000 program seems to rely on RAM from 0x00470000 onwards being
757757    non-zero on a reset, otherwise the 3D object data doesn't get uploaded! */
r8581r8582
762762   /* TODO? BOTSS crashes when starting the final stage because the 68000
763763    overwrites memory in use by the Am29000. Slowing down the 68000 slightly
764764    avoids this */
765   cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.945f);
765   machine->device("maincpu")->set_clock_scale(0.945f);
766766}
767767
768768DRIVER_INIT( botssa )
src/mame/machine/nmk004.c
r8581r8582
10211021   memset(&NMK004_state, 0, sizeof(NMK004_state));
10221022
10231023   NMK004_state.machine = machine;
1024   NMK004_state.ymdevice = devtag_get_device(machine, "ymsnd");
1025   NMK004_state.oki1device = devtag_get_device(machine, "oki1");
1026   NMK004_state.oki2device = devtag_get_device(machine, "oki2");
1024   NMK004_state.ymdevice = machine->device("ymsnd");
1025   NMK004_state.oki1device = machine->device("oki1");
1026   NMK004_state.oki2device = machine->device("oki2");
10271027
10281028   NMK004_state.rom = memory_region(machine, "audiocpu");
10291029
src/mame/machine/fd1089.c
r8581r8582
397397
398398static UINT16 *decrypted;
399399
400static void clear_decrypted(running_machine &machine)
401{
402   decrypted = NULL;
403}
404
400405static void sys16_decrypt(running_machine *machine, const UINT8 *key,int cputype)
401406{
402407   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
r8581r8582
405410   int A;
406411   decrypted = auto_alloc_array(machine, UINT16, size/2);
407412
413   machine->add_notifier(MACHINE_NOTIFY_EXIT, clear_decrypted);
408414   memory_set_decrypted_region(space, 0x000000, size - 1, decrypted);
409415
410416   for (A = 0;A < size;A+=2)
src/mame/machine/playch10.c
r8581r8582
5151
5252MACHINE_RESET( pc10 )
5353{
54   running_device *rp5h01 = devtag_get_device(machine, "rp5h01");
54   running_device *rp5h01 = machine->device("rp5h01");
5555
5656   /* initialize latches and flip-flops */
5757   pc10_nmi_enable = pc10_dog_di = pc10_dispmask = pc10_sdcs = pc10_int_detect = 0;
r8581r8582
8484   /* move to individual boards as documentation of actual boards allows */
8585   nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
8686
87   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w);
88   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w);
87   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w);
88   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w);
8989
9090   if (NULL != vram)
9191      set_videoram_bank(machine, 0, 8, 0, 8);
r8581r8582
104104
105105   vram = auto_alloc_array(machine, UINT8, 0x2000);
106106
107   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w);
108   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w);
107   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w);
108   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w);
109109}
110110
111111/*************************************
r8581r8582
193193
194194READ8_HANDLER( pc10_prot_r )
195195{
196   running_device *rp5h01 = devtag_get_device(space->machine, "rp5h01");
196   running_device *rp5h01 = space->machine->device("rp5h01");
197197   int data = 0xe7;
198198
199199   /* we only support a single cart connected at slot 0 */
r8581r8582
209209
210210WRITE8_HANDLER( pc10_prot_w )
211211{
212   running_device *rp5h01 = devtag_get_device(space->machine, "rp5h01");
212   running_device *rp5h01 = space->machine->device("rp5h01");
213213   /* we only support a single cart connected at slot 0 */
214214   if (cart_sel == 0)
215215   {
r8581r8582
277277   /* do the gun thing */
278278   if (pc10_gun_controller)
279279   {
280      running_device *ppu = devtag_get_device(space->machine, "ppu");
280      running_device *ppu = space->machine->device("ppu");
281281      int trigger = input_port_read(space->machine, "P1");
282282      int x = input_port_read(space->machine, "GUNX");
283283      int y = input_port_read(space->machine, "GUNY");
r8581r8582
869869      if (--gboard_scanline_counter == -1)
870870      {
871871         gboard_scanline_counter = gboard_scanline_latch;
872         generic_pulse_irq_line(devtag_get_device(device->machine, "cart"), 0);
872         generic_pulse_irq_line(device->machine->device("cart"), 0);
873873      }
874874   }
875875}
876876
877877static WRITE8_HANDLER( gboard_rom_switch_w )
878878{
879   running_device *ppu = devtag_get_device(space->machine, "ppu");
879   running_device *ppu = space->machine->device("ppu");
880880
881881   /* basically, a MMC3 mapper from the nes */
882882
src/mame/machine/s16fd.c
r8581r8582
6767
6868   fd1094_state = state;
6969
70   cpu_set_reg(devtag_get_device(machine, fd1094_cputag), M68K_PREF_ADDR, 0x0010);   // force a flush of the prefetch cache
70   cpu_set_reg(machine->device(fd1094_cputag), M68K_PREF_ADDR, 0x0010);   // force a flush of the prefetch cache
7171
7272   /* set the FD1094 state ready to decrypt.. */
7373   state = fd1094_set_state(fd1094_key, state) & 0xff;
r8581r8582
8080         /* copy cached state */
8181         fd1094_userregion = fd1094_cacheregion[i];
8282         set_decrypted_region(machine);
83         m68k_set_encrypted_opcode_range(devtag_get_device(machine, fd1094_cputag), 0, fd1094_cpuregionsize);
83         m68k_set_encrypted_opcode_range(machine->device(fd1094_cputag), 0, fd1094_cpuregionsize);
8484
8585         return;
8686      }
r8581r8582
9999   /* copy newly decrypted data to user region */
100100   fd1094_userregion = fd1094_cacheregion[fd1094_current_cacheposition];
101101   set_decrypted_region(machine);
102   m68k_set_encrypted_opcode_range(devtag_get_device(machine, fd1094_cputag), 0, fd1094_cpuregionsize);
102   m68k_set_encrypted_opcode_range(machine->device(fd1094_cputag), 0, fd1094_cpuregionsize);
103103
104104   fd1094_current_cacheposition++;
105105
r8581r8582
166166      int selected_state = fd1094_selected_state;
167167      int state = fd1094_state;
168168
169      fd1094_machine_init(devtag_get_device(machine, fd1094_cputag));
169      fd1094_machine_init(machine->device(fd1094_cputag));
170170
171171      fd1094_setstate_and_decrypt(machine, selected_state);
172172      fd1094_setstate_and_decrypt(machine, state);
r8581r8582
192192   fd1094_current_cacheposition = 1;
193193
194194   /* flush the prefetch queue */
195   cpu_set_reg(devtag_get_device(machine, fd1094_cputag), M68K_PREF_ADDR, 0x0010);
195   cpu_set_reg(machine->device(fd1094_cputag), M68K_PREF_ADDR, 0x0010);
196196}
197197
198198
src/mame/machine/asic65.c
r8581r8582
131131   asic65.type = asictype;
132132   asic65.yorigin = 0x1800;
133133   if (asic65.type == ASIC65_ROMBASED)
134      asic65.cpu = devtag_get_device(machine, "asic65");
134      asic65.cpu = machine->device("asic65");
135135}
136136
137137
src/mame/machine/tnzs.c
r8581r8582
693693   state->bank1 = 2;
694694   state->bank2 = 0;
695695
696   state->audiocpu = devtag_get_device(machine, "audiocpu");
697   state->subcpu = devtag_get_device(machine, "sub");
698   state->mcu = devtag_get_device(machine, "mcu");
696   state->audiocpu = machine->device("audiocpu");
697   state->subcpu = machine->device("sub");
698   state->mcu = machine->device("mcu");
699699
700700   state_save_register_global(machine, state->screenflip);
701701   state_save_register_global(machine, state->kageki_csport_sel);
r8581r8582
725725   memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
726726   memory_configure_bank(machine, "bank2", 0, 4, &SUB[0x10000], 0x2000);
727727
728   state->subcpu = devtag_get_device(machine, "sub");
728   state->subcpu = machine->device("sub");
729729   state->mcu = NULL;
730730
731731   state->bank1 = 2;
src/mame/machine/atari.c
r8581r8582
159159
160160void a800_handle_keyboard(running_machine *machine)
161161{
162   running_device *pokey = devtag_get_device(machine, "pokey");
162   running_device *pokey = machine->device("pokey");
163163   int atari_code, count, ipt, i;
164164   static const char *const tag[] = {
165165      "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
r8581r8582
244244
245245void a5200_handle_keypads(running_machine *machine)
246246{
247   running_device *pokey = devtag_get_device(machine, "pokey");
247   running_device *pokey = machine->device("pokey");
248248   int atari_code, count, ipt, i;
249249   static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" };
250250
r8581r8582
322322
323323static void console_write(const address_space *space, UINT8 data)
324324{
325   running_device *dac = devtag_get_device(space->machine, "dac");
325   running_device *dac = space->machine->device("dac");
326326   if (data & 0x08)
327327      dac_data_w(dac, (UINT8)-120);
328328   else
src/mame/machine/midyunit.c
r8581r8582
213213
214214static WRITE16_HANDLER( term2_hack_w )
215215{
216    if (offset == 0 && cpu_get_pc(space->cpu) == 0xffce5230) /* FIX ME - Not correct for LA4 */
217    {
218        t2_hack_mem[offset] = 0;
219        return;
220    }
221   COMBINE_DATA(&t2_hack_mem[offset]);
222}
223
224static WRITE16_HANDLER( term2la3_hack_w )
225{
216226    if (offset == 0 && cpu_get_pc(space->cpu) == 0xffce5230)
217227    {
218228        t2_hack_mem[offset] = 0;
r8581r8582
530540}
531541
532542DRIVER_INIT( term2 ) { term2_init_common(machine, term2_hack_w); }
543DRIVER_INIT( term2la3 ) { term2_init_common(machine, term2la3_hack_w); }
533544DRIVER_INIT( term2la2 ) { term2_init_common(machine, term2la2_hack_w); }
534545DRIVER_INIT( term2la1 ) { term2_init_common(machine, term2la1_hack_w); }
535546
src/mame/machine/mhavoc.c
r8581r8582
102102MACHINE_RESET( mhavoc )
103103{
104104   const address_space *space = cputag_get_address_space(machine, "alpha", ADDRESS_SPACE_PROGRAM);
105   has_gamma_cpu = (devtag_get_device(machine, "gamma") != NULL);
105   has_gamma_cpu = (machine->device("gamma") != NULL);
106106
107107   memory_configure_bank(machine, "bank1", 0, 1, mhavoc_zram0, 0);
108108   memory_configure_bank(machine, "bank1", 1, 1, mhavoc_zram1, 0);
r8581r8582
223223
224224CUSTOM_INPUT( tms5220_r )
225225{
226   return tms5220_readyq_r(devtag_get_device(field->port->machine, "tms")) ? 1 : 0;
226   return tms5220_readyq_r(field->port->machine->device("tms")) ? 1 : 0;
227227}
228228
229229CUSTOM_INPUT( mhavoc_bit67_r )
r8581r8582
328328
329329static WRITE8_HANDLER( mhavocrv_speech_strobe_w )
330330{
331   running_device *tms = devtag_get_device(space->machine, "tms");
331   running_device *tms = space->machine->device("tms");
332332   tms5220_data_w(tms, 0, speech_write_buffer);
333333}
334334
src/mame/machine/decocass.c
r8581r8582
13371337{
13381338   decocass_state *state = (decocass_state *)machine->driver_data;
13391339
1340   state->maincpu = devtag_get_device(machine, "maincpu");
1341   state->audiocpu = devtag_get_device(machine, "audiocpu");
1342   state->mcu = devtag_get_device(machine, "mcu");
1343   state->cassette = devtag_get_device(machine, "cassette");
1340   state->maincpu = machine->device("maincpu");
1341   state->audiocpu = machine->device("audiocpu");
1342   state->mcu = machine->device("mcu");
1343   state->cassette = machine->device("cassette");
13441344}
13451345
13461346static void decocass_reset_common( running_machine *machine )
src/mame/machine/konppc.c
r8581r8582
142142{
143143   const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2";
144144   const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2";
145   running_device *dsp = devtag_get_device(space->machine, dsptag);
146   running_device *k033906 = devtag_get_device(space->machine, pcitag);
145   running_device *dsp = space->machine->device(dsptag);
146   running_device *k033906 = space->machine->device(pcitag);
147147//  mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, cpu_get_pc(space->cpu));
148148
149149   if (cgboard_id < MAX_CG_BOARDS)
r8581r8582
225225      case CGBOARD_TYPE_GTICLUB:
226226      {
227227         //cputag_set_input_line(machine, "dsp", SHARC_INPUT_FLAG0, ASSERT_LINE);
228         sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 0, ASSERT_LINE);
228         sharc_set_flag_input(space->machine->device("dsp"), 0, ASSERT_LINE);
229229
230230         if (offset == 1)
231231         {
r8581r8582
239239      case CGBOARD_TYPE_HANGPLT:
240240      {
241241         const char *dsptag = (board == 0) ? "dsp" : "dsp2";
242         running_device *device = devtag_get_device(space->machine, dsptag);
242         running_device *device = space->machine->device(dsptag);
243243
244244         if (offset == 1)
245245         {
r8581r8582
354354static UINT32 nwk_fifo_r(const address_space *space, int board)
355355{
356356   const char *dsptag = (board == 0) ? "dsp" : "dsp2";
357   running_device *device = devtag_get_device(space->machine, dsptag);
357   running_device *device = space->machine->device(dsptag);
358358   UINT32 data;
359359
360360   if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r)
r8581r8582
385385static void nwk_fifo_w(running_machine *machine, int board, UINT32 data)
386386{
387387   const char *dsptag = (board == 0) ? "dsp" : "dsp2";
388   running_device *device = devtag_get_device(machine, dsptag);
388   running_device *device = machine->device(dsptag);
389389
390390   if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w)
391391   {
r8581r8582
409409
410410READ32_HANDLER( K033906_0_r )
411411{
412   running_device *k033906_1 = devtag_get_device(space->machine, "k033906_1");
412   running_device *k033906_1 = space->machine->device("k033906_1");
413413   if (nwk_device_sel[0] & 0x01)
414414      return nwk_fifo_r(space, 0);
415415   else
r8581r8582
418418
419419WRITE32_HANDLER( K033906_0_w )
420420{
421   running_device *k033906_1 = devtag_get_device(space->machine, "k033906_1");
421   running_device *k033906_1 = space->machine->device("k033906_1");
422422   k033906_w(k033906_1, offset, data, mem_mask);
423423}
424424
425425READ32_HANDLER( K033906_1_r )
426426{
427   running_device *k033906_2 = devtag_get_device(space->machine, "k033906_2");
427   running_device *k033906_2 = space->machine->device("k033906_2");
428428   if (nwk_device_sel[1] & 0x01)
429429      return nwk_fifo_r(space, 1);
430430   else
r8581r8582
433433
434434WRITE32_HANDLER(K033906_1_w)
435435{
436   running_device *k033906_2 = devtag_get_device(space->machine, "k033906_2");
436   running_device *k033906_2 = space->machine->device("k033906_2");
437437   k033906_w(k033906_2, offset, data, mem_mask);
438438}
439439
src/mame/machine/leland.c
r8581r8582
376376
377377   /* reset globals */
378378   leland_gfx_control = 0x00;
379   leland_sound_port_w(devtag_get_device(machine, "ay8910.1"), 0, 0xff);
379   leland_sound_port_w(machine->device("ay8910.1"), 0, 0xff);
380380   wcol_enable = 0;
381381
382382   dangerz_x = 512;
r8581r8582
11431143
11441144      case 0x01:   /* /GIN1 */
11451145         result = input_port_read(space->machine, "IN1");
1146         if (cpu_get_reg(devtag_get_device(space->machine, "slave"), Z80_HALT))
1146         if (cpu_get_reg(space->machine->device("slave"), Z80_HALT))
11471147            result ^= 0x01;
11481148         break;
11491149
r8581r8582
11541154
11551155      case 0x03:   /* /IGID */
11561156      case 0x13:
1157         result = ay8910_r(devtag_get_device(space->machine, "ay8910.1"), offset);
1157         result = ay8910_r(space->machine->device("ay8910.1"), offset);
11581158         break;
11591159
11601160      case 0x10:   /* /GIN0 */
r8581r8582
11861186         cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
11871187         cputag_set_input_line(space->machine, "slave", 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
11881188
1189         eeprom = devtag_get_device(space->machine, "eeprom");
1189         eeprom = space->machine->device("eeprom");
11901190         if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", cpu_get_pc(space->cpu),
11911191               (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
11921192         eeprom_write_bit     (eeprom, (data & 0x10) >> 4);
r8581r8582
11961196
11971197      case 0x0a:   /* /OGIA */
11981198      case 0x0b:   /* /OGID */
1199         ay8910_address_data_w(devtag_get_device(space->machine, "ay8910.1"), offset, data);
1199         ay8910_address_data_w(space->machine->device("ay8910.1"), offset, data);
12001200         break;
12011201
12021202      case 0x0c:   /* /BKXL */
r8581r8582
12251225
12261226      case 0x07:   /* /SLVBLK */
12271227         result = input_port_read(space->machine, "IN1");
1228         if (cpu_get_reg(devtag_get_device(space->machine, "slave"), Z80_HALT))
1228         if (cpu_get_reg(space->machine->device("slave"), Z80_HALT))
12291229            result ^= 0x01;
12301230         break;
12311231
src/mame/machine/namco06.c
r8581r8582
231231   assert(state->nmicpu != NULL);
232232
233233   /* resolve our devices */
234   state->device[0] = (config->chip0 != NULL) ? devtag_get_device(device->machine, config->chip0) : NULL;
234   state->device[0] = (config->chip0 != NULL) ? device->machine->device(config->chip0) : NULL;
235235   assert(state->device[0] != NULL || config->chip0 == NULL);
236   state->device[1] = (config->chip1 != NULL) ? devtag_get_device(device->machine, config->chip1) : NULL;
236   state->device[1] = (config->chip1 != NULL) ? device->machine->device(config->chip1) : NULL;
237237   assert(state->device[1] != NULL || config->chip1 == NULL);
238   state->device[2] = (config->chip2 != NULL) ? devtag_get_device(device->machine, config->chip2) : NULL;
238   state->device[2] = (config->chip2 != NULL) ? device->machine->device(config->chip2) : NULL;
239239   assert(state->device[2] != NULL || config->chip2 == NULL);
240   state->device[3] = (config->chip3 != NULL) ? devtag_get_device(device->machine, config->chip3) : NULL;
240   state->device[3] = (config->chip3 != NULL) ? device->machine->device(config->chip3) : NULL;
241241   assert(state->device[3] != NULL || config->chip3 == NULL);
242242
243243   /* loop over devices and set their read/write handlers */
src/mame/machine/midwayic.c
r8581r8582
600600   ioasic_register_state(machine);
601601
602602   /* do we have a DCS2 sound chip connected? (most likely) */
603   ioasic.has_dcs = (devtag_get_device(machine, "dcs2") != NULL || devtag_get_device(machine, "dsio") != NULL || devtag_get_device(machine, "denver") != NULL);
604   ioasic.has_cage = (devtag_get_device(machine, "cage") != NULL);
605   ioasic.dcs_cpu = devtag_get_device(machine, "dcs2");
603   ioasic.has_dcs = (machine->device("dcs2") != NULL || machine->device("dsio") != NULL || machine->device("denver") != NULL);
604   ioasic.has_cage = (machine->device("cage") != NULL);
605   ioasic.dcs_cpu = machine->device("dcs2");
606606   if (ioasic.dcs_cpu == NULL)
607      ioasic.dcs_cpu = devtag_get_device(machine, "dsio");
607      ioasic.dcs_cpu = machine->device("dsio");
608608   if (ioasic.dcs_cpu == NULL)
609      ioasic.dcs_cpu = devtag_get_device(machine, "denver");
609      ioasic.dcs_cpu = machine->device("denver");
610610   ioasic.shuffle_type = shuffle;
611611   ioasic.shuffle_map = &shuffle_maps[shuffle][0];
612612   ioasic.auto_ack = 0;
src/mame/machine/stvcd.c
r8581r8582
258258   }
259259
260260   #ifdef MESS
261   cdrom = mess_cd_get_cdrom_file(devtag_get_device( machine, "cdrom" ));
261   cdrom = mess_cd_get_cdrom_file(machine->device( "cdrom" ));
262262   #else
263263   cdrom = cdrom_open(get_disk_handle(machine, "cdrom"));
264264   #endif
src/mame/machine/dc.c
r8581r8582
409409   }
410410
411411   level=dc_compute_interrupt_level(machine);
412   sh4_set_irln_input(devtag_get_device(machine, "maincpu"), 15-level);
412   sh4_set_irln_input(machine->device("maincpu"), 15-level);
413413
414414   /* Wave DMA HW trigger */
415415   if(wave_dma.flag && ((wave_dma.sel & 2) == 2))
r8581r8582
663663            ddtdata.direction=0;
664664            ddtdata.channel=2;
665665            ddtdata.mode=25; //011001
666            sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata);
666            sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
667667            #if DEBUG_SYSCTRL
668668            if ((address >= 0x11000000) && (address <= 0x11FFFFFF))
669669               if (dc_sysctrl_regs[SB_LMMODE0])
r8581r8582
793793               ddtdata.direction=0;   // 0 source to buffer, 1 buffer to source
794794               ddtdata.channel= -1;   // not used
795795               ddtdata.mode= -1;      // copy from/to buffer
796               sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"), &ddtdata);
796               sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata);
797797
798798               endflag=buff[0] & 0x80000000;
799799               port=(buff[0] >> 16) & 3;
r8581r8582
832832                        ddtdata.direction=0;
833833                        ddtdata.channel= -1;
834834                        ddtdata.mode=-1;
835                        sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata);
835                        sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
836836                        chk=0;
837837                        for (a=1;a < length;a++)
838838                        {
r8581r8582
858858                        ddtdata.direction=0;
859859                        ddtdata.channel= -1;
860860                        ddtdata.mode=-1;
861                        sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata);
861                        sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
862862
863863                        subcommand = buff[0] & 0xff;
864864                        #if DEBUG_MAPLE
r8581r8582
10621062               ddtdata.destination=destination;
10631063               ddtdata.buffer=buff;
10641064               ddtdata.direction=1;
1065               sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata);
1065               sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
10661066
10671067               if (endflag)
10681068               {
r8581r8582
11391139               ddtdata.direction=0;   // 0 source to buffer, 1 buffer to source
11401140               ddtdata.channel= -1;   // not used
11411141               ddtdata.mode= -1;      // copy from/to buffer
1142               sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"), &ddtdata);
1142               sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata);
11431143
11441144               endflag=buff[0] & 0x80000000;
11451145               port=(buff[0] >> 16) & 3;
r8581r8582
12111211               ddtdata.destination=destination;
12121212               ddtdata.buffer=buff;
12131213               ddtdata.direction=1;
1214               sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata);
1214               sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
12151215
12161216               if (endflag)
12171217               {
r8581r8582
13301330         ddtdata.channel= -1;   // not used
13311331         ddtdata.mode= -1;      // copy from/to buffer
13321332         mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dmaoffset, g1bus_regs[SB_GDSTAR]);
1333         sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"), &ddtdata);
1333         sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata);
13341334         /* Note: KOF Neowave definitely wants this to be delayed (!) */
13351335         /* FIXME: timing of this */
13361336         timer_set(space->machine, ATTOTIME_IN_USEC(500), NULL, 0, gdrom_dma_irq);
src/mame/machine/scramble.c
r8581r8582
2020{
2121   MACHINE_RESET_CALL(galaxold);
2222
23   if (devtag_get_device(machine, "audiocpu") != NULL)
23   if (machine->device("audiocpu") != NULL)
2424      scramble_sh_init(machine);
2525
2626  security_2B_counter = 0;
r8581r8582
6060
6161static READ8_DEVICE_HANDLER( scramble_protection_r )
6262{
63   switch (cpu_get_pc(devtag_get_device(device->machine, "maincpu")))
63   switch (cpu_get_pc(device->machine->device("maincpu")))
6464   {
6565   case 0x00a8: return 0xf0;
6666   case 0x00be: return 0xb0;
r8581r8582
120120   cavelon_banksw(space->machine);
121121
122122   if      ((offset >= 0x0100) && (offset <= 0x0103))
123      return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset - 0x0100);
123      return ppi8255_r(space->machine->device("ppi8255_0"), offset - 0x0100);
124124   else if ((offset >= 0x0200) && (offset <= 0x0203))
125      return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset - 0x0200);
125      return ppi8255_r(space->machine->device("ppi8255_1"), offset - 0x0200);
126126
127127   return 0xff;
128128}
r8581r8582
132132   cavelon_banksw(space->machine);
133133
134134   if      ((offset >= 0x0100) && (offset <= 0x0103))
135      ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), offset - 0x0100, data);
135      ppi8255_w(space->machine->device("ppi8255_0"), offset - 0x0100, data);
136136   else if ((offset >= 0x0200) && (offset <= 0x0203))
137      ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset - 0x0200, data);
137      ppi8255_w(space->machine->device("ppi8255_1"), offset - 0x0200, data);
138138}
139139
140140
src/mame/machine/gaplus.c
r8581r8582
2121
2222WRITE8_HANDLER( gaplus_customio_3_w )
2323{
24   running_device *samples = devtag_get_device(space->machine, "samples");
24   running_device *samples = space->machine->device("samples");
2525   if ((offset == 0x09) && (data >= 0x0f))
2626      sample_start(samples,0,0,0);
2727
src/mame/machine/carpolo.c
r8581r8582
497497MACHINE_START( carpolo )
498498{
499499   /* find flip-flops */
500   ttl7474_2s_1 = devtag_get_device(machine, "7474_2s_1");
501   ttl7474_2s_2 = devtag_get_device(machine, "7474_2s_2");
502   ttl7474_2u_1 = devtag_get_device(machine, "7474_2u_1");
503   ttl7474_2u_2 = devtag_get_device(machine, "7474_2u_2");
504   ttl7474_1f_1 = devtag_get_device(machine, "7474_1f_1");
505   ttl7474_1f_2 = devtag_get_device(machine, "7474_1f_2");
506   ttl7474_1d_1 = devtag_get_device(machine, "7474_1d_1");
507   ttl7474_1d_2 = devtag_get_device(machine, "7474_1d_2");
508   ttl7474_1c_1 = devtag_get_device(machine, "7474_1c_1");
509   ttl7474_1c_2 = devtag_get_device(machine, "7474_1c_2");
510   ttl7474_1a_1 = devtag_get_device(machine, "7474_1a_1");
511   ttl7474_1a_2 = devtag_get_device(machine, "7474_1a_2");
500   ttl7474_2s_1 = machine->device("7474_2s_1");
501   ttl7474_2s_2 = machine->device("7474_2s_2");
502   ttl7474_2u_1 = machine->device("7474_2u_1");
503   ttl7474_2u_2 = machine->device("7474_2u_2");
504   ttl7474_1f_1 = machine->device("7474_1f_1");
505   ttl7474_1f_2 = machine->device("7474_1f_2");
506   ttl7474_1d_1 = machine->device("7474_1d_1");
507   ttl7474_1d_2 = machine->device("7474_1d_2");
508   ttl7474_1c_1 = machine->device("7474_1c_1");
509   ttl7474_1c_2 = machine->device("7474_1c_2");
510   ttl7474_1a_1 = machine->device("7474_1a_1");
511   ttl7474_1a_2 = machine->device("7474_1a_2");
512512
513   ttl74148_3s = devtag_get_device(machine, "74148_3s");
514   ttl74153_1k = devtag_get_device(machine, "74153_1k");
513   ttl74148_3s = machine->device("74148_3s");
514   ttl74153_1k = machine->device("74153_1k");
515515
516516    state_save_register_global(machine, ball_screen_collision_cause);
517517    state_save_register_global(machine, car_ball_collision_x);
src/mame/machine/namcos1.c
r8581r8582
619619      offset &= 0x3ff;
620620
621621      /* CUS 30 */
622      return namcos1_cus30_r(devtag_get_device(space->machine, "namco"),offset);
622      return namcos1_cus30_r(space->machine->device("namco"),offset);
623623   }
624624   else
625625   {
r8581r8582
637637      offset &= 0x3ff;
638638
639639      /* CUS 30 */
640      namcos1_cus30_w(devtag_get_device(space->machine, "namco"),offset,data);
640      namcos1_cus30_w(space->machine->device("namco"),offset,data);
641641   }
642642   else
643643   {
r8581r8582
745745{
746746//  logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag(), offset, data);
747747
748   namcos1_bankswitch(space->machine, (space->cpu == devtag_get_device(space->machine, "maincpu")) ? 0 : 1, offset, data);
748   namcos1_bankswitch(space->machine, (space->cpu == space->machine->device("maincpu")) ? 0 : 1, offset, data);
749749}
750750
751751/* Sub cpu set start bank port */
src/mame/machine/n64.c
r8581r8582
20062006
20072007MACHINE_START( n64 )
20082008{
2009   mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
2009   mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
20102010
20112011   /* configure fast RAM regions for DRC */
2012   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x007fffff, FALSE, rdram);
2012   mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, rdram);
20132013
2014   rspdrc_set_options(devtag_get_device(machine, "rsp"), 0);
2015   rspdrc_add_imem(devtag_get_device(machine, "rsp"), rsp_imem);
2016   rspdrc_add_dmem(devtag_get_device(machine, "rsp"), rsp_dmem);
2017   rspdrc_flush_drc_cache(devtag_get_device(machine, "rsp"));
2014   rspdrc_set_options(machine->device("rsp"), 0);
2015   rspdrc_add_imem(machine->device("rsp"), rsp_imem);
2016   rspdrc_add_dmem(machine->device("rsp"), rsp_dmem);
2017   rspdrc_flush_drc_cache(machine->device("rsp"));
20182018
20192019   audio_timer = timer_alloc(machine, audio_timer_callback, NULL);
20202020}
src/mame/machine/deco102.c
r8581r8582
5959   memcpy(buf, rom, size);
6060
6161   memory_set_decrypted_region(space, 0, size - 1, opcodes);
62   m68k_set_encrypted_opcode_range(devtag_get_device(machine, cputag), 0, size);
62   m68k_set_encrypted_opcode_range(machine->device(cputag), 0, size);
6363
6464   for (i = 0; i < size / 2; i++)
6565   {
src/mame/machine/vsnes.c
r8581r8582
201201
202202MACHINE_START( vsnes )
203203{
204   const address_space *ppu1_space = cpu_get_address_space(devtag_get_device(machine, "ppu1"), ADDRESS_SPACE_PROGRAM);
204   const address_space *ppu1_space = cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM);
205205   int i;
206206
207207   /* establish nametable ram */
r8581r8582
256256   nt_page[1][2] = nt_ram[1] + 0x800;
257257   nt_page[1][3] = nt_ram[1] + 0xc00;
258258
259   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu1"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt0_r, vsnes_nt0_w);
260   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu2"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt1_r, vsnes_nt1_w);
259   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt0_r, vsnes_nt0_w);
260   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu2"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt1_r, vsnes_nt1_w);
261261   // read only!
262   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu1"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank2");
262   memory_install_read_bank(cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank2");
263263   // read only!
264   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu2"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank3");
264   memory_install_read_bank(cpu_get_address_space(machine->device("ppu2"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank3");
265265   memory_configure_bank(machine, "bank2", 0, vrom_size[0] / 0x2000, vrom[0], 0x2000);
266266   memory_configure_bank(machine, "bank3", 0, vrom_size[1] / 0x2000, vrom[1], 0x2000);
267267   memory_set_bank(machine, "bank2", 0);
r8581r8582
362362
363363static WRITE8_HANDLER( gun_in0_w )
364364{
365   running_device *ppu1 = devtag_get_device(space->machine, "ppu1");
365   running_device *ppu1 = space->machine->device("ppu1");
366366   static int zapstore;
367367
368368   if (vsnes_do_vrom_bank)
r8581r8582
699699
700700static WRITE8_HANDLER( mapper4_w )
701701{
702   running_device *ppu1 = devtag_get_device(space->machine, "ppu1");
702   running_device *ppu1 = space->machine->device("ppu1");
703703   UINT8 MMC3_helper, cmd;
704704
705705   switch (offset & 0x6001)
r8581r8582
10191019
10201020static WRITE8_HANDLER( vsdual_vrom_banking )
10211021{
1022   running_device *other_cpu = (space->cpu == devtag_get_device(space->machine, "maincpu")) ? devtag_get_device(space->machine, "sub") : devtag_get_device(space->machine, "maincpu");
1022   running_device *other_cpu = (space->cpu == space->machine->device("maincpu")) ? space->machine->device("sub") : space->machine->device("maincpu");
10231023
10241024   /* switch vrom */
1025   (space->cpu == devtag_get_device(space->machine, "maincpu")) ? memory_set_bank(space->machine, "bank2", BIT(data, 2)) : memory_set_bank(space->machine, "bank3", BIT(data, 2));
1025   (space->cpu == space->machine->device("maincpu")) ? memory_set_bank(space->machine, "bank2", BIT(data, 2)) : memory_set_bank(space->machine, "bank3", BIT(data, 2));
10261026
10271027   /* bit 1 ( data & 2 ) triggers irq on the other cpu */
10281028   cpu_set_input_line(other_cpu, 0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
10291029
10301030   /* move along */
1031   if (space->cpu == devtag_get_device(space->machine, "maincpu"))
1031   if (space->cpu == space->machine->device("maincpu"))
10321032      vsnes_in0_w(space, offset, data);
10331033   else
10341034      vsnes_in0_1_w(space, offset, data);
src/mame/machine/qix.c
r8581r8582
252252
253253WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed )
254254{
255   running_device *pia = devtag_get_device(device->machine, "sndpia0");
256   pia6821_cb1_w(pia, 0, state);
255   running_device *pia = device->machine->device("sndpia0");
256   pia6821_cb1_w(pia, state);
257257}
258258
259259
r8581r8582
508508static WRITE8_DEVICE_HANDLER( slither_76489_0_w )
509509{
510510   /* write to the sound chip */
511   sn76496_w(devtag_get_device(device->machine, "sn1"), 0, data);
511   sn76496_w(device->machine->device("sn1"), 0, data);
512512
513513   /* clock the ready line going back into CB1 */
514   pia6821_cb1_w(device, 0, 0);
515   pia6821_cb1_w(device, 0, 1);
514   pia6821_cb1_w(device, 0);
515   pia6821_cb1_w(device, 1);
516516}
517517
518518
519519static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
520520{
521521   /* write to the sound chip */
522   sn76496_w(devtag_get_device(device->machine, "sn2"), 0, data);
522   sn76496_w(device->machine->device("sn2"), 0, data);
523523
524524   /* clock the ready line going back into CB1 */
525   pia6821_cb1_w(device, 0, 0);
526   pia6821_cb1_w(device, 0, 1);
525   pia6821_cb1_w(device, 0);
526   pia6821_cb1_w(device, 1);
527527}
528528
529529
src/mame/machine/snes.c
r8581r8582
727727      case MEMSEL:   /* Access cycle designation in memory (2) area */
728728         /* FIXME: Need to adjust the speed only during access of banks 0x80+
729729             * Currently we are just increasing it no matter what */
730//          cpu_set_clockscale(state->maincpu, (data & 0x1) ? 1.335820896 : 1.0 );
730//          state->maincpu->set_clock_scale((data & 0x1) ? 1.335820896 : 1.0 );
731731#ifdef SNES_DBG_REG_W
732732         if ((data & 0x1) != (snes_ram[MEMSEL] & 0x1))
733733            mame_printf_debug( "CPU speed: %f Mhz\n", (data & 0x1) ? 3.58 : 2.68 );
r8581r8582
16791679
16801680static DIRECT_UPDATE_HANDLER( spc_direct )
16811681{
1682   direct->raw = direct->decrypted = spc_get_ram(devtag_get_device(space->machine, "spc700"));
1682   direct->raw = direct->decrypted = spc_get_ram(space->machine->device("spc700"));
16831683   return ~0;
16841684}
16851685
src/mame/machine/taitosj.c
r8581r8582
5353   zaccept = 1;
5454   zready = 0;
5555   busreq = 0;
56   if (devtag_get_device(machine, "mcu") != NULL)
56   if (machine->device("mcu") != NULL)
5757      cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
5858
5959   spacecr_prot_value = 0;
src/mame/machine/amiga.c
r8581r8582
318318MACHINE_RESET( amiga )
319319{
320320   /* set m68k reset  function */
321   m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), amiga_m68k_reset);
321   m68k_set_reset_callback(machine->device("maincpu"), amiga_m68k_reset);
322322
323   amiga_m68k_reset(devtag_get_device(machine, "maincpu"));
323   amiga_m68k_reset(machine->device("maincpu"));
324324
325325   /* call the system-specific callback */
326326   if (amiga_intf->reset_callback)
r8581r8582
341341static TIMER_CALLBACK( scanline_callback )
342342{
343343   int scanline = param;
344   running_device *cia_0 = devtag_get_device(machine, "cia_0");
345   running_device *cia_1 = devtag_get_device(machine, "cia_1");
344   running_device *cia_0 = machine->device("cia_0");
345   running_device *cia_1 = machine->device("cia_1");
346346
347347   /* on the first scanline, we do some extra bookkeeping */
348348   if (scanline == 0)
r8581r8582
10461046   /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
10471047   if ((offset & 0x0800) == 0)
10481048   {
1049      cia = devtag_get_device(space->machine, "cia_1");
1049      cia = space->machine->device("cia_1");
10501050      shift = 8;
10511051   }
10521052
10531053   /* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
10541054   else
10551055   {
1056      cia = devtag_get_device(space->machine, "cia_0");
1056      cia = space->machine->device("cia_0");
10571057      shift = 0;
10581058   }
10591059
r8581r8582
10861086   {
10871087      if (!ACCESSING_BITS_8_15)
10881088         return;
1089      cia = devtag_get_device(space->machine, "cia_1");
1089      cia = space->machine->device("cia_1");
10901090      data >>= 8;
10911091   }
10921092
r8581r8582
10951095   {
10961096      if (!ACCESSING_BITS_0_7)
10971097         return;
1098      cia = devtag_get_device(space->machine, "cia_0");
1098      cia = space->machine->device("cia_0");
10991099      data &= 0xff;
11001100   }
11011101
r8581r8582
14441444            CUSTOM_REG(REG_SERDATR) &= ~0x8000;
14451445
14461446         data = (data & 0x8000) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff));
1447         cia_0 = devtag_get_device(space->machine, "cia_0");
1448         cia_1 = devtag_get_device(space->machine, "cia_1");
1447         cia_0 = space->machine->device("cia_0");
1448         cia_1 = space->machine->device("cia_1");
14491449         if ( mos6526_irq_r( cia_0 ) ) data |= INTENA_PORTS;
14501450         if ( mos6526_irq_r( cia_1 ) ) data |= INTENA_EXTER;
14511451         CUSTOM_REG(offset) = data;
src/mame/machine/vertigo.c
r8581r8582
220220{
221221   int i;
222222
223   ttl74148 = devtag_get_device(machine, "74148");
223   ttl74148 = machine->device("74148");
224224   ttl74148_enable_input_w(ttl74148, 0);
225225
226226   for (i = 0; i < 8; i++)
src/mame/machine/atarigen.c
r8581r8582
295295   emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer;
296296
297297   /* generate the interrupt */
298   atarigen_scanline_int_gen(devtag_get_device(machine, "maincpu"));
298   atarigen_scanline_int_gen(machine->device("maincpu"));
299299
300300   /* set a new timer to go off at the same scan line next frame */
301301   timer_adjust_oneshot(timer, screen.frame_period(), 0);
r8581r8582
859859   /* set up the states and signal the sound interrupt to the main CPU */
860860   state->sound_to_cpu = param;
861861   state->sound_to_cpu_ready = 1;
862   atarigen_sound_int_gen(devtag_get_device(machine, "maincpu"));
862   atarigen_sound_int_gen(machine->device("maincpu"));
863863}
864864
865865
r8581r8582
14081408
14091409void atarigen_halt_until_hblank_0(screen_device &screen)
14101410{
1411   running_device *cpu = devtag_get_device(screen.machine, "maincpu");
1411   running_device *cpu = screen.machine->device("maincpu");
14121412
14131413   /* halt the CPU until the next HBLANK */
14141414   int hpos = screen.hpos();
src/mame/machine/namcos2.c
r8581r8582
494494   UINT16 *pC148RegAlt = NULL;
495495   UINT16 result = 0;
496496
497   if (space->cpu == devtag_get_device(space->machine, "maincpu"))
497   if (space->cpu == space->machine->device("maincpu"))
498498   {
499499      pC148Reg = namcos2_68k_master_C148;
500      altcpu = devtag_get_device(space->machine, "slave");
500      altcpu = space->machine->device("slave");
501501      pC148RegAlt = namcos2_68k_slave_C148;
502502   }
503   else if (space->cpu == devtag_get_device(space->machine, "slave"))
503   else if (space->cpu == space->machine->device("slave"))
504504   {
505505      pC148Reg = namcos2_68k_slave_C148;
506      altcpu = devtag_get_device(space->machine, "maincpu");
506      altcpu = space->machine->device("maincpu");
507507      pC148RegAlt = namcos2_68k_master_C148;
508508   }
509   else if (space->cpu == devtag_get_device(space->machine, "gpu"))
509   else if (space->cpu == space->machine->device("gpu"))
510510   {
511511      pC148Reg = namcos2_68k_gpu_C148;
512      altcpu = devtag_get_device(space->machine, "maincpu");
512      altcpu = space->machine->device("maincpu");
513513      pC148RegAlt = namcos2_68k_master_C148;
514514   }
515515
r8581r8582
584584      break;
585585
586586   case 0x1e2000: /* Sound CPU Reset control */
587      if (space->cpu == devtag_get_device(space->machine, "maincpu")) /* ? */
587      if (space->cpu == space->machine->device("maincpu")) /* ? */
588588      {
589589         if (data & 0x01)
590590         {
r8581r8582
609609      break;
610610
611611   case 0x1e4000: /* Alt 68000 & IO CPU Reset */
612      if (space->cpu == devtag_get_device(space->machine, "maincpu")) /* ? */
612      if (space->cpu == space->machine->device("maincpu")) /* ? */
613613      {
614614         if (data & 0x01)
615615         { /* Resume execution */
r8581r8582
787787      /* If the interrupt enable bit is set trigger an A/D IRQ */
788788      if(data & 0x20)
789789      {
790         generic_pulse_irq_line(devtag_get_device(space->machine, "mcu"), HD63705_INT_ADCONV);
790         generic_pulse_irq_line(space->machine->device("mcu"), HD63705_INT_ADCONV);
791791      }
792792   }
793793}
src/mame/machine/naomibd.c
r8581r8582
917917 *
918918 *************************************/
919919
920#define FILENAME_LENGTH 16
920#define FILENAME_LENGTH 24
921921
922922static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
923923{
r8581r8582
17901790         break;
17911791
17921792      case DIMM_BOARD:
1793         v->memory = (UINT8 *)memory_region(device->machine, config->regiontag);
1793         v->memory = (UINT8 *)auto_alloc_array_clear(device->machine, UINT8, 0x40000000); // 0x40000000 is needed for some Chihiro sets, Naomi should be less, we should pass as device param
17941794         v->gdromchd = get_disk_handle(device->machine, config->gdromregiontag);
17951795         v->picdata = (UINT8 *)memory_region(device->machine, config->picregiontag);
17961796         if (v->memory != NULL && v->gdromchd != NULL && v->picdata != NULL)
src/mame/machine/tx1.c
r8581r8582
402402   }
403403
404404   math.dbgaddr = math.promaddr;
405   math.dbgpc = cpu_get_previouspc(devtag_get_device(machine, "math_cpu"));
405   math.dbgpc = cpu_get_previouspc(machine->device("math_cpu"));
406406}
407407
408408
src/mame/machine/decoprot.c
r8581r8582
13111311
13121312//  case 0x582: return input_port_read(space->machine, "IN0"); /* IN0 */
13131313//  case 0x672: return input_port_read(space->machine, "IN1"); /* IN1 */
1314//  case 0x04c: return eeprom_read_bit(devtag_get_device(space->machine, "eeprom"));
1314//  case 0x04c: return eeprom_read_bit(space->machine->device("eeprom"));
13151315
13161316   case 0x468:
13171317      val=DECO_PORT(0x570);
r8581r8582
16601660   {
16611661   case 0x582: return (input_port_read(space->machine, "IN0")<<16) | 0xffff; /* IN0 */
16621662   case 0x672: return (input_port_read(space->machine, "IN1")<<16) | 0xffff; /* IN1 */
1663   case 0x04c: return (eeprom_read_bit(devtag_get_device(space->machine, "eeprom"))<<16) | 0xffff;
1663   case 0x04c: return (eeprom_read_bit(space->machine->device("eeprom"))<<16) | 0xffff;
16641664   }
16651665
16661666   /* Handle 'one shots' - writing data to an address, then immediately reading it back */
src/mame/machine/mcr.c
r8581r8582
420420
421421INTERRUPT_GEN( mcr_interrupt )
422422{
423   running_device *ctc = devtag_get_device(device->machine, "ctc");
423   running_device *ctc = device->machine->device("ctc");
424424
425425   /* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */
426426   /* for the 30Hz interlaced display */
r8581r8582
439439
440440INTERRUPT_GEN( mcr_ipu_interrupt )
441441{
442   running_device *ctc = devtag_get_device(device->machine, "ipu_ctc");
442   running_device *ctc = device->machine->device("ipu_ctc");
443443
444444   /* CTC line 3 is connected to 493, which is signalled once every */
445445   /* frame at 30Hz */
r8581r8582
606606
607607static TIMER_CALLBACK( zwackery_493_off_callback )
608608{
609   running_device *pia = devtag_get_device(machine, "pia0");
610   pia6821_ca1_w(pia, 0, 0);
609   running_device *pia = machine->device("pia0");
610   pia6821_ca1_w(pia, 0);
611611}
612612
613613
614614static TIMER_CALLBACK( zwackery_493_callback )
615615{
616   running_device *pia = devtag_get_device(machine, "pia0");
616   running_device *pia = machine->device("pia0");
617617
618   pia6821_ca1_w(pia, 0, 1);
618   pia6821_ca1_w(pia, 1);
619619   timer_set(machine, machine->primary_screen->scan_period(), NULL, 0, zwackery_493_off_callback);
620620}
621621
src/mame/machine/s24fd.c
r8581r8582
4343
4444   fd1094_state = state;
4545
46   cpu_set_reg(devtag_get_device(machine, "sub"), M68K_PREF_ADDR, 0x0010);   // force a flush of the prefetch cache
46   cpu_set_reg(machine->device("sub"), M68K_PREF_ADDR, 0x0010);   // force a flush of the prefetch cache
4747
4848   /* set the s24_fd1094 state ready to decrypt.. */
4949   state = fd1094_set_state(s24_fd1094_key,state) & 0xff;
r8581r8582
5656         /* copy cached state */
5757         s24_fd1094_userregion = s24_fd1094_cacheregion[i];
5858         memory_set_decrypted_region(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
59         m68k_set_encrypted_opcode_range(devtag_get_device(machine, "sub"), 0, s24_fd1094_cpuregionsize);
59         m68k_set_encrypted_opcode_range(machine->device("sub"), 0, s24_fd1094_cpuregionsize);
6060
6161         return;
6262      }
r8581r8582
7777   /* copy newly decrypted data to user region */
7878   s24_fd1094_userregion = s24_fd1094_cacheregion[fd1094_current_cacheposition];
7979   memory_set_decrypted_region(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
80   m68k_set_encrypted_opcode_range(devtag_get_device(machine, "sub"), 0, s24_fd1094_cpuregionsize);
80   m68k_set_encrypted_opcode_range(machine->device("sub"), 0, s24_fd1094_cpuregionsize);
8181
8282   fd1094_current_cacheposition++;
8383
r8581r8582
130130   s24_fd1094_setstate_and_decrypt(machine, FD1094_STATE_RESET);
131131   s24_fd1094_kludge_reset_values();
132132
133   m68k_set_cmpild_callback(devtag_get_device(machine, "sub"), s24_fd1094_cmp_callback);
134   m68k_set_rte_callback(devtag_get_device(machine, "sub"), s24_fd1094_rte_callback);
135   cpu_set_irq_callback(devtag_get_device(machine, "sub"), s24_fd1094_int_callback);
133   m68k_set_cmpild_callback(machine->device("sub"), s24_fd1094_cmp_callback);
134   m68k_set_rte_callback(machine->device("sub"), s24_fd1094_rte_callback);
135   cpu_set_irq_callback(machine->device("sub"), s24_fd1094_int_callback);
136136
137137   machine->device("sub")->reset();
138138}
src/mame/machine/archimds.c
r8581r8582
317317READ32_HANDLER(archimedes_ioc_r)
318318{
319319   #ifdef MESS
320   running_device *fdc = (running_device *)devtag_get_device(space->machine, "wd1772");
320   running_device *fdc = (running_device *)space->machine->device("wd1772");
321321   #endif
322322   if (offset >= 0x80000 && offset < 0xc0000)
323323   {
r8581r8582
367367WRITE32_HANDLER(archimedes_ioc_w)
368368{
369369   #ifdef MESS
370   running_device *fdc = (running_device *)devtag_get_device(space->machine, "wd1772");
370   running_device *fdc = (running_device *)space->machine->device("wd1772");
371371   #endif
372372
373373   if (offset >= 0x80000 && offset < 0xc0000)
r8581r8582
597597            else
598598            {
599599               timer_adjust_oneshot(snd_timer, attotime_never, 0);
600               dac_signed_data_w(devtag_get_device(space->machine, "dac"), 0x80);
600               dac_signed_data_w(space->machine->device("dac"), 0x80);
601601            }
602602            break;
603603
src/mame/machine/galaxold.c
r8581r8582
4545
4646WRITE8_HANDLER( galaxold_nmi_enable_w )
4747{
48    running_device *target = devtag_get_device(space->machine, "7474_9m_1");
48    running_device *target = space->machine->device("7474_9m_1");
4949   ttl7474_preset_w(target, data ? 1 : 0);
5050}
5151
5252
5353TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer )
5454{
55    running_device *target = devtag_get_device(timer.machine, "7474_9m_2");
55    running_device *target = timer.machine->device("7474_9m_2");
5656
5757   /* 128V, 64V and 32V go to D */
5858   ttl7474_d_w(target, ((param & 0xe0) != 0xe0) ? 1 : 0);
r8581r8582
6868
6969static void machine_reset_common(running_machine *machine, int line)
7070{
71    running_device *ttl7474_9m_1 = devtag_get_device(machine, "7474_9m_1");
72    running_device *ttl7474_9m_2 = devtag_get_device(machine, "7474_9m_2");
71    running_device *ttl7474_9m_1 = machine->device("7474_9m_1");
72    running_device *ttl7474_9m_2 = machine->device("7474_9m_2");
7373   irq_line = line;
7474
7575   /* initalize main CPU interrupt generator flip-flops */
r8581r8582
9898MACHINE_RESET( hunchbkg )
9999{
100100   machine_reset_common(machine, 0);
101   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), hunchbkg_irq_callback);
101   cpu_set_irq_callback(machine->device("maincpu"), hunchbkg_irq_callback);
102102}
103103
104104WRITE8_HANDLER( galaxold_coin_lockout_w )
src/mame/machine/slikshot.c
r8581r8582
506506
507507   /* this is a big kludge: only allow a reset if the Z80 is stopped */
508508   /* at its endpoint; otherwise, we never get a result from the Z80 */
509   if ((data & 0x10) || cpu_get_reg(devtag_get_device(machine, "sub"), Z80_PC) == 0x13a)
509   if ((data & 0x10) || cpu_get_reg(machine->device("sub"), Z80_PC) == 0x13a)
510510   {
511511      cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
512512
src/mame/machine/beezer.c
r8581r8582
108108{
109109   if ((data & 0x07) == 0)
110110   {
111      running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
111      running_device *via_0 = space->machine->device("via6522_0");
112112      memory_install_write8_handler(space, 0xc600, 0xc7ff, 0, 0, watchdog_reset_w);
113113      memory_install_write8_handler(space, 0xc800, 0xc9ff, 0, 0, beezer_map_w);
114114      memory_install_read8_handler(space, 0xca00, 0xcbff, 0, 0, beezer_line_r);
src/mame/machine/williams.c
r8581r8582
172172const pia6821_interface williams2_pia_1_intf =
173173{
174174   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
175   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w),
175   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w),
176176   /*irqs   : A/B             */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
177177};
178178
r8581r8582
180180const pia6821_interface williams2_snd_pia_intf =
181181{
182182   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
183   /*outputs: A/B,CA/B2       */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_HANDLER("pia_1", pia6821_cb1_w), DEVCB_NULL,
183   /*outputs: A/B,CA/B2       */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_LINE("pia_1", pia6821_cb1_w), DEVCB_NULL,
184184   /*irqs   : A/B             */ DEVCB_LINE(williams_snd_irq), DEVCB_LINE(williams_snd_irq)
185185};
186186
r8581r8582
204204const pia6821_interface mysticm_pia_1_intf =
205205{
206206   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
207   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w),
207   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w),
208208   /*irqs   : A/B             */ DEVCB_LINE(mysticm_main_irq), DEVCB_LINE(mysticm_main_irq)
209209};
210210
r8581r8582
220220const pia6821_interface tshoot_pia_1_intf =
221221{
222222   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
223   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w),
223   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w),
224224   /*irqs   : A/B             */ DEVCB_LINE(tshoot_main_irq), DEVCB_LINE(tshoot_main_irq)
225225};
226226
r8581r8582
228228const pia6821_interface tshoot_snd_pia_intf =
229229{
230230   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
231   /*outputs: A/B,CA/B2       */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_HANDLER("pia_1", pia6821_cb1_w), DEVCB_HANDLER(tshoot_maxvol_w),
231   /*outputs: A/B,CA/B2       */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_LINE("pia_1", pia6821_cb1_w), DEVCB_HANDLER(tshoot_maxvol_w),
232232   /*irqs   : A/B             */ DEVCB_LINE(williams_snd_irq), DEVCB_LINE(williams_snd_irq)
233233};
234234
r8581r8582
236236const pia6821_interface joust2_pia_1_intf =
237237{
238238   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
239   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(joust2_snd_cmd_w), DEVCB_HANDLER(joust2_pia_3_cb1_w), DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w),
239   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_HANDLER(joust2_snd_cmd_w), DEVCB_HANDLER(joust2_pia_3_cb1_w), DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w),
240240   /*irqs   : A/B             */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
241241};
242242
r8581r8582
254254   int scanline = param;
255255
256256   /* the IRQ signal comes into CB1, and is set to VA11 */
257   pia6821_cb1_w(pia_1, 0, scanline & 0x20);
257   pia6821_cb1_w(pia_1, scanline & 0x20);
258258
259259   /* set a timer for the next update */
260260   scanline += 0x20;
r8581r8582
268268   pia6821_device *pia_1 = machine->device<pia6821_device>("pia_1");
269269
270270   /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
271   pia6821_ca1_w(pia_1, 0, 0);
271   pia6821_ca1_w(pia_1, 0);
272272}
273273
274274
r8581r8582
277277   pia6821_device *pia_1 = timer.machine->device<pia6821_device>("pia_1");
278278
279279   /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
280   pia6821_ca1_w(pia_1, 0, 1);
280   pia6821_ca1_w(pia_1, 1);
281281
282282   /* set a timer to turn it off once the scanline counter resets */
283283   timer_set(timer.machine, timer.machine->primary_screen->time_until_pos(0), NULL, 0, williams_count240_off_callback);
r8581r8582
398398   int scanline = param;
399399
400400   /* the IRQ signal comes into CB1, and is set to VA11 */
401   pia6821_cb1_w(pia_0, 0, scanline & 0x20);
402   pia6821_ca1_w(pia_1, 0, scanline & 0x20);
401   pia6821_cb1_w(pia_0, scanline & 0x20);
402   pia6821_ca1_w(pia_1, scanline & 0x20);
403403
404404   /* set a timer for the next update */
405405   scanline += 0x20;
r8581r8582
413413   pia6821_device *pia_0 = machine->device<pia6821_device>("pia_0");
414414
415415   /* the /ENDSCREEN signal comes into CA1 */
416   pia6821_ca1_w(pia_0, 0, 1);
416   pia6821_ca1_w(pia_0, 1);
417417}
418418
419419
r8581r8582
422422   pia6821_device *pia_0 = timer.machine->device<pia6821_device>("pia_0");
423423
424424   /* the /ENDSCREEN signal comes into CA1 */
425   pia6821_ca1_w(pia_0, 0, 0);
425   pia6821_ca1_w(pia_0, 0);
426426
427427   /* set a timer to turn it off once the scanline counter resets */
428428   timer_set(timer.machine, timer.machine->primary_screen->time_until_pos(8), NULL, 0, williams2_endscreen_off_callback);
r8581r8582
540540   pia6821_device *pia_2 = machine->device<pia6821_device>("pia_2");
541541
542542   pia6821_portb_w(pia_2, 0, param);
543   pia6821_cb1_w(pia_2, 0, (param == 0xff) ? 0 : 1);
543   pia6821_cb1_w(pia_2, (param == 0xff) ? 0 : 1);
544544}
545545
546546WRITE8_DEVICE_HANDLER( williams_snd_cmd_w )
r8581r8582
957957
958958   /* standard init */
959959   MACHINE_RESET_CALL(williams2);
960   pia6821_ca1_w(pia_3, 0, 1);
960   pia6821_ca1_w(pia_3, 1);
961961}
962962
963963
r8581r8582
973973   pia6821_device *pia_3 = device->machine->device<pia6821_device>("cvsdpia");
974974
975975   joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
976   pia6821_cb1_w(pia_3, offset, data);
976   pia6821_cb1_w(pia_3, data);
977977}
978978
979979
src/mame/machine/cps2crpt.c
r8581r8582
721721   }
722722
723723   memory_set_decrypted_region(space, 0x000000, length - 1, dec);
724   m68k_set_encrypted_opcode_range(devtag_get_device(machine, "maincpu"), 0, length);
724   m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length);
725725}
726726
727727
r8581r8582
844844   { "sfzjr1",   { 0x8db3167a,0xc29e0f45 }, 0x080000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
845845   { "sfzjr2",   { 0x8db3167a,0xc29e0f45 }, 0x080000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
846846   { "sfzh",     { 0x876b0e39,0x5ca24fd1 }, 0x080000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
847   { "sfzhr1",   { 0x876b0e39,0x5ca24fd1 }, 0x080000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
847848   { "sfzb",     { 0xef415bd3,0x7a92c680 }, 0x080000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
848849   { "sfzbr1",   { 0xef415bd3,0x7a92c680 }, 0x080000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
849850   { "mmancp2u", { 0x054893fa,0x94642525 }, 0x100000 },   // 0C80 0564 2194  cmpi.l  #$05642194,D0
src/mame/machine/starwars.c
r8581r8582
113113         break;
114114
115115      case 7:      /* NVRAM array recall */
116         x2212_array_recall(devtag_get_device(space->machine, "x2212"), data >> 7);
116         x2212_array_recall(space->machine->device("x2212"), data >> 7);
117117         break;
118118   }
119119}
src/mame/machine/atarifb.c
r8581r8582
1313WRITE8_HANDLER( atarifb_out1_w )
1414{
1515   atarifb_state *state = (atarifb_state *)space->machine->driver_data;
16   running_device *discrete = devtag_get_device(space->machine, "discrete");
16   running_device *discrete = space->machine->device("discrete");
1717
1818   state->CTRLD = data;
1919
r8581r8582
2727WRITE8_HANDLER( atarifb4_out1_w )
2828{
2929   atarifb_state *state = (atarifb_state *)space->machine->driver_data;
30   running_device *discrete = devtag_get_device(space->machine, "discrete");
30   running_device *discrete = space->machine->device("discrete");
3131
3232   state->CTRLD = data;
3333
r8581r8582
4343WRITE8_HANDLER( abaseb_out1_w )
4444{
4545   atarifb_state *state = (atarifb_state *)space->machine->driver_data;
46   running_device *discrete = devtag_get_device(space->machine, "discrete");
46   running_device *discrete = space->machine->device("discrete");
4747
4848   state->CTRLD = data;
4949
r8581r8582
7070WRITE8_HANDLER( soccer_out1_w )
7171{
7272   atarifb_state *state = (atarifb_state *)space->machine->driver_data;
73   running_device *discrete = devtag_get_device(space->machine, "discrete");
73   running_device *discrete = space->machine->device("discrete");
7474
7575   state->CTRLD = data;
7676
r8581r8582
9494
9595WRITE8_HANDLER( atarifb_out2_w )
9696{
97   running_device *discrete = devtag_get_device(space->machine, "discrete");
97   running_device *discrete = space->machine->device("discrete");
9898
9999   discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
100100
r8581r8582
104104
105105WRITE8_HANDLER( soccer_out2_w )
106106{
107   running_device *discrete = devtag_get_device(space->machine, "discrete");
107   running_device *discrete = space->machine->device("discrete");
108108
109109   discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
110110
src/mame/machine/simpsons.c
r8581r8582
8686   state->xtraram = auto_alloc_array_clear(machine, UINT8, 0x1000);
8787   state->spriteram = auto_alloc_array_clear(machine, UINT16, 0x1000 / 2);
8888
89   state->maincpu = devtag_get_device(machine, "maincpu");
90   state->audiocpu = devtag_get_device(machine, "audiocpu");
91   state->k053260 = devtag_get_device(machine, "k053260");
92   state->k052109 = devtag_get_device(machine, "k052109");
93   state->k053246 = devtag_get_device(machine, "k053246");
94   state->k053251 = devtag_get_device(machine, "k053251");
89   state->maincpu = machine->device("maincpu");
90   state->audiocpu = machine->device("audiocpu");
91   state->k053260 = machine->device("k053260");
92   state->k052109 = machine->device("k052109");
93   state->k053246 = machine->device("k053246");
94   state->k053251 = machine->device("k053251");
9595
9696   state_save_register_global(machine, state->firq_enabled);
9797   state_save_register_global(machine, state->video_bank);
r8581r8582
109109   simpsons_state *state = (simpsons_state *)machine->driver_data;
110110   int i;
111111
112   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), simpsons_banking);
112   konami_configure_set_lines(machine->device("maincpu"), simpsons_banking);
113113
114114   for (i = 0; i < 3; i++)
115115   {
src/mame/machine/model1.c
r8581r8582
20352035   if (copro_fifoout_num == 0)
20362036   {
20372037      // Reading from empty FIFO causes the v60 to enter wait state
2038      v60_stall(devtag_get_device(space->machine, "maincpu"));
2038      v60_stall(space->machine->device("maincpu"));
20392039
20402040      timer_call_after_resynch(space->machine, NULL, 0, NULL);
20412041
src/mame/machine/ajax.c
r8581r8582
209209   memory_set_bank(machine, "bank1", 0);
210210   memory_set_bank(machine, "bank2", 0);
211211
212   state->maincpu = devtag_get_device(machine, "maincpu");
213   state->audiocpu = devtag_get_device(machine, "audiocpu");
214   state->subcpu = devtag_get_device(machine, "sub");
215   state->k007232_1 = devtag_get_device(machine, "k007232_1");
216   state->k007232_2 = devtag_get_device(machine, "k007232_2");
217   state->k052109 = devtag_get_device(machine, "k052109");
218   state->k051960 = devtag_get_device(machine, "k051960");
219   state->k051316 = devtag_get_device(machine, "k051316");
212   state->maincpu = machine->device("maincpu");
213   state->audiocpu = machine->device("audiocpu");
214   state->subcpu = machine->device("sub");
215   state->k007232_1 = machine->device("k007232_1");
216   state->k007232_2 = machine->device("k007232_2");
217   state->k052109 = machine->device("k052109");
218   state->k051960 = machine->device("k051960");
219   state->k051316 = machine->device("k051316");
220220
221221   state_save_register_global(machine, state->priority);
222222   state_save_register_global(machine, state->firq_enable);
src/mame/machine/mw8080bw.c
r8581r8582
100100
101101   mw8080bw_create_interrupt_timer(machine);
102102
103   state->maincpu = devtag_get_device(machine, "maincpu");
104   state->samples = devtag_get_device(machine, "samples");
105   state->samples1 = devtag_get_device(machine, "samples1");
106   state->samples2 = devtag_get_device(machine, "samples2");
107   state->sn = devtag_get_device(machine, "snsnd");
108   state->sn1 = devtag_get_device(machine, "sn1");
109   state->sn2 = devtag_get_device(machine, "sn2");
110   state->discrete = devtag_get_device(machine, "discrete");
111   state->speaker = devtag_get_device(machine, "speaker");
112   state->mb14241 = devtag_get_device(machine, "mb14241");
103   state->maincpu = machine->device("maincpu");
104   state->samples = machine->device("samples");
105   state->samples1 = machine->device("samples1");
106   state->samples2 = machine->device("samples2");
107   state->sn = machine->device("snsnd");
108   state->sn1 = machine->device("sn1");
109   state->sn2 = machine->device("sn2");
110   state->discrete = machine->device("discrete");
111   state->speaker = machine->device("speaker");
112   state->mb14241 = machine->device("mb14241");
113113}
114114
115115
src/mame/machine/nitedrvr.c
r8581r8582
284284{
285285   nitedrvr_state *state = (nitedrvr_state *)machine->driver_data;
286286
287   state->maincpu = devtag_get_device(machine, "maincpu");
288   state->discrete = devtag_get_device(machine, "discrete");
287   state->maincpu = machine->device("maincpu");
288   state->discrete = machine->device("discrete");
289289
290290   state_save_register_global(machine, state->gear);
291291   state_save_register_global(machine, state->track);
src/mame/mamedriv.c
r8581r8582
16351635   DRIVER( uccopsar )   /* (c) 1992 Irem (World) */
16361636   DRIVER( uccopsj )   /* (c) 1992 Irem (Japan) */
16371637   DRIVER( mysticri )   /* (c) 1992 Irem (World) */
1638   DRIVER( mysticrib )   /* bootleg? */
16381639   DRIVER( gunhohki )   /* (c) 1992 Irem (Japan) */
16391640   DRIVER( majtitl2 )   /* (c) 1992 Irem (World) */
16401641   DRIVER( majtitl2j )   /* (c) 1992 Irem (Japan) */
r8581r8582
18101811   DRIVER( storming )   /* A64 (c) 1986 Taito Corporation */
18111812   DRIVER( daikaiju )   /* A74 (c) 1986 Taito */
18121813   DRIVER( tokio )      /* A71 1986 */
1814   DRIVER( tokioo )   /* A71 1986 */
18131815   DRIVER( tokiou )   /* A71 1986 */
18141816   DRIVER( tokiob )   /* bootleg */
18151817   DRIVER( bublbobl )   /* A78 (c) 1986 Taito Corporation */
r8581r8582
27152717   DRIVER( kodu )      /* 10/09/1991 (c) 1991 (US)    */
27162718   DRIVER( kodj )      /* 05/08/1991 (c) 1991 (Japan) */
27172719   DRIVER( kodb )      /* bootleg */
2718   DRIVER( captcomm )   /* 14/10/1991 (c) 1991 (World) */
2720   DRIVER( captcomm )   /* 02/12/1991 (c) 1991 (World) */
2721   DRIVER( captcommr1 )   /* 14/10/1991 (c) 1991 (World) */
27192722   DRIVER( captcommu )   /* 28/ 9/1991 (c) 1991 (US)    */
27202723   DRIVER( captcommj )   /* 02/12/1991 (c) 1991 (Japan) */
27212724   DRIVER( captcommb )   /* bootleg */
r8581r8582
28792882   DRIVER( sfzj )      /* 27/07/1995 (c) 1995 (Japan) */
28802883   DRIVER( sfzjr1 )   /* 27/06/1995 (c) 1995 (Japan) */
28812884   DRIVER( sfzjr2 )   /* 05/06/1995 (c) 1995 (Japan) */
2882   DRIVER( sfzh )      /* 27/06/1995 (c) 1995 (Hispanic) */
2885   DRIVER( sfzh )      /* 18/07/1995 (c) 1995 (Hispanic) */
2886   DRIVER( sfzhr1 )   /* 27/06/1995 (c) 1995 (Hispanic) */
28832887   DRIVER( sfzb )      /* 09/11/1995 (c) 1995 (Brazil) */
28842888   DRIVER( sfzbr1 )   /* 27/07/1995 (c) 1995 (Brazil) */
28852889   DRIVER( mmancp2u )   /* 06/10/1995 (c) 1995 (Japan) */
r8581r8582
38943898   DRIVER( timescan1 )   /* (c) 1987 (FD1089B, decrypted) */
38953899   DRIVER( wb31 )      /* (c) 1988 Sega / Westone (FD1094, decrypted) */
38963900   DRIVER( wb35 )      /* (c) 1988 Sega / Westone (FD1089A, decrypted) */
3901   DRIVER( wb35a )      /* (c) 1988 Sega / Westone (FD1089A, decrypted) */
38973902   DRIVER( passsht16a )/* (c) 1988 */
38983903
38993904   /* System 16B */
r8581r8582
39053910   DRIVER( altbeastj )   /* (c) 1988 (8751) */
39063911   DRIVER( altbeast5 )   /* (c) 1988 (8751) */
39073912   DRIVER( altbeast4 )   /* (c) 1988 (MC-8123B) */
3908   DRIVER( altbeastj3 )   /* (c) 1988 (FD1094, decrypted) */
39093913   DRIVER( altbeast2 )   /* (c) 1988 (MC-8123B) */
39103914   DRIVER( altbeastj1 )   /* (c) 1988 (protected) */
3915   DRIVER( altbeastj2 )   /* (c) 1988 (protected) */
3916   DRIVER( altbeastj3 )   /* (c) 1988 (FD1094, decrypted) */
39113917   DRIVER( aurail )   /* (c) 1990 Sega / Westone */
39123918   DRIVER( aurail1 )   /* (c) 1990 Sega / Westone (FD1089B, decrypted) */
39133919   DRIVER( aurailj )   /* (C) 1990 Sega / Westone (FD1089A, decrypted) */
r8581r8582
48264832                  /* 2005.04 Virtua Striker 4 ver.A */
48274833                  /* 2005.08 Avalon no Kagi ver.2.5 Kagi Seisen */
48284834                  /* 2005.12 Mario Kart Arcade Grand Prix */
4829                  /* 2006.05 Virtua Striker 4 ver.2006 */
4835   DRIVER( vs42006 )   /* 2006.05 Virtua Striker 4 ver.2006 */
48304836                  /* 2007.03 Mario Kart Arcade Grand Prix 2 */
48314837
48324838   DRIVER( tfupdate )   /* Triforce GDROM Boot Update (GDT-0011) */
r8581r8582
48384844   DRIVER( vcop3 )      /* 2003.04 Virtua Cop 3 */
48394845   DRIVER( outr2 )      /* 2003.12 Outrun 2 */
48404846                  /* 2004.03 Sega Network Taisen Mahjong MJ 2 */
4841                  /* 2004.03 Ollie King */
4847   DRIVER( ollie )      /* 2004.03 Ollie King */
48424848                  /* 2004.04 Sega Network Taisen Mahjong MJ 2 ver.B */
48434849   DRIVER( wangmid )   /* 2004.07 Wangan Midnight Maximum Tune */
48444850   DRIVER( mj2 )      /* 2004.07 Sega Network Taisen Mahjong MJ 2 ver.C */
r8581r8582
48514857   DRIVER( ghostsqu )   /* 2004.12 Ghost Squad */
48524858                  /* 2004.12 Quest of D ver.1.10a */
48534859                  /* 2005.03 Sangokushi Taisen */
4854                  /* 2005.03 Kidou Senshi Gundam Battle Operating Simulator */
4860   DRIVER( gundamos )   /* 2005.03 Kidou Senshi Gundam Battle Operating Simulator */
48554861                  /* 2005.04 Quest of D ver.1.20 */
48564862                  /* 2005.04 Sega Network Taisen Mahjong MJ 2 ver.E */
48574863   DRIVER( wangmid2 )   /* 2005.04 Wangan Midnight Maximum Tune 2 */
r8581r8582
48664872                  /* 2005.12 Kidou Senshi Gundam 0079 Card Builder */
48674873   DRIVER( mj3 )      /* 2005.12 Sega Network Taisen Mahjong MJ 3 */
48684874                  /* 2005.12 Quest of D Gofu no Keisyousya ver.2.01 */
4869                  /* 2005.12 Sega Golf Club 2006 Next Tours */
4875   DRIVER( scg06nt )   /* 2005.12 Sega Golf Club 2006 Next Tours */
48704876                  /* 2006.02 Sangokushi Taisen Ranse no Gunrou ver.1.12 */
48714877                  /* 2006.03 Kidou Senshi Gundam 0079 Card Builder ver.1.007 */
48724878                  /* 2006.03 Quest of D Gofu no Keisyousya ver.2.02b */
r8581r8582
53195325   DRIVER( ryukendna )   /* 6215 - (c) 1989 Tecmo (Japan) */
53205326   DRIVER( mastninj )   /* bootleg */
53215327   DRIVER( wildfang )   /* (c) 1989 Tecmo */
5328   DRIVER( wildfangs )   /* (c) 1989 Tecmo */
53225329   DRIVER( tknight )   /* (c) 1989 Tecmo */
53235330   DRIVER( stratof )   /* (c) 1991 Tecmo */
53245331   DRIVER( raiga )      /* (c) 1991 Tecmo */
r8581r8582
64776484   DRIVER( 2020bba )   /* 0030 (c) 1991 SNK / Pallas */
64786485   DRIVER( 2020bbh )   /* 0030 (c) 1991 SNK / Pallas */
64796486   DRIVER( socbrawl )   /* 0031 (c) 1991 SNK */
6480   DRIVER( socbrawla )   /* 0031 (c) 1991 SNK */
6487   DRIVER( socbrawlh )   /* 0031 (c) 1991 SNK */
64816488   DRIVER( roboarmy )   /* 0032 (c) 1991 SNK */
64826489   DRIVER( fatfury1 )   /* 0033 (c) 1991 SNK */
64836490   DRIVER( fbfrenzy )   /* 0034 (c) 1992 SNK */
r8581r8582
65476554   DRIVER( tws96 )      /* 0086 (c) 1996 Tecmo */
65486555   DRIVER( samsho3 )   /* 0087 (c) 1995 SNK */
65496556   DRIVER( samsho3h )   /* 0087 (c) 1995 SNK */
6550   DRIVER( fswords )   /* Korean hack of samsho3 */
6557   DRIVER( fswords )   /* 0187 Korean hack of samsho3 */
65516558   DRIVER( stakwin )   /* 0088 (c) 1995 Saurus */
65526559   DRIVER( pulstar )   /* 0089 (c) 1995 Aicom */
65536560   DRIVER( whp )      /* 0090 (c) 1995 ADK / SNK */
r8581r8582
65586565   DRIVER( rbff1 )      /* 0095 (c) 1995 SNK */
65596566   DRIVER( rbff1a )   /* 0095 (c) 1995 SNK */
65606567   DRIVER( aof3 )      /* 0096 (c) 1996 SNK */
6561   DRIVER( aof3k )      /* Censored Korean release of aof3 */
6568   DRIVER( aof3k )      /* 0196 Censored Korean release of aof3 */
65626569   DRIVER( sonicwi3 )   /* 0097 (c) 1995 Video System Co. */
65636570                  /* 0098 Idol Mahjong - final romance 2 (CD only? not confirmed, MVS might exist) */
65646571                  /* 0099 Neo Pool Masters */
r8581r8582
66056612   DRIVER( magdrop3 )   /* 0233 (c) 1997 Data East Corporation */
66066613   DRIVER( lastblad )   /* 0234 (c) 1997 SNK */
66076614   DRIVER( lastbladh )   /* 0234 (c) 1997 SNK */
6608   DRIVER( lastsold )   /* Censored Korean release of lastblad */
6615   DRIVER( lastsold )   /* 0196 Censored Korean release of lastblad */
66096616   DRIVER( puzzldpr )   /* 0235 (c) 1997 Taito (Visco license) */
66106617   DRIVER( irrmaze )   /* 0236 (c) 1997 SNK / Saurus */
66116618   DRIVER( popbounc )   /* 0237 (c) 1997 Video System Co. */
r8581r8582
66146621   DRIVER( blazstar )   /* 0239 (c) 1998 Yumekobo */
66156622   DRIVER( rbff2 )      /* 0240 (c) 1998 SNK */
66166623   DRIVER( rbff2h )   /* 0240 (c) 1998 SNK */
6617   DRIVER( rbff2k )   /* Censored Korean release of rbff2 */
6624   DRIVER( rbff2k )   /* 0140 Censored Korean release of rbff2 */
66186625   DRIVER( mslug2 )   /* 0241 (c) 1998 SNK */
66196626   DRIVER( kof98 )      /* 0242 (c) 1998 SNK */
66206627   DRIVER( kof98k )   /* 0242 (c) 1998 SNK */
r8581r8582
66326639   DRIVER( kof99 )      /* 0251 (c) 1999 SNK */
66336640   DRIVER( kof99a )   /* 0251 (c) 1999 SNK */
66346641   DRIVER( kof99e )   /* 0251 (c) 1999 SNK */
6635   DRIVER( kof99n )   /* 0251 (c) 1999 SNK */
6642   DRIVER( kof99k )   /* 0152 (c) 1999 SNK */
66366643   DRIVER( kof99p )   /* 0251 (c) 1999 SNK */
66376644   DRIVER( ganryu )   /* 0252 (c) 1999 Visco */
66386645   DRIVER( garou )      /* 0253 (c) 1999 SNK */
r8581r8582
69937000   DRIVER( trog4 )      /* (c) 1990 Midway */
69947001   DRIVER( trog3 )      /* (c) 1990 Midway */
69957002   DRIVER( trogpa6 )   /* (c) 1990 Midway */
6996   DRIVER( trogp )      /* (c) 1990 Midway */
7003   DRIVER( trogpa4 )   /* (c) 1990 Midway */
69977004   DRIVER( smashtv )   /* (c) 1990 Williams */
69987005   DRIVER( smashtv6 )   /* (c) 1990 Williams */
69997006   DRIVER( smashtv5 )   /* (c) 1990 Williams */
r8581r8582
70227029   DRIVER( mkla4 )      /* (c) 1992 Midway */
70237030   DRIVER( mkyawdim )   /* bootleg */
70247031   DRIVER( term2 )      /* (c) 1992 Midway */
7032   DRIVER( term2la3 )   /* (c) 1992 Midway */
70257033   DRIVER( term2la2 )   /* (c) 1992 Midway */
70267034   DRIVER( term2la1 )   /* (c) 1992 Midway */
70277035   DRIVER( totcarn )   /* (c) 1992 Midway */
r8581r8582
71607168
71617169   /* Cinematronics vector games */
71627170   DRIVER( spacewar )   /* (c) 1977 */
7171   DRIVER( spaceshp )   /* (c) 1978 Cinematronics (Sega licence) */
71637172   DRIVER( barrier )   /* (c) 1979 Vectorbeam */
71647173   DRIVER( starcas )   /* (c) 1980 */
71657174   DRIVER( starcas1 )   /* (c) 1980 */
r8581r8582
73477356   DRIVER( rfjeta )   /* (c) 1998 Seibu Kaihatsu (Dream Island license) */
73487357   DRIVER( rfjetj )   /* (c) 1998 Seibu Kaihatsu */
73497358   DRIVER( rfjetus )   /* (c) 1998 Seibu Kaihatsu (Fabtek license) */
7359   DRIVER( rfjet2kc )   /* (c) 2000 Seibu Kaihatsu */
73507360
73517361   DRIVER( ejsakura )   /* (c) 1999 Seibu Kaihatsu */
73527362   DRIVER( ejsakura12 )   /* (c) 1999 Seibu Kaihatsu */
r8581r8582
97629772   DRIVER( wcat3 )
97639773   DRIVER( mtonic )   /* 198? (c) Tonic */
97649774   DRIVER( magical )   /* 198? (c) Micro Manufacturing Ltd. */
9775   DRIVER( magicala )   /* 198? (c) Micro Manufacturing Ltd. */
97659776
97669777   DRIVER( sfbonus )   /* (c) 2003 Amcoe - Skill Fruit Bonus */
97679778   DRIVER( sfbonusd1 )   /* (c) 2003 Amcoe */
r8581r8582
97749785   DRIVER( parrot3v1 )   /* (c) 2004 Amcoe */
97759786   DRIVER( parrot3o )   /* (c) 2004 Amcoe */
97769787   DRIVER( hldspin1 )   /* (c) 2000 Amcoe - Hold & Spin I */
9777   DRIVER( hldspin1dt )/* (c) 2000 Amcoe */
9778   DRIVER( hldspin1vt )/* (c) 2000 Amcoe */
9788   DRIVER( hldspin1dt )   /* (c) 2000 Amcoe */
9789   DRIVER( hldspin1vt )   /* (c) 2000 Amcoe */
97799790   DRIVER( hldspin1o )   /* (c) 2000 Amcoe */
97809791   DRIVER( hldspin2 )   /* (c) 2000 Amcoe - Hold & Spin II */
9781   DRIVER( hldspin2d1 )/* (c) 2000 Amcoe */
9782   DRIVER( hldspin2v1 )/* (c) 2000 Amcoe */
9792   DRIVER( hldspin2d1 )   /* (c) 2000 Amcoe */
9793   DRIVER( hldspin2v1 )   /* (c) 2000 Amcoe */
97839794   DRIVER( hldspin2o )   /* (c) 2000 Amcoe */
97849795   DRIVER( fcnudge )   /* (c) 2003 Amcoe - Fruit Carnival Nudge */
97859796   DRIVER( fcnudgeo )   /* (c) 2003 Amcoe */
r8581r8582
98269837   DRIVER( pirpok2v1 )   /* (c) 2003 Amcoe */
98279838   DRIVER( pirpok2o )   /* (c) 2003 Amcoe */
98289839   DRIVER( anibonus )   /* (c) 2003 Amcoe - Animal Bonus */
9829   DRIVER( anibonusv1 )/* (c) 2003 Amcoe */
9830   DRIVER( anibonusv2 )/* (c) 2003 Amcoe */
9831   DRIVER( anibonusb1 )/* (c) 2003 Amcoe */
9832   DRIVER( anibonusd1 )/* (c) 2003 Amcoe */
9833   DRIVER( anibonusb2 )/* (c) 2003 Amcoe */
9834   DRIVER( anibonusd2 )/* (c) 2003 Amcoe */
9840   DRIVER( anibonusv1 )   /* (c) 2003 Amcoe */
9841   DRIVER( anibonusv2 )   /* (c) 2003 Amcoe */
9842   DRIVER( anibonusb1 )   /* (c) 2003 Amcoe */
9843   DRIVER( anibonusd1 )   /* (c) 2003 Amcoe */
9844   DRIVER( anibonusb2 )   /* (c) 2003 Amcoe */
9845   DRIVER( anibonusd2 )   /* (c) 2003 Amcoe */
98359846   DRIVER( anibonuso )   /* (c) 2003 Amcoe */
9836   DRIVER( anibonuso2 )/* (c) 2003 Amcoe */
9837   DRIVER( anibonuso3 )/* (c) 2003 Amcoe */
9838   DRIVER( anibonusxo )/* (c) 2003 Amcoe */
9839   DRIVER( anibonusxo2 )/* (c) 2003 Amcoe */
9840   DRIVER( anibonusxo3 )/* (c) 2003 Amcoe */
9847   DRIVER( anibonuso2 )   /* (c) 2003 Amcoe */
9848   DRIVER( anibonuso3 )   /* (c) 2003 Amcoe */
9849   DRIVER( anibonusxo )   /* (c) 2003 Amcoe */
9850   DRIVER( anibonusxo2 )   /* (c) 2003 Amcoe */
9851   DRIVER( anibonusxo3 )   /* (c) 2003 Amcoe */
98419852   DRIVER( abnudge )   /* (c) 2003 Amcoe - Animal Bonus Nudge */
98429853   DRIVER( abnudgeb )   /* (c) 2003 Amcoe */
98439854   DRIVER( abnudged )   /* (c) 2003 Amcoe */
r8581r8582
98489859   DRIVER( dblchalv1 )   /* (c) 2003 Amcoe */
98499860   DRIVER( dblchalo )   /* (c) 2003 Amcoe */
98509861   DRIVER( anithunt )   /* (c) 2003 Amcoe - Animal Treasure Hunt */
9851   DRIVER( anithuntd1 )/* (c) 2003 Amcoe */
9852   DRIVER( anithuntv1 )/* (c) 2003 Amcoe */
9862   DRIVER( anithuntd1 )   /* (c) 2003 Amcoe */
9863   DRIVER( anithuntv1 )   /* (c) 2003 Amcoe */
98539864   DRIVER( anithunto )   /* (c) 2003 Amcoe */
9854   DRIVER( anithunto2 )/* (c) 2003 Amcoe */
9865   DRIVER( anithunto2 )   /* (c) 2003 Amcoe */
98559866   DRIVER( sfruitb )   /* (c) 2002 Amcoe - Super Fruit Bonus */
98569867   DRIVER( sfruitbb1 )   /* (c) 2002 Amcoe */
98579868   DRIVER( sfruitbd1 )   /* (c) 2002 Amcoe */
r8581r8582
98979908   DRIVER( fb5c )      /* (c) 2005 Amcoe */
98989909   DRIVER( fb5d )      /* (c) 2005 Amcoe */
98999910   DRIVER( fb5v )      /* (c) 2005 Amcoe */
9900   DRIVER( fb6 )      /* (c) 200? Amcoe - Fruit Bonus '06 - 10th anniversary */
9901   DRIVER( fb6v )      /* (c) 200? Amcoe */
9902   DRIVER( fb6d1 )      /* (c) 200? Amcoe */
9903   DRIVER( fb6s1 )      /* (c) 200? Amcoe */
9904   DRIVER( fb6v1 )      /* (c) 200? Amcoe */
9905   DRIVER( fb6d2 )      /* (c) 200? Amcoe */
9906   DRIVER( fb6s2 )      /* (c) 200? Amcoe */
9907   DRIVER( fb6v2 )      /* (c) 200? Amcoe */
9908   DRIVER( fb6se )      /* (c) 200? Amcoe - Fruit Bonus 2006 Special Edition */
9909   DRIVER( fb6sev )   /* (c) 200? Amcoe */
9910   DRIVER( fb6sed1 )   /* (c) 200? Amcoe */
9911   DRIVER( fb6sev1 )   /* (c) 200? Amcoe */
9912   DRIVER( fb6sed2 )   /* (c) 200? Amcoe */
9913   DRIVER( fb6sev2 )   /* (c) 200? Amcoe */
9914   DRIVER( version4 )   /* (c) 200? Amcoe - Version 4 ? */
9915   DRIVER( bugfever )   /* (c) 200? Amcoe - Bug Fever */
9916   DRIVER( bugfevero )   /* (c) 200? Amcoe */
9917   DRIVER( bugfeverd )   /* (c) 200? Amcoe */
9918   DRIVER( bugfeverv )   /* (c) 200? Amcoe */
9919   DRIVER( bugfeverv2 )   /* (c) 200? Amcoe */
9920   DRIVER( dvisland )   /* (c) 200? Amcoe - Devil's Island */
9921   DRIVER( funriver )   /* (c) 200? Amcoe - Fun River */
9922   DRIVER( funriverv )   /* (c) 200? Amcoe */
9911   DRIVER( fb6 )      /* (c) 2006 Amcoe - Fruit Bonus '06 - 10th anniversary */
9912   DRIVER( fb6v )      /* (c) 2006 Amcoe */
9913   DRIVER( fb6d1 )      /* (c) 2006 Amcoe */
9914   DRIVER( fb6s1 )      /* (c) 2006 Amcoe */
9915   DRIVER( fb6v1 )      /* (c) 2006 Amcoe */
9916   DRIVER( fb6d2 )      /* (c) 2006 Amcoe */
9917   DRIVER( fb6s2 )      /* (c) 2006 Amcoe */
9918   DRIVER( fb6v2 )      /* (c) 2006 Amcoe */
9919   DRIVER( fb6s3 )      /* (c) 2006 Amcoe */
9920   DRIVER( fb6se )      /* (c) 2006 Amcoe - Fruit Bonus 2006 Special Edition */
9921   DRIVER( fb6sev )   /* (c) 2006 Amcoe */
9922   DRIVER( fb6sed1 )   /* (c) 2006 Amcoe */
9923   DRIVER( fb6sev1 )   /* (c) 2006 Amcoe */
9924   DRIVER( fb6sed2 )   /* (c) 2006 Amcoe */
9925   DRIVER( fb6sev2 )   /* (c) 2006 Amcoe */
9926   DRIVER( version4 )   /* (c) 2006 Amcoe - Version 4 ? */
9927   DRIVER( bugfever )   /* (c) 2006 Amcoe - Bug Fever */
9928   DRIVER( bugfevero )   /* (c) 2006 Amcoe */
9929   DRIVER( bugfeverd )   /* (c) 2006 Amcoe */
9930   DRIVER( bugfeverv )   /* (c) 2006 Amcoe */
9931   DRIVER( bugfeverv2 )   /* (c) 2006 Amcoe */
9932   DRIVER( funriver )   /* (c) 2005 Amcoe - Fun River */
9933   DRIVER( funriverv )   /* (c) 2005 Amcoe */
9934   DRIVER( dvisland )   /* (c) 2006 Amcoe - Devil's Island */
9935   DRIVER( atworld )   /* (c) 2007 Amcoe - Around The World */
9936   DRIVER( atworldd1 )   /* (c) 2007 Amcoe */
99239937   DRIVER( amclink )   /* (c) 200? Amcoe - Amcoe Link Control Box? */
99249938
99259939   DRIVER( act2000 )   /* (c) 1999 Amcoe - Action 2000 */
src/mame/includes/midyunit.h
r8581r8582
2929DRIVER_INIT( mkyturbo );
3030DRIVER_INIT( mkyawdim );
3131DRIVER_INIT( term2 );
32DRIVER_INIT( term2la3 );
3233DRIVER_INIT( term2la2 );
3334DRIVER_INIT( term2la1 );
3435DRIVER_INIT( totcarn );
src/mame/includes/coolpool.h
r0r8582
1class coolpool_state
2{
3public:
4   static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, coolpool_state(machine)); }
5
6   coolpool_state(running_machine &machine) { }
7
8   UINT16 *vram_base;
9
10   UINT8 cmd_pending;
11   UINT16 iop_cmd;
12   UINT16 iop_answer;
13   int iop_romaddr;
14
15   UINT8 newx[3];
16   UINT8 newy[3];
17   UINT8 oldx[3];
18   UINT8 oldy[3];
19   int dx[3];
20   int dy[3];
21
22   UINT16 result;
23   UINT16 lastresult;
24};
src/mame/includes/gaiden.h
r8581r8582
1919   size_t      spriteram_size;
2020
2121   /* video-related */
22   tilemap_t     *text_layer,*foreground,*background;
22   tilemap_t   *text_layer,*foreground,*background;
2323   bitmap_t    *sprite_bitmap, *tile_bitmap_bg, *tile_bitmap_fg;
2424   UINT16      tx_scroll_x, tx_scroll_y;
2525   UINT16      bg_scroll_x, bg_scroll_y;
2626   UINT16      fg_scroll_x, fg_scroll_y;
27   INT8      tx_offset_y, bg_offset_y, fg_offset_y, spr_offset_y;
2728
2829   /* misc */
2930   int         sprite_sizey;
r8581r8582
5253WRITE16_HANDLER( gaiden_videoram3_w );
5354READ16_HANDLER( gaiden_videoram3_r );
5455
56WRITE16_HANDLER( gaiden_flip_w );
5557WRITE16_HANDLER( gaiden_txscrollx_w );
5658WRITE16_HANDLER( gaiden_txscrolly_w );
5759WRITE16_HANDLER( gaiden_fgscrollx_w );
5860WRITE16_HANDLER( gaiden_fgscrolly_w );
5961WRITE16_HANDLER( gaiden_bgscrollx_w );
6062WRITE16_HANDLER( gaiden_bgscrolly_w );
61WRITE16_HANDLER( gaiden_flip_w );
63WRITE16_HANDLER( gaiden_txoffsety_w );
64WRITE16_HANDLER( gaiden_fgoffsety_w );
65WRITE16_HANDLER( gaiden_bgoffsety_w );
66WRITE16_HANDLER( gaiden_sproffsety_w );
src/mame/includes/polepos.h
r8581r8582
2424extern UINT16 *polepos_road16_memory;
2525extern UINT16 *polepos_alpha16_memory;
2626extern UINT16 *polepos_sprite16_memory;
27extern int polepos_gear_bit;
2827
2928VIDEO_START( polepos );
3029PALETTE_INIT( polepos );
src/mame/mame.mak
r8581r8582
18001800                  $(LAYOUT)/pe_keno.lh \
18011801                  $(LAYOUT)/pe_slots.lh
18021802
1803$(DRIVERS)/polepos.o:   $(LAYOUT)/polepos.lh
1803$(DRIVERS)/polepos.o:   $(LAYOUT)/polepos.lh \
1804                  $(LAYOUT)/topracer.lh
18041805
18051806$(DRIVERS)/qix.o:      $(LAYOUT)/elecyoyo.lh
18061807
r8581r8582
19091910            $(MAMESRC)/machine/snesst10.c \
19101911            $(MAMESRC)/machine/snes7110.c \
19111912            $(MAMESRC)/machine/snesbsx.c
1913$(VIDEO)/jaguar.o:      $(MAMESRC)/video/jagobj.c \
1914            $(MAMESRC)/video/jagblit.c
19121915$(VIDEO)/model2.o:      $(MAMESRC)/video/model2rd.c
19131916$(VIDEO)/model3.o:      $(MAMESRC)/video/m3raster.c
1917$(VIDEO)/n64.o:         $(MAMESRC)/video/rdpfiltr.c
src/mame/video/antic.c
r8581r8582
9090      data = antic.r.antic09;
9191      break;
9292   case 10: /* WSYNC read */
93      cpu_spinuntil_trigger(devtag_get_device(space->machine, "maincpu"), TRIGGER_HSYNC);
93      cpu_spinuntil_trigger(space->machine->device("maincpu"), TRIGGER_HSYNC);
9494      antic.w.wsync = 1;
9595      data = antic.r.antic0a;
9696      break;
r8581r8582
200200      break;
201201   case 10: /* WSYNC write */
202202      LOG(("ANTIC 0A write WSYNC  $%02X\n", data));
203      cpu_spinuntil_trigger(devtag_get_device(space->machine, "maincpu"), TRIGGER_HSYNC);
203      cpu_spinuntil_trigger(space->machine->device("maincpu"), TRIGGER_HSYNC);
204204      antic.w.wsync = 1;
205205      break;
206206   case 11:
src/mame/video/thief.c
r8581r8582
110110   int flipscreen = thief_video_control&1;
111111   const UINT8 *source = screen->machine->generic.videoram.u8;
112112
113   if (tms9927_screen_reset(devtag_get_device(screen->machine, "tms")))
113   if (tms9927_screen_reset(screen->machine->device("tms")))
114114   {
115115      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
116116      return 0;
src/mame/video/exterm.c
r8581r8582
7878   int x;
7979
8080   /* get parameters for the slave CPU */
81   tms34010_get_display_params(devtag_get_device(screen.machine, "slave"), &fgparams);
81   tms34010_get_display_params(screen.machine->device("slave"), &fgparams);
8282
8383   /* compute info about the slave vram */
8484   if (fgparams.enabled && scanline >= fgparams.veblnk && scanline < fgparams.vsblnk && fgparams.heblnk < fgparams.hsblnk)
src/mame/video/undrfire.c
r8581r8582
357357
358358VIDEO_UPDATE( undrfire )
359359{
360   running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn");
361   running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp");
360   running_device *tc0100scn = screen->machine->device("tc0100scn");
361   running_device *tc0480scp = screen->machine->device("tc0480scp");
362362   UINT8 layer[5];
363363   UINT8 pivlayer[3];
364364   UINT16 priority;
r8581r8582
503503
504504VIDEO_UPDATE( cbombers )
505505{
506   running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn");
507   running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp");
506   running_device *tc0100scn = screen->machine->device("tc0100scn");
507   running_device *tc0480scp = screen->machine->device("tc0480scp");
508508   UINT8 layer[5];
509509   UINT8 pivlayer[3];
510510   UINT16 priority;
src/mame/video/gaiden.c
r8581r8582
165165
166166***************************************************************************/
167167
168WRITE16_HANDLER( gaiden_flip_w )
169{
170   if (ACCESSING_BITS_0_7)
171      flip_screen_set(space->machine, data & 1);
172}
173
168174WRITE16_HANDLER( gaiden_txscrollx_w )
169175{
170176   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
r8581r8582
176182{
177183   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
178184   COMBINE_DATA(&state->tx_scroll_y);
179   tilemap_set_scrolly(state->text_layer, 0, state->tx_scroll_y);
185   tilemap_set_scrolly(state->text_layer, 0, (state->tx_scroll_y - state->tx_offset_y) & 0xffff);
180186}
181187
182188WRITE16_HANDLER( gaiden_fgscrollx_w )
r8581r8582
190196{
191197   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
192198   COMBINE_DATA(&state->fg_scroll_y);
193   tilemap_set_scrolly(state->foreground, 0, state->fg_scroll_y);
199   tilemap_set_scrolly(state->foreground, 0, (state->fg_scroll_y - state->fg_offset_y) & 0xffff);
194200}
195201
196202WRITE16_HANDLER( gaiden_bgscrollx_w )
r8581r8582
204210{
205211   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
206212   COMBINE_DATA(&state->bg_scroll_y);
207   tilemap_set_scrolly(state->background, 0, state->bg_scroll_y);
213   tilemap_set_scrolly(state->background, 0, (state->bg_scroll_y - state->bg_offset_y) & 0xffff);
208214}
209215
210WRITE16_HANDLER( gaiden_videoram3_w )
216WRITE16_HANDLER( gaiden_txoffsety_w )
211217{
212218   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
213   COMBINE_DATA(&state->videoram3[offset]);
214   tilemap_mark_tile_dirty(state->background, offset & 0x07ff);
219
220   if (ACCESSING_BITS_0_7) {
221      state->tx_offset_y = data;
222      tilemap_set_scrolly(state->text_layer, 0, (state->tx_scroll_y - state->tx_offset_y) & 0xffff);
223   }
215224}
216225
217WRITE16_HANDLER( gaiden_flip_w )
226WRITE16_HANDLER( gaiden_fgoffsety_w )
218227{
219   if (ACCESSING_BITS_0_7)
220      flip_screen_set(space->machine, data & 1);
228   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
229
230   if (ACCESSING_BITS_0_7) {
231      state->fg_offset_y = data;
232      tilemap_set_scrolly(state->foreground, 0, (state->fg_scroll_y - state->fg_offset_y) & 0xffff);
233   }
221234}
222235
236WRITE16_HANDLER( gaiden_bgoffsety_w )
237{
238   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
223239
240   if (ACCESSING_BITS_0_7) {
241      state->bg_offset_y = data;
242      tilemap_set_scrolly(state->background, 0, (state->bg_scroll_y - state->bg_offset_y) & 0xffff);
243   }
244}
245
246WRITE16_HANDLER( gaiden_sproffsety_w )
247{
248   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
249
250   if (ACCESSING_BITS_0_7) {
251      state->spr_offset_y = data;
252      // handled in draw_sprites
253   }
254}
255
256
257WRITE16_HANDLER( gaiden_videoram3_w )
258{
259   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
260   COMBINE_DATA(&state->videoram3[offset]);
261   tilemap_mark_tile_dirty(state->background, offset & 0x07ff);
262}
263
224264READ16_HANDLER( gaiden_videoram3_r )
225265{
226266   gaiden_state *state = (gaiden_state *)space->machine->driver_data;
r8581r8582
358398         /* raiga needs something like this */
359399         UINT32 number = (source[1] & (sizex > 2 ? 0x7ff8 : 0x7ffc));
360400
361         int ypos = source[3] & 0x01ff;
401         int ypos = (source[3] + state->spr_offset_y) & 0x01ff;
362402         int xpos = source[4] & 0x01ff;
363403
364404         color = (color >> 4) & 0x0f;
r8581r8582
480520         /* raiga needs something like this */
481521         UINT32 number = (source[1] & (sizex > 2 ? 0x7ff8 : 0x7ffc));
482522
483         int ypos = source[3] & 0x01ff;
523         int ypos = (source[3] + state->spr_offset_y) & 0x01ff;
484524         int xpos = source[4] & 0x01ff;
485525
486526         color = (color >> 4) & 0x0f;
src/mame/video/punchout.c
r8581r8582
370370
371371VIDEO_UPDATE( punchout )
372372{
373   running_device *top_screen    = devtag_get_device(screen->machine, "top");
374   running_device *bottom_screen = devtag_get_device(screen->machine, "bottom");
373   running_device *top_screen    = screen->machine->device("top");
374   running_device *bottom_screen = screen->machine->device("bottom");
375375
376376   if (screen == top_screen)
377377   {
r8581r8582
404404
405405VIDEO_UPDATE( armwrest )
406406{
407   running_device *top_screen    = devtag_get_device(screen->machine, "top");
408   running_device *bottom_screen = devtag_get_device(screen->machine, "bottom");
407   running_device *top_screen    = screen->machine->device("top");
408   running_device *bottom_screen = screen->machine->device("bottom");
409409
410410   if (screen == top_screen)
411411   {
src/mame/video/galpanic.c
r8581r8582
101101
102102VIDEO_UPDATE( galpanic )
103103{
104   running_device *pandora = devtag_get_device(screen->machine, "pandora");
104   running_device *pandora = screen->machine->device("pandora");
105105
106106   /* copy the temporary bitmap to the screen */
107107   copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,0,0,cliprect);
src/mame/video/gticlub.c
r8581r8582
311311            if (K001005_fifo_read_ptr < 0x3ff)
312312            {
313313               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
314               sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, CLEAR_LINE);
314               sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE);
315315            }
316316            else
317317            {
318318               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
319               sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE);
319               sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
320320            }
321321         }
322322         else
323323         {
324324            //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
325            sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE);
325            sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
326326         }
327327
328328         K001005_fifo_read_ptr++;
r8581r8582
364364            if (K001005_fifo_write_ptr < 0x400)
365365            {
366366               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
367               sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE);
367               sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
368368            }
369369            else
370370            {
371371               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
372               sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, CLEAR_LINE);
372               sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE);
373373            }
374374         }
375375         else
376376         {
377377            //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
378            sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE);
378            sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
379379         }
380380
381381       //  mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, cpu_get_pc(space->cpu));
r8581r8582
979979
980980VIDEO_UPDATE( gticlub )
981981{
982   running_device *k001604 = devtag_get_device(screen->machine, "k001604_1");
982   running_device *k001604 = screen->machine->device("k001604_1");
983983
984984   k001604_draw_back_layer(k001604, bitmap, cliprect);
985985
r8581r8582
10411041   draw_7segment_led(bitmap, 9, 3, gticlub_led_reg1);
10421042
10431043   //cputag_set_input_line(screen->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
1044   sharc_set_flag_input(devtag_get_device(screen->machine, "dsp"), 1, ASSERT_LINE);
1044   sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE);
10451045   return 0;
10461046}
10471047
src/mame/video/sprint4.c
r8581r8582
9494
9595   /* check for sprite-playfield collisions */
9696
97   running_device *discrete = devtag_get_device(machine, "discrete");
97   running_device *discrete = machine->device("discrete");
9898
9999   for (i = 0; i < 4; i++)
100100   {
src/mame/video/beezer.c
r8581r8582
77
88INTERRUPT_GEN( beezer_interrupt )
99{
10   running_device *via_0 = devtag_get_device(device->machine, "via6522_0");
10   running_device *via_0 = device->machine->device("via6522_0");
1111
1212   scanline = (scanline + 1) % 0x80;
1313   via_ca2_w(via_0, (scanline & 0x10) ? 1 : 0);
src/mame/video/kaneko16.c
r8581r8582
11211121
11221122VIDEO_UPDATE( sandscrp )
11231123{
1124   running_device *pandora = devtag_get_device(screen->machine, "pandora");
1124   running_device *pandora = screen->machine->device("pandora");
11251125   kaneko16_fill_bitmap(screen->machine,bitmap,cliprect);
11261126
11271127   // if the display is disabled, do nothing?
src/mame/video/polepos.c
r8581r8582
1919static tilemap_t *bg_tilemap,*tx_tilemap;
2020static int polepos_chacl;
2121
22int polepos_gear_bit;
23
2422/***************************************************************************
2523
2624  Convert the color PROMs.
src/mame/video/qdrmfgp.c
r8581r8582
2929
3030VIDEO_START( qdrmfgp )
3131{
32   running_device *k056832 = devtag_get_device(machine, "k056832");
32   running_device *k056832 = machine->device("k056832");
3333
3434   k056832_set_layer_association(k056832, 0);
3535
r8581r8582
4141
4242VIDEO_START( qdrmfgp2 )
4343{
44   running_device *k056832 = devtag_get_device(machine, "k056832");
44   running_device *k056832 = machine->device("k056832");
4545
4646   k056832_set_layer_association(k056832, 0);
4747
r8581r8582
5959
6060VIDEO_UPDATE( qdrmfgp )
6161{
62   running_device *k056832 = devtag_get_device(screen->machine, "k056832");
62   running_device *k056832 = screen->machine->device("k056832");
6363   bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
6464
6565   k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1);
src/mame/video/cps1.c
r8581r8582
12451245   {"kodj",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
12461246   {"kodb",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },   /* bootleg, doesn't use multiply protection */
12471247   {"captcomm", CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
1248   {"captcommr1", CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
12481249   {"captcommu",CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
12491250   {"captcommj",CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
12501251   {"captcommb",CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
src/mame/video/starcrus.c
r8581r8582
6464
6565WRITE8_HANDLER( starcrus_ship_parm_1_w )
6666{
67   running_device *samples = devtag_get_device(space->machine, "samples");
67   running_device *samples = space->machine->device("samples");
6868
6969    s1_sprite = data&0x1f;
7070    engine1_on = ((data&0x20)>>5)^0x01;
r8581r8582
9090
9191WRITE8_HANDLER( starcrus_ship_parm_2_w )
9292{
93   running_device *samples = devtag_get_device(space->machine, "samples");
93   running_device *samples = space->machine->device("samples");
9494
9595    s2_sprite = data&0x1f;
9696    set_led_status(space->machine, 2,~data & 0x80);       /* game over lamp */
r8581r8582
118118
119119WRITE8_HANDLER( starcrus_proj_parm_1_w )
120120{
121   running_device *samples = devtag_get_device(space->machine, "samples");
121   running_device *samples = space->machine->device("samples");
122122
123123    p1_sprite = data&0x0f;
124124    launch1_on = ((data&0x20)>>5)^0x01;
r8581r8582
157157
158158WRITE8_HANDLER( starcrus_proj_parm_2_w )
159159{
160   running_device *samples = devtag_get_device(space->machine, "samples");
160   running_device *samples = space->machine->device("samples");
161161
162162    p2_sprite = data&0x0f;
163163    launch2_on = ((data&0x20)>>5)^0x01;
src/mame/video/tia.c
r8581r8582
18631863   case 0x18: /* AUDF1 */
18641864   case 0x19: /* AUDV0 */
18651865   case 0x1A: /* AUDV1 */
1866      tia_sound_w(devtag_get_device(space->machine, "tia"), offset, data);
1866      tia_sound_w(space->machine->device("tia"), offset, data);
18671867      break;
18681868
18691869   case 0x1B:
src/mame/video/segaic16.c
r8581r8582
328328    probably because they had it handy and it handles medium res.
329329
330330  System32:
331    5-layer tilemap hardware consisting of 4 independant rom-based
331    5-layer tilemap hardware consisting of 4 independent rom-based
332332    layers with linescroll, lineselection, linezoom and window
333333    clipping capability and one simpler ram-based text plane.  Mixed
334334    ram/rom sprite engine with palette indirection, per-color priority
src/mame/video/segaic16.h
r8581r8582
330330extern struct palette_info segaic16_palette;
331331extern struct rotate_info segaic16_rotate[SEGAIC16_MAX_ROTATE];
332332extern struct road_info segaic16_road[SEGAIC16_MAX_ROADS];
333
src/mame/video/qix.c
r8581r8582
350350
351351static VIDEO_UPDATE( qix )
352352{
353   running_device *mc6845 = devtag_get_device(screen->machine, MC6845_TAG);
353   running_device *mc6845 = screen->machine->device(MC6845_TAG);
354354   mc6845_update(mc6845, bitmap, cliprect);
355355
356356   return 0;
src/mame/video/toaplan2.c
r8581r8582
923923static void toaplan2_scroll_reg_data_w(running_machine *machine, offs_t offset, UINT16 data, UINT16 mem_mask, int controller)
924924{
925925   /************************************************************************/
926   /***** layer X and Y flips can be set independantly, so emulate it ******/
926   /***** layer X and Y flips can be set independently, so emulate it ******/
927927   /************************************************************************/
928928
929929   //printf("toaplan2_scroll_reg_data_w %04x %04x\n", offset, data);
r8581r8582
10361036               if ((toaplan2_sub_cpu == CPU_2_Z80) && (data == 3))
10371037               {
10381038                  /* HACK! When tilted, sound CPU needs to be reset. */
1039                  running_device *ym = devtag_get_device(machine, "ymsnd");
1039                  running_device *ym = machine->device("ymsnd");
10401040
10411041                  if (ym && ym->type() == SOUND_YM3812)
10421042                  {
src/mame/video/cinemat.c
r8581r8582
226226   VIDEO_UPDATE_CALL(vector);
227227   vector_clear_list();
228228
229   ccpu_wdt_timer_trigger(devtag_get_device(screen->machine, "maincpu"));
229   ccpu_wdt_timer_trigger(screen->machine->device("maincpu"));
230230
231231   return 0;
232232}
src/mame/video/wecleman.c
r8581r8582
11251125
11261126VIDEO_UPDATE( hotchase )
11271127{
1128   running_device *k051316_1 = devtag_get_device(screen->machine, "k051316_1");
1129   running_device *k051316_2 = devtag_get_device(screen->machine, "k051316_2");
1128   running_device *k051316_1 = screen->machine->device("k051316_1");
1129   running_device *k051316_2 = screen->machine->device("k051316_2");
11301130   int video_on;
11311131
11321132   video_on = wecleman_irqctrl & 0x40;
src/mame/video/galastrm.c
r8581r8582
449449
450450VIDEO_UPDATE( galastrm )
451451{
452   running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn");
453   running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp");
452   running_device *tc0100scn = screen->machine->device("tc0100scn");
453   running_device *tc0480scp = screen->machine->device("tc0480scp");
454454   UINT8 layer[5];
455455   UINT8 pivlayer[3];
456456   UINT16 priority;
src/mame/video/tetrisp2.c
r8581r8582
677677   int scr_pri;
678678   int rot_pri;
679679
680   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
681   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
680   running_device *left_screen  = screen->machine->device("lscreen");
681   running_device *right_screen = screen->machine->device("rscreen");
682682
683683   /* Black background color */
684684   if (screen == left_screen)
src/mame/video/atarisy1.c
r8581r8582
399399   int scanline = param;
400400
401401   /* update the state */
402   atarigen_scanline_int_gen(devtag_get_device(timer.machine, "maincpu"));
402   atarigen_scanline_int_gen(timer.machine->device("maincpu"));
403403
404404   /* set a timer to turn it off */
405405   state->int3off_timer->adjust(timer.machine->primary_screen->scan_period());
src/mame/video/tceptor.c
r8581r8582
534534   int pri;
535535   int bg_center = 144 - ((((bg1_scroll_x + bg2_scroll_x ) & 0x1ff) - 288) / 2);
536536
537   running_device *_2d_screen       = devtag_get_device(screen->machine, "2dscreen");
538   running_device *_3d_left_screen  = devtag_get_device(screen->machine, "3dleft");
539   running_device *_3d_right_screen = devtag_get_device(screen->machine, "3dright");
537   running_device *_2d_screen       = screen->machine->device("2dscreen");
538   running_device *_3d_left_screen  = screen->machine->device("3dleft");
539   running_device *_3d_right_screen = screen->machine->device("3dright");
540540
541541   if (screen != _2d_screen)
542542   {
src/mame/video/vindictr.c
r8581r8582
187187            break;
188188
189189         case 6:      /* /VIRQ */
190            atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
190            atarigen_scanline_int_gen(screen.machine->device("maincpu"));
191191            break;
192192
193193         case 7:      /* /PFVS */
src/mame/video/skydiver.c
r8581r8582
130130
131131WRITE8_HANDLER( skydiver_2000_201F_w )
132132{
133   running_device *discrete = devtag_get_device(space->machine, "discrete");
133   running_device *discrete = space->machine->device("discrete");
134134   int bit = offset & 0x01;
135135
136136   watchdog_reset_w(space,0,0);
src/mame/video/jaguar.c
r8581r8582
682682
683683   if (gpu_regs[PIT0])
684684   {
685      sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(devtag_get_device(machine,"gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1]));
685      sample_period = ATTOTIME_IN_NSEC(machine->device("gpu")->unscaled_clock() / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1]));
686686//      timer_set(machine, sample_period, NULL, 0, jaguar_pit);
687687   }
688688}
r8581r8582
712712         case PIT1:
713713            if (gpu_regs[PIT0])
714714            {
715               sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(devtag_get_device(space->machine,"gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1]));
715               sample_period = ATTOTIME_IN_NSEC(space->machine->device("gpu")->unscaled_clock() / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1]));
716716               timer_set(space->machine, sample_period, NULL, 0, jaguar_pit);
717717            }
718718            break;
src/mame/video/seta.c
r8581r8582
293293        ---- ---- ---- ---0     Coin #0 Counter     */
294294         if (ACCESSING_BITS_0_7)
295295         {
296            running_device *x1_010 = devtag_get_device(space->machine, "x1snd");
296            running_device *x1_010 = space->machine->device("x1snd");
297297            seta_coin_lockout_w (space->machine, data & 0x0f);
298298            if (x1_010 != NULL)
299299               seta_sound_enable_w (x1_010, data & 0x20);
src/mame/video/plygonet.c
r8581r8582
123123
124124VIDEO_UPDATE( polygonet )
125125{
126   running_device *k053936 = devtag_get_device(screen->machine, "k053936");
126   running_device *k053936 = screen->machine->device("k053936");
127127   bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
128128   bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
129129
src/mame/video/superchs.c
r8581r8582
209209
210210VIDEO_UPDATE( superchs )
211211{
212   running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp");
212   running_device *tc0480scp = screen->machine->device("tc0480scp");
213213   UINT8 layer[5];
214214   UINT16 priority;
215215   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
src/mame/video/astrocde.c
r8581r8582
646646      case 0x17:   /* noise volume register */
647647      case 0x18:   /* sound block transfer */
648648         if (astrocade_video_config & AC_SOUND_PRESENT)
649            astrocade_sound_w(devtag_get_device(space->machine, "astrocade1"), offset, data);
649            astrocade_sound_w(space->machine->device("astrocade1"), offset, data);
650650         break;
651651
652652      case 0x19:   /* expand register */
src/mame/video/nbmj8688.c
r8581r8582
717717{
718718   int x, y, b;
719719
720   running_device *main_screen = devtag_get_device(screen->machine, "screen");
721   running_device *lcd0_screen = devtag_get_device(screen->machine, "lcd0");
722   running_device *lcd1_screen = devtag_get_device(screen->machine, "lcd1");
720   running_device *main_screen = screen->machine->device("screen");
721   running_device *lcd0_screen = screen->machine->device("lcd0");
722   running_device *lcd1_screen = screen->machine->device("lcd1");
723723
724724   if (screen == main_screen) VIDEO_UPDATE_CALL(mbmj8688);
725725
src/mame/video/vsnes.c
r8581r8582
5858VIDEO_UPDATE( vsnes )
5959{
6060   /* render the ppu */
61   ppu2c0x_render( devtag_get_device(screen->machine, "ppu1"), bitmap, 0, 0, 0, 0 );
61   ppu2c0x_render( screen->machine->device("ppu1"), bitmap, 0, 0, 0, 0 );
6262   return 0;
6363}
6464
6565
6666VIDEO_UPDATE( vsdual )
6767{
68   running_device *top_screen = devtag_get_device(screen->machine, "top");
69   running_device *bottom_screen = devtag_get_device(screen->machine, "bottom");
68   running_device *top_screen = screen->machine->device("top");
69   running_device *bottom_screen = screen->machine->device("bottom");
7070
7171   /* render the ppu's */
7272   if (screen == top_screen)
73      ppu2c0x_render(devtag_get_device(screen->machine, "ppu1"), bitmap, 0, 0, 0, 0);
73      ppu2c0x_render(screen->machine->device("ppu1"), bitmap, 0, 0, 0, 0);
7474   else if (screen == bottom_screen)
75      ppu2c0x_render(devtag_get_device(screen->machine, "ppu2"), bitmap, 0, 0, 0, 0);
75      ppu2c0x_render(screen->machine->device("ppu2"), bitmap, 0, 0, 0, 0);
7676
7777   return 0;
7878}
src/mame/video/psikyo4.c
r8581r8582
129129
130130VIDEO_UPDATE( psikyo4 )
131131{
132   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
133   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
132   running_device *left_screen  = screen->machine->device("lscreen");
133   running_device *right_screen = screen->machine->device("rscreen");
134134
135135   if (screen == left_screen)
136136   {
src/mame/video/tx1.c
r8581r8582
11941194
11951195VIDEO_UPDATE( tx1 )
11961196{
1197   running_device *left_screen   = devtag_get_device(screen->machine, "lscreen");
1198   running_device *centre_screen = devtag_get_device(screen->machine, "cscreen");
1199   running_device *right_screen  = devtag_get_device(screen->machine, "rscreen");
1197   running_device *left_screen   = screen->machine->device("lscreen");
1198   running_device *centre_screen = screen->machine->device("cscreen");
1199   running_device *right_screen  = screen->machine->device("rscreen");
12001200
12011201   if (screen == left_screen)
12021202   {
r8581r8582
30813081
30823082VIDEO_UPDATE( buggyboy )
30833083{
3084   running_device *left_screen = devtag_get_device(screen->machine, "lscreen");
3085   running_device *center_screen = devtag_get_device(screen->machine, "cscreen");
3086   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
3084   running_device *left_screen = screen->machine->device("lscreen");
3085   running_device *center_screen = screen->machine->device("cscreen");
3086   running_device *right_screen = screen->machine->device("rscreen");
30873087
30883088   if (screen == left_screen)
30893089   {
src/mame/video/blstroid.c
r8581r8582
100100static TIMER_CALLBACK( irq_on )
101101{
102102   /* generate the interrupt */
103   atarigen_scanline_int_gen(devtag_get_device(machine, "maincpu"));
103   atarigen_scanline_int_gen(machine->device("maincpu"));
104104   atarigen_update_interrupts(machine);
105105}
106106
src/mame/video/vrender0.c
r8581r8582
566566   vr0video_state *vr0 = get_safe_token(device);
567567   const vr0video_interface *intf = get_interface(device);
568568
569   vr0->cpu = devtag_get_device(device->machine, intf->cpu);
569   vr0->cpu = device->machine->device(intf->cpu);
570570
571571   state_save_register_device_item_array(device, 0, vr0->InternalPalette);
572572   state_save_register_device_item(device, 0, vr0->LastPalUpdate);
src/mame/video/ultratnk.c
r8581r8582
9696{
9797   int i;
9898   UINT16 BG = colortable_entry_get_value(machine->colortable, 0);
99   running_device *discrete = devtag_get_device(machine, "discrete");
99   running_device *discrete = machine->device("discrete");
100100   UINT8 *videoram = machine->generic.videoram.u8;
101101
102102   /* check for sprite-playfield collisions */
src/mame/video/gunbustr.c
r8581r8582
212212
213213VIDEO_UPDATE( gunbustr )
214214{
215   running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp");
215   running_device *tc0480scp = screen->machine->device("tc0480scp");
216216   UINT8 layer[5];
217217   UINT16 priority;
218218   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
src/mame/video/playch10.c
r8581r8582
118118
119119VIDEO_UPDATE( playch10 )
120120{
121   running_device *ppu = devtag_get_device(screen->machine, "ppu");
121   running_device *ppu = screen->machine->device("ppu");
122122
123123   /* Dual monitor version */
124124   if (pc10_bios == 1)
125125   {
126      running_device *top_screen = devtag_get_device(screen->machine, "top");
126      running_device *top_screen = screen->machine->device("top");
127127
128128      /* On Playchoice 10 single monitor, this bit toggles    */
129129      /* between PPU and BIOS display.                        */
src/mame/video/cyberbal.c
r8581r8582
343343   rectangle visarea = screen.visible_area();
344344
345345   /* for 2p games, the left screen is the main screen */
346   running_device *left_screen = devtag_get_device(screen.machine, "lscreen");
346   running_device *left_screen = screen.machine->device("lscreen");
347347   if (left_screen == NULL)
348      left_screen = devtag_get_device(screen.machine, "screen");
348      left_screen = screen.machine->device("screen");
349349
350350   /* draw the playfield */
351351   tilemap_draw(bitmap, cliprect, (&screen == left_screen) ? state->atarigen.playfield_tilemap : state->atarigen.playfield2_tilemap, 0, 0);
src/mame/video/atari.c
r8581r8582
11601160   LOG(("           @cycle #%3d steal %d cycles\n", cycle(machine), antic.steal_cycles));
11611161   after(machine, antic.steal_cycles, antic_line_done, "antic_line_done");
11621162    antic.steal_cycles = 0;
1163   cpu_spinuntil_trigger( devtag_get_device(machine, "maincpu"), TRIGGER_STEAL );
1163   cpu_spinuntil_trigger( machine->device("maincpu"), TRIGGER_STEAL );
11641164}
11651165
11661166
src/mame/video/segas32.c
r8581r8582
26242624{
26252625   UINT8 enablemask;
26262626
2627   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
2627   running_device *left_screen  = screen->machine->device("lscreen");
26282628
26292629   /* update the visible area */
26302630   if (system32_videoram[0x1ff00/2] & 0x8000)
src/mame/video/kan_pand.c
r8581r8582
5959   int          clear_bitmap;
6060   UINT8        region;
6161   int          xoffset, yoffset;
62   int          bg_pen; // might work some other way..
6263};
6364
6465/*****************************************************************************
r8581r8582
8485    IMPLEMENTATION
8586*****************************************************************************/
8687
88void pandora_set_bg_pen( running_device *device, int pen )
89{
90   kaneko_pandora_state *pandora = get_safe_token(device);
91   pandora->bg_pen = pen;
92}
93
8794void pandora_set_clear_bitmap( running_device *device, int clear )
8895{
8996   kaneko_pandora_state *pandora = get_safe_token(device);
r8581r8582
195202
196203   // the games can disable the clearing of the sprite bitmap, to leave sprite trails
197204   if (pandora->clear_bitmap)
198      bitmap_fill(pandora->sprites_bitmap, &pandora->screen->visible_area(), 0);
205      bitmap_fill(pandora->sprites_bitmap, &pandora->screen->visible_area(), pandora->bg_pen);
199206
200207   pandora_draw(device, pandora->sprites_bitmap, &pandora->screen->visible_area());
201208}
r8581r8582
298305   pandora->region = intf->gfx_region;
299306   pandora->xoffset = intf->x;
300307   pandora->yoffset = intf->y;
308   pandora->bg_pen = 0;
301309
302310   pandora->spriteram = auto_alloc_array(device->machine, UINT8, 0x1000);
303311
src/mame/video/kan_pand.h
r8581r8582
4242void pandora_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect);
4343void pandora_eof(running_device *device);
4444void pandora_set_clear_bitmap(running_device *device, int clear);
45void pandora_set_bg_pen( running_device *device, int pen );
4546
4647WRITE8_DEVICE_HANDLER ( pandora_spriteram_w );
4748READ8_DEVICE_HANDLER( pandora_spriteram_r );
src/mame/video/sega16sp.c
r8581r8582
14611461   sega16sp_state *sega16sp;
14621462
14631463   if (!which)
1464      device = devtag_get_device(screen->machine,"segaspr1");
1464      device = screen->machine->device("segaspr1");
14651465   else
1466      device = devtag_get_device(screen->machine,"segaspr2");
1466      device = screen->machine->device("segaspr2");
14671467
14681468   if (!device)
14691469      fatalerror("segaic16_sprites_draw device not found\n");
r8581r8582
14911491   running_device* device = 0;
14921492
14931493   if (!which)
1494      device = devtag_get_device(machine,"segaspr1");
1494      device = machine->device("segaspr1");
14951495   else
1496      device = devtag_get_device(machine,"segaspr2");
1496      device = machine->device("segaspr2");
14971497
14981498   if (!device)
14991499      fatalerror("segaic16_sprites_set_bank device not found\n");
r8581r8582
15211521   running_device* device = 0;
15221522
15231523   if (!which)
1524      device = devtag_get_device(machine,"segaspr1");
1524      device = machine->device("segaspr1");
15251525   else
1526      device = devtag_get_device(machine,"segaspr2");
1526      device = machine->device("segaspr2");
15271527
15281528   if (!device)
15291529      fatalerror("segaic16_sprites_set_flip device not found\n");
r8581r8582
15521552   running_device* device = 0;
15531553
15541554   if (!which)
1555      device = devtag_get_device(machine,"segaspr1");
1555      device = machine->device("segaspr1");
15561556   else
1557      device = devtag_get_device(machine,"segaspr2");
1557      device = machine->device("segaspr2");
15581558
15591559   if (!device)
15601560      fatalerror("segaic16_sprites_set_shadow device not found\n");
r8581r8582
16141614{
16151615   running_device* device = 0;
16161616
1617   device = devtag_get_device(space->machine,"segaspr1");
1617   device = space->machine->device("segaspr1");
16181618
16191619   if (!device)
16201620      fatalerror("segaic16_sprites_draw_0_w device not found\n");
r8581r8582
16271627{
16281628   running_device* device = 0;
16291629
1630   device = devtag_get_device(space->machine,"segaspr2");
1630   device = space->machine->device("segaspr2");
16311631
16321632   if (!device)
16331633      fatalerror("segaic16_sprites_draw_1_w device not found\n");
src/mame/video/irobot.c
r8581r8582
150150        Word 0, Slope (0xFFFF = side done)
151151        Word 1, bits 7..15: Ending Y of vector
152152
153    Each side is a continous set of vectors. Both sides are drawn at
153    Each side is a continuous set of vectors. Both sides are drawn at
154154    the same time and the space between them is filled in.
155155
156156***************************************************************************/
src/mame/video/konicdev.c
r8581r8582
79217921   k056832->active_layer = 0;
79227922   k056832->linemap_enabled = 0;
79237923
7924   k056832->k055555 = devtag_get_device(device->machine, intf->k055555);
7924   k056832->k055555 = device->machine->device(intf->k055555);
79257925
79267926   memset(k056832->line_dirty, 0, sizeof(UINT32) * K056832_PAGE_COUNT * 8);
79277927
r8581r8582
84148414   const k054338_interface *intf = k054338_get_interface(device);
84158415
84168416   k054338->screen = device->machine->device<screen_device>(intf->screen);
8417   k054338->k055555 = devtag_get_device(device->machine, intf->k055555);
8417   k054338->k055555 = device->machine->device(intf->k055555);
84188418
84198419   k054338->alphainverted = intf->alpha_inv;
84208420
r8581r8582
1007910079   const k001005_interface *intf = k001005_get_interface(device);
1008010080   int i, width, height;
1008110081
10082   k001005->cpu = devtag_get_device(device->machine, intf->cpu);
10083   k001005->dsp = devtag_get_device(device->machine, intf->dsp);
10084   k001005->k001006_1 = devtag_get_device(device->machine, intf->k001006_1);
10085   k001005->k001006_2 = devtag_get_device(device->machine, intf->k001006_2);
10082   k001005->cpu = device->machine->device(intf->cpu);
10083   k001005->dsp = device->machine->device(intf->dsp);
10084   k001005->k001006_1 = device->machine->device(intf->k001006_1);
10085   k001005->k001006_2 = device->machine->device(intf->k001006_2);
1008610086
1008710087   k001005->screen = device->machine->device<screen_device>(intf->screen);
1008810088   width = k001005->screen->width();
src/mame/video/djmain.c
r8581r8582
1414
1515static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect)
1616{
17   running_device *k055555 = devtag_get_device(machine, "k055555");
17   running_device *k055555 = machine->device("k055555");
1818   int offs, pri_code;
1919   int sortedlist[NUM_SPRITES];
2020
r8581r8582
135135
136136VIDEO_START( djmain )
137137{
138   running_device *k056832 = devtag_get_device(machine, "k056832");
138   running_device *k056832 = machine->device("k056832");
139139
140140   k056832_set_layer_offs(k056832, 0, -92, -27);
141141   // k056832_set_layer_offs(k056832, 1, -87, -27);
r8581r8582
144144
145145VIDEO_UPDATE( djmain )
146146{
147   running_device *k056832 = devtag_get_device(screen->machine, "k056832");
148   running_device *k055555 = devtag_get_device(screen->machine, "k055555");
147   running_device *k056832 = screen->machine->device("k056832");
148   running_device *k055555 = screen->machine->device("k055555");
149149   int enables = k055555_read_register(k055555, K55_INPUT_ENABLES);
150150   int pri[NUM_LAYERS + 1];
151151   int order[NUM_LAYERS + 1];
src/mame/video/segahang.c
r8581r8582
8585   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
8686   return 0;
8787}
88
src/mame/video/konamigx.c
r8581r8582
23882388
23892389   if (konamigx_has_dual_screen)
23902390   {
2391      running_device *left_screen  = devtag_get_device(screen->machine, "screen");
2392      running_device *right_screen = devtag_get_device(screen->machine, "screen2");
2391      running_device *left_screen  = screen->machine->device("screen");
2392      running_device *right_screen = screen->machine->device("screen2");
23932393
23942394      /* the video gets demuxed by a board which plugs into the jamma connector */
23952395      if (screen==left_screen)
r8581r8582
25992599
26002600   if (konamigx_has_dual_screen)
26012601   {
2602      running_device *left_screen  = devtag_get_device(screen->machine, "screen");
2603      running_device *right_screen = devtag_get_device(screen->machine, "screen2");
2602      running_device *left_screen  = screen->machine->device("screen");
2603      running_device *right_screen = screen->machine->device("screen2");
26042604
26052605      if (screen==left_screen)
26062606      {
src/mame/video/groundfx.c
r8581r8582
212212
213213VIDEO_UPDATE( groundfx )
214214{
215   running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn");
216   running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp");
215   running_device *tc0100scn = screen->machine->device("tc0100scn");
216   running_device *tc0480scp = screen->machine->device("tc0480scp");
217217   UINT8 layer[5];
218218   UINT8 pivlayer[3];
219219   UINT16 priority;
src/mame/video/cidelsa.c
r8581r8582
190190   state->charram = auto_alloc_array(machine, UINT8, CIDELSA_CHARRAM_SIZE);
191191
192192   /* find devices */
193   state->cdp1869 = devtag_get_device(machine, CDP1869_TAG);
193   state->cdp1869 = machine->device(CDP1869_TAG);
194194
195195   /* register for state saving */
196196   state_save_register_global(machine, state->cdp1869_pcb);
src/mame/video/fuukifg2.c
r8581r8582
288288   UINT16 scrollx_offs, scrolly_offs;
289289
290290   /*
291    It's not independant bits causing layers to switch, that wouldn't make sense with 3 bits.
291    It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits.
292292    See fuukifg3 for more justification
293293    */
294294   static const int pri_table[6][3] = {
src/mame/video/gaelco2.c
r8581r8582
468468{
469469   int i;
470470
471   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
472   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
471   running_device *left_screen  = screen->machine->device("lscreen");
472   running_device *right_screen = screen->machine->device("rscreen");
473473
474474   /* read scroll values */
475475   int scroll0x = gaelco2_videoram[0x2802/2] + 0x14;
src/mame/video/megasys1.c
r8581r8582
455455      case 0x100/2   :   megasys1_sprite_flag = new_data;      break;
456456
457457      case 0x300/2   :   megasys1_screen_flag = new_data;
458                     if (devtag_get_device(space->machine, "soundcpu"))
458                     if (space->machine->device("soundcpu"))
459459                     {
460460                        if (new_data & 0x10)
461461                           cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
src/mame/video/fuukifg3.c
r8581r8582
321321   UINT16 scrollx_offs,   scrolly_offs;
322322
323323   /*
324    It's not independant bits causing layers to switch, that wouldn't make sense with 3 bits.
324    It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits.
325325    */
326326
327327   static const int pri_table[6][3] = {
src/mame/video/tbowl.c
r8581r8582
212212
213213VIDEO_UPDATE( tbowl )
214214{
215   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
216   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
215   running_device *left_screen  = screen->machine->device("lscreen");
216   running_device *right_screen = screen->machine->device("rscreen");
217217
218218   if (screen == left_screen)
219219   {
src/mame/video/genesis.c
r8581r8582
325325      case 0x09:
326326      case 0x0a:
327327      case 0x0b:
328         device = devtag_get_device(space->machine, "snsnd");
328         device = space->machine->device("snsnd");
329329         if (device != NULL && ACCESSING_BITS_0_7)
330330            sn76496_w(device, 0, data & 0xff);
331331         break;
src/mame/video/triplhnt.c
r8581r8582
130130
131131VIDEO_UPDATE( triplhnt )
132132{
133   running_device *discrete = devtag_get_device(screen->machine, "discrete");
133   running_device *discrete = screen->machine->device("discrete");
134134
135135   tilemap_mark_all_tiles_dirty(bg_tilemap);
136136
src/mame/video/subs.c
r8581r8582
4242   UINT8 *spriteram = screen->machine->generic.spriteram.u8;
4343   int offs;
4444
45   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
46   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
47   running_device *discrete = devtag_get_device(screen->machine, "discrete");
45   running_device *left_screen  = screen->machine->device("lscreen");
46   running_device *right_screen = screen->machine->device("rscreen");
47   running_device *discrete = screen->machine->device("discrete");
4848
4949   /* for every character in the Video RAM, check if it has been modified */
5050   /* since last time and update it accordingly. */
src/mame/layout/topracer.lay
r0r8582
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="shifter" defstate="0">
4      <rect>
5         <bounds left="0" right="32" top="0" bottom="64" />
6         <color red="0.8" green="0.0" blue="0.0" />
7      </rect>
8      <rect>
9         <bounds left="2" right="30" top="2" bottom="62" />
10         <color red="0.0" green="0.0" blue="0.0" />
11      </rect>
12      <rect>
13         <bounds left="14" right="18" top="15" bottom="49" />
14         <color red="0.5" green="0.5" blue="0.5" />
15      </rect>
16      <disk>
17         <bounds left="14" right="18" top="13" bottom="17" />
18         <color red="0.5" green="0.5" blue="0.5" />
19      </disk>
20      <disk>
21         <bounds left="14" right="18" top="47" bottom="51" />
22         <color red="0.5" green="0.5" blue="0.5" />
23      </disk>
24      <text string="LOW" state="0">
25         <bounds left="3" right="29" top="2" bottom="12" />
26         <color red="1.0" green="1.0" blue="0.0" />
27      </text>
28      <text string="LOW" state="1">
29         <bounds left="3" right="29" top="2" bottom="12" />
30         <color red="1.0" green="1.0" blue="1.0" />
31      </text>
32
33      <text string="HIGH" state="0">
34         <bounds left="3" right="29" top="52" bottom="62" />
35         <color red="1.0" green="1.0" blue="1.0" />
36      </text>
37      <text string="HIGH" state="1">
38         <bounds left="3" right="29" top="52" bottom="62" />
39         <color red="1.0" green="1.0" blue="0.0" />
40      </text>
41      <disk state="0">
42         <bounds left="9" right="23" top="14" bottom="28" />
43         <color red="0.8" green="0.0" blue="0.0" />
44      </disk>
45      <disk state="1">
46         <bounds left="9" right="23" top="36" bottom="50" />
47         <color red="0.8" green="0.0" blue="0.0" />
48      </disk>
49   </element>
50   <view name="Shifter-R">
51      <screen index="0">
52         <bounds x="0" y="0" width="640" height="480" />
53      </screen>     
54      <bezel element="shifter" inputtag="IN0" inputmask="0x20">
55         <bounds x="606" y="414" width="32" height="64" />
56         <color alpha="0.9" />
57      </bezel>
58   </view>
59   <view name="Shifter-L">
60      <screen index="0">
61         <bounds x="0" y="0" width="640" height="480" />
62      </screen>     
63      <bezel element="shifter" inputtag="IN0" inputmask="0x20">
64         <bounds x="2" y="414" width="32" height="64" />
65         <color alpha="0.9" />
66      </bezel>
67   </view>
68</mamelayout>
src/mame/drivers/nycaptor.c
r8581r8582
699699{
700700   nycaptor_state *state = (nycaptor_state *)machine->driver_data;
701701
702   state->maincpu = devtag_get_device(machine, "maincpu");
703   state->audiocpu = devtag_get_device(machine, "audiocpu");
704   state->subcpu = devtag_get_device(machine, "sub");
705   state->mcu = devtag_get_device(machine, "mcu");
702   state->maincpu = machine->device("maincpu");
703   state->audiocpu = machine->device("audiocpu");
704   state->subcpu = machine->device("sub");
705   state->mcu = machine->device("mcu");
706706
707707   state_save_register_global(machine, state->generic_control_reg);
708708   state_save_register_global(machine, state->sound_nmi_enable);
src/mame/drivers/mitchell.c
r8581r8582
115115
116116static READ8_HANDLER( pang_port5_r )
117117{
118   int bit = eeprom_read_bit(devtag_get_device(space->machine, "eeprom")) << 7;
118   int bit = eeprom_read_bit(space->machine->device("eeprom")) << 7;
119119
120120   /* bits 0 and (sometimes) 3 are checked in the interrupt handler.
121121        bit 3 is checked before updating the palette so it really seems to be vblank.
src/mame/drivers/blktiger.c
r8581r8582
283283{
284284   blktiger_state *state = (blktiger_state *)machine->driver_data;
285285
286   state->audiocpu = devtag_get_device(machine, "audiocpu");
287   state->mcu = devtag_get_device(machine, "mcu");
286   state->audiocpu = machine->device("audiocpu");
287   state->mcu = machine->device("mcu");
288288
289289   /* configure bankswitching */
290290   memory_configure_bank(machine, "bank1", 0, 16, memory_region(machine, "maincpu") + 0x10000, 0x4000);
src/mame/drivers/mgolf.c
r8581r8582
304304{
305305   mgolf_state *state = (mgolf_state *)machine->driver_data;
306306
307   state->maincpu = devtag_get_device(machine, "maincpu");
307   state->maincpu = machine->device("maincpu");
308308
309309   state_save_register_global(machine, state->prev);
310310   state_save_register_global(machine, state->mask);
src/mame/drivers/deco_mlc.c
r8581r8582
742742static DRIVER_INIT( avengrgs )
743743{
744744   // init options
745   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
745   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
746746
747747   // set up speed cheat
748   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x3234);
749   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x32dc);
748   sh2drc_add_pcflush(machine->device("maincpu"), 0x3234);
749   sh2drc_add_pcflush(machine->device("maincpu"), 0x32dc);
750750
751751   mainCpuIsArm = 0;
752752   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r );
r8581r8582
758758   /* The timing in the ARM core isn't as accurate as it should be, so bump up the
759759        effective clock rate here to compensate otherwise we have slowdowns in
760760        Skull Fung where there probably shouldn't be. */
761   cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 2.0f);
761   machine->device("maincpu")->set_clock_scale(2.0f);
762762   mainCpuIsArm = 1;
763763   deco156_decrypt(machine);
764764   descramble_sound(machine);
src/mame/drivers/pasha2.c
r8581r8582
463463   ROM_LOAD16_BYTE( "pp2-u1.u102",  0x400001, 0x200000, CRC(7a3492fb) SHA1(de72c4d10e17eaf2b7531f637b42cbb3d07819b5) )
464464   // empty space, but no empty sockets on the pcb
465465
466   ROM_REGION( 0x0800, "cpu1", 0 ) /* AT89C52 (protected) */
467   ROM_LOAD( "pasha2_at89c52",  0x0000, 0x0800, NO_DUMP ) /* MCU internal 8K flash */
466   // not hooked up yet
467   ROM_REGION( 0x2000, "cpu1", 0 ) /* AT89C52 */
468   ROM_LOAD( "89c52.bin",  0x0000, 0x2000, CRC(9ce43ce4) SHA1(8027a3549b38e9a2e7bb8f518a0defcaf9743371) )
468469
469470   ROM_REGION( 0x80000, "user3", 0 ) /* SAM9773 sound data */
470471   ROM_LOAD( "pp2.um2",      0x00000, 0x80000, CRC(86814b37) SHA1(70f8a94410e362669570c39e00492c0d69de6b17) )
src/mame/drivers/bublbobl.c
r8581r8582
255255  sound every four rounds of demo play.
256256
257257TODO:
258- the MCU is actually a 6801U4, which has additional features like internal timers
259  (similar to the HD63701). I've just mapped the I/O ports since that's the only
260    thing required for normal operation, but the program does use some of the
261    additional features in its special "test" mode.
262- tokio: doesn't work due to missing MCU protection emulation.
258- the Bubble Bobble MCU is actually an MC6801U4, which has additional features like
259    internal timers (similar to the HD63701). I've just mapped the I/O ports since
260    that's the only thing required for normal operation, but the program does
261    use some of the additional features in its special "test" mode.
262- tokio: doesn't work due to missing MC68705 MCU protection emulation.
263263- tokio: sound support is probably incomplete. There are a couple of unknown
264264  accesses done by the CPU, including to the YM2203 I/O ports. At the
265265  very least, there should be some filters.
r8581r8582
725725{
726726   bublbobl_state *state = (bublbobl_state *)machine->driver_data;
727727
728   state->maincpu = devtag_get_device(machine, "maincpu");
729   state->mcu = devtag_get_device(machine, "mcu");
730   state->audiocpu = devtag_get_device(machine, "audiocpu");
731   state->slave = devtag_get_device(machine, "slave");
728   state->maincpu = machine->device("maincpu");
729   state->mcu = machine->device("mcu");
730   state->audiocpu = machine->device("audiocpu");
731   state->slave = machine->device("slave");
732732
733733   state_save_register_global(machine, state->sound_nmi_enable);
734734   state_save_register_global(machine, state->pending_nmi);
r8581r8582
981981 *  ROM definition(s)
982982 *
983983 *************************************/
984ROM_START( tokio ) // newer japan set, has -1 revision of roms 02, 03 and 06
985   ROM_REGION( 0x30000, "maincpu", 0 )   /* main CPU */
986   ROM_LOAD( "a71-02-1.ic4", 0x00000, 0x8000, CRC(BB8DABD7) SHA1(141E9F0C19BCF316477681369E2D98DFFDD8435D) )
987   /* ROMs banked at 8000-bfff */
988   ROM_LOAD( "a71-03-1.ic5", 0x10000, 0x8000, CRC(EE49B383) SHA1(D510A1D168542DF6A87C7D7C67A47CF776A51F29) )
989   ROM_LOAD( "a71-04.ic6",   0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
990   ROM_LOAD( "a71-05.ic7",   0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
991   ROM_LOAD( "a71-06-1.ic8", 0x28000, 0x8000, CRC(56927B3F) SHA1(33FB4E71B95664ECFF1F35F6782A14101982A56D) )
984992
985ROM_START( tokio )
993   ROM_REGION( 0x10000, "slave", 0 )   /* video CPU */
994   ROM_LOAD( "a71-01.ic1",   0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
995
996   ROM_REGION( 0x10000, "audiocpu", 0 )   /* audio CPU */
997   ROM_LOAD( "a71-07.ic10",  0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
998
999   ROM_REGION( 0x0800, "cpu3", 0 )   /* 2k for the microcontroller (68705P5) */
1000   ROM_LOAD( "a71-24.ic57",  0x0000, 0x0800, NO_DUMP )
1001
1002   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT ) /* gfx roms, on gfx board */
1003   ROM_LOAD( "a71-08.ic12",  0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1004   ROM_LOAD( "a71-09.ic13",  0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1005   ROM_LOAD( "a71-10.ic14",  0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1006   ROM_LOAD( "a71-11.ic15",  0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1007   ROM_LOAD( "a71-12.ic16",  0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1008   ROM_LOAD( "a71-13.ic17",  0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1009   ROM_LOAD( "a71-14.ic18",  0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1010   ROM_LOAD( "a71-15.ic19",  0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1011   ROM_LOAD( "a71-16.ic30",  0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1012   ROM_LOAD( "a71-17.ic31",  0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1013   ROM_LOAD( "a71-18.ic32",  0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1014   ROM_LOAD( "a71-19.ic33",  0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1015   ROM_LOAD( "a71-20.ic34",  0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1016   ROM_LOAD( "a71-21.ic35",  0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1017   ROM_LOAD( "a71-22.ic36",  0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1018   ROM_LOAD( "a71-23.ic37",  0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
1019
1020   ROM_REGION( 0x0100, "proms", 0 )
1021   ROM_LOAD( "a71-25.ic41",  0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing, on gfx board */
1022
1023   ROM_REGION( 0x0200, "plds", 0 )
1024   ROM_LOAD( "a71-26.ic19",  0x0000, 0x0117, CRC(4e1f119c) SHA1(0ac8eb2fdb202951e5f7145f92dfd10fe96b294b) )
1025ROM_END
1026
1027ROM_START( tokioo ) // older japan set, has older roms 02, 03, 06
9861028   ROM_REGION( 0x30000, "maincpu", 0 )   /* main CPU */
987   ROM_LOAD( "a71-02.4",     0x00000, 0x8000, CRC(d556c908) SHA1(d5d8afb7f7888d77aa9a372dfbab75fbd0358cc3) )
1029   ROM_LOAD( "a71-02.ic4",   0x00000, 0x8000, CRC(d556c908) SHA1(d5d8afb7f7888d77aa9a372dfbab75fbd0358cc3) )
9881030   /* ROMs banked at 8000-bfff */
989   ROM_LOAD( "a71-03.5",     0x10000, 0x8000, CRC(69dacf44) SHA1(ee8c33702749c0e2562951f9f80c897d3fbd7dd7) )
990   ROM_LOAD( "a71-04.6",     0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
991   ROM_LOAD( "a71-05.7",     0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
992   ROM_LOAD( "a71-06.8",     0x28000, 0x8000, CRC(447d6779) SHA1(5b329b221357a9cea777415d409a6423529a925c) )
1031   ROM_LOAD( "a71-03.ic5",   0x10000, 0x8000, CRC(69dacf44) SHA1(ee8c33702749c0e2562951f9f80c897d3fbd7dd7) )
1032   ROM_LOAD( "a71-04.ic6",   0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
1033   ROM_LOAD( "a71-05.ic7",   0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
1034   ROM_LOAD( "a71-06.ic8",   0x28000, 0x8000, CRC(447d6779) SHA1(5b329b221357a9cea777415d409a6423529a925c) )
9931035
9941036   ROM_REGION( 0x10000, "slave", 0 )   /* video CPU */
995   ROM_LOAD( "a71-01.1",     0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
1037   ROM_LOAD( "a71-01.ic1",   0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
9961038
9971039   ROM_REGION( 0x10000, "audiocpu", 0 )   /* audio CPU */
998   ROM_LOAD( "a71-07.10",    0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
1040   ROM_LOAD( "a71-07.ic10",  0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
9991041
10001042   ROM_REGION( 0x0800, "cpu3", 0 )   /* 2k for the microcontroller (68705P5) */
1001   ROM_LOAD( "a71-24.57",    0x0000, 0x0800, NO_DUMP )
1043   ROM_LOAD( "a71-24.ic57",  0x0000, 0x0800, NO_DUMP )
10021044
1003   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT )
1004   ROM_LOAD( "a71-08.12",    0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1005   ROM_LOAD( "a71-09.13",    0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1006   ROM_LOAD( "a71-10.14",    0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1007   ROM_LOAD( "a71-11.15",    0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1008   ROM_LOAD( "a71-12.16",    0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1009   ROM_LOAD( "a71-13.17",    0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1010   ROM_LOAD( "a71-14.18",    0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1011   ROM_LOAD( "a71-15.19",    0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1012   ROM_LOAD( "a71-16.30",    0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1013   ROM_LOAD( "a71-17.31",    0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1014   ROM_LOAD( "a71-18.32",    0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1015   ROM_LOAD( "a71-19.33",    0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1016   ROM_LOAD( "a71-20.34",    0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1017   ROM_LOAD( "a71-21.35",    0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1018   ROM_LOAD( "a71-22.36",    0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1019   ROM_LOAD( "a71-23.37",    0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
1045   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT ) /* gfx roms, on gfx board */
1046   ROM_LOAD( "a71-08.ic12",  0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1047   ROM_LOAD( "a71-09.ic13",  0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1048   ROM_LOAD( "a71-10.ic14",  0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1049   ROM_LOAD( "a71-11.ic15",  0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1050   ROM_LOAD( "a71-12.ic16",  0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1051   ROM_LOAD( "a71-13.ic17",  0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1052   ROM_LOAD( "a71-14.ic18",  0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1053   ROM_LOAD( "a71-15.ic19",  0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1054   ROM_LOAD( "a71-16.ic30",  0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1055   ROM_LOAD( "a71-17.ic31",  0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1056   ROM_LOAD( "a71-18.ic32",  0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1057   ROM_LOAD( "a71-19.ic33",  0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1058   ROM_LOAD( "a71-20.ic34",  0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1059   ROM_LOAD( "a71-21.ic35",  0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1060   ROM_LOAD( "a71-22.ic36",  0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1061   ROM_LOAD( "a71-23.ic37",  0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
10201062
10211063   ROM_REGION( 0x0100, "proms", 0 )
1022   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1064   ROM_LOAD( "a71-25.ic41",  0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing, on gfx board */
10231065
10241066   ROM_REGION( 0x0200, "plds", 0 )
1025   ROM_LOAD( "a71-26.bin", 0x0000, 0x0117, CRC(4e1f119c) SHA1(0ac8eb2fdb202951e5f7145f92dfd10fe96b294b) )
1067   ROM_LOAD( "a71-26.ic19", 0x0000, 0x0117, CRC(4e1f119c) SHA1(0ac8eb2fdb202951e5f7145f92dfd10fe96b294b) )
10261068ROM_END
10271069
10281070ROM_START( tokiou )
10291071   ROM_REGION( 0x30000, "maincpu", 0 )   /* main CPU */
1030   ROM_LOAD( "a71-27-1.4",  0x00000, 0x8000, CRC(8c180896) SHA1(bc8aeb42da4bae7db6f65b9874224f60a9bc4500) )
1072   ROM_LOAD( "a71-27-1.ic4", 0x00000, 0x8000, CRC(8c180896) SHA1(bc8aeb42da4bae7db6f65b9874224f60a9bc4500) )
10311073   /* ROMs banked at 8000-bfff */
1032   ROM_LOAD( "a71-28-1.5",   0x10000, 0x8000, CRC(1b447527) SHA1(6939e6c1b8492825d18f4e96f39ff45f4c96eea2) )
1033   ROM_LOAD( "a71-04.6",     0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
1034   ROM_LOAD( "a71-05.7",     0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
1035   ROM_LOAD( "a71-06-1.8",   0x28000, 0x8000, CRC(56927b3f) SHA1(33fb4e71b95664ecff1f35f6782a14101982a56d) )
1074   ROM_LOAD( "a71-28-1.ic5", 0x10000, 0x8000, CRC(1b447527) SHA1(6939e6c1b8492825d18f4e96f39ff45f4c96eea2) )
1075   ROM_LOAD( "a71-04.ic6",   0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
1076   ROM_LOAD( "a71-05.ic7",   0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
1077   ROM_LOAD( "a71-06-1.ic8", 0x28000, 0x8000, CRC(56927b3f) SHA1(33fb4e71b95664ecff1f35f6782a14101982a56d) )
10361078
10371079   ROM_REGION( 0x10000, "slave", 0 )   /* video CPU */
1038   ROM_LOAD( "a71-01.1",     0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
1080   ROM_LOAD( "a71-01.ic1",   0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
10391081
10401082   ROM_REGION( 0x10000, "audiocpu", 0 )   /* audio CPU */
1041   ROM_LOAD( "a71-07.10",    0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
1083   ROM_LOAD( "a71-07.ic10",  0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
10421084
10431085   ROM_REGION( 0x0800, "cpu3", 0 )   /* 2k for the microcontroller (68705P5) */
1044   ROM_LOAD( "a71-24.57",    0x0000, 0x0800, NO_DUMP )
1086   ROM_LOAD( "a71-24.ic57",  0x0000, 0x0800, NO_DUMP )
10451087
1046   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT )
1047   ROM_LOAD( "a71-08.12",    0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1048   ROM_LOAD( "a71-09.13",    0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1049   ROM_LOAD( "a71-10.14",    0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1050   ROM_LOAD( "a71-11.15",    0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1051   ROM_LOAD( "a71-12.16",    0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1052   ROM_LOAD( "a71-13.17",    0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1053   ROM_LOAD( "a71-14.18",    0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1054   ROM_LOAD( "a71-15.19",    0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1055   ROM_LOAD( "a71-16.30",    0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1056   ROM_LOAD( "a71-17.31",    0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1057   ROM_LOAD( "a71-18.32",    0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1058   ROM_LOAD( "a71-19.33",    0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1059   ROM_LOAD( "a71-20.34",    0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1060   ROM_LOAD( "a71-21.35",    0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1061   ROM_LOAD( "a71-22.36",    0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1062   ROM_LOAD( "a71-23.37",    0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
1088   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT ) /* gfx roms, on gfx board */
1089   ROM_LOAD( "a71-08.ic12",  0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1090   ROM_LOAD( "a71-09.ic13",  0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1091   ROM_LOAD( "a71-10.ic14",  0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1092   ROM_LOAD( "a71-11.ic15",  0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1093   ROM_LOAD( "a71-12.ic16",  0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1094   ROM_LOAD( "a71-13.ic17",  0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1095   ROM_LOAD( "a71-14.ic18",  0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1096   ROM_LOAD( "a71-15.ic19",  0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1097   ROM_LOAD( "a71-16.ic30",  0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1098   ROM_LOAD( "a71-17.ic31",  0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1099   ROM_LOAD( "a71-18.ic32",  0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1100   ROM_LOAD( "a71-19.ic33",  0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1101   ROM_LOAD( "a71-20.ic34",  0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1102   ROM_LOAD( "a71-21.ic35",  0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1103   ROM_LOAD( "a71-22.ic36",  0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1104   ROM_LOAD( "a71-23.ic37",  0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
10631105
10641106   ROM_REGION( 0x0100, "proms", 0 )
1065   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1107   ROM_LOAD( "a71-25.ic41",  0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing, on gfx board */
10661108
10671109   ROM_REGION( 0x0200, "plds", 0 )
1068   ROM_LOAD( "a71-26.bin", 0x0000, 0x0117, CRC(4e1f119c) SHA1(0ac8eb2fdb202951e5f7145f92dfd10fe96b294b) )
1110   ROM_LOAD( "a71-26.ic19", 0x0000, 0x0117, CRC(4e1f119c) SHA1(0ac8eb2fdb202951e5f7145f92dfd10fe96b294b) )
10691111ROM_END
10701112
10711113ROM_START( tokiob )
10721114   ROM_REGION( 0x30000, "maincpu", 0 ) /* main CPU */
1073   ROM_LOAD( "2",            0x00000, 0x8000, CRC(f583b1ef) SHA1(a97b36299b51792953516224191f11decc579a38) )
1115   ROM_LOAD( "2.ic4",        0x00000, 0x8000, CRC(f583b1ef) SHA1(a97b36299b51792953516224191f11decc579a38) )
10741116   /* ROMs banked at 8000-bfff */
1075   ROM_LOAD( "a71-03.5",     0x10000, 0x8000, CRC(69dacf44) SHA1(ee8c33702749c0e2562951f9f80c897d3fbd7dd7) )
1076   ROM_LOAD( "a71-04.6",     0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
1077   ROM_LOAD( "a71-05.7",     0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
1078   ROM_LOAD( "6",            0x28000, 0x8000, CRC(1490e95b) SHA1(a73e1857a1029156f0b5f7f7fe34a37870e72209) )
1117   ROM_LOAD( "a71-03.ic5",   0x10000, 0x8000, CRC(69dacf44) SHA1(ee8c33702749c0e2562951f9f80c897d3fbd7dd7) )
1118   ROM_LOAD( "a71-04.ic6",   0x18000, 0x8000, CRC(a0a4ce0e) SHA1(c49bdcd85c760a5e7327d1b424772e1560f1a318) )
1119   ROM_LOAD( "a71-05.ic7",   0x20000, 0x8000, CRC(6da0b945) SHA1(6c80b8333dd95657f99e6ba5b6e877733ac02a8c) )
1120   ROM_LOAD( "6.ic8",        0x28000, 0x8000, CRC(1490e95b) SHA1(a73e1857a1029156f0b5f7f7fe34a37870e72209) )
10791121
10801122   ROM_REGION( 0x10000, "slave", 0 )   /* video CPU */
1081   ROM_LOAD( "a71-01.1",     0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
1123   ROM_LOAD( "a71-01.ic1",   0x00000, 0x8000, CRC(0867c707) SHA1(7129974f1252b28e9e338bd3c7fcb87210dcf412) )
10821124
10831125   ROM_REGION( 0x10000, "audiocpu", 0 )   /* audio CPU */
1084   ROM_LOAD( "a71-07.10",    0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
1126   ROM_LOAD( "a71-07.ic10",  0x0000, 0x08000, CRC(f298cc7b) SHA1(ebf5c804aa07b7f198ec3e1f8d1e111cd89ebdf3) )
10851127
1086   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT )
1087   ROM_LOAD( "a71-08.12",    0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1088   ROM_LOAD( "a71-09.13",    0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1089   ROM_LOAD( "a71-10.14",    0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1090   ROM_LOAD( "a71-11.15",    0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1091   ROM_LOAD( "a71-12.16",    0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1092   ROM_LOAD( "a71-13.17",    0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1093   ROM_LOAD( "a71-14.18",    0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1094   ROM_LOAD( "a71-15.19",    0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1095   ROM_LOAD( "a71-16.30",    0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1096   ROM_LOAD( "a71-17.31",    0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1097   ROM_LOAD( "a71-18.32",    0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1098   ROM_LOAD( "a71-19.33",    0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1099   ROM_LOAD( "a71-20.34",    0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1100   ROM_LOAD( "a71-21.35",    0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1101   ROM_LOAD( "a71-22.36",    0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1102   ROM_LOAD( "a71-23.37",    0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
1128   ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT ) /* gfx roms, on gfx board */
1129   ROM_LOAD( "a71-08.ic12",  0x00000, 0x8000, CRC(0439ab13) SHA1(84142220a6a29f0e34f7c7c751b583bf394df8ce) )    /* 1st plane */
1130   ROM_LOAD( "a71-09.ic13",  0x08000, 0x8000, CRC(edb3d2ff) SHA1(0c6e4bbc786a097f9d99220e72f98c1c795a7292) )
1131   ROM_LOAD( "a71-10.ic14",  0x10000, 0x8000, CRC(69f0888c) SHA1(1704ab6339981195cd09d581e83094c75037d18e) )
1132   ROM_LOAD( "a71-11.ic15",  0x18000, 0x8000, CRC(4ae07c31) SHA1(452d1eb5a70e7853791cd05e4578c1454477bdec) )
1133   ROM_LOAD( "a71-12.ic16",  0x20000, 0x8000, CRC(3f6bd706) SHA1(b03c534a95b71941331d3ffd9aa7069b5f05687e) )
1134   ROM_LOAD( "a71-13.ic17",  0x28000, 0x8000, CRC(f2c92aaa) SHA1(7dfdc473794a298032405ba918df8085b0bbe174) )
1135   ROM_LOAD( "a71-14.ic18",  0x30000, 0x8000, CRC(c574b7b2) SHA1(9839adce60c0017ae3997603a2aece511af226d2) )
1136   ROM_LOAD( "a71-15.ic19",  0x38000, 0x8000, CRC(12d87e7f) SHA1(327a80f08207ee66721738f7e1c53f75b5659be0) )
1137   ROM_LOAD( "a71-16.ic30",  0x40000, 0x8000, CRC(0bce35b6) SHA1(3f0496db6681c7be1e36ba41296115d158d7457a) )    /* 2nd plane */
1138   ROM_LOAD( "a71-17.ic31",  0x48000, 0x8000, CRC(deda6387) SHA1(40f0be3a71b0a03f0275da72f4124424b162318a) )
1139   ROM_LOAD( "a71-18.ic32",  0x50000, 0x8000, CRC(330cd9d7) SHA1(919f78036b760938d6aa72754be1a615f568b470) )
1140   ROM_LOAD( "a71-19.ic33",  0x58000, 0x8000, CRC(fc4b29e0) SHA1(d11393a24b5c6c04f5058b299e4b0fc773a03e4b) )
1141   ROM_LOAD( "a71-20.ic34",  0x60000, 0x8000, CRC(65acb265) SHA1(2ef940f994e76d4387be6e0d53a565813cc59636) )
1142   ROM_LOAD( "a71-21.ic35",  0x68000, 0x8000, CRC(33cde9b2) SHA1(9b227ab609e3c7c6be90c29739a57ea4959cd68e) )
1143   ROM_LOAD( "a71-22.ic36",  0x70000, 0x8000, CRC(fb98eac0) SHA1(57615c3934de5510eeeb0ba16024abda8ee95303) )
1144   ROM_LOAD( "a71-23.ic37",  0x78000, 0x8000, CRC(30bd46ad) SHA1(6e1618ed237c769d1a8d329fbd7a9f7216993215) )
11031145
11041146   ROM_REGION( 0x0100, "proms", 0 )
1105   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1147   ROM_LOAD( "a71-25.ic41",  0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing, on gfx board */
11061148ROM_END
11071149
11081150
r8581r8582
15471589 *
15481590 *************************************/
15491591
1550GAME( 1986, tokio,      0,        tokio,    tokio,    tokio,    ROT90, "Taito Corporation", "Tokio / Scramble Formation", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
1592GAME( 1986, tokio,      0,        tokio,    tokio,    tokio,    ROT90, "Taito Corporation", "Tokio / Scramble Formation (newer)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
1593GAME( 1986, tokioo,     tokio,        tokio,    tokio,    tokio,    ROT90, "Taito Corporation", "Tokio / Scramble Formation (older)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
15511594GAME( 1986, tokiou,     tokio,    tokio,    tokio,    tokio,    ROT90, "Taito America Corporation (Romstar license)", "Tokio / Scramble Formation (US)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
15521595GAME( 1986, tokiob,     tokio,    tokio,    tokio,    tokiob,   ROT90, "bootleg", "Tokio / Scramble Formation (bootleg)", GAME_SUPPORTS_SAVE )
15531596
src/mame/drivers/skyfox.c
r8581r8582
224224{
225225   skyfox_state *state = (skyfox_state *)machine->driver_data;
226226
227   state->maincpu = devtag_get_device(machine, "maincpu");
227   state->maincpu = machine->device("maincpu");
228228
229229   state_save_register_global(machine, state->bg_pos);
230230   state_save_register_global(machine, state->bg_ctrl);
src/mame/drivers/fgoal.c
r8581r8582
340340{
341341   fgoal_state *state = (fgoal_state *)machine->driver_data;
342342
343   state->maincpu = devtag_get_device(machine, "maincpu");
344   state->mb14241 = devtag_get_device(machine, "mb14241");
343   state->maincpu = machine->device("maincpu");
344   state->mb14241 = machine->device("mb14241");
345345
346346   state_save_register_global(machine, state->xpos);
347347   state_save_register_global(machine, state->ypos);
src/mame/drivers/mystston.c
r8581r8582
7878   if (((*state->ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00))
7979   {
8080      /* bit 4 goes to the 8910 #0 BC1 pin */
81      ay8910_data_address_w(devtag_get_device(space->machine, "ay1"), *state->ay8910_select >> 4, *state->ay8910_data);
81      ay8910_data_address_w(space->machine->device("ay1"), *state->ay8910_select >> 4, *state->ay8910_data);
8282   }
8383
8484   /* bit 7 goes to 8910 #1 BDIR pin */
8585   if (((*state->ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00))
8686   {
8787      /* bit 6 goes to the 8910 #1 BC1 pin */
88      ay8910_data_address_w(devtag_get_device(space->machine, "ay2"), *state->ay8910_select >> 6, *state->ay8910_data);
88      ay8910_data_address_w(space->machine->device("ay2"), *state->ay8910_select >> 6, *state->ay8910_data);
8989   }
9090
9191   *state->ay8910_select = data;
src/mame/drivers/rampart.c
r8581r8582
4949{
5050   /* generate 32V signals */
5151   if ((scanline & 32) == 0)
52      atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
52      atarigen_scanline_int_gen(screen.machine->device("maincpu"));
5353}
5454
5555
r8581r8582
500500
501501   state->atarigen.eeprom_default = compressed_default_eeprom;
502502   memcpy(&rom[0x140000], &rom[0x40000], 0x8000);
503   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x140000, 0x438000, 118);
503   atarigen_slapstic_init(machine->device("maincpu"), 0x140000, 0x438000, 118);
504504}
505505
506506
src/mame/drivers/yiear.c
r8581r8582
194194   trackfld_state *state = (trackfld_state *)machine->driver_data;
195195
196196   state->audiocpu = NULL;
197   state->vlm = devtag_get_device(machine, "vlm");
197   state->vlm = machine->device("vlm");
198198
199199   state_save_register_global(machine, state->yiear_nmi_enable);
200200
src/mame/drivers/bfm_sc1.c
r8581r8582
33    Bellfruit scorpion1 driver, (under heavy construction !!!)
44
55    A.G.E Code Copyright J. Wallace and the AGEMAME Development Team.
6    Visit http://www.mameworld.net/agemame/ for more information.
6    Visit http://agemame.mameworld.info for more information.
77
88    M.A.M.E Core Copyright Nicola Salmoria and the MAME Team,
99    used under license from http://mamedev.org
r8581r8582
180180
181181       sc1_Inputs[2] = input_port_read(device->machine,"STROBE0");
182182
183      generic_pulse_irq_line(devtag_get_device(device->machine, "maincpu"), M6809_IRQ_LINE);
183      generic_pulse_irq_line(device->machine->device("maincpu"), M6809_IRQ_LINE);
184184   }
185185}
186186
r8581r8582
277277         if ( changed & (1 << i) )
278278         {
279279            Mechmtr_update(i, cycles, data & (1 << i) );
280            generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE);
280            generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
281281         }
282282      }
283283   }
src/mame/drivers/snowbros.c
r8581r8582
8282
8383static VIDEO_UPDATE( snowbros )
8484{
85   running_device *pandora = devtag_get_device(screen->machine, "pandora");
85   running_device *pandora = screen->machine->device("pandora");
8686
8787   /* This clears & redraws the entire screen each pass */
8888   bitmap_fill(bitmap,cliprect,0xf0);
r8581r8582
9393
9494static VIDEO_EOF( snowbros )
9595{
96   running_device *pandora = devtag_get_device(machine, "pandora");
96   running_device *pandora = machine->device("pandora");
9797   pandora_eof(pandora);
9898}
9999
r8581r8582
124124
125125static INTERRUPT_GEN( snowbro3_interrupt )
126126{
127   running_device *adpcm = devtag_get_device(device->machine, "oki");
127   running_device *adpcm = device->machine->device("oki");
128128   int status = okim6295_r(adpcm,0);
129129
130130   cpu_set_input_line(device, cpu_getiloops(device) + 2, ASSERT_LINE);   /* IRQs 4, 3, and 2 */
r8581r8582
523523
524524static INPUT_PORTS_START( snowbros )
525525   PORT_START("DSW1")   /* 500001 */
526   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) )
526   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) )      PORT_DIPLOCATION("SW1:1") /* Listed as "NOT USE" in the manual */
527527   PORT_DIPSETTING(    0x00, DEF_STR( Europe ) )
528528   PORT_DIPSETTING(    0x01, "America (Romstar license)" )
529   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
529   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:2")
530530   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
531531   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
532   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
533   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
532   PORT_SERVICE_DIPLOC(  0x04, IP_ACTIVE_LOW, "SW1:3" )
533   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:4")
534534   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
535535   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
536   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
536   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5,6")
537537   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
538538   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
539539   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
r8581r8582
541541   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
542542   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
543543   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
544   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
544   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:7,8")
545545   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
546546   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
547547   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
r8581r8582
561561                                       /* probably VBlank */
562562
563563   PORT_START("DSW2")   /* 500003 */
564   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
564   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
565565   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
566566   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
567567   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
568568   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
569   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
569   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:3,4")
570570   PORT_DIPSETTING(    0x04, "100k and every 200k" )
571571   PORT_DIPSETTING(    0x0c, "100k Only" )
572572   PORT_DIPSETTING(    0x08, "200k Only" )
573573   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
574   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
574   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:5,6")
575575   PORT_DIPSETTING(    0x20, "1" )
576576   PORT_DIPSETTING(    0x00, "2" )
577577   PORT_DIPSETTING(    0x30, "3" )
578578   PORT_DIPSETTING(    0x10, "4" )
579   PORT_DIPNAME( 0x40, 0x40, "Invulnerability" )
579   PORT_DIPNAME( 0x40, 0x40, "Invulnerability" )      PORT_DIPLOCATION("SW2:7")
580580   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
581581   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
582   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) )
582   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW2:8") /* Listed as "NOT USE" in the manual */
583583   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
584584   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
585585   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
603603INPUT_PORTS_END
604604
605605static INPUT_PORTS_START( snowbroj )
606   PORT_START("DSW1")   /* 500001 */
607   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
606   PORT_INCLUDE(snowbros)
607
608   PORT_MODIFY("DSW1")
609   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW1:1") /* Listed as "NOT USE" in the manual */
608610   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
609611   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
610   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
611   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
612   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
613   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
614   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
615   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
616   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
617   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
618   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
619   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
620   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
621   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
622   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
623   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
624   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
625   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
626   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
627   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
628   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
629   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
630   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
631   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
632   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
633   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
634   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* Must be low or game stops! */
635                                       /* probably VBlank */
636
637   PORT_START("DSW2")   /* 500003 */
638   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
639   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
640   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
641   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
642   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
643   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
644   PORT_DIPSETTING(    0x04, "100k and every 200k" )
645   PORT_DIPSETTING(    0x0c, "100k Only" )
646   PORT_DIPSETTING(    0x08, "200k Only" )
647   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
648   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
649   PORT_DIPSETTING(    0x20, "1" )
650   PORT_DIPSETTING(    0x00, "2" )
651   PORT_DIPSETTING(    0x30, "3" )
652   PORT_DIPSETTING(    0x10, "4" )
653   PORT_DIPNAME( 0x40, 0x40, "Invulnerability" )
654   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
655   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
656   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) )
657   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
658   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
659   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
660   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
661   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
662   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
663   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
664   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
665   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
666   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
667
668   PORT_START("SYSTEM")   /* 500005 */
669   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
670   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
671   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 )
672   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 )
673   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
674   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT )
675   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN3 )
676   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
677612INPUT_PORTS_END
678613
679614static INPUT_PORTS_START( honeydol )
r8581r8582
759694   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
760695   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )
761696   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_2C ) )
762    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
763    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
764    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
765    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
766    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
767    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
697   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
698   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
699   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
700   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
701   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
702   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
768703   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Demo_Sounds ) )
769704   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
770705   PORT_DIPSETTING(      0x0010, DEF_STR( On ) )
771706   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) )
772707   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
773708   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
774    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
775    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
776    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
709   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
710   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
711   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
777712   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Level_Select ) ) /* P1 Button 2 to advance, P1 Button 1 to start, starts game with 10 credits */
778713   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
779714   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r8581r8582
798733   PORT_DIPNAME( 0x0008, 0x0008, "Ticket Mode #1" ) /* Shows on title screen "EVERY 4 GAMES = 1 TICKET" same as 0x0040 below? */
799734   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
800735   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
801    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
802    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
803    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
804    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
805    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
806    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
736   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
737   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
738   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
739   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
740   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
741   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
807742   PORT_DIPNAME( 0x0040, 0x0040, "Ticket Mode #2" ) /* Shows on title screen "EVERY 4 GAMES = 1 TICKET" same as 0x0008 above? */
808743   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
809744   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
810   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) /* Always shows 24 credits */
811   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
812   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
745   PORT_DIPNAME( 0x80,   0x0080, DEF_STR( Free_Play ) ) /* Always shows 24 credits */
746   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
747   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
813748   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
814749   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
815750   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
832767
833768static INPUT_PORTS_START( 4in1boot )
834769   PORT_START("DSW1")   /* 500001 */
835   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
770   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
836771   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
837772   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
838   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
773   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:2,3")
839774   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
840775   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
841776   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
842777   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
843   PORT_DIPNAME( 0x78, 0x78, DEF_STR( Coinage ) )
778   PORT_DIPNAME( 0x78, 0x78, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:4,5,6,7")
844779   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
845780   PORT_DIPSETTING(    0x38, DEF_STR( 3C_1C ) )
846781   PORT_DIPSETTING(    0x10, DEF_STR( 4C_2C ) )
r8581r8582
857792   PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )
858793   PORT_DIPSETTING(    0x68, DEF_STR( 1C_3C ) )
859794   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
860   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )
795   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW1:8")
861796   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
862797   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
863798   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r8581r8582
871806                                       /* probably VBlank */
872807
873808   PORT_START("DSW2")   /* 500003 */
874   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
809   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW2:1,2")
875810   PORT_DIPSETTING(    0x02, "1" )
876811   PORT_DIPSETTING(    0x00, "2" )
877812   PORT_DIPSETTING(    0x03, "3" )
878813   PORT_DIPSETTING(    0x01, "4" )
879   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
880   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
881   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
882   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
883   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
884   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
885   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
886   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
887   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
888   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
889   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
890   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
891   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
892   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
893   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
894   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
814   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0000, "SW2:3" )
815   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0000, "SW2:4" )
816   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
817   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW2:6" )
818   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW2:7" )
819   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW2:8" )
895820   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
896821   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
897822   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
914839
915840static INPUT_PORTS_START( hyperpac )
916841   PORT_START("DSW1")   /* 500000.w */
917   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
842   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
918843   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
919844   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
920   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Lives ) )   // "Language" in the "test mode"
921   PORT_DIPSETTING(      0x0002, "3" )               // "Korean"
922   PORT_DIPSETTING(      0x0000, "5" )               // "English"
923   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coinage ) )
845   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:2")   // "Language" in the "test mode"
846   PORT_DIPSETTING(      0x0002, "3" )                     // "Korean"
847   PORT_DIPSETTING(      0x0000, "5" )                     // "English"
848   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:3,4,5")
924849   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
925850   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_1C ) )
926851   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
r8581r8582
929854   PORT_DIPSETTING(      0x0014, DEF_STR( 2C_3C ) )
930855   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
931856   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
932   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
857   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:6,7")
933858   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
934859   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
935860   PORT_DIPSETTING(      0x0040, DEF_STR( Hard ) )
936861   PORT_DIPSETTING(      0x0020, DEF_STR( Hardest ) )         // DEF_STR( Very_Hard )
937   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
862   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
938863   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
939864   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
940865   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r8581r8582
945870   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
946871
947872   PORT_START("DSW2")   /* 500002.w */
948   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
949   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
950   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
951   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
952   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
953   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
954   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
955   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
956   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
957   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
958   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
959   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
960   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
961   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
962   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
963   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
964   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
965   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
966   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
967   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
968   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
969   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
970   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
971   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
873   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0000, "SW2:1" )
874   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0000, "SW2:2" )
875   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0000, "SW2:3" )
876   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0000, "SW2:4" )
877   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
878   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW2:6" )
879   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW2:7" )
880   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0000, "SW2:8" )
972881   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
973882   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
974883   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
991900
992901static INPUT_PORTS_START( cookbib2 )
993902   PORT_START("DSW1")   /* 500000.w */
994   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
903   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
995904   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
996905   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
997   PORT_DIPNAME( 0x0002, 0x0002, "Max Vs Round" )   // "Language" in the "test mode"
906   PORT_DIPNAME( 0x0002, 0x0002, "Max Vs Round" )      PORT_DIPLOCATION("SW1:2")   // "Language" in the "test mode"
998907   PORT_DIPSETTING(      0x0002, "3" )
999908   PORT_DIPSETTING(      0x0000, "1" )
1000   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coinage ) )
909   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:3,4,5")
1001910   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1002911   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_1C ) )
1003912   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
r8581r8582
1006915   PORT_DIPSETTING(      0x0014, DEF_STR( 2C_3C ) )
1007916   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
1008917   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
1009   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
918   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:6,7")
1010919   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
1011920   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
1012921   PORT_DIPSETTING(      0x0040, DEF_STR( Hard ) )
1013922   PORT_DIPSETTING(      0x0020, DEF_STR( Hardest ) )         // DEF_STR( Very_Hard )
1014   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
923   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
1015924   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1016925   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1017926   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r8581r8582
1022931   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1023932
1024933   PORT_START("DSW2")   /* 500002.w */
1025   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
1026   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1027   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1028   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
1029   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1030   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1031   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
1032   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
1033   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1034   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
1035   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1036   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1037   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
1038   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1039   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1040   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1041   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1042   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1043   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1044   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1045   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1046   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1047   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1048   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
934   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0000, "SW2:1" )
935   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0000, "SW2:2" )
936   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0000, "SW2:3" )
937   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0000, "SW2:4" )
938   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
939   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW2:6" )
940   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW2:7" )
941   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0000, "SW2:8" )
1049942   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1050943   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1051944   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
1068961
1069962static INPUT_PORTS_START( cookbib3 )
1070963   PORT_START("DSW1")   /* 500000.w */
1071   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
964   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
1072965   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1073966   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1074   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Coinage ) )
967   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:2,3,4")
1075968   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1076969   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
1077970   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_1C ) )
r8581r8582
1080973   PORT_DIPSETTING(      0x000a, DEF_STR( 2C_3C ) )
1081974   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
1082975   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
1083   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Difficulty ) )
976   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:5,6,7")
1084977   PORT_DIPSETTING(      0x0020, "Level 1" )
1085978   PORT_DIPSETTING(      0x0010, "Level 2" )
1086979   PORT_DIPSETTING(      0x0000, "Level 3" )
r8581r8582
1089982   PORT_DIPSETTING(      0x0050, "Level 6" )
1090983   PORT_DIPSETTING(      0x0040, "Level 7" )
1091984   PORT_DIPSETTING(      0x0030, "Level 8" )
1092   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
985   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
1093986   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1094987   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1095988   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r8581r8582
1100993   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1101994
1102995   PORT_START("DSW2")   /* 500002.w */
1103   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
1104   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1105   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1106   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
1107   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1108   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1109   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
1110   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
1111   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1112   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
1113   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1114   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1115   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
1116   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1117   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1118   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1119   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1120   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1121   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1122   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1123   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1124   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) /* Will go into negative credits and cause graphics issues */
996   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0000, "SW2:1" )
997   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0000, "SW2:2" )
998   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0000, "SW2:3" )
999   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0000, "SW2:4" )
1000   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
1001   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW2:6" )
1002   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW2:7" )
1003   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW2:8") /* Will go into negative credits and cause graphics issues */
11251004   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
11261005   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
11271006   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
11461025
11471026static INPUT_PORTS_START( moremore )
11481027   PORT_START("DSW1")   /* 500000.w */
1149   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
1028   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
11501029   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
11511030   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1152   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Coinage ) )
1031   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:2,3,4")
11531032   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
11541033   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
11551034   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_1C ) )
r8581r8582
11581037   PORT_DIPSETTING(      0x000a, DEF_STR( 2C_3C ) )
11591038   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
11601039   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
1161   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Difficulty ) )
1040   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:5,6,7")
11621041   PORT_DIPSETTING(      0x0020, "Level 1" )
11631042   PORT_DIPSETTING(      0x0010, "Level 2" )
11641043   PORT_DIPSETTING(      0x0000, "Level 3" )
r8581r8582
11671046   PORT_DIPSETTING(      0x0050, "Level 6" )
11681047   PORT_DIPSETTING(      0x0040, "Level 7" )
11691048   PORT_DIPSETTING(      0x0030, "Level 8" )
1170   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1049   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
11711050   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
11721051   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
11731052   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r8581r8582
11781057   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
11791058
11801059   PORT_START("DSW2")   /* 500002.w */
1181   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
1182   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1183   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1184   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
1185   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1186   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1187   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
1188   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
1189   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1190   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
1191   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1192   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1193   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
1194   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1195   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1196   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1197   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1198   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1199   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1200   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1201   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1202   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
1060   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0000, "SW2:1" )
1061   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0000, "SW2:2" )
1062   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0000, "SW2:3" )
1063   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0000, "SW2:4" )
1064   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
1065   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW2:6" )
1066   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW2:7" )
1067   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW2:8")
12031068   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
12041069   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
12051070   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
12221087   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12231088INPUT_PORTS_END
12241089
1225static INPUT_PORTS_START( toppyrap )
1090// don't trust the test mode! <-- Verified via actual game play: Demo Sounds, Coinage & Free Play
1091static INPUT_PORTS_START( pzlbreak )
12261092   PORT_START("DSW1")   /* 500000.w */
1227   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
1093   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
12281094   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
12291095   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1230   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
1231   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1096   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:2,3,4")
1097   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1098   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
1099   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_1C ) )
1100   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_1C ) )
1101   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_1C ) )
1102   PORT_DIPSETTING(      0x000a, DEF_STR( 2C_3C ) )
1103   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
1104   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_3C ) )
1105   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:5,6,7")
1106   PORT_DIPSETTING(      0x0020, "Level 1" )
1107   PORT_DIPSETTING(      0x0010, "Level 2" )
1108   PORT_DIPSETTING(      0x0000, "Level 3" )
1109   PORT_DIPSETTING(      0x0070, "Level 4" )
1110   PORT_DIPSETTING(      0x0060, "Level 5" )
1111   PORT_DIPSETTING(      0x0050, "Level 6" )
1112   PORT_DIPSETTING(      0x0040, "Level 7" )
1113   PORT_DIPSETTING(      0x0030, "Level 8" )
1114   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
1115   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1116   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1117   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1118   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1119   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1120   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
1121   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)
1122   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1123
1124   PORT_START("DSW2")   /* 500002.w */
1125   PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0000, "SW2:1" )
1126   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0000, "SW2:2" )
1127   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0000, "SW2:3" )
1128   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0000, "SW2:4" )
1129   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
1130   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW2:6" )
1131   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW2:7" )
1132   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW2:8")
1133   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
12321134   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1233   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coinage ) )
1135   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1136   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1137   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1138   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1139   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1140   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1141   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
1142   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1143
1144   PORT_START("SYSTEM")   /* 500004.w */
1145   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_START1 )
1146   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_START2 )
1147   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_COIN1 )
1148   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN2 )
1149   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1150   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1151   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1152   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1153INPUT_PORTS_END
1154
1155static INPUT_PORTS_START( toppyrap )
1156   PORT_START("DSW1")   /* 500000.w */
1157   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:1")
1158   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1159   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1160   PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0000, "SW1:2" )
1161   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:3,4,5")
12341162   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
12351163   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_1C ) )
12361164   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
r8581r8582
12391167   PORT_DIPSETTING(      0x0014, DEF_STR( 2C_3C ) )
12401168   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
12411169   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
1242   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
1170   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:6,7")
12431171   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
12441172   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
12451173   PORT_DIPSETTING(      0x0040, DEF_STR( Hard ) )
12461174   PORT_DIPSETTING(      0x0020, DEF_STR( Hardest ) )
1247   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1175   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
12481176   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
12491177   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
12501178   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r8581r8582
12551183   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12561184
12571185   PORT_START("DSW2")   /* 500002.w */
1258   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
1259   PORT_DIPSETTING(    0x00, "2" )
1260   PORT_DIPSETTING(    0x03, "3" )
1261   PORT_DIPSETTING(    0x02, "4" )
1262   PORT_DIPSETTING(    0x01, "5" )
1263   PORT_DIPNAME( 0x000c, 0x000c, "Time" )
1186   PORT_DIPNAME( 0x03,   0x0003, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW2:1,2")
1187   PORT_DIPSETTING(      0x0000, "2" )
1188   PORT_DIPSETTING(      0x0003, "3" )
1189   PORT_DIPSETTING(      0x0002, "4" )
1190   PORT_DIPSETTING(      0x0001, "5" )
1191   PORT_DIPNAME( 0x000c, 0x000c, "Time" )         PORT_DIPLOCATION("SW2:3,4")
12641192   PORT_DIPSETTING(      0x0004, "40 Seconds" )
12651193   PORT_DIPSETTING(      0x0008, "50 Seconds" )
12661194   PORT_DIPSETTING(      0x000c, "60 Seconds" )
12671195   PORT_DIPSETTING(      0x0000, "70 Seconds" )
1268   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
1269   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1270   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1271   PORT_DIPNAME( 0x0020, 0x0020, "God Mode" )
1196   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0000, "SW2:5" )
1197   PORT_DIPNAME( 0x0020, 0x0020, "God Mode" )      PORT_DIPLOCATION("SW2:6")
12721198   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
12731199   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1274   PORT_DIPNAME( 0x0040, 0x0040, "Internal Test" )
1200   PORT_DIPNAME( 0x0040, 0x0040, "Internal Test" )      PORT_DIPLOCATION("SW2:7")
12751201   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
12761202   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1277   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
1203   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW2:8")
12781204   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
12791205   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
12801206   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r8581r8582
20742000   ROM_REGION16_BE( 0x200, "user1", ROMREGION_ERASEFF ) /* Data from Shared RAM */
20752001   /* this is not a real rom but instead the data extracted from
20762002       shared ram, the MCU puts it there */
2077   //ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(1) SHA1(1) )
2003   ROM_LOAD16_WORD( "protdata.bin", 0x00000, 0x200, CRC(092cb794) SHA1(eb2b336d97b440453ca37ee7605654b35dfb6bad) )
20782004
20792005   ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
20802006   ROM_LOAD( "1.uj15", 0x00000, 0x40000, CRC(dbfae77c) SHA1(cc509d52cd9c608fc80df799890e62e7b4c143c6) )
r8581r8582
27712697   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x200001, 0, 0, cookbib3_read );
27722698}
27732699
2700static DRIVER_INIT( pzlbreak )
2701{
2702   pandora_set_bg_pen(machine->device("pandora"), 0xc0);
2703}
27742704
27752705GAME( 1990, snowbros,  0,        snowbros, snowbros, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 1)", 0 )
27762706GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 2)", 0 )
r8581r8582
27922722GAME( 1997, cookbib3, 0,        semiprot, cookbib3, cookbib3, ROT0, "SemiCom", "Cookie & Bibi 3", 0 )
27932723GAME( 1997, 3in1semi, 0,        semiprot, moremore, 3in1semi, ROT0, "SemiCom", "XESS - The New Revolution (SemiCom 3-in-1)", 0 )
27942724GAME( 1997, twinkle,  0,        semiprot, moremore, 0,        ROT0, "SemiCom", "Twinkle", 0 )
2795GAME( 1997, pzlbreak, 0,        semiprot, moremore, 0,        ROT0, "SemiCom", "Puzzle Break", GAME_NOT_WORKING ) // need to extract protection data
2725GAME( 1997, pzlbreak, 0,        semiprot, pzlbreak, pzlbreak, ROT0, "SemiCom", "Puzzle Break", 0 )
27962726GAME( 1999, moremore, 0,        semiprot, moremore, moremorp, ROT0, "SemiCom / Exit", "More More", 0 )
27972727GAME( 1999, moremorp, 0,        semiprot, moremore, moremorp, ROT0, "SemiCom / Exit", "More More Plus", 0 )
27982728GAME( 2002, 4in1boot, 0,        _4in1,    4in1boot, 4in1boot, ROT0, "K1 Soft", "Puzzle King (includes bootleg of Snow Bros.)" , 0)
src/mame/drivers/segaxbd.c
r8581r8582
3535Thunder Blade      (C) Sega 1987
3636
3737* denotes not dumped. There are also several revisions of the above games not dumper either.
38If you can help, please contact us via http://www.mameworld.net/gurudumps/ or http://www.mamedev.org
38If you can help, please contact us via http://guru.mameworld.info or http://www.mamedev.org
3939
4040Main Board
4141----------
r8581r8582
277277
278278   state->gprider_hack = 0;
279279
280   state->maincpu = devtag_get_device(machine, "maincpu");
281   state->soundcpu = devtag_get_device(machine, "soundcpu");
282   state->subcpu = devtag_get_device(machine, "sub");
283   state->_315_5250_1 = devtag_get_device(machine, "5250_main");
280   state->maincpu = machine->device("maincpu");
281   state->soundcpu = machine->device("soundcpu");
282   state->subcpu = machine->device("sub");
283   state->_315_5250_1 = machine->device("5250_main");
284284
285285   state_save_register_global(machine, state->iochip_force_input);
286286   state_save_register_global(machine, state->vblank_irq_state);
r8581r8582
434434
435435static MACHINE_RESET( xboard )
436436{
437   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
437   fd1094_machine_init(machine->device("maincpu"));
438438   segaic16_tilemap_reset(machine, 0);
439439
440440   /* hook the RESET line, which resets CPU #1 */
441   m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), xboard_reset);
441   m68k_set_reset_callback(machine->device("maincpu"), xboard_reset);
442442
443443   /* start timers to track interrupts */
444444   timer_set(machine, machine->primary_screen->time_until_pos(1), NULL, 1, scanline_callback);
src/mame/drivers/nbmj9195.c
r8581r8582
359359            nbmj9195_soundbank_w(space, 0, data);
360360            break;
361361         case 6:         /* PB_1 */
362            DAC_WRITE(devtag_get_device(space->machine, "dac2"), 0, data);
362            DAC_WRITE(space->machine->device("dac2"), 0, data);
363363            break;
364364         case 7:         /* PC_1 */
365            DAC_WRITE(devtag_get_device(space->machine, "dac1"), 0, data);
365            DAC_WRITE(space->machine->device("dac1"), 0, data);
366366            break;
367367         case 8:         /* PD_1 */
368368            break;
r8581r8582
397397            nbmj9195_soundbank_w(space, 0, data);
398398            break;
399399         case 6:         /* PB_1 */
400            DAC_WRITE(devtag_get_device(space->machine, "dac2"), 0, data);
400            DAC_WRITE(space->machine->device("dac2"), 0, data);
401401            break;
402402         case 7:         /* PC_1 */
403            DAC_WRITE(devtag_get_device(space->machine, "dac1"), 0, data);
403            DAC_WRITE(space->machine->device("dac1"), 0, data);
404404            break;
405405         case 8:         /* PD_1 */
406406            break;
r8581r8582
471471/* CTC of main cpu, ch0 trigger is vblank */
472472static INTERRUPT_GEN( ctc0_trg1 )
473473{
474   running_device *ctc = devtag_get_device(device->machine, "main_ctc");
474   running_device *ctc = device->machine->device("main_ctc");
475475   z80ctc_trg1_w(ctc, 1);
476476   z80ctc_trg1_w(ctc, 0);
477477}
src/mame/drivers/sslam.c
r8581r8582
441441      data = soundlatch_r(space,0);
442442   }
443443   else if ((state->oki_control & 0x38) == 0x28) {
444      data = (okim6295_r(devtag_get_device(space->machine, "oki"),0) & 0x0f);
444      data = (okim6295_r(space->machine->device("oki"),0) & 0x0f);
445445   }
446446
447447   return data;
r8581r8582
471471
472472   if ((data & 0x38) == 0x18)
473473   {
474      okim6295_w(devtag_get_device(space->machine, "oki"), 0, state->oki_command);
474      okim6295_w(space->machine->device("oki"), 0, state->oki_command);
475475   }
476476
477477//  !(data & 0x80) -> sound enable
src/mame/drivers/sonson.c
r8581r8582
231231{
232232   sonson_state *state = (sonson_state *)machine->driver_data;
233233
234   state->audiocpu = devtag_get_device(machine, "audiocpu");
234   state->audiocpu = machine->device("audiocpu");
235235
236236   state_save_register_global(machine, state->last_irq);
237237}
src/mame/drivers/hcastle.c
r8581r8582
183183
184184   memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
185185
186   state->audiocpu = devtag_get_device(machine, "audiocpu");
187   state->k007121_1 = devtag_get_device(machine, "k007121_1");
188   state->k007121_2 = devtag_get_device(machine, "k007121_2");
186   state->audiocpu = machine->device("audiocpu");
187   state->k007121_1 = machine->device("k007121_1");
188   state->k007121_2 = machine->device("k007121_2");
189189
190190   state_save_register_global(machine, state->pf2_bankbase);
191191   state_save_register_global(machine, state->pf1_bankbase);
src/mame/drivers/cntsteer.c
r8581r8582
787787{
788788   cntsteer_state *state = (cntsteer_state *)machine->driver_data;
789789
790   state->maincpu = devtag_get_device(machine, "maincpu");
791   state->audiocpu = devtag_get_device(machine, "audiocpu");
792   state->subcpu = devtag_get_device(machine, "subcpu");
790   state->maincpu = machine->device("maincpu");
791   state->audiocpu = machine->device("audiocpu");
792   state->subcpu = machine->device("subcpu");
793793
794794   state_save_register_global(machine, state->flipscreen);
795795   state_save_register_global(machine, state->bg_bank);
src/mame/drivers/skeetsht.c
r8581r8582
4444{
4545   skeetsht_state *state = (skeetsht_state *)machine->driver_data;
4646
47   state->ay = devtag_get_device(machine, "aysnd");
48   state->tms = devtag_get_device(machine, "tms");
47   state->ay = machine->device("aysnd");
48   state->tms = machine->device("tms");
4949
5050   /* Setup the Bt476 VGA RAMDAC palette chip */
5151   tlc34076_reset(6);
src/mame/drivers/bking.c
r8581r8582
413413{
414414   buggychl_state *state = (buggychl_state *)machine->driver_data;
415415
416   state->audiocpu = devtag_get_device(machine, "audiocpu");
416   state->audiocpu = machine->device("audiocpu");
417417
418418   /* video */
419419   state_save_register_global_array(machine, state->pc3259_output);
r8581r8582
439439{
440440   buggychl_state *state = (buggychl_state *)machine->driver_data;
441441
442   state->mcu = devtag_get_device(machine, "mcu");
442   state->mcu = machine->device("mcu");
443443
444444   MACHINE_START_CALL(bking);
445445
src/mame/drivers/dblewing.c
r8581r8582
661661{
662662   dblewing_state *state = (dblewing_state *)machine->driver_data;
663663
664   state->maincpu = devtag_get_device(machine, "maincpu");
665   state->audiocpu = devtag_get_device(machine, "audiocpu");
666   state->deco16ic = devtag_get_device(machine, "deco_custom");
664   state->maincpu = machine->device("maincpu");
665   state->audiocpu = machine->device("audiocpu");
666   state->deco16ic = machine->device("deco_custom");
667667
668668   state_save_register_global(machine, state->_008_data);
669669   state_save_register_global(machine, state->_104_data);
src/mame/drivers/labyrunr.c
r8581r8582
190190
191191   memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
192192
193   state->k007121 = devtag_get_device(machine, "k007121");
193   state->k007121 = machine->device("k007121");
194194}
195195
196196static MACHINE_DRIVER_START( labyrunr )
src/mame/drivers/taito_o.c
r8581r8582
242242{
243243   taitoo_state *state = (taitoo_state *)machine->driver_data;
244244
245   state->maincpu = devtag_get_device(machine, "maincpu");
246   state->tc0080vco = devtag_get_device(machine, "tc0080vco");
245   state->maincpu = machine->device("maincpu");
246   state->tc0080vco = machine->device("tc0080vco");
247247}
248248
249249static MACHINE_DRIVER_START( parentj )
src/mame/drivers/hornet.c
r8581r8582
331331
332332static READ32_HANDLER( hornet_k037122_sram_r )
333333{
334   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
334   running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
335335   return k037122_sram_r(k037122, offset, mem_mask);
336336}
337337
338338static WRITE32_HANDLER( hornet_k037122_sram_w )
339339{
340   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
340   running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
341341   k037122_sram_w(k037122, offset, data, mem_mask);
342342}
343343
344344
345345static READ32_HANDLER( hornet_k037122_char_r )
346346{
347   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
347   running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
348348   return k037122_char_r(k037122, offset, mem_mask);
349349}
350350
351351static WRITE32_HANDLER( hornet_k037122_char_w )
352352{
353   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
353   running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
354354   k037122_char_w(k037122, offset, data, mem_mask);
355355}
356356
357357static READ32_HANDLER( hornet_k037122_reg_r )
358358{
359   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
359   running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
360360   return k037122_reg_r(k037122, offset, mem_mask);
361361}
362362
363363static WRITE32_HANDLER( hornet_k037122_reg_w )
364364{
365   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
365   running_device *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
366366   k037122_reg_w(k037122, offset, data, mem_mask);
367367}
368368
r8581r8582
378378
379379static VIDEO_UPDATE( hornet )
380380{
381   running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
382   running_device *k037122 = devtag_get_device(screen->machine, "k037122_1");
381   running_device *voodoo = screen->machine->device("voodoo0");
382   running_device *k037122 = screen->machine->device("k037122_1");
383383
384384   voodoo_update(voodoo, bitmap, cliprect);
385385
r8581r8582
394394{
395395   if (strcmp(screen->tag(), "lscreen") == 0)
396396   {
397      running_device *k037122 = devtag_get_device(screen->machine, "k037122_1");
398      running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
397      running_device *k037122 = screen->machine->device("k037122_1");
398      running_device *voodoo = screen->machine->device("voodoo0");
399399      voodoo_update(voodoo, bitmap, cliprect);
400400
401401      /* TODO: tilemaps per screen */
r8581r8582
403403   }
404404   else if (strcmp(screen->tag(), "rscreen") == 0)
405405   {
406      running_device *k037122 = devtag_get_device(screen->machine, "k037122_2");
407      running_device *voodoo = devtag_get_device(screen->machine, "voodoo1");
406      running_device *k037122 = screen->machine->device("k037122_2");
407      running_device *voodoo = screen->machine->device("voodoo1");
408408      voodoo_update(voodoo, bitmap, cliprect);
409409
410410      /* TODO: tilemaps per screen */
r8581r8582
422422{
423423   UINT8 r = 0;
424424   static const char *const portnames[] = { "IN0", "IN1", "IN2" };
425   running_device *adc12138 = devtag_get_device(space->machine, "adc12138");
426   running_device *eeprom = devtag_get_device(space->machine, "eeprom");
425   running_device *adc12138 = space->machine->device("adc12138");
426   running_device *eeprom = space->machine->device("eeprom");
427427
428428   switch (offset)
429429   {
r8581r8582
456456
457457static WRITE8_HANDLER( sysreg_w )
458458{
459   running_device *adc12138 = devtag_get_device(space->machine, "adc12138");
459   running_device *adc12138 = space->machine->device("adc12138");
460460
461461   switch (offset)
462462   {
r8581r8582
836836   jvs_sdata = auto_alloc_array_clear(machine, UINT8, 1024);
837837
838838   /* set conservative DRC options */
839   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
839   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
840840
841841   /* configure fast RAM regions for DRC */
842   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, workram);
842   ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, workram);
843843
844844   state_save_register_global(machine, led_reg0);
845845   state_save_register_global(machine, led_reg1);
r8581r8582
10831083      if (b == 0xe0)
10841084      {
10851085         sum += 0xd0 + 0xdf;
1086         ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xd0);
1087         ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xdf);
1086         ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0);
1087         ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xdf);
10881088      }
10891089      else if (b == 0xd0)
10901090      {
10911091         sum += 0xd0 + 0xcf;
1092         ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xd0);
1093         ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xcf);
1092         ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0);
1093         ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xcf);
10941094      }
10951095      else
10961096      {
10971097         sum += b;
1098         ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), b);
1098         ppc4xx_spu_receive_byte(machine->device("maincpu"), b);
10991099      }
11001100   }
11011101   return sum;
r8581r8582
11881188
11891189   // write jvs return data
11901190   sum = 0x00 + (rdata_ptr+1);
1191   ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xe0);         // sync
1192   ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0x00);         // node
1193   ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), rdata_ptr + 1);   // num of bytes
1191   ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xe0);         // sync
1192   ppc4xx_spu_receive_byte(machine->device("maincpu"), 0x00);         // node
1193   ppc4xx_spu_receive_byte(machine->device("maincpu"), rdata_ptr + 1);   // num of bytes
11941194   sum += jvs_encode_data(machine, rdata, rdata_ptr);
1195   ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), sum - 1);      // checksum
1195   ppc4xx_spu_receive_byte(machine->device("maincpu"), sum - 1);      // checksum
11961196
11971197   jvs_sdata_ptr = 0;
11981198}
r8581r8582
12071207
12081208   led_reg0 = led_reg1 = 0x7f;
12091209
1210   ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), jamma_jvs_w);
1210   ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w);
12111211}
12121212
12131213static DRIVER_INIT(hornet_2board)
r8581r8582
12181218
12191219   led_reg0 = led_reg1 = 0x7f;
12201220
1221   ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), jamma_jvs_w);
1221   ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w);
12221222}
12231223
12241224/*****************************************************************************/
src/mame/drivers/pipedrm.c
r8581r8582
591591{
592592   fromance_state *state = (fromance_state *)machine->driver_data;
593593
594   state->subcpu = devtag_get_device(machine, "sub");
594   state->subcpu = machine->device("sub");
595595
596596   /* initialize main Z80 bank */
597597   memory_configure_bank(machine, "bank1", 0, 8, memory_region(machine, "maincpu") + 0x10000, 0x2000);
src/mame/drivers/ccastles.c
r8581r8582
201201   rectangle visarea;
202202
203203   /* initialize globals */
204   state->maincpu = devtag_get_device(machine, "maincpu");
204   state->maincpu = machine->device("maincpu");
205205   state->syncprom = memory_region(machine, "proms") + 0x000;
206206
207207   /* find the start of VBLANK in the SYNC PROM */
src/mame/drivers/ddragon3.c
r8581r8582
562562{
563563   ddragon3_state *state = (ddragon3_state *)machine->driver_data;
564564
565   state->maincpu = devtag_get_device(machine, "maincpu");
566   state->audiocpu = devtag_get_device(machine, "audiocpu");
565   state->maincpu = machine->device("maincpu");
566   state->audiocpu = machine->device("audiocpu");
567567
568568   state_save_register_global(machine, state->vreg);
569569   state_save_register_global(machine, state->bg_scrollx);
src/mame/drivers/discoboy.c
r8581r8582
445445{
446446   discoboy_state *state = (discoboy_state *)machine->driver_data;
447447
448   state->audiocpu = devtag_get_device(machine, "audiocpu");
448   state->audiocpu = machine->device("audiocpu");
449449
450450   state_save_register_global(machine, state->ram_bank);
451451   state_save_register_global(machine, state->port_00);
src/mame/drivers/mediagx.c
r8581r8582
973973{
974974   UINT8 *rom = memory_region(machine, "bios");
975975
976   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
976   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
977977
978978   memcpy(bios_ram, rom, 0x40000);
979979   machine->device("maincpu")->reset();
src/mame/drivers/orbit.c
r8581r8582
276276{
277277   orbit_state *state = (orbit_state *)machine->driver_data;
278278
279   state->maincpu = devtag_get_device(machine, "maincpu");
280   state->discrete = devtag_get_device(machine, "discrete");
279   state->maincpu = machine->device("maincpu");
280   state->discrete = machine->device("discrete");
281281
282282   state_save_register_global(machine, state->misc_flags);
283283   state_save_register_global(machine, state->flip_screen);
src/mame/drivers/policetr.c
r8581r8582
155155   /* handle EEPROM I/O */
156156   if (ACCESSING_BITS_16_23)
157157   {
158      running_device *device = devtag_get_device(space->machine, "eeprom");
158      running_device *device = space->machine->device("eeprom");
159159      eeprom_write_bit(device, data & 0x00800000);
160160      eeprom_set_cs_line(device, (data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE);
161161      eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE);
r8581r8582
164164   /* toggling BSMT off then on causes a reset */
165165   if (!(old & 0x80000000) && (control_data & 0x80000000))
166166   {
167      running_device *device = devtag_get_device(space->machine, "bsmt");
167      running_device *device = space->machine->device("bsmt");
168168      bsmt2000_data_w(device, bsmt_data_bank, 0, 0xffff);
169169      device->reset();
170170   }
src/mame/drivers/skimaxx.c
r8581r8582
212212
213213static WRITE32_HANDLER( m68k_tms_w )
214214{
215   tms34010_host_w(devtag_get_device(space->machine, "tms"), offset, data);
215   tms34010_host_w(space->machine->device("tms"), offset, data);
216216}
217217
218218static READ32_HANDLER( m68k_tms_r )
219219{
220   return tms34010_host_r(devtag_get_device(space->machine, "tms"), offset);
220   return tms34010_host_r(space->machine->device("tms"), offset);
221221}
222222
223223
r8581r8582
274274   // 7e/7f at the start. 3f/7f, related to reads from 1018xxxx
275275   if (ACCESSING_BITS_0_7)
276276   {
277      running_device *subcpu = devtag_get_device(space->machine, "subcpu");
277      running_device *subcpu = space->machine->device("subcpu");
278278
279279      cpu_set_input_line(subcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
280280      cpu_set_input_line(subcpu, INPUT_LINE_HALT,  (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/gaplus.c
r8581r8582
184184static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
185185{
186186   int bit = !BIT(offset, 11);
187   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
187   cpu_interrupt_enable(space->machine->device("maincpu"), bit);
188188   if (!bit)
189189      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
190190}
r8581r8582
192192static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
193193{
194194   int bit = !BIT(offset, 13);
195   cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), bit);
195   cpu_interrupt_enable(space->machine->device("sub2"), bit);
196196   if (!bit)
197197      cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
198198}
r8581r8582
200200static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
201201{
202202   int bit = offset & 1;
203   cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
203   cpu_interrupt_enable(space->machine->device("sub"), bit);
204204   if (!bit)
205205      cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
206206}
r8581r8582
210210   int bit = !BIT(offset, 11);
211211   cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
212212   cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
213   mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit);
213   mappy_sound_enable(space->machine->device("namco"), bit);
214214}
215215
216216static WRITE8_HANDLER( gaplus_freset_w )
217217{
218   running_device *io58xx = devtag_get_device(space->machine, "58xx");
219   running_device *io56xx = devtag_get_device(space->machine, "56xx");
218   running_device *io58xx = space->machine->device("58xx");
219   running_device *io56xx = space->machine->device("56xx");
220220   int bit = !BIT(offset, 11);
221221
222222   logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit);
r8581r8582
228228static MACHINE_RESET( gaplus )
229229{
230230   /* on reset, VINTON is reset, while the other flags don't seem to be affected */
231   cpu_interrupt_enable(devtag_get_device(machine, "sub"), 0);
231   cpu_interrupt_enable(machine->device("sub"), 0);
232232   cputag_set_input_line(machine, "sub", 0, CLEAR_LINE);
233233}
234234
235235static TIMER_CALLBACK( namcoio_run )
236236{
237   running_device *io58xx = devtag_get_device(machine, "58xx");
238   running_device *io56xx = devtag_get_device(machine, "56xx");
237   running_device *io58xx = machine->device("58xx");
238   running_device *io56xx = machine->device("56xx");
239239
240240   switch (param)
241241   {
r8581r8582
250250
251251static INTERRUPT_GEN( gaplus_interrupt_1 )
252252{
253   running_device *io58xx = devtag_get_device(device->machine, "58xx");
254   running_device *io56xx = devtag_get_device(device->machine, "56xx");
253   running_device *io58xx = device->machine->device("58xx");
254   running_device *io56xx = device->machine->device("56xx");
255255
256256   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
257257                        // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
src/mame/drivers/5clown.c
r8581r8582
12281228
12291229   /* Assigning AY-3-8910 sound device */
12301230
1231   ay8910 = devtag_get_device(machine, "ay8910");
1231   ay8910 = machine->device("ay8910");
12321232}
12331233
12341234
src/mame/drivers/flkatck.c
r8581r8582
202202
203203   memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x2000);
204204
205   state->audiocpu = devtag_get_device(machine, "audiocpu");
206   state->k007121 = devtag_get_device(machine, "k007121");
205   state->audiocpu = machine->device("audiocpu");
206   state->k007121 = machine->device("k007121");
207207
208208   state_save_register_global(machine, state->irq_enabled);
209209   state_save_register_global_array(machine, state->multiply_reg);
r8581r8582
214214{
215215   flkatck_state *state = (flkatck_state *)machine->driver_data;
216216
217   k007232_set_bank(devtag_get_device(machine, "konami"), 0, 1);
217   k007232_set_bank(machine->device("konami"), 0, 1);
218218
219219   state->irq_enabled = 0;
220220   state->multiply_reg[0] = 0;
src/mame/drivers/contra.c
r8581r8582
176176
177177   memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
178178
179   state->audiocpu = devtag_get_device(machine, "audiocpu");
180   state->k007121_1 = devtag_get_device(machine, "k007121_1");
181   state->k007121_2 = devtag_get_device(machine, "k007121_2");
179   state->audiocpu = machine->device("audiocpu");
180   state->k007121_1 = machine->device("k007121_1");
181   state->k007121_2 = machine->device("k007121_2");
182182}
183183
184184static MACHINE_DRIVER_START( contra )
src/mame/drivers/zn.c
r8581r8582
11561156
11571157static WRITE32_HANDLER( bank_coh1000t_w )
11581158{
1159   running_device *mb3773 = devtag_get_device(space->machine, "mb3773");
1160   mb3773_set_ck(mb3773, 0, (data & 0x20) >> 5);
1159   running_device *mb3773 = space->machine->device("mb3773");
1160   mb3773_set_ck(mb3773, (data & 0x20) >> 5);
11611161   verboselog( space->machine, 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
11621162   memory_set_bankptr(space->machine,  "bank1", memory_region( space->machine, "user2" ) + ( ( data & 3 ) * 0x800000 ) );
11631163}
r8581r8582
11691169
11701170static READ32_HANDLER( taitofx1a_ymsound_r )
11711171{
1172   running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt");
1172   running_device *tc0140syt = space->machine->device("tc0140syt");
11731173   return tc0140syt_comm_r(tc0140syt, 0) << 16;
11741174}
11751175
11761176static WRITE32_HANDLER( taitofx1a_ymsound_w )
11771177{
1178   running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt");
1178   running_device *tc0140syt = space->machine->device("tc0140syt");
11791179
11801180   if (mem_mask == 0x0000ffff)
11811181   {
r8581r8582
14691469
14701470static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
14711471{
1472   running_device *ide = devtag_get_device(machine, "ide");
1472   running_device *ide = machine->device("ide");
14731473
14741474   logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address);
14751475
r8581r8582
14971497
14981498static DRIVER_INIT( coh1000w )
14991499{
1500   running_device *ide = devtag_get_device(machine, "ide");
1500   running_device *ide = machine->device("ide");
15011501
15021502   memory_install_read_bank         ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f1fffff, 0, 0, "bank1" );
15031503   memory_nop_write                         ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f000003, 0, 0 );
r8581r8582
21702170   if( ( !strcmp( machine->gamedrv->name, "jdredd" ) ) ||
21712171      ( !strcmp( machine->gamedrv->name, "jdreddb" ) ) )
21722172   {
2173      running_device *ide = devtag_get_device(machine, "ide");
2173      running_device *ide = machine->device("ide");
21742174
21752175      memory_install_read32_device_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), ide, 0x1fbfff8c, 0x1fbfff8f, 0, 0, jdredd_idestat_r );
21762176      memory_nop_write                    ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1fbfff8c, 0x1fbfff8f, 0, 0 );
src/mame/drivers/paradise.c
r8581r8582
548548   UINT8 *ROM = memory_region(machine, "maincpu");
549549
550550   memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x00000], 0x4000);
551   memory_configure_bank(machine, "bank1", 3, bank_n - 4, &ROM[0x10000], 0x4000);
551   memory_configure_bank(machine, "bank1", 3, bank_n - 3, &ROM[0x10000], 0x4000);
552552
553553   state_save_register_global(machine, state->palbank);
554554   state_save_register_global(machine, state->priority);
r8581r8582
646646
647647                          Paradise / Paradise Deluxe
648648
649(c) Yun Sung  year unkown
649(c) Yun Sung  year unknown
650650
651651Another porn qix like game
652652
src/mame/drivers/galpani3.c
r8581r8582
5656
5757
5858--- Team Japump!!! ---
59http://www.rainemu.com/japump/
60http://japump.i.am/
6159Dumped by Uki
626010/22/2000
6361
src/mame/drivers/ddribble.c
r8581r8582
254254   UINT8 *ROM = memory_region(machine, "maincpu");
255255   memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x10000], 0x2000);
256256
257   state->filter1 = devtag_get_device(machine, "filter1");
258   state->filter2 = devtag_get_device(machine, "filter2");
259   state->filter3 = devtag_get_device(machine, "filter3");
257   state->filter1 = machine->device("filter1");
258   state->filter2 = machine->device("filter2");
259   state->filter3 = machine->device("filter3");
260260
261261   state_save_register_global(machine, state->int_enable_0);
262262   state_save_register_global(machine, state->int_enable_1);
src/mame/drivers/deco32.c
r8581r8582
363363   switch (offset) {
364364   case 0: return 0xffff0000 | input_port_read(space->machine, "IN0");
365365   case 1: return 0xffff0000 | input_port_read(space->machine, "IN1"); //check top bits??
366   case 2: return 0xfffffffe | eeprom_read_bit(devtag_get_device(space->machine, "eeprom"));
366   case 2: return 0xfffffffe | eeprom_read_bit(space->machine->device("eeprom"));
367367   }
368368
369369   return 0xffffffff;
r8581r8582
631631   switch (offset<<1) {
632632   case 0x280: return input_port_read(space->machine, "IN0") << 16| 0xffff; /* IN0 */
633633   case 0x4c4: return input_port_read(space->machine, "IN1") << 16| 0xffff; /* IN1 */
634   case 0x35a: return (eeprom_read_bit(devtag_get_device(space->machine, "eeprom"))<< 16) | 0xffff; // Debug switch in low word??
634   case 0x35a: return (eeprom_read_bit(space->machine->device("eeprom"))<< 16) | 0xffff; // Debug switch in low word??
635635   }
636636
637637   //logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
src/mame/drivers/malzak.c
r8581r8582
151151//  Bits 1-3 are all set high upon death, until the game continues
152152//  Bit 6 is used only in Malzak II, and is set high after checking
153153//        the selected version
154//  logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(devtag_get_device(space->machine, "maincpu")), data);
154//  logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(space->machine->device("maincpu")), data);
155155   memory_set_bank(space->machine, "bank1", (data & 0x40) >> 6);
156156}
157157
r8581r8582
372372
373373   memory_configure_bank(machine, "bank1", 0, 2, memory_region(machine, "user2"), 0x400);
374374
375   state->s2636_0 = devtag_get_device(machine, "s2636_0");
376   state->s2636_1 = devtag_get_device(machine, "s2636_1");
377   state->saa5050 = devtag_get_device(machine, "saa5050");
375   state->s2636_0 = machine->device("s2636_0");
376   state->s2636_1 = machine->device("s2636_1");
377   state->saa5050 = machine->device("saa5050");
378378
379379   state_save_register_global_array(machine, state->playfield_code);
380380   state_save_register_global(machine, state->malzak_x);
src/mame/drivers/midzeus.c
r8581r8582
1313    Known bugs:
1414        * not done yet
1515
16    To Do
17        * make version 1.0 of MK4 work
18
1619According to a Midway service bulletin
1720As of 2/12/2001 the lastest software levels:
1821
r8581r8582
2831#include "cpu/tms32031/tms32031.h"
2932#include "cpu/tms34010/tms34010.h"
3033#include "cpu/adsp2100/adsp2100.h"
34#include "cpu/pic16c5x/pic16c5x.h"
3135#include "includes/midzeus.h"
3236#include "machine/midwayic.h"
3337#include "machine/timekpr.h"
r8581r8582
11281132   MDRV_IMPORT_FROM(dcs2_audio_2104)
11291133MACHINE_DRIVER_END
11301134
1135static READ8_HANDLER( PIC16C5X_T0_clk_r )
1136{
1137   return 0;
1138}
11311139
1140static ADDRESS_MAP_START( pic_io_map, ADDRESS_SPACE_IO, 8 )
1141   AM_RANGE(PIC16C5x_T0, PIC16C5x_T0) AM_READ(PIC16C5X_T0_clk_r)
1142ADDRESS_MAP_END
1143
1144
1145static MACHINE_DRIVER_START( invasn )
1146
1147   MDRV_IMPORT_FROM(midzeus)
1148
1149   MDRV_CPU_ADD("pic", PIC16C57, 8000000)   /* ? */
1150   MDRV_CPU_IO_MAP(pic_io_map)
1151MACHINE_DRIVER_END
1152
11321153static MACHINE_DRIVER_START( midzeus2 )
11331154
11341155   /* basic machine hardware */
r8581r8582
12221243   ROM_LOAD16_BYTE( "invasion2.u4", 0x800000, 0x200000, CRC(5ef1fab5) SHA1(987afa0672fa89b18cf20d28644848a9e5ee9b17) )
12231244   ROM_LOAD16_BYTE( "invasion2.u5", 0xc00000, 0x200000, CRC(e42805c9) SHA1(e5b71eb1852809a649ac43a82168b3bdaf4b1526) )
12241245
1246   ROM_REGION( 0x2000, "pic", 0 ) /* PIC16c57 Code */
1247   ROM_LOAD( "pic16c57.u76", 0x00000, 0x2000, CRC(f62729c9) SHA1(9642c53dd7eceeb7eb178497d367691c44abc5c5) ) // is this even a valid dump?
1248
12251249   ROM_REGION32_LE( 0x1800000, "user1", 0 )
12261250   ROM_LOAD32_WORD( "invasion5.u10", 0x0000000, 0x200000, CRC(8c7785d9) SHA1(701602314cd4eba4215c47ea0ae75fd4eddad43b) ) /* Roms U10 & U11 were labeled as v5.0 */
12271251   ROM_LOAD32_WORD( "invasion5.u11", 0x0000002, 0x200000, CRC(8ceb1f32) SHA1(82d01f25cba25d77b11c347632e8b72776e12984) )
r8581r8582
12421266   ROM_LOAD16_BYTE( "invasion2.u4", 0x800000, 0x200000, CRC(5ef1fab5) SHA1(987afa0672fa89b18cf20d28644848a9e5ee9b17) )
12431267   ROM_LOAD16_BYTE( "invasion2.u5", 0xc00000, 0x200000, CRC(e42805c9) SHA1(e5b71eb1852809a649ac43a82168b3bdaf4b1526) )
12441268
1269   ROM_REGION( 0x2000, "pic", 0 ) /* PIC16c57 Code */
1270   ROM_LOAD( "pic16c57.u76", 0x00000, 0x2000, CRC(f62729c9) SHA1(9642c53dd7eceeb7eb178497d367691c44abc5c5) ) // is this even a valid dump?
1271
12451272   ROM_REGION32_LE( 0x1800000, "user1", 0 )
12461273   ROM_LOAD32_WORD( "invasion4.u10", 0x0000000, 0x200000, CRC(b3ce958b) SHA1(ed51c167d85bc5f6155b8046ec056a4f4ad5cf9d) ) /* These rom were all labeled as v4.0 */
12471274   ROM_LOAD32_WORD( "invasion4.u11", 0x0000002, 0x200000, CRC(0bd09359) SHA1(f40886bd2e5f5fbf506580e5baa2f733be200852) )
r8581r8582
14361463GAME(  1997, mk4,      0,        midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (version 3.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
14371464GAME(  1997, mk4a,     mk4,      midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (version 2.1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
14381465GAME(  1997, mk4b,     mk4,      midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (version 1.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1439GAME(  1999, invasnab, 0,        midzeus,  invasn,   invasn,   ROT0, "Midway", "Invasion - The Abductors (version 5.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1440GAME(  1999, invasnv4, invasnab, midzeus,  invasn,   invasn,   ROT0, "Midway", "Invasion - The Abductors (version 4.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1466GAME(  1999, invasnab, 0,        invasn,   invasn,   invasn,   ROT0, "Midway", "Invasion - The Abductors (version 5.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1467GAME(  1999, invasnv4, invasnab, invasn,   invasn,   invasn,   ROT0, "Midway", "Invasion - The Abductors (version 4.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
14411468GAMEL( 1999, crusnexo, 0,        midzeus2, crusnexo, crusnexo, ROT0, "Midway", "Cruis'n Exotica (version 2.4)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_crusnexo )
14421469GAMEL( 1999, crusnexoa,crusnexo, midzeus2, crusnexo, crusnexo, ROT0, "Midway", "Cruis'n Exotica (version 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_crusnexo )
14431470GAMEL( 1999, crusnexob,crusnexo, midzeus2, crusnexo, crusnexo, ROT0, "Midway", "Cruis'n Exotica (version 1.6)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_crusnexo )
src/mame/drivers/drw80pkr.c
r8581r8582
179179
180180      // ay8910 control port
181181      if (p1 == 0xfc)
182         ay8910_address_w(devtag_get_device(space->machine, "aysnd"), 0, data);
182         ay8910_address_w(space->machine->device("aysnd"), 0, data);
183183
184184      // ay8910_write_port_0_w
185185      if (p1 == 0xfe)
186         ay8910_data_w(devtag_get_device(space->machine, "aysnd"), 0, data);
186         ay8910_data_w(space->machine->device("aysnd"), 0, data);
187187   }
188188}
189189
src/mame/drivers/superdq.c
r8581r8582
319319{
320320   superdq_state *state = (superdq_state *)machine->driver_data;
321321
322   state->laserdisc = devtag_get_device(machine, "laserdisc");
322   state->laserdisc = machine->device("laserdisc");
323323}
324324
325325
src/mame/drivers/tomcat.c
r8581r8582
143143{
144144   // 320 Reset Low         (Address Strobe)
145145   // Reset TMS320
146   cpu_set_input_line(devtag_get_device(space->machine, "dsp"), INPUT_LINE_RESET, ASSERT_LINE);
146   cpu_set_input_line(space->machine->device("dsp"), INPUT_LINE_RESET, ASSERT_LINE);
147147}
148148
149149static WRITE16_HANDLER(tomcat_mresh_w)
r8581r8582
151151   // 320 Reset high        (Address Strobe)
152152   // Release reset of TMS320
153153   dsp_BIO = 0;
154   cpu_set_input_line(devtag_get_device(space->machine, "dsp"), INPUT_LINE_RESET, CLEAR_LINE);
154   cpu_set_input_line(space->machine->device("dsp"), INPUT_LINE_RESET, CLEAR_LINE);
155155}
156156
157157static WRITE16_HANDLER(tomcat_irqclr_w)
src/mame/drivers/norautp.c
r8581r8582
5757  Mosfat, Unique, GEI, etc...
5858
5959  You can see some legal issues in the following links:
60  http://www.altlaw.org/v1/cases/533481
6160  http://cases.justia.com/us-court-of-appeals/F2/783/421/41759/
6261
6362
r8581r8582
651650  xxxx ----  * Discrete Sound Lines.
652651*/
653652
654   running_device *discrete = devtag_get_device(device->machine, "discrete");
653   running_device *discrete = device->machine->device("discrete");
655654
656655   output_set_lamp_value(8, (data >> 0) & 1);   /* DEAL / DRAW lamp */
657656   output_set_lamp_value(9, (data >> 1) & 1);   /* BET / COLLECT lamp */
r8581r8582
721720   np_vram[np_addr] = data & 0xff;
722721
723722   /* trigger 8255-2 port C bit 7 (/OBF) */
724//  i8255a_pc7_w(devtag_get_device(device->machine, "ppi8255_2"), 0);
725//  i8255a_pc7_w(devtag_get_device(device->machine, "ppi8255_2"), 1);
723//  i8255a_pc7_w(device->machine->device("ppi8255_2"), 0);
724//  i8255a_pc7_w(device->machine->device("ppi8255_2"), 1);
726725
727726}
728727
src/mame/drivers/karnov.c
r8581r8582
764764{
765765   karnov_state *state = (karnov_state *)machine->driver_data;
766766
767   state->maincpu = devtag_get_device(machine, "maincpu");
768   state->audiocpu = devtag_get_device(machine, "audiocpu");
767   state->maincpu = machine->device("maincpu");
768   state->audiocpu = machine->device("audiocpu");
769769
770770   state_save_register_global(machine, state->flipscreen);
771771   state_save_register_global_array(machine, state->scroll);
src/mame/drivers/xtheball.c
r8581r8582
133133         switch (offset)
134134         {
135135            case 7:
136               ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, data << 7);
136               ticket_dispenser_w(space->machine->device("ticket"), 0, data << 7);
137137               break;
138138
139139            case 8:
src/mame/drivers/punchout.c
r8581r8582
145145static CUSTOM_INPUT( punchout_vlm5030_busy_r )
146146{
147147   /* bit 4 of DSW1 is busy pin level */
148   return (vlm5030_bsy(devtag_get_device(field->port->machine, "vlm"))) ? 0x00 : 0x01;
148   return (vlm5030_bsy(field->port->machine->device("vlm"))) ? 0x00 : 0x01;
149149}
150150
151151static WRITE8_DEVICE_HANDLER( punchout_speech_reset_w )
r8581r8582
508508   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
509509   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 )
510510
511   /* See http://www.mametesters.org/mantis/view.php?id=790 for more info about coinage */
511   /* Coinage:
512
513    R18 (Coin Slots setting) determines which table is used.
514
515    L = number of credits per coin for left coin slot
516    R = number of credits per coin for right coin slot
517    C = number of credits needed for one play
518
519Table 1 (for 2 Coin Slots):
520
521    DSW1 DSW2
522bit 3210 5432  L  R  C
523
524    0000 0000  1  1  1
525    0000 0001  8  1  1
526    0000 0010  2  1  1
527    0000 0011  8  3  3
528    0000 0100  3  1  2
529    0000 0101  3  12 4
530    0000 0110  1  2  2
531    0000 0111  3  24 2
532    0000 1000  1  3  3
533    0000 1001  4  1  3
534    0000 1010  1  4  4
535    0000 1011  3  3  4
536    0000 1100  1  5  5
537    0000 1101  1  1  1
538    0000 1110  2  3  3
539    0000 1111  5  5  3
540
541    0001 0000  1  2  1
542    0001 0001  1  8  1
543    0001 0010  2  2  1
544    0001 0011  3  8  3
545    0001 0100  3  2  1
546    0001 0101  12 3  4
547    0001 0110  1  4  2
548    0001 0111  24 3  2
549    0001 1000  1  6  3
550    0001 1001  1  4  3
551    0001 1010  1  8  4
552    0001 1011  3  3  4
553    0001 1100  1  10 5
554    0001 1101  1  1  2
555    0001 1110  2  6  3
556    0001 1111  5  5  4
557
558    0010 0000  1  3  1
559    0010 0001  9  1  1
560    0010 0010  2  3  1
561    0010 0011  3  4  4
562    0010 0100  3  3  1
563    0010 0101  4  4  1
564    0010 0110  1  6  2
565    0010 0111  3  1  2
566    0010 1000  1  9  3
567    0010 1001  10 1  3
568    0010 1010  1  12 4
569    0010 1011  1  1  6
570    0010 1100  1  15 5
571    0010 1101  2  2  1
572    0010 1110  2  9  3
573    0010 1111  2  2  5
574
575    0011 0000  1  4  1
576    0011 0001  1  9  1
577    0011 0010  2  4  1
578    0011 0011  4  3  4
579    0011 0100  3  4  1
580    0011 0101  4  4  1
581    0011 0110  1  8  2
582    0011 0111  1  3  2
583    0011 1000  1  12 3
584    0011 1001  1  10 3
585    0011 1010  1  16 4
586    0011 1011  1  1  6
587    0011 1100  1  20 5
588    0011 1101  1  1  4
589    0011 1110  2  12 3
590    0011 1111  8  8  1
591
592    0100 0000  1  5  1
593    0100 0001  10 1  1
594    0100 0010  2  5  1
595    0100 0011  2  5  5
596    0100 0100  3  5  1
597    0100 0101  4  4  1
598    0100 0110  1  10 2
599    0100 0111  10 1  2
600    0100 1000  1  15 3
601    0100 1001  20 1  3
602    0100 1010  1  20 4
603    0100 1011  16 1  2
604    0100 1100  1  25 5
605    0100 1101  1  1  5
606    0100 1110  2  15 3
607    0100 1111  8  8  3
608
609    0101 0000  1  6  1
610    0101 0001  1  10 1
611    0101 0010  2  6  1
612    0101 0011  5  2  5
613    0101 0100  3  6  1
614    0101 0101  4  5  1
615    0101 0110  1  12 2
616    0101 0111  1  10 2
617    0101 1000  1  18 3
618    0101 1001  1  20 3
619    0101 1010  1  24 4
620    0101 1011  20 20 0  Not a "Freeplay": you MUST insert a coin!
621    0101 1100  1  30 5
622    0101 1101  3  3  3
623    0101 1110  2  18 1
624    0101 1111  9  9  1
625
626    0110 0000  2  1  2
627    0110 0001  12 1  1
628    0110 0010  4  1  2
629    0110 0011  10 2  1
630    0110 0100  6  1  2
631    0110 0101  3  8  2
632    0110 0110  1  1  2
633    0110 0111  3  2  4
634    0110 1000  2  3  6
635    0110 1001  9  4  12
636    0110 1010  1  2  4
637    0110 1011  1  1  1
638    0110 1100  2  5  10
639    0110 1101  4  4  1
640    0110 1110  4  3  6
641    0110 1111  9  9  2
642
643    0111 0000  3  1  3
644    0111 0001  1  12 1
645    0111 0010  6  1  3
646    0111 0011  2  10 1
647    0111 0100  9  1  3
648    0111 0101  8  3  2
649    0111 0110  3  2  6
650    0111 0111  2  3  4
651    0111 1000  1  1  3
652    0111 1001  4  9  12
653    0111 1010  3  4  12
654    0111 1011  1  1  1
655    0111 1100  3  5  15
656    0111 1101  6  6  1
657    0111 1110  2  2  3
658    0111 1111  10 10 1
659
660    1000 0000  4  1  4
661    1000 0001  3  2  2
662    1000 0010  8  1  4
663    1000 0011  12 2  1
664    1000 0100  12 1  4
665    1000 0101  5  5  1
666    1000 0110  2  1  4
667    1000 0111  3  3  2
668    1000 1000  4  3  12
669    1000 1001  4  2  3
670    1000 1010  1  1  4
671    1000 1011  1  1  1
672    1000 1100  4  5  20
673    1000 1101  1  1  6
674    1000 1110  8  3  12
675    1000 1111  10 10 3
676
677    1001 0000  5  1  5
678    1001 0001  2  3  2
679    1001 0010  10 1  5
680    1001 0011  2  12 1
681    1001 0100  15 1  5
682    1001 0101  5  5  1
683    1001 0110  5  2  10
684    1001 0111  3  3  2
685    1001 1000  5  3  15
686    1001 1001  2  4  3
687    1001 1010  5  4  20
688    1001 1011  1  1  1
689    1001 1100  1  1  5
690    1001 1101  2  2  3
691    1001 1110  10 3  15
692    1001 1111  11 11 1
693
694    1010 0000  3  2  3
695    1010 0001  5  2  2
696    1010 0010  6  2  3
697    1010 0011  3  4  2
698    1010 0100  9  2  3
699    1010 0101  6  6  1
700    1010 0110  3  4  6
701    1010 0111  4  9  6
702    1010 1000  1  2  3
703    1010 1001  10 2  3
704    1010 1010  3  8 12
705    1010 1011  1  1  1
706    1010 1100  2  10 15
707    1010 1101  5  5  1
708    1010 1110  2  2  3
709    1010 1111  11 11 3
710
711    1011 0000  3  5  3
712    1011 0001  2  5  2
713    1011 0010  6  5  3
714    1011 0011  4  3  2
715    1011 0100  9  5  3
716    1011 0101  6  6  1
717    1011 0110  3  10 6
718    1011 0111  9  4  6
719    1011 1000  1  5  3
720    1011 1001  2  10 3
721    1011 1010  3  20 12
722    1011 1011  1  1  1
723    1011 1100  3  25 15
724    1011 1101  3  3  2
725    1011 1110  2  5  3
726    1011 1111  12 12 1
727
728    1100 0000  4  5  4
729    1100 0001  9  2  2
730    1100 0010  8  5  4
731    1100 0011  3  8  4
732    1100 0100  12 5  4
733    1100 0101  3  12 2
734    1100 0110  2  5  4
735    1100 0111  8  9  6
736    1100 1000  4  15 12
737    1100 1001  11 2  3
738    1100 1010  1  5  4
739    1100 1011  1  1  1
740    1100 1100  4  25 20
741    1100 1101  1  1  3
742    1100 1110  8  15 12
743    1100 1111  20 20 3
744
745    1101 0000  4  1  1
746    1101 0001  2  9  2
747    1101 0010  4  2  1
748    1101 0011  8  3  4
749    1101 0100  4  3  1
750    1101 0101  12 3  2
751    1101 0110  8  1  2
752    1101 0111  9  8  6
753    1101 1000  12 1  3
754    1101 1001  2  11 3
755    1101 1010  12 2  3
756    1101 1011  1  1  1
757    1101 1100  20 1  5
758    1101 1101  5  5  2
759    1101 1110  18 2  3
760    1101 1111  3  3  4
761
762    1110 0000  5  5  1
763    1110 0001  4  4  3
764    1110 0010  5  2  1
765    1110 0011  11 2  1
766    1110 0100  5  3  1
767    1110 0101  3  24 4
768    1110 0110  10 1  2
769    1110 0111  1  6  4
770    1110 1000  15 1  3
771    1110 1001  9  8  12
772    1110 1010  20 1  4
773    1110 1011  1  1  1
774    1110 1100  25 1  5
775    1110 1101  4  4  3
776    1110 1110  20 4  4
777    1110 1111  20 20 0  Not a "Freeplay": you MUST insert a coin!
778
779    1111 0000  6  1  1
780    1111 0001  3  4  3
781    1111 0010  6  2  1
782    1111 0011  2  11 1
783    1111 0100  6  3  1
784    1111 0101  24 3  1
785    1111 0110  12 1  2
786    1111 0111  6  1  4
787    1111 1000  18 1  3
788    1111 1001  8  9  12
789    1111 1010  24 1  4
790    1111 1011  1  1  1
791    1111 1100  15 2  3
792    1111 1101  3  3  4
793    1111 1110  "Freeplay"
794    1111 1111  "Freeplay"
795
796
797Table 2 (for 1 Coin Slot):
798
799    DSW1 DSW2
800bit 3210 5432  L  R  C
801
802    0000 0xxx  1  1  1
803    0000 1xxx  5  5  3
804
805    0001 0xxx  1  1  2
806    0001 1xxx  5  5  4
807
808    0010 0xxx  2  2  1
809    0010 1xxx  2  2  5
810
811    0011 0xxx  1  1  4
812    0011 1xxx  8  8  1
813
814    0100 0xxx  1  1  5
815    0100 1xxx  8  8  3
816
817    0101 0xxx  3  3  1
818    0101 1xxx  9  9  1
819
820    0110 0xxx  4  4  1
821    0110 1xxx  9  9  2
822
823    0111 0xxx  6  6  1
824    0111 1xxx  10 10 1
825
826    1000 0xxx  1  1  6
827    1000 1xxx  10 10 3
828
829    1001 0xxx  5  1  5
830    1001 1xxx  11 11 1
831
832    1010 0xxx  5  5  1
833    1010 1xxx  11 11 3
834
835    1011 0xxx  3  3  2
836    1011 1xxx  12 12 1
837
838    1100 0xxx  1  1  3
839    1100 1xxx  20 20 3
840
841    1101 0xxx  5  5  2
842    1101 1xxx  3  3  4
843
844    1110 0xxx  4  4  3
845    1110 1xxx  20 20 0  Not a "Freeplay": you MUST insert a coin!
846
847    1111 xxxx  "Freeplay"
848
849    */
850
512851   PORT_MODIFY("DSW2")
513   PORT_DIPNAME( 0x1c, 0x00, "Coinage 2" )            PORT_DIPLOCATION("SW2:!3,!4,!5") //K,L,M
514   PORT_DIPSETTING(    0x00, "0" )
515   PORT_DIPSETTING(    0x04, "4" )
516   PORT_DIPSETTING(    0x08, "8" )
517   PORT_DIPSETTING(    0x0c, "c" )
518   PORT_DIPSETTING(    0x10, "10" )
519   PORT_DIPSETTING(    0x14, "14" )
520   PORT_DIPSETTING(    0x18, "18" )
521   PORT_DIPSETTING(    0x1c, "1c" )
522   PORT_DIPNAME( 0x20, 0x00, "Coinage 3" )            PORT_DIPLOCATION("SW2:!6") //N
523   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
524   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
852   PORT_DIPNAME( 0x3c, 0x00, "Coinage 2" )            PORT_DIPLOCATION("SW2:!3,!4,!5,!6") // K,L,M,N
853   PORT_DIPSETTING(    0x00, "0000" )
854   PORT_DIPSETTING(    0x04, "0001" )
855   PORT_DIPSETTING(    0x08, "0010" )
856   PORT_DIPSETTING(    0x0c, "0011" )
857   PORT_DIPSETTING(    0x10, "0100" )
858   PORT_DIPSETTING(    0x14, "0101" )
859   PORT_DIPSETTING(    0x18, "0110" )
860   PORT_DIPSETTING(    0x1c, "0111" )
861   PORT_DIPSETTING(    0x20, "1000" )
862   PORT_DIPSETTING(    0x24, "1001" )
863   PORT_DIPSETTING(    0x28, "1010" )
864   PORT_DIPSETTING(    0x2c, "1011" )
865   PORT_DIPSETTING(    0x30, "1100" )
866   PORT_DIPSETTING(    0x34, "1101" )
867   PORT_DIPSETTING(    0x38, "1110" )
868   PORT_DIPSETTING(    0x3c, "1111" )
525869   PORT_DIPNAME( 0x40, 0x00, "Rematches" )            PORT_DIPLOCATION("SW2:!7")
526870   PORT_DIPSETTING(    0x40, "3" )
527871   PORT_DIPSETTING(    0x00, "7" )
528872
529873   PORT_MODIFY("DSW1")
530   PORT_DIPNAME( 0x0f, 0x00, "Coinage 1" )            PORT_DIPLOCATION("SW1:!1,!2,!3,!4") //A,B,C,D
531   PORT_DIPSETTING(    0x00, "0" )
532   PORT_DIPSETTING(    0x01, "1" )
533   PORT_DIPSETTING(    0x02, "2" )
534   PORT_DIPSETTING(    0x03, "3" )
535   PORT_DIPSETTING(    0x04, "4" )
536   PORT_DIPSETTING(    0x05, "5" )
537   PORT_DIPSETTING(    0x06, "6" )
538   PORT_DIPSETTING(    0x07, "7" )
539   PORT_DIPSETTING(    0x08, "8" )
540   PORT_DIPSETTING(    0x09, "9" )
541   PORT_DIPSETTING(    0x0a, "a" )
542   PORT_DIPSETTING(    0x0b, "b" )
543   PORT_DIPSETTING(    0x0c, "c" )
544   PORT_DIPSETTING(    0x0d, "d" )
545   PORT_DIPSETTING(    0x0e, "e" )
546   PORT_DIPSETTING(    0x0f, "f" )
874   PORT_DIPNAME( 0x0f, 0x00, "Coinage 1" )            PORT_DIPLOCATION("SW1:!1,!2,!3,!4") // A,B,C,D
875   PORT_DIPSETTING(    0x00, "0000" )
876   PORT_DIPSETTING(    0x01, "0001" )
877   PORT_DIPSETTING(    0x02, "0010" )
878   PORT_DIPSETTING(    0x03, "0011" )
879   PORT_DIPSETTING(    0x04, "0100" )
880   PORT_DIPSETTING(    0x05, "0101" )
881   PORT_DIPSETTING(    0x06, "0110" )
882   PORT_DIPSETTING(    0x07, "0111" )
883   PORT_DIPSETTING(    0x08, "1000" )
884   PORT_DIPSETTING(    0x09, "1001" )
885   PORT_DIPSETTING(    0x0a, "1010" )
886   PORT_DIPSETTING(    0x0b, "1011" )
887   PORT_DIPSETTING(    0x0c, "1100" )
888   PORT_DIPSETTING(    0x0d, "1101" )
889   PORT_DIPSETTING(    0x0e, "1110" )
890   PORT_DIPSETTING(    0x0f, "1111" )
547891   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(punchout_vlm5030_busy_r, NULL)   /* VLM5030 busy signal */
548892   PORT_DIPNAME( 0x40, 0x00, "Coin Slots" )         PORT_DIPLOCATION("R18:!1") /* R18 resistor */
549893   PORT_DIPSETTING(    0x40, "1" )
src/mame/drivers/maxaflex.c
r8581r8582
5353static WRITE8_HANDLER( mcu_portA_w )
5454{
5555   portA_out = data;
56   speaker_level_w(devtag_get_device(space->machine, "speaker"), data >> 7);
56   speaker_level_w(space->machine->device("speaker"), data >> 7);
5757}
5858
5959/* Port B:
r8581r8582
154154      if ( (tcr & 0x40) == 0 )
155155      {
156156         //timer interrupt!
157         generic_pulse_irq_line(devtag_get_device(timer.machine, "mcu"), M68705_INT_TIMER);
157         generic_pulse_irq_line(timer.machine->device("mcu"), M68705_INT_TIMER);
158158      }
159159   }
160160}
src/mame/drivers/kopunch.c
r8581r8582
175175{
176176   kopunch_state *state = (kopunch_state *)machine->driver_data;
177177
178   state->maincpu = devtag_get_device(machine, "maincpu");
178   state->maincpu = machine->device("maincpu");
179179
180180   state_save_register_global(machine, state->gfxbank);
181181}
src/mame/drivers/segaybd.c
r8581r8582
195195{
196196   segas1x_state *state = (segas1x_state *)machine->driver_data;
197197
198   state->maincpu = devtag_get_device(machine, "maincpu");
199   state->soundcpu = devtag_get_device(machine, "soundcpu");
200   state->subx = devtag_get_device(machine, "subx");
201   state->suby = devtag_get_device(machine, "suby");
198   state->maincpu = machine->device("maincpu");
199   state->soundcpu = machine->device("soundcpu");
200   state->subx = machine->device("subx");
201   state->suby = machine->device("suby");
202202
203203   state_save_register_global(machine, state->vblank_irq_state);
204204   state_save_register_global(machine, state->timer_irq_state);
src/mame/drivers/cclimber.c
r8581r8582
257257
258258static TIMER_CALLBACK( disable_interrupts )
259259{
260   cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0);
260   cpu_interrupt_enable(machine->device("maincpu"), 0);
261261}
262262
263263
src/mame/drivers/foodf.c
r8581r8582
121121       mystery yet */
122122
123123   /* INT 1 is on 32V */
124   atarigen_scanline_int_gen(devtag_get_device(timer.machine, "maincpu"));
124   atarigen_scanline_int_gen(timer.machine->device("maincpu"));
125125
126126   /* advance to the next interrupt */
127127   scanline += 64;
src/mame/drivers/aliens.c
r8581r8582
243243   memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000);
244244   memory_set_bank(machine, "bank1", 0);
245245
246   state->maincpu = devtag_get_device(machine, "maincpu");
247   state->audiocpu = devtag_get_device(machine, "audiocpu");
248   state->k007232 = devtag_get_device(machine, "k007232");
249   state->k052109 = devtag_get_device(machine, "k052109");
250   state->k051960 = devtag_get_device(machine, "k051960");
246   state->maincpu = machine->device("maincpu");
247   state->audiocpu = machine->device("audiocpu");
248   state->k007232 = machine->device("k007232");
249   state->k052109 = machine->device("k052109");
250   state->k051960 = machine->device("k051960");
251251
252252   state_save_register_global(machine, state->palette_selected);
253253}
r8581r8582
256256{
257257   aliens_state *state = (aliens_state *)machine->driver_data;
258258
259   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), aliens_banking);
259   konami_configure_set_lines(machine->device("maincpu"), aliens_banking);
260260
261261   state->palette_selected = 0;
262262}
src/mame/drivers/88games.c
r8581r8582
317317{
318318   _88games_state *state = (_88games_state *)machine->driver_data;
319319
320   state->audiocpu = devtag_get_device(machine, "audiocpu");
321   state->k052109 = devtag_get_device(machine, "k052109");
322   state->k051960 = devtag_get_device(machine, "k051960");
323   state->k051316 = devtag_get_device(machine, "k051316");
324   state->upd_1 = devtag_get_device(machine, "upd1");
325   state->upd_2 = devtag_get_device(machine, "upd2");
320   state->audiocpu = machine->device("audiocpu");
321   state->k052109 = machine->device("k052109");
322   state->k051960 = machine->device("k051960");
323   state->k051316 = machine->device("k051316");
324   state->upd_1 = machine->device("upd1");
325   state->upd_2 = machine->device("upd2");
326326
327327   state_save_register_global(machine, state->videobank);
328328   state_save_register_global(machine, state->zoomreadroms);
r8581r8582
337337{
338338   _88games_state *state = (_88games_state *)machine->driver_data;
339339
340   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), k88games_banking);
340   konami_configure_set_lines(machine->device("maincpu"), k88games_banking);
341341   machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x20000];
342342
343343   state->videobank = 0;
src/mame/drivers/ddenlovr.c
r8581r8582
75767576{
75777577   dynax_state *state = (dynax_state *)machine->driver_data;
75787578
7579   state->maincpu = devtag_get_device(machine, "maincpu");
7580   state->soundcpu = devtag_get_device(machine, "soundcpu");
7579   state->maincpu = machine->device("maincpu");
7580   state->soundcpu = machine->device("soundcpu");
75817581   state->oki = machine->device<okim6295_device>("oki");
75827582
75837583   state_save_register_global(machine, state->input_sel);
src/mame/drivers/chinagat.c
r8581r8582
526526{
527527   ddragon_state *state = (ddragon_state *)machine->driver_data;
528528
529   state->maincpu = devtag_get_device(machine, "maincpu");
530   state->sub_cpu = devtag_get_device(machine, "sub");
531   state->snd_cpu = devtag_get_device(machine, "audiocpu");
529   state->maincpu = machine->device("maincpu");
530   state->sub_cpu = machine->device("sub");
531   state->snd_cpu = machine->device("audiocpu");
532532
533533   /* configure banks */
534534   memory_configure_bank(machine, "bank1", 0, 8, memory_region(machine, "maincpu") + 0x10000, 0x4000);
src/mame/drivers/kaneko16.c
r8581r8582
17701770{
17711771   // FIXME: the device line cannot be directly put in the interface due to inverse value!
17721772   // we might want to define a "reversed" set_cs_line handler
1773   running_device *eeprom = devtag_get_device(device->machine, "eeprom");
1773   running_device *eeprom = device->machine->device("eeprom");
17741774   // reset line asserted: reset.
17751775   eeprom_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
17761776}
src/mame/drivers/namcos10.c
r8581r8582
4444*Uchuu Daisakusen : Chocovader Contactee (CVC1 Ver.A) (C) Namco, 2002
4545
4646* - denotes not dumped yet. If you can help with the remaining undumped S10 games,
47    please contact me at http://www.mameworld.net/gurudumps/
47    please contact me at http://guru.mameworld.info/
4848
4949The Namco System 10 system comprises 2 PCB's....
5050MAIN PCB - This is the mother board PCB. It holds the main CPU/GPU & SPU and all sound circuitry, program & video RAM,
src/mame/drivers/gauntlet.c
r8581r8582
148148
149149   /* sound IRQ is on 32V */
150150   if (scanline & 32)
151      atarigen_6502_irq_gen(devtag_get_device(screen.machine, "audiocpu"));
151      atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
152152   else
153153      atarigen_6502_irq_ack_r(space, 0);
154154}
r8581r8582
173173   atarigen_slapstic_reset(&state->atarigen);
174174   atarigen_interrupt_reset(&state->atarigen, update_interrupts);
175175   atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
176   atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
176   atarigen_sound_io_reset(machine->device("audiocpu"));
177177}
178178
179179
r8581r8582
217217         {
218218            devtag_reset(space->machine, "ymsnd");
219219            devtag_reset(space->machine, "tms");
220            tms5220_set_frequency(devtag_get_device(space->machine, "tms"), ATARI_CLOCK_14MHz/2 / 11);
220            tms5220_set_frequency(space->machine->device("tms"), ATARI_CLOCK_14MHz/2 / 11);
221221            atarigen_set_ym2151_vol(space->machine, 0);
222222            atarigen_set_pokey_vol(space->machine, 0);
223223            atarigen_set_tms5220_vol(space->machine, 0);
r8581r8582
241241
242242   if (state->atarigen.cpu_to_sound_ready) temp ^= 0x80;
243243   if (state->atarigen.sound_to_cpu_ready) temp ^= 0x40;
244   if (!tms5220_readyq_r(devtag_get_device(space->machine, "tms"))) temp ^= 0x20;
244   if (!tms5220_readyq_r(space->machine->device("tms"))) temp ^= 0x20;
245245   if (!(input_port_read(space->machine, "803008") & 0x0008)) temp ^= 0x10;
246246
247247   return temp;
r8581r8582
256256
257257static WRITE8_HANDLER( sound_ctl_w )
258258{
259   running_device *tms = devtag_get_device(space->machine, "tms");
259   running_device *tms = space->machine->device("tms");
260260   switch (offset & 7)
261261   {
262262      case 0:   /* music reset, bit D7, low reset */
r8581r8582
16271627   gauntlet_state *state = (gauntlet_state *)machine->driver_data;
16281628   UINT8 *rom = memory_region(machine, "maincpu");
16291629   state->atarigen.eeprom_default = NULL;
1630   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x038000, 0, slapstic);
1630   atarigen_slapstic_init(machine->device("maincpu"), 0x038000, 0, slapstic);
16311631
16321632   /* swap the top and bottom halves of the main CPU ROM images */
16331633   atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000);
src/mame/drivers/ms32.c
r8581r8582
12201220{
12211221   irqreq = 0;
12221222   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
1223   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
1223   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
12241224}
12251225
12261226static void irq_raise(running_machine *machine, int level)
src/mame/drivers/mpu4.c
r8581r8582
5757  28-04-2006: El Condor
5858  20-05-2004: Re-Animator
5959
60  See http://www.mameworld.net/agemame/techinfo/mpu4.php for Information.
60  See http://agemame.mameworld.info/techinfo/mpu4.php for Information.
6161
6262--- Board Setup ---
6363
r8581r8582
453453/* 6809 IRQ handler */
454454static WRITE_LINE_DEVICE_HANDLER( cpu0_irq )
455455{
456   running_device *pia3 = devtag_get_device(device->machine, "pia_ic3");
457   running_device *pia4 = devtag_get_device(device->machine, "pia_ic4");
458   running_device *pia5 = devtag_get_device(device->machine, "pia_ic5");
459   running_device *pia6 = devtag_get_device(device->machine, "pia_ic6");
460   running_device *pia7 = devtag_get_device(device->machine, "pia_ic7");
461   running_device *pia8 = devtag_get_device(device->machine, "pia_ic8");
462   running_device *ptm6840 = devtag_get_device(device->machine, "6840ptm");
456   running_device *pia3 = device->machine->device("pia_ic3");
457   running_device *pia4 = device->machine->device("pia_ic4");
458   running_device *pia5 = device->machine->device("pia_ic5");
459   running_device *pia6 = device->machine->device("pia_ic6");
460   running_device *pia7 = device->machine->device("pia_ic7");
461   running_device *pia8 = device->machine->device("pia_ic8");
462   running_device *ptm6840 = device->machine->device("6840ptm");
463463
464464   /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */
465465   int combined_state = pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3) |
r8581r8582
484484
485485static WRITE_LINE_DEVICE_HANDLER( cpu0_irq_m6840 )
486486{
487   cpu0_irq(devtag_get_device(device->machine, "pia_ic3"), state);
487   cpu0_irq(device->machine->device("pia_ic3"), state);
488488}
489489
490490
r8581r8582
513513
514514static WRITE8_DEVICE_HANDLER( ic2_o2_callback )
515515{
516   running_device *pia = devtag_get_device(device->machine, "pia_ic3");
517   pia6821_ca1_w(pia, 0, data); /* copy output value to IC3 ca1 */
516   running_device *pia = device->machine->device("pia_ic3");
517   pia6821_ca1_w(pia, data); /* copy output value to IC3 ca1 */
518518
519519   /* the output from timer2 is the input clock for timer3 */
520520   ptm6840_set_c3(device, 0, data);
r8581r8582
686686   if ( serial_data )
687687   {
688688      ic4_input_b |=  0x80;
689      pia6821_cb1_w(device, 0, 1);
689      pia6821_cb1_w(device, 1);
690690   }
691691   else
692692   {
693693      ic4_input_b &= ~0x80;
694      pia6821_cb1_w(device, 0, 0);
694      pia6821_cb1_w(device, 0);
695695   }
696696
697697   if ( optic_pattern & 0x01 ) ic4_input_b |=  0x40; /* reel A tab */
r8581r8582
755755
756756static READ8_DEVICE_HANDLER( pia_ic5_portb_r )
757757{
758   running_device *pia_ic5 = devtag_get_device(device->machine, "pia_ic5");
758   running_device *pia_ic5 = device->machine->device("pia_ic5");
759759   LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",cpuexec_describe_context(device->machine)));
760760   coin_lockout_w(device->machine, 0, (pia6821_get_output_b(pia_ic5) & 0x01) );
761761   coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) );
r8581r8582
808808          }
809809         case 0x01:
810810         {   /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */
811            running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6");
811            running_device *pia_ic6 = device->machine->device("pia_ic6");
812812            LOG(("AY8913 address = %d \n",pia6821_get_output_a(pia_ic6)&0x0f));
813813            break;
814814         }
815815         case 0x02:
816816         {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */
817            running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6");
818            running_device *ay = devtag_get_device(device->machine, "ay8913");
817            running_device *pia_ic6 = device->machine->device("pia_ic6");
818            running_device *ay = device->machine->device("ay8913");
819819            ay8910_data_w(ay, 0, pia6821_get_output_a(pia_ic6));
820820            LOG(("AY Chip Write \n"));
821821            break;
r8581r8582
823823         case 0x03:
824824         {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it.
825825             The register will remain selected until another is chosen.*/
826            running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6");
827            running_device *ay = devtag_get_device(device->machine, "ay8913");
826            running_device *pia_ic6 = device->machine->device("pia_ic6");
827            running_device *ay = device->machine->device("ay8913");
828828            ay8910_address_w(ay, 0, pia6821_get_output_a(pia_ic6));
829829            LOG(("AY Chip Select \n"));
830830            break;
r8581r8582
10271027static READ8_DEVICE_HANDLER( pia_ic8_porta_r )
10281028{
10291029   static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" };
1030   running_device *pia_ic5 = devtag_get_device(device->machine, "pia_ic5");
1030   running_device *pia_ic5 = device->machine->device("pia_ic5");
10311031
10321032   LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", cpuexec_describe_context(device->machine)));
10331033/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
10341034   This is achieved via connecting every input line to an AND gate, thus allowing two strobes
10351035   to represent each orange input bank (strobes are active low). */
1036   pia6821_cb1_w(pia_ic5, 0, (input_port_read(device->machine, "AUX2") & 0x80));
1036   pia6821_cb1_w(pia_ic5, (input_port_read(device->machine, "AUX2") & 0x80));
10371037   return input_port_read(device->machine, portnames[input_strobe]);
10381038}
10391039
r8581r8582
10881088
10891089static WRITE8_DEVICE_HANDLER( pia_gb_porta_w )
10901090{
1091   running_device *msm6376 = devtag_get_device(device->machine, "msm6376");
1091   running_device *msm6376 = device->machine->device("msm6376");
10921092
10931093   LOG(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data));
10941094   okim6376_w(msm6376, 0, data);
r8581r8582
17451745    oscillating signal.*/
17461746   signal_50hz = signal_50hz?0:1;
17471747   update_lamps();
1748   pia6821_ca1_w(devtag_get_device(timer.machine, "pia_ic4"), 0, signal_50hz);   /* signal is connected to IC4 CA1 */
1748   pia6821_ca1_w(timer.machine->device("pia_ic4"), signal_50hz);   /* signal is connected to IC4 CA1 */
17491749}
17501750
17511751
src/mame/drivers/deniam.c
r8581r8582
11/***************************************************************************
22
33Deniam games
4
54driver by Nicola Salmoria
65
6Check archive.org for http://deniam.co.kr
77
8http://deniam.co.kr/text/c_game01.htm
9
108Title            System     Date
119---------------- ---------- ----------
1210GO!GO!           deniam-16b 1995/10/11
r8581r8582
243241{
244242   deniam_state *state = (deniam_state *)machine->driver_data;
245243
246   state->audio_cpu = devtag_get_device(machine, "audiocpu");
244   state->audio_cpu = machine->device("audiocpu");
247245
248246   state_save_register_global(machine, state->display_enable);
249247   state_save_register_global(machine, state->coinctrl);
src/mame/drivers/pipeline.c
r8581r8582
411411   ROM_LOAD( "rom2.u84", 0x00000, 0x08000, CRC(e77c43b7) SHA1(8b04005bc448083a429ace3319fc7e168a61f2f9) )
412412
413413   ROM_REGION( 0x1000, "mcu", 0 )
414   ROM_LOAD( "68705r3.u74", 0x00000, 0x01000, CRC(0550e87f) SHA1(bc051720ee2b1b871c883ab37140380a7b616445) )
414   ROM_LOAD( "68705r3.u74", 0x00000, 0x01000, CRC(9bef427e) SHA1(d8e9b144190ac1c837e379e4be69d1e258a6c666) )
415415
416416   ROM_REGION( 0x18000, "gfx2",0  )
417417   ROM_LOAD( "rom3.u32", 0x00000, 0x08000, CRC(d065ca46) SHA1(9fd8bb66735195d1cd20420096438abb5cb3fd54) )
src/mame/drivers/taito_b.c
r8581r8582
21942194{
21952195   taitob_state *state = (taitob_state *)machine->driver_data;
21962196
2197   state->maincpu = devtag_get_device(machine, "maincpu");
2198   state->audiocpu = devtag_get_device(machine, "audiocpu");
2199   state->mb87078 = devtag_get_device(machine, "mb87078");
2200   state->ym = devtag_get_device(machine, "ymsnd");
2201   state->tc0180vcu = devtag_get_device(machine, "tc0180vcu");
2202   state->tc0640fio = devtag_get_device(machine, "tc0640fio");
2203   state->tc0220ioc = devtag_get_device(machine, "tc0220ioc");
2197   state->maincpu = machine->device("maincpu");
2198   state->audiocpu = machine->device("audiocpu");
2199   state->mb87078 = machine->device("mb87078");
2200   state->ym = machine->device("ymsnd");
2201   state->tc0180vcu = machine->device("tc0180vcu");
2202   state->tc0640fio = machine->device("tc0640fio");
2203   state->tc0220ioc = machine->device("tc0220ioc");
22042204
22052205   state_save_register_global(machine, state->eep_latch);
22062206   state_save_register_global(machine, state->coin_word);
src/mame/drivers/kungfur.c
r8581r8582
2222
232350pin cable to 7seg&lamp control board.
2424
25flyer.gif from
26http://www.hoizinger.com/ed/EM.HTML
25Information:
26http://www.wshin.com/games/review/ka/kung-fu-roushi.htm
27http://www.youtube.com/watch?v=ssEfw-RbSjs
28
29
2730----------------------------------------------------------------
2831
2932***************************************************************************/
r8581r8582
160163{
161164   adpcm_pos[0] = 0x40000+(data & 0xff) * 0x100;
162165   adpcm_idle[0] = 0;
163   msm5205_reset_w(devtag_get_device(device->machine, "adpcm1"),0);
166   msm5205_reset_w(device->machine->device("adpcm1"),0);
164167}
165168
166169static WRITE8_DEVICE_HANDLER( kungfur_adpcm2_w )
167170{
168171   adpcm_pos[1] = (data & 0xff) * 0x400;
169172   adpcm_idle[1] = 0;
170   msm5205_reset_w(devtag_get_device(device->machine, "adpcm2"),0);
173   msm5205_reset_w(device->machine->device("adpcm2"),0);
171174}
172175
173176/*
r8581r8582
262265
263266   if (adpcm_pos[0] >= 0x40000 || adpcm_idle[0])
264267   {
265      msm5205_reset_w(devtag_get_device(device->machine, "adpcm1"),1);
268      msm5205_reset_w(device->machine->device("adpcm1"),1);
266269      trigger = 0;
267270   }
268271   else
r8581r8582
270273      UINT8 *ROM = memory_region(device->machine, "adpcm1");
271274
272275      adpcm_data = ((trigger ? (ROM[adpcm_pos[0]] & 0x0f) : (ROM[adpcm_pos[0]] & 0xf0)>>4) );
273      msm5205_data_w(devtag_get_device(device->machine, "adpcm1"),adpcm_data & 0xf);
276      msm5205_data_w(device->machine->device("adpcm1"),adpcm_data & 0xf);
274277      trigger^=1;
275278      if(trigger == 0)
276279      {
r8581r8582
288291
289292   if (adpcm_pos[1] >= 0x10000 || adpcm_idle[1])
290293   {
291      msm5205_reset_w(devtag_get_device(device->machine, "adpcm2"),1);
294      msm5205_reset_w(device->machine->device("adpcm2"),1);
292295      trigger = 0;
293296   }
294297   else
r8581r8582
296299      UINT8 *ROM = memory_region(device->machine, "adpcm2");
297300
298301      adpcm_data = ((trigger ? (ROM[adpcm_pos[1]] & 0x0f) : (ROM[adpcm_pos[1]] & 0xf0)>>4) );
299      msm5205_data_w(devtag_get_device(device->machine, "adpcm2"),adpcm_data & 0xf);
302      msm5205_data_w(device->machine->device("adpcm2"),adpcm_data & 0xf);
300303      trigger^=1;
301304      if(trigger == 0)
302305      {
src/mame/drivers/viper.c
r8581r8582
4949
5050static VIDEO_UPDATE(viper)
5151{
52   running_device *device = devtag_get_device(screen->machine, "voodoo");
52   running_device *device = screen->machine->device("voodoo");
5353   return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
5454}
5555
r8581r8582
462462      }
463463
464464      default:
465         fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(devtag_get_device(device->machine, "maincpu")));
465         fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(device->machine->device("maincpu")));
466466   }
467467   return 0;
468468}
r8581r8582
530530      }
531531
532532      default:
533         fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(devtag_get_device(device->machine, "maincpu")));
533         fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(device->machine->device("maincpu")));
534534   }
535535}
536536
r8581r8582
658658
659659static DRIVER_INIT(vipercf)
660660{
661   running_device *ide = devtag_get_device(machine, "ide");
661   running_device *ide = machine->device("ide");
662662
663663   DRIVER_INIT_CALL(viper);
664664
src/mame/drivers/jackal.c
r8581r8582
342342   memory_configure_bank(machine, "bank1", 1, 1, &ROM[0x14000], 0x8000);
343343   memory_set_bank(machine, "bank1", 0);
344344
345   state->mastercpu = devtag_get_device(machine, "master");
346   state->slavecpu = devtag_get_device(machine, "slave");
345   state->mastercpu = machine->device("master");
346   state->slavecpu = machine->device("slave");
347347
348348   state_save_register_global(machine, state->irq_enable);
349349}
r8581r8582
355355
356356   // HACK: running at the nominal clock rate, music stops working
357357   // at the beginning of the game. This fixes it.
358   cpu_set_clockscale(devtag_get_device(machine, "slave"), 1.2f);
358   machine->device("slave")->set_clock_scale(1.2f);
359359
360360   state->rambank = rgn;
361361   state->spritebank = rgn;
src/mame/drivers/mw8080bw.c
r8581r8582
630630   mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
631631
632632   if (offset & 0x01)
633      tornbase_audio_w(devtag_get_device(space->machine, "discrete"), 0, data);
633      tornbase_audio_w(space->machine->device("discrete"), 0, data);
634634
635635   if (offset & 0x02)
636636      mb14241_shift_count_w(state->mb14241, 0, data);
r8581r8582
883883static STATE_POSTLOAD( maze_update_discrete )
884884{
885885   mw8080bw_state *state = (mw8080bw_state *)machine->driver_data;
886   maze_write_discrete(devtag_get_device(machine, "discrete"), state->maze_tone_timing_state);
886   maze_write_discrete(machine->device("discrete"), state->maze_tone_timing_state);
887887}
888888
889889
src/mame/drivers/namcos86.c
r8581r8582
327327      case 1:
328328      case 2:
329329      case 3:
330         namco_63701x_w(devtag_get_device(space->machine, "namco2"), (offset & 0x1e00) >> 9,data);
330         namco_63701x_w(space->machine->device("namco2"), (offset & 0x1e00) >> 9,data);
331331         break;
332332
333333      case 4:
src/mame/drivers/suna8.c
r8581r8582
10221022static WRITE8_HANDLER( brickzn_pcm_w )
10231023{
10241024   static const char *const dacs[] = { "dac1", "dac2", "dac3", "dac4" };
1025   dac_signed_data_w( devtag_get_device(space->machine, dacs[offset & 3]), (data & 0xf) * 0x11 );
1025   dac_signed_data_w( space->machine->device(dacs[offset & 3]), (data & 0xf) * 0x11 );
10261026}
10271027
10281028
src/mame/drivers/vaportra.c
r8581r8582
234234{
235235   vaportra_state *state = (vaportra_state *)machine->driver_data;
236236
237   state->maincpu = devtag_get_device(machine, "maincpu");
238   state->audiocpu = devtag_get_device(machine, "audiocpu");
239   state->deco16ic = devtag_get_device(machine, "deco_custom");
237   state->maincpu = machine->device("maincpu");
238   state->audiocpu = machine->device("audiocpu");
239   state->deco16ic = machine->device("deco_custom");
240240
241241   state_save_register_global_array(machine, state->priority);
242242}
src/mame/drivers/chanbara.c
r8581r8582
369369{
370370   chanbara_state *state = (chanbara_state *)machine->driver_data;
371371
372   state->maincpu = devtag_get_device(machine, "maincpu");
372   state->maincpu = machine->device("maincpu");
373373
374374   state_save_register_global(machine, state->scroll);
375375   state_save_register_global(machine, state->scrollhi);
src/mame/drivers/btime.c
r8581r8582
13601360 */
13611361#define BTIME_R49   RES_K(47)   /* pcb: 47.4k */
13621362
1363/* The input divider R51 R50 is not independant of R52, which
1363/* The input divider R51 R50 is not independent of R52, which
13641364 * also depends on ay internal resistance.
13651365 * FIXME: Develop proper model when I am retired.
13661366 *
r8581r8582
14071407
14081408   /* Amplifier is upc1181H3
14091409     *
1410     * http://www.mydarc.de/dj7oh/fad/ics/upc1181/upc1181.htm
1410     * http://www.ic-ts-histo.de/fad/ics/upc1181/upc1181.htm
14111411     *
14121412     * A linear frequency response is mentioned as well as a lower
14131413     * edge frequency determined by cap on pin3, however no formula given.
r8581r8582
14271427{
14281428   btime_state *state = (btime_state *)machine->driver_data;
14291429
1430   state->maincpu = devtag_get_device(machine, "maincpu");
1431   state->audiocpu = devtag_get_device(machine, "audiocpu");
1430   state->maincpu = machine->device("maincpu");
1431   state->audiocpu = machine->device("audiocpu");
14321432
14331433   state_save_register_global(machine, state->btime_palette);
14341434   state_save_register_global(machine, state->bnj_scroll1);
r8581r8582
18311831ROM_END
18321832
18331833/* There is a flyer with a screen shot for Lock'n'Chase at:
1834   http://www.gamearchive.com/flyers/video/taito/locknchase_f.jpg  */
1834   http://www.arcadeflyers.com/?page=flyer&db=videodb&id=608&image=1  */
18351835
18361836ROM_START( lnc )
18371837   ROM_REGION( 0x10000, "maincpu", 0 )
r8581r8582
20882088   for (addr = 0; addr < 0x10000; addr++)
20892089      decrypt[addr] = swap_bits_5_6(rom[addr]);
20902090
2091   if (space->cpu == devtag_get_device(machine, "maincpu"))
2091   if (space->cpu == machine->device("maincpu"))
20922092      decrypted = decrypt;
20932093}
20942094
src/mame/drivers/m14.c
r8581r8582
4444
4545
4646--- Team Japump!!! ---
47http://japump.i.am/
4847Dumped by Chackn
494801/30/2000
5049
r8581r8582
317316{
318317   m14_state *state = (m14_state *)machine->driver_data;
319318
320   state->maincpu = devtag_get_device(machine, "maincpu");
319   state->maincpu = machine->device("maincpu");
321320
322321   state_save_register_global(machine, state->hop_mux);
323322}
src/mame/drivers/mermaid.c
r8581r8582
330330{
331331   mermaid_state *state = (mermaid_state *)machine->driver_data;
332332
333   state->maincpu = devtag_get_device(machine, "maincpu");
334   state->ay1 = devtag_get_device(machine, "ay1");
335   state->ay2 = devtag_get_device(machine, "ay2");
333   state->maincpu = machine->device("maincpu");
334   state->ay1 = machine->device("ay1");
335   state->ay2 = machine->device("ay2");
336336
337337   state_save_register_global(machine, state->coll_bit0);
338338   state_save_register_global(machine, state->coll_bit1);
src/mame/drivers/photon2.c
r8581r8582
192192
193193static WRITE8_HANDLER(photon2_fe_w)
194194{
195   running_device *speaker = devtag_get_device(space->machine, "speaker");
195   running_device *speaker = space->machine->device("speaker");
196196   spectrum_port_fe = data;
197197
198198   speaker_level_w(speaker, BIT(data,4));
src/mame/drivers/gstriker.c
r8581r8582
127127c13_u11.u11     HN624116 - GFX
128128c13_u12.u12     HN624116 - GFX
129129
130              Screenshots and board pics are available here...
131              http://unemulated.emuunlim.com/shopraid/index.html
132130
133131*** ROMSET: vgoalsca
134132
src/mame/drivers/fcrash.c
r8581r8582
696696
697697   memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
698698
699   state->maincpu = devtag_get_device(machine, "maincpu");
700   state->audiocpu = devtag_get_device(machine, "soundcpu");
701   state->msm_1 = devtag_get_device(machine, "msm1");
702   state->msm_2 = devtag_get_device(machine, "msm2");
699   state->maincpu = machine->device("maincpu");
700   state->audiocpu = machine->device("soundcpu");
701   state->msm_1 = machine->device("msm1");
702   state->msm_2 = machine->device("msm2");
703703
704704   state_save_register_global(machine, state->sample_buffer1);
705705   state_save_register_global(machine, state->sample_buffer2);
r8581r8582
711711{
712712   cps_state *state = (cps_state *)machine->driver_data;
713713
714   state->maincpu = devtag_get_device(machine, "maincpu");
715   state->audiocpu = devtag_get_device(machine, "soundcpu");
714   state->maincpu = machine->device("maincpu");
715   state->audiocpu = machine->device("soundcpu");
716716}
717717
718718static MACHINE_RESET( fcrash )
src/mame/drivers/othello.c
r8581r8582
383383{
384384   othello_state *state = (othello_state *)machine->driver_data;
385385
386   state->maincpu = devtag_get_device(machine, "maincpu");
387   state->mc6845 = devtag_get_device(machine, "crtc");
388   state->n7751 = devtag_get_device(machine, "n7751");
389   state->ay1 = devtag_get_device(machine, "ay1");
390   state->ay2 = devtag_get_device(machine, "ay2");
386   state->maincpu = machine->device("maincpu");
387   state->mc6845 = machine->device("crtc");
388   state->n7751 = machine->device("n7751");
389   state->ay1 = machine->device("ay1");
390   state->ay2 = machine->device("ay2");
391391
392392   state_save_register_global(machine, state->tile_bank);
393393   state_save_register_global(machine, state->ay_select);
src/mame/drivers/cosmic.c
r8581r8582
10241024{
10251025   cosmic_state *state = (cosmic_state *)machine->driver_data;
10261026
1027   state->samples = devtag_get_device(machine, "samples");
1028   state->dac = devtag_get_device(machine, "dac");
1027   state->samples = machine->device("samples");
1028   state->dac = machine->device("dac");
10291029
10301030   state_save_register_global(machine, state->sound_enabled);
10311031   state_save_register_global(machine, state->march_select);
r8581r8582
16181618
16191619static DRIVER_INIT( nomnlnd )
16201620{
1621   running_device *dac = devtag_get_device(machine, "dac");
1621   running_device *dac = machine->device("dac");
16221622   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r);
16231623   memory_nop_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4800, 0x4800, 0, 0);
16241624   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
src/mame/drivers/model2.c
r8581r8582
230230   {
231231      if (copro_fifoout_num == COPRO_FIFOOUT_SIZE)
232232      {
233         sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, ASSERT_LINE);
233         sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
234234      }
235235      else
236236      {
237         sharc_set_flag_input(devtag_get_device(space->machine, "dsp"), 1, CLEAR_LINE);
237         sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE);
238238      }
239239   }
240240
r8581r8582
497497   else
498498   {
499499      ret &= ~0x0030;
500      return ret | 0x00d0 | (eeprom_read_bit(devtag_get_device(field->port->machine, "eeprom")) << 5);
500      return ret | 0x00d0 | (eeprom_read_bit(field->port->machine->device("eeprom")) << 5);
501501   }
502502}
503503
r8581r8582
673673
674674   //logerror("copro_function_port_w: %08X, %08X, %08X\n", data, offset, mem_mask);
675675   if (dsp_type == DSP_TYPE_SHARC)
676      copro_fifoin_push(devtag_get_device(space->machine, "dsp"), d);
676      copro_fifoin_push(space->machine->device("dsp"), d);
677677   else
678      copro_fifoin_push(devtag_get_device(space->machine, "tgp"), d);
678      copro_fifoin_push(space->machine->device("tgp"), d);
679679}
680680
681681static READ32_HANDLER(copro_fifo_r)
r8581r8582
690690   {
691691      if (dsp_type == DSP_TYPE_SHARC)
692692      {
693         sharc_external_dma_write(devtag_get_device(space->machine, "dsp"), model2_coprocnt, data & 0xffff);
693         sharc_external_dma_write(space->machine->device("dsp"), model2_coprocnt, data & 0xffff);
694694      }
695695      else if (dsp_type == DSP_TYPE_TGP)
696696      {
r8581r8582
703703   {
704704      //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(space->cpu));
705705      if (dsp_type == DSP_TYPE_SHARC)
706         copro_fifoin_push(devtag_get_device(space->machine, "dsp"), data);
706         copro_fifoin_push(space->machine->device("dsp"), data);
707707      else
708         copro_fifoin_push(devtag_get_device(space->machine, "tgp"), data);
708         copro_fifoin_push(space->machine->device("tgp"), data);
709709   }
710710}
711711
r8581r8582
724724      (strcmp(space->machine->gamedrv->name, "vonj" ) == 0) ||
725725      (strcmp(space->machine->gamedrv->name, "rchase2" ) == 0))
726726   {
727      sharc_external_iop_write(devtag_get_device(space->machine, "dsp"), offset, data);
727      sharc_external_iop_write(space->machine->device("dsp"), offset, data);
728728   }
729729   else
730730   {
r8581r8582
735735      else
736736      {
737737         iop_data |= (data & 0xffff) << 16;
738         sharc_external_iop_write(devtag_get_device(space->machine, "dsp"), offset, iop_data);
738         sharc_external_iop_write(space->machine->device("dsp"), offset, iop_data);
739739      }
740740      iop_write_num++;
741741   }
r8581r8582
810810{
811811    if (model2_geoctl & 0x80000000)
812812    {
813        sharc_external_dma_write(devtag_get_device(space->machine, "dsp2"), model2_geocnt, data & 0xffff);
813        sharc_external_dma_write(space->machine->device("dsp2"), model2_geocnt, data & 0xffff);
814814
815815        model2_geocnt++;
816816    }
r8581r8582
826826{
827827    if ((strcmp(space->machine->gamedrv->name, "schamp" ) == 0))
828828    {
829        sharc_external_iop_write(devtag_get_device(space->machine, "dsp2"), offset, data);
829        sharc_external_iop_write(space->machine->device("dsp2"), offset, data);
830830    }
831831    else
832832    {
r8581r8582
837837        else
838838        {
839839            geo_iop_data |= (data & 0xffff) << 16;
840            sharc_external_iop_write(devtag_get_device(space->machine, "dsp2"), offset, geo_iop_data);
840            sharc_external_iop_write(space->machine->device("dsp2"), offset, geo_iop_data);
841841        }
842842        geo_iop_write_num++;
843843    }
r8581r8582
10141014
10151015static int snd_68k_ready_r(const address_space *space)
10161016{
1017   int sr = cpu_get_reg(devtag_get_device(space->machine, "audiocpu"), M68K_SR);
1017   int sr = cpu_get_reg(space->machine->device("audiocpu"), M68K_SR);
10181018
10191019   if ((sr & 0x0700) > 0x0100)
10201020   {
r8581r8582
10621062{
10631063   if (ACCESSING_BITS_0_7 && (offset == 0))
10641064   {
1065      scsp_midi_in(devtag_get_device(space->machine, "scsp"), 0, data&0xff, 0);
1065      scsp_midi_in(space->machine->device("scsp"), 0, data&0xff, 0);
10661066
10671067      // give the 68k time to notice
10681068      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(40));
r8581r8582
19451945   UINT32 result = 0;
19461946   //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(space->cpu));
19471947
1948   copro_fifoin_pop(devtag_get_device(space->machine, "dsp"), &result);
1948   copro_fifoin_pop(space->machine->device("dsp"), &result);
19491949   return result;
19501950}
19511951
19521952static WRITE32_HANDLER(copro_sharc_output_fifo_w)
19531953{
19541954   //mame_printf_debug("SHARC FIFOOUT push %08X\n", data);
1955   copro_fifoout_push(devtag_get_device(space->machine, "dsp"), data);
1955   copro_fifoout_push(space->machine->device("dsp"), data);
19561956}
19571957
19581958static READ32_HANDLER(copro_sharc_buffer_r)
src/mame/drivers/cps2.c
r8581r8582
11951195{
11961196   cps_state *state = (cps_state *)machine->driver_data;
11971197
1198   state->maincpu = devtag_get_device(machine, "maincpu");
1199   state->audiocpu = devtag_get_device(machine, "audiocpu");
1198   state->maincpu = machine->device("maincpu");
1199   state->audiocpu = machine->device("audiocpu");
12001200
12011201   state_save_register_global(machine, state->scancount);
12021202
r8581r8582
54325432
54335433ROM_START( sfzh )
54345434   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
5435   ROM_LOAD16_WORD_SWAP( "sfzh.03d", 0x000000, 0x80000, CRC(6e08cbe0) SHA1(c9d0e709004677b51efe0b62e0ae9b681dde1744) )
5436   ROM_LOAD16_WORD_SWAP( "sfz.04c",  0x080000, 0x80000, CRC(bb90acd5) SHA1(a19795963b90f1152f44cae29e78dd2ce67a41d6) )
5437   ROM_LOAD16_WORD_SWAP( "sfz.05c",  0x100000, 0x80000, CRC(0810544d) SHA1(5f39bda3e7b16508eb58e5a2e0cc58c09cf428ce) ) /* Same as revision "A" below */
5438   ROM_LOAD16_WORD_SWAP( "sfz.06",   0x180000, 0x80000, CRC(806e8f38) SHA1(b6d6912aa8f2f590335d7ff9a8214648e7131ebb) )
5439
5440   ROM_REGION( 0x1000000, "gfx", 0 )
5441   ROM_FILL(              0x000000, 0x800000, 0 )
5442   ROMX_LOAD( "sfz.14m",  0x800000, 0x200000, CRC(90fefdb3) SHA1(5eb28c8de57acfeaefebdd01509c7d9ba5244705) , ROM_GROUPWORD | ROM_SKIP(6) )
5443   ROMX_LOAD( "sfz.16m",  0x800002, 0x200000, CRC(5354c948) SHA1(07588f1ba6addc04fef3274c971174aaf3e632ab) , ROM_GROUPWORD | ROM_SKIP(6) )
5444   ROMX_LOAD( "sfz.18m",  0x800004, 0x200000, CRC(41a1e790) SHA1(ce25dad542308691dbe9606b26279bbd59ea4b81) , ROM_GROUPWORD | ROM_SKIP(6) )
5445   ROMX_LOAD( "sfz.20m",  0x800006, 0x200000, CRC(a549df98) SHA1(f054e95df650a891ef56da8bfb31cb2c945a9aed) , ROM_GROUPWORD | ROM_SKIP(6) )
5446
5447   ROM_REGION( QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
5448   ROM_LOAD( "sfz.01",   0x00000, 0x08000, CRC(ffffec7d) SHA1(75b4aef001b72a0f571b51b2b97803facc1832dd) )
5449   ROM_CONTINUE(         0x10000, 0x18000 )
5450   ROM_LOAD( "sfz.02",   0x28000, 0x20000, CRC(45f46a08) SHA1(e32dbd27b52ab708278045b5a829376e55a4ca81) )
5451
5452   ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
5453   ROM_LOAD16_WORD_SWAP( "sfz.11m",   0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
5454   ROM_LOAD16_WORD_SWAP( "sfz.12m",   0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
5455ROM_END
5456
5457ROM_START( sfzhr1 )
5458   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
54355459   ROM_LOAD16_WORD_SWAP( "sfzh.03c", 0x000000, 0x80000, CRC(bce635aa) SHA1(323da2de6c3ff6fd8c2c66ce6bd1d287873db9b1) )
54365460   ROM_LOAD16_WORD_SWAP( "sfz.04a",  0x080000, 0x80000, CRC(5f99e9a5) SHA1(e9f286315d17096adc08e6b4e6ff7c5351f5bef3) )
54375461   ROM_LOAD16_WORD_SWAP( "sfz.05a",  0x100000, 0x80000, CRC(0810544d) SHA1(5f39bda3e7b16508eb58e5a2e0cc58c09cf428ce) )
r8581r8582
72077231   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
72087232   ROM_LOAD16_WORD_SWAP( "xmnh.03",  0x000000, 0x80000, CRC(e4b85a90) SHA1(1eaf94ce42438eea45cd5c813f2859abf258dd3a) )  /* These are later date, but no revision leter code? */
72097233   ROM_LOAD16_WORD_SWAP( "xmnh.04",  0x080000, 0x80000, CRC(7dfe1406) SHA1(4ddc0a8947d78ce587220f8188c8a8f00c7372c4) )  /* These are later date, but no revision leter code? */
7210   ROM_LOAD16_WORD_SWAP( "xmn.05a",  0x100000, 0x80000, CRC(ac0d7759) SHA1(650d4474b13f16af7910a0f721fcda2ddb2414fd) )
7234   ROM_LOAD16_WORD_SWAP( "xmnh.05",  0x100000, 0x80000, CRC(87b0ed0f) SHA1(f4d78fdd9fcf864e909d9a2bb351b49a5f8ec7a0) )  /* These are later date, but no revision leter code? */
72117235   ROM_LOAD16_WORD_SWAP( "xmn.06a",  0x180000, 0x80000, CRC(1b86a328) SHA1(2469cd705139ee9f1142e6e379e68d0c9675b37e) )
72127236   ROM_LOAD16_WORD_SWAP( "xmn.07a",  0x200000, 0x80000, CRC(2c142a44) SHA1(7624875f9c39b361fc83e52e87e0fd5e96279713) )
72137237   ROM_LOAD16_WORD_SWAP( "xmn.08a",  0x280000, 0x80000, CRC(f712d44f) SHA1(0d18d4a4eacad94a66beca6ec509ac7f690c6882) )
r8581r8582
72387262   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
72397263   ROM_LOAD16_WORD_SWAP( "xmnh.03d", 0x000000, 0x80000, CRC(63b0a84f) SHA1(4a0d604ff11e68313a0711702803390cb0d2f234) )
72407264   ROM_LOAD16_WORD_SWAP( "xmnh.04d", 0x080000, 0x80000, CRC(b1b9b727) SHA1(b04ae3b7aab88cbb1a55068343ff9a9806d331a4) )
7241   ROM_LOAD16_WORD_SWAP( "xmnh.05",  0x100000, 0x80000, CRC(87b0ed0f) SHA1(f4d78fdd9fcf864e909d9a2bb351b49a5f8ec7a0) )
7265   ROM_LOAD16_WORD_SWAP( "xmn.05a",  0x100000, 0x80000, CRC(ac0d7759) SHA1(650d4474b13f16af7910a0f721fcda2ddb2414fd) )
72427266   ROM_LOAD16_WORD_SWAP( "xmn.06a",  0x180000, 0x80000, CRC(1b86a328) SHA1(2469cd705139ee9f1142e6e379e68d0c9675b37e) )
72437267   ROM_LOAD16_WORD_SWAP( "xmn.07a",  0x200000, 0x80000, CRC(2c142a44) SHA1(7624875f9c39b361fc83e52e87e0fd5e96279713) )
72447268   ROM_LOAD16_WORD_SWAP( "xmn.08a",  0x280000, 0x80000, CRC(f712d44f) SHA1(0d18d4a4eacad94a66beca6ec509ac7f690c6882) )
r8581r8582
78317855   state->scancount = 0;
78327856   state->cps2networkpresent = 0;
78337857
7834   cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
7858   machine->device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
78357859}
78367860
78377861static DRIVER_INIT( ssf2tb )
r8581r8582
78877911
78887912   memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x618000, 0x619fff, 0, 0, gigamn2_dummyqsound_r, gigamn2_dummyqsound_w); // no qsound..
78897913   memory_set_decrypted_region(space, 0x000000, (length) - 1, &rom[length/4]);
7890   m68k_set_encrypted_opcode_range(devtag_get_device(machine, "maincpu"), 0, length);
7914   m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length);
78917915}
78927916
78937917
r8581r8582
79838007GAME( 1995, sfzj,       sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Japan 950727)", GAME_SUPPORTS_SAVE )
79848008GAME( 1995, sfzjr1,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Japan 950627)", GAME_SUPPORTS_SAVE )
79858009GAME( 1995, sfzjr2,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Japan 950605)", GAME_SUPPORTS_SAVE )
7986GAME( 1995, sfzh,       sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Hispanic 950627)", GAME_SUPPORTS_SAVE )
8010GAME( 1995, sfzh,       sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Hispanic 950718)", GAME_SUPPORTS_SAVE )
8011GAME( 1995, sfzhr1,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Hispanic 950627)", GAME_SUPPORTS_SAVE )
79878012GAME( 1995, sfzb,       sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Brazil 951109)", GAME_SUPPORTS_SAVE )
79888013GAME( 1995, sfzbr1,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Brazil 950727)", GAME_SUPPORTS_SAVE )
79898014GAME( 1995, mmancp2u,   megaman,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man - The Power Battle (CPS2, USA 951006, SAMPLE Version)", GAME_SUPPORTS_SAVE )
src/mame/drivers/pushman.c
r8581r8582
422422{
423423   pushman_state *state = (pushman_state *)machine->driver_data;
424424
425   state->maincpu = devtag_get_device(machine, "maincpu");
426   state->audiocpu = devtag_get_device(machine, "audiocpu");
427   state->mcu = devtag_get_device(machine, "mcu");
425   state->maincpu = machine->device("maincpu");
426   state->audiocpu = machine->device("audiocpu");
427   state->mcu = machine->device("mcu");
428428
429429   state_save_register_global_array(machine, state->control);
430430   state_save_register_global_array(machine, state->shared_ram);
src/mame/drivers/hyperspt.c
r8581r8582
271271   trackfld_state *state = (trackfld_state *)machine->driver_data;
272272
273273   state->audiocpu = machine->device<cpu_device>("audiocpu");
274   state->vlm = devtag_get_device(machine, "vlm");
274   state->vlm = machine->device("vlm");
275275
276276   /* sound */
277277   state_save_register_global(machine, state->SN76496_latch);
src/mame/drivers/hnayayoi.c
r8581r8582
543543   hnayayoi_state *state = (hnayayoi_state *)machine->driver_data;
544544
545545   /* start with the MSM5205 reset */
546   msm5205_reset_w(devtag_get_device(machine, "msm"), 1);
546   msm5205_reset_w(machine->device("msm"), 1);
547547
548548   state->palbank = 0;
549549   state->blit_layer = 0;
src/mame/drivers/shanghai.c
r8581r8582
6363
6464static VIDEO_UPDATE( shanghai )
6565{
66   running_device *hd63484 = devtag_get_device(screen->machine, "hd63484");
66   running_device *hd63484 = screen->machine->device("hd63484");
6767   int x, y, b, src;
6868
6969   b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff);
src/mame/drivers/jpmimpct.c
r8581r8582
198198
199199static WRITE16_HANDLER( m68k_tms_w )
200200{
201   tms34010_host_w(devtag_get_device(space->machine, "dsp"), offset, data);
201   tms34010_host_w(space->machine->device("dsp"), offset, data);
202202}
203203
204204static READ16_HANDLER( m68k_tms_r )
205205{
206   return tms34010_host_r(devtag_get_device(space->machine, "dsp"), offset);
206   return tms34010_host_r(space->machine->device("dsp"), offset);
207207}
208208
209209
src/mame/drivers/namcos12.c
r8581r8582
5757Wanted Games
5858------------
5959Aerosmith - Quest for Fame              (C) Namco,        2001
60http://www.bandainamcogames.co.jp/aa/am/vg/questforfame/
60http://www.bandainamcogames.co.jp/am/vg/questforfame/
6161
6262Attack Pla-Rail                         (C) Tomy/Namco,   199?
6363Possibly some kind of redemption game for kids
6464
6565Kart Duel                               (C) Namco,        2000
66http://www.bandainamcogames.co.jp/aa/am/vg/kartduel/
66http://www.bandainamcogames.co.jp/am/english/aa/kartduel/
6767
6868Oh Bakyuuun                             (C) Namco/Raizing,1999
6969http://www.8ing.net/prd/ohbakyun/index.html
r8581r8582
7777It was shown only at an amusement show. Possibly a prototype still exists. Possibly not.
7878
7979Techno Drive                            (C) Namco,        1998
80http://www.bandainamcogames.co.jp/aa/am/em/techno-drive/main/index.php
80http://www.bandainamcogames.co.jp/am/em/techno-drive/main/index.php
8181
8282Tekno Werk                              (C) Namco,        1999
8383Some kind of music game similar to Konami's Keyboard Mania series
8484
8585Truck Kyosokyoku                        (C) Namco,        2000
86http://www.bandainamcogames.co.jp/aa/am/vg/truckkyosokyoku/
86http://www.bandainamcogames.co.jp/am/english/aa/truckkyosokyoku/
8787
8888Um Jammer Lammy                         (C) Namco,        1999
89http://www.bandainamcogames.co.jp/aa/am/vg/umjammerlammy/#nbgiWrapper
89http://www.wailee.com/sys/lpic/UM_Jammer_Lammy.jpg
9090
91If you can help with the remaining undumped S12 games, please contact me at http://www.mameworld.net/gurudumps/
91If you can help with the remaining undumped S12 games, please contact me at http://guru.mameworld.info/
9292Note that this list above may not be 100% complete. Alternative versions are also welcome :-)
9393
9494The Namco System 12 system comprises 3 mandatory PCB's....
src/mame/drivers/scramble.c
r8581r8582
957957     * it must be multiplexed by flip line. */
958958   PORT_START("IN0")
959959   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
960   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
960   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
961961   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
962962   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
963963   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
src/mame/drivers/missb2.c
r8581r8582
359359{
360360   bublbobl_state *state = (bublbobl_state *)machine->driver_data;
361361
362   state->maincpu = devtag_get_device(machine, "maincpu");
363   state->audiocpu = devtag_get_device(machine, "audiocpu");
364   state->slave = devtag_get_device(machine, "slave");
362   state->maincpu = machine->device("maincpu");
363   state->audiocpu = machine->device("audiocpu");
364   state->slave = machine->device("slave");
365365   state->mcu = NULL;
366366
367367   state_save_register_global(machine, state->sound_nmi_enable);
src/mame/drivers/photon.c
r8581r8582
9292
9393static WRITE8_DEVICE_HANDLER(pk8000_80_portc_w)
9494{
95   speaker_level_w(devtag_get_device(device->machine, "speaker"), BIT(data,7));
95   speaker_level_w(device->machine->device("speaker"), BIT(data,7));
9696}
9797
9898static I8255A_INTERFACE( pk8000_ppi8255_interface_1 )
r8581r8582
180180static MACHINE_RESET(pk8000)
181181{
182182   pk8000_set_bank(machine,0);
183   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), pk8000_irq_callback);
183   cpu_set_irq_callback(machine->device("maincpu"), pk8000_irq_callback);
184184}
185185
186186static VIDEO_START( photon )
src/mame/drivers/citycon.c
r8581r8582
191191{
192192   citycon_state *state = (citycon_state *)machine->driver_data;
193193
194   state->maincpu = devtag_get_device(machine, "maincpu");
194   state->maincpu = machine->device("maincpu");
195195
196196   state_save_register_global(machine, state->bg_image);
197197}
src/mame/drivers/sigmab52.c
r8581r8582
146146
147147static VIDEO_UPDATE( jwildb52 )
148148{
149   running_device *hd63484 = devtag_get_device(screen->machine, "hd63484");
149   running_device *hd63484 = screen->machine->device("hd63484");
150150
151151   int x, y, b, src;
152152
r8581r8582
226226{
227227   static int latch=0;
228228   static unsigned int acrtc_data=0;
229   running_device *hd63484 = devtag_get_device(space->machine, "hd63484");
229   running_device *hd63484 = space->machine->device("hd63484");
230230   if(!offset)
231231   {
232232      //address select
r8581r8582
257257{
258258   if(offset&1)
259259   {
260      running_device *hd63484 = devtag_get_device(space->machine, "hd63484");
260      running_device *hd63484 = space->machine->device("hd63484");
261261      return hd63484_data_r(hd63484, 0, 0xff);
262262   }
263263
r8581r8582
546546      UINT16 *rom = (UINT16*)memory_region(machine, "gfx1");
547547      int i;
548548
549      running_device *hd63484 = devtag_get_device(machine, "hd63484");
549      running_device *hd63484 = machine->device("hd63484");
550550
551551      for(i = 0; i < 0x40000/2; ++i)
552552      {
src/mame/drivers/playmark.c
r8581r8582
909909{
910910   playmark_state *state = (playmark_state *)machine->driver_data;
911911
912   state->oki = devtag_get_device(machine, "oki");
913   state->eeprom = devtag_get_device(machine, "eeprom");
912   state->oki = machine->device("oki");
913   state->eeprom = machine->device("eeprom");
914914
915915   state_save_register_global(machine, state->bgscrollx);
916916   state_save_register_global(machine, state->bgscrolly);
r8581r8582
15181518         data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 3]));
15191519         data |= (data_hi << 12) | (data_lo << 8);
15201520
1521         pic16c5x_set_config(devtag_get_device(machine, "audiocpu"), data);
1521         pic16c5x_set_config(machine->device("audiocpu"), data);
15221522
15231523         src_pos = 0x7fff;      /* Force Exit */
15241524      }
src/mame/drivers/jangou.c
r8581r8582
399399   AM_RANGE(0x11,0x11) AM_WRITE(mux_w)
400400   AM_RANGE(0x12,0x17) AM_WRITE(blitter_process_w)
401401   AM_RANGE(0x20,0x2f) AM_WRITE(blit_vregs_w)
402   AM_RANGE(0x30,0x30) AM_WRITENOP //? polls 0x03 continously
402   AM_RANGE(0x30,0x30) AM_WRITENOP //? polls 0x03 continuously
403403   AM_RANGE(0x31,0x31) AM_WRITE(sound_latch_w)
404404ADDRESS_MAP_END
405405
r8581r8582
470470   AM_RANGE(0x11,0x11) AM_WRITE(mux_w)
471471   AM_RANGE(0x12,0x17) AM_WRITE(blitter_process_w)
472472   AM_RANGE(0x20,0x2f) AM_WRITE(blit_vregs_w )
473   AM_RANGE(0x30,0x30) AM_WRITENOP //? polls 0x03 continously
473   AM_RANGE(0x30,0x30) AM_WRITENOP //? polls 0x03 continuously
474474//  AM_RANGE(0x31,0x31) AM_WRITE(sound_latch_w)
475475ADDRESS_MAP_END
476476
r8581r8582
800800{
801801   jangou_state *state = (jangou_state *)machine->driver_data;
802802
803   state->cpu_0 = devtag_get_device(machine, "cpu0");
804   state->cpu_1 = devtag_get_device(machine, "cpu1");
805   state->cvsd = devtag_get_device(machine, "cvsd");
806   state->nsc = devtag_get_device(machine, "nsc");
803   state->cpu_0 = machine->device("cpu0");
804   state->cpu_1 = machine->device("cpu1");
805   state->cvsd = machine->device("cvsd");
806   state->nsc = machine->device("nsc");
807807
808808   state_save_register_global_array(machine, state->pen_data);
809809   state_save_register_global_array(machine, state->blit_data);
src/mame/drivers/namcos21.c
r8581r8582
99    DIP4 ON for Screen on the right
1010    should not toggle on both
1111
12    -The left, center and right screens have separate programs and boards, each would work independantly.
12    -The left, center and right screens have separate programs and boards, each would work independently.
1313    About projection angles of left and right screen, the angle is correct on "DRIVER'S EYES" title screen, however in the tracks of demo mode it doesn't seem correct.
1414
1515    -On demo screen, should fog effects be turned off?
r8581r8582
612612      }
613613      else if (namcos2_gametype == NAMCOS21_SOLVALOU &&
614614               offset == 0x103 &&
615               space->cpu == devtag_get_device(space->machine, "maincpu"))
615               space->cpu == space->machine->device("maincpu"))
616616      { /* hack; synchronization for solvalou */
617617         cpu_yield(space->cpu);
618618      }
src/mame/drivers/pgm.c
r8581r8582
13461346
13471347   state->soundcpu = machine->device<cpu_device>("soundcpu");
13481348   state->prot = machine->device<cpu_device>("prot");
1349   state->ics = devtag_get_device(machine, "ics");
1349   state->ics = machine->device("ics");
13501350
13511351   state_save_register_global(machine, state->cal_val);
13521352   state_save_register_global(machine, state->cal_mask);
src/mame/drivers/gameplan.c
r8581r8582
984984{
985985   gameplan_state *state = (gameplan_state *)machine->driver_data;
986986
987   state->maincpu = devtag_get_device(machine, "maincpu");
988   state->audiocpu = devtag_get_device(machine, "audiocpu");
989   state->riot = devtag_get_device(machine, "riot");
990   state->via_0 = devtag_get_device(machine, "via6522_0");
991   state->via_1 = devtag_get_device(machine, "via6522_1");
992   state->via_2 = devtag_get_device(machine, "via6522_2");
987   state->maincpu = machine->device("maincpu");
988   state->audiocpu = machine->device("audiocpu");
989   state->riot = machine->device("riot");
990   state->via_0 = machine->device("via6522_0");
991   state->via_1 = machine->device("via6522_1");
992   state->via_2 = machine->device("via6522_2");
993993
994994   /* register for save states */
995995   state_save_register_global(machine, state->current_port);
src/mame/drivers/capbowl.c
r8581r8582
349349{
350350   capbowl_state *state = (capbowl_state *)machine->driver_data;
351351
352   state->maincpu = devtag_get_device(machine, "maincpu");
353   state->audiocpu = devtag_get_device(machine, "audiocpu");
352   state->maincpu = machine->device("maincpu");
353   state->audiocpu = machine->device("audiocpu");
354354
355355   state_save_register_global(machine, state->blitter_addr);
356356   state_save_register_global(machine, state->last_trackball_val[0]);
src/mame/drivers/darius.c
r8581r8582
859859   memory_configure_bank(machine, "bank1", 4, 1, memory_region(machine, "audiocpu"), 0x8000);
860860   memory_set_bank(machine, "bank1", 4);
861861
862   state->maincpu = devtag_get_device(machine, "maincpu");
863   state->audiocpu = devtag_get_device(machine, "audiocpu");
864   state->cpub = devtag_get_device(machine, "cpub");
865   state->adpcm = devtag_get_device(machine, "adpcm");
866   state->pc080sn = devtag_get_device(machine, "pc080sn");
867   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
862   state->maincpu = machine->device("maincpu");
863   state->audiocpu = machine->device("audiocpu");
864   state->cpub = machine->device("cpub");
865   state->adpcm = machine->device("adpcm");
866   state->pc080sn = machine->device("pc080sn");
867   state->tc0140syt = machine->device("tc0140syt");
868868
869   state->lscreen = devtag_get_device(machine, "lscreen");
870   state->mscreen = devtag_get_device(machine, "mscreen");
871   state->rscreen = devtag_get_device(machine, "rscreen");
869   state->lscreen = machine->device("lscreen");
870   state->mscreen = machine->device("mscreen");
871   state->rscreen = machine->device("rscreen");
872872
873   state->filter0_0l = devtag_get_device(machine, "filter0.0l");
874   state->filter0_0r = devtag_get_device(machine, "filter0.0r");
875   state->filter0_1l = devtag_get_device(machine, "filter0.1l");
876   state->filter0_1r = devtag_get_device(machine, "filter0.1r");
877   state->filter0_2l = devtag_get_device(machine, "filter0.2l");
878   state->filter0_2r = devtag_get_device(machine, "filter0.2r");
879   state->filter0_3l = devtag_get_device(machine, "filter0.3l");
880   state->filter0_3r = devtag_get_device(machine, "filter0.3r");
873   state->filter0_0l = machine->device("filter0.0l");
874   state->filter0_0r = machine->device("filter0.0r");
875   state->filter0_1l = machine->device("filter0.1l");
876   state->filter0_1r = machine->device("filter0.1r");
877   state->filter0_2l = machine->device("filter0.2l");
878   state->filter0_2r = machine->device("filter0.2r");
879   state->filter0_3l = machine->device("filter0.3l");
880   state->filter0_3r = machine->device("filter0.3r");
881881
882   state->filter1_0l = devtag_get_device(machine, "filter1.0l");
883   state->filter1_0r = devtag_get_device(machine, "filter1.0r");
884   state->filter1_1l = devtag_get_device(machine, "filter1.1l");
885   state->filter1_1r = devtag_get_device(machine, "filter1.1r");
886   state->filter1_2l = devtag_get_device(machine, "filter1.2l");
887   state->filter1_2r = devtag_get_device(machine, "filter1.2r");
888   state->filter1_3l = devtag_get_device(machine, "filter1.3l");
889   state->filter1_3r = devtag_get_device(machine, "filter1.3r");
882   state->filter1_0l = machine->device("filter1.0l");
883   state->filter1_0r = machine->device("filter1.0r");
884   state->filter1_1l = machine->device("filter1.1l");
885   state->filter1_1r = machine->device("filter1.1r");
886   state->filter1_2l = machine->device("filter1.2l");
887   state->filter1_2r = machine->device("filter1.2r");
888   state->filter1_3l = machine->device("filter1.3l");
889   state->filter1_3r = machine->device("filter1.3r");
890890
891   state->msm5205_l = devtag_get_device(machine, "msm5205.l");
892   state->msm5205_r = devtag_get_device(machine, "msm5205.r");
891   state->msm5205_l = machine->device("msm5205.l");
892   state->msm5205_r = machine->device("msm5205.r");
893893
894894   state_save_register_global(machine, state->cpua_ctrl);
895895   state_save_register_global(machine, state->coin_word);
src/mame/drivers/ssingles.c
r8581r8582
257257
258258static VIDEO_UPDATE( ssingles )
259259{
260   running_device *mc6845 = devtag_get_device(screen->machine, "crtc");
260   running_device *mc6845 = screen->machine->device("crtc");
261261   mc6845_update(mc6845, bitmap, cliprect);
262262
263263   return 0;
src/mame/drivers/kinst.c
r8581r8582
157157
158158static MACHINE_START( kinst )
159159{
160   running_device *ide = devtag_get_device(machine, "ide");
160   running_device *ide = machine->device("ide");
161161   UINT8 *features = ide_get_features(ide);
162162
163163   if (strncmp(machine->gamedrv->name, "kinst2", 6) != 0)
r8581r8582
190190   }
191191
192192   /* set the fastest DRC options */
193   mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS);
193   mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS);
194194
195195   /* configure fast RAM regions for DRC */
196   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x08000000, 0x087fffff, FALSE, rambase2);
197   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x0007ffff, FALSE, rambase);
198   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  rombase);
196   mips3drc_add_fastram(machine->device("maincpu"), 0x08000000, 0x087fffff, FALSE, rambase2);
197   mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x0007ffff, FALSE, rambase);
198   mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  rombase);
199199}
200200
201201
src/mame/drivers/mpoker.c
r8581r8582
446446
447447//static WRITE8_HANDLER( sound_w )
448448//{
449//  dac_data_w(devtag_get_device(space->machine, "dac"), data);
449//  dac_data_w(space->machine->device("dac"), data);
450450//}
451451*/
452452
src/mame/drivers/sbasketb.c
r8581r8582
177177   trackfld_state *state = (trackfld_state *)machine->driver_data;
178178
179179   state->audiocpu = machine->device<cpu_device>("audiocpu");
180   state->vlm = devtag_get_device(machine, "vlm");
180   state->vlm = machine->device("vlm");
181181
182182   /* sound */
183183   state_save_register_global(machine, state->SN76496_latch);
src/mame/drivers/himesiki.c
r8581r8582
274274
275275   memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
276276
277   state->subcpu = devtag_get_device(machine, "sub");
277   state->subcpu = machine->device("sub");
278278
279279   state_save_register_global_array(machine, state->scrollx);
280280   state_save_register_global(machine, state->flipscreen);
src/mame/drivers/adp.c
r8581r8582
206206   adp_state *state = (adp_state *)machine->driver_data;
207207   microtouch_init(machine, microtouch_tx, 0);
208208
209   state->maincpu = devtag_get_device(machine, "maincpu");
210   state->duart = devtag_get_device(machine, "duart68681");
211   state->hd63484 = devtag_get_device(machine, "hd63484");
209   state->maincpu = machine->device("maincpu");
210   state->duart = machine->device("duart68681");
211   state->hd63484 = machine->device("hd63484");
212212
213213   state_save_register_global(machine, state->mux_data);
214214   state_save_register_global(machine, state->register_active);
r8581r8582
227227      UINT16 *rom = (UINT16*)memory_region(machine, "gfx1");
228228      int i;
229229
230      running_device *hd63484 = devtag_get_device(machine, "hd63484");
230      running_device *hd63484 = machine->device("hd63484");
231231
232232      for(i = 0; i < 0x40000/2; ++i)
233233      {
src/mame/drivers/konamigq.c
r8581r8582
199199   data = 0;
200200   if( ACCESSING_BITS_0_7 )
201201   {
202      data |= k054539_r( devtag_get_device(space->machine, "konami2"), offset );
202      data |= k054539_r( space->machine->device("konami2"), offset );
203203   }
204204   if( ACCESSING_BITS_8_15 )
205205   {
206      data |= k054539_r( devtag_get_device(space->machine, "konami1"), offset ) << 8;
206      data |= k054539_r( space->machine->device("konami1"), offset ) << 8;
207207   }
208208   return data;
209209}
r8581r8582
212212{
213213   if( ACCESSING_BITS_0_7 )
214214   {
215      k054539_w( devtag_get_device(space->machine, "konami2"), offset, data );
215      k054539_w( space->machine->device("konami2"), offset, data );
216216   }
217217   if( ACCESSING_BITS_8_15 )
218218   {
219      k054539_w( devtag_get_device(space->machine, "konami1"), offset, data >> 8 );
219      k054539_w( space->machine->device("konami1"), offset, data >> 8 );
220220   }
221221}
222222
src/mame/drivers/pcxt.c
r8581r8582
454454static WRITE8_DEVICE_HANDLER( port_b_w )
455455{
456456   port_b_data = data;
457// running_device *beep = devtag_get_device(device->machine, "beep");
458// running_device *cvsd = devtag_get_device(device->machine, "cvsd");
457// running_device *beep = device->machine->device("beep");
458// running_device *cvsd = device->machine->device("cvsd");
459459//  hc55516_digit_w(cvsd, data);
460460//  popmessage("%02x\n",data);
461461//  beep_set_state(beep, 0);
r8581r8582
909909   bank = -1;
910910   lastvalue = -1;
911911   hv_blank = 0;
912   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
913   filetto_devices.pit8253 = devtag_get_device( machine, "pit8253" );
914   filetto_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
915   filetto_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
916   filetto_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
917   filetto_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
912   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
913   filetto_devices.pit8253 = machine->device( "pit8253" );
914   filetto_devices.pic8259_1 = machine->device( "pic8259_1" );
915   filetto_devices.pic8259_2 = machine->device( "pic8259_2" );
916   filetto_devices.dma8237_1 = machine->device( "dma8237_1" );
917   filetto_devices.dma8237_2 = machine->device( "dma8237_2" );
918918}
919919
920920static MACHINE_DRIVER_START( filetto )
src/mame/drivers/mcatadv.c
r8581r8582
434434   memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
435435   memory_set_bank(machine, "bank1", 1);
436436
437   state->maincpu = devtag_get_device(machine, "maincpu");
438   state->soundcpu = devtag_get_device(machine, "soundcpu");
437   state->maincpu = machine->device("maincpu");
438   state->soundcpu = machine->device("soundcpu");
439439
440440   state_save_register_global(machine, state->palette_bank1);
441441   state_save_register_global(machine, state->palette_bank2);
src/mame/drivers/cinemat.c
r8581r8582
2323        * War of the Worlds
2424        * Boxing Bugs
2525        * QB-3
26        * Space Ship
2627
2728    To do:
2829        * look into bad sample latency
r8581r8582
280281
281282static WRITE8_HANDLER( qb3_ram_bank_w )
282283{
283   memory_set_bank(space->machine, "bank1", cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_P) & 3);
284   memory_set_bank(space->machine, "bank1", cpu_get_reg(space->machine->device("maincpu"), CCPU_P) & 3);
284285}
285286
286287
r8581r8582
376377INPUT_PORTS_END
377378
378379
380static INPUT_PORTS_START( spaceshp )
381   PORT_INCLUDE(spacewar )
382
383   PORT_MODIFY("SWITCHES")
384   PORT_DIPNAME( 0x03, 0x00, "Time" ) PORT_DIPLOCATION("SW1:!4,!3")
385   PORT_DIPSETTING(   0x00, "1:00/coin" )
386   PORT_DIPSETTING(   0x01, "1:30/coin" )
387   PORT_DIPSETTING(   0x02, "2:00/coin" )
388   PORT_DIPSETTING(   0x03, "2:30/coin" )
389   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
390   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:!1" )
391   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:!2" )
392INPUT_PORTS_END
393
394
379395static INPUT_PORTS_START( barrier )
380396   PORT_START("INPUTS")
381397   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Skill A") PORT_CODE(KEYCODE_A)
r8581r8582
11831199ROM_END
11841200
11851201
1202ROM_START( spaceshp )
1203   ROM_REGION( 0x1000, "maincpu", 0 )
1204   ROMX_LOAD( "pr08.61", 0x0000, 0x0400, CRC(556c4ff4) SHA1(c8c1f3e5fe7bf48ecaa92dabf376adfd6a0a9b72), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
1205   ROMX_LOAD( "pr07.63", 0x0000, 0x0400, CRC(ba7747d1) SHA1(e9eb9de07ad5a306f815ee0d8371c64f8f242de6), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
1206   ROMX_LOAD( "pr04.83", 0x0001, 0x0400, CRC(19966799) SHA1(ffadb6cbcf4e4c4a60a251eb239eddc7d1030e6e), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
1207   ROMX_LOAD( "pr03.85", 0x0001, 0x0400, CRC(d6557503) SHA1(c226fdf85236558208942e43bcc3ce5af7e3d588), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
1208   ROMX_LOAD( "pr10.62", 0x0800, 0x0400, CRC(3ee163f9) SHA1(30269158434fb66049620bbac5f1c9b878416468), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
1209   ROMX_LOAD( "pr09.64", 0x0800, 0x0400, CRC(7946086c) SHA1(09d5435bc602a10ddd4206fd546f5b758e746cb2), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
1210   ROMX_LOAD( "pr06.84", 0x0801, 0x0400, CRC(f19c8eb0) SHA1(80f66d00caaf258232ea5e6adf515899abf53896), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
1211   ROMX_LOAD( "pr05.86", 0x0801, 0x0400, CRC(3dbc6360) SHA1(8d59dfee6e02ec29f755cc1c85ae236621009715), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
1212
1213   ROM_REGION( 0x1a0, "proms", 0 )
1214   ROM_LOAD( "pr13.139", 0x0000, 0x0100, CRC(9edbf536) SHA1(036ad8a231284e05f44b1106d38fc0c7e041b6e8) )
1215   ROM_LOAD( "pr17.138", 0x0100, 0x0020, CRC(29dbfb87) SHA1(d8c40ab010b2ea30f29b2c443819e2b69f376c04) )
1216   ROM_LOAD( "pr18.137", 0x0120, 0x0020, CRC(98b7bd46) SHA1(fd7d0cac8783964bac36918e0ffcc07e2ea2081a) )
1217   ROM_LOAD( "pr19.136", 0x0140, 0x0020, CRC(07492cda) SHA1(32df9148797c23f70db47b840139c40e046dd710) )
1218   ROM_LOAD( "pr20.72" , 0x0160, 0x0020, CRC(791ec9e1) SHA1(6f7fcce4aa3be9020595235568381588adaab88e) )
1219   ROM_LOAD( "pr21.143", 0x0180, 0x0020, CRC(a481ca71) SHA1(ce145d61686f600cc16b77febfd5c783bf8c13b0) )
1220ROM_END
1221
1222
11861223ROM_START( barrier )
11871224   ROM_REGION( 0x1000, "maincpu", 0 )
11881225   ROM_LOAD16_BYTE( "barrier.t7", 0x0000, 0x0800, CRC(7c3d68c8) SHA1(1138029552b73e94522b3b48096befc057d603c7) )
r8581r8582
14851522 *************************************/
14861523
14871524GAME( 1977, spacewar, 0,       spacewar, spacewar, 0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Space Wars", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1525GAME( 1978, spaceshp, spacewar,spacewar, spaceshp, 0,        ORIENTATION_FLIP_Y,   "Cinematronics (Sega license)", "Space Ship", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
14881526GAME( 1979, barrier,  0,       barrier,  barrier,  0,        ORIENTATION_FLIP_X ^ ROT270, "Vectorbeam", "Barrier", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
14891527GAME( 1979, speedfrk, 0,       speedfrk, speedfrk, speedfrk, ORIENTATION_FLIP_Y,   "Vectorbeam", "Speed Freak", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
14901528GAME( 1979, starhawk, 0,       starhawk, starhawk, 0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Star Hawk", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/toaplan2.c
r8581r8582
319319      This is important for games with common RAM; the RAM test will fail
320320      when leaving service mode if the sound CPU is not reset.
321321    */
322   m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), toaplan2_reset);
322   m68k_set_reset_callback(machine->device("maincpu"), toaplan2_reset);
323323}
324324
325325static MACHINE_RESET( ghox )
r8581r8582
366366static DRIVER_INIT( T2_Z80 )      /* init_t2_Z80(); */
367367{
368368   toaplan2_sub_cpu = CPU_2_Z80;
369   sub_cpu = devtag_get_device(machine, "audiocpu");
369   sub_cpu = machine->device("audiocpu");
370370   register_state_save(machine);
371371}
372372
373373static DRIVER_INIT( T2_Z180 )
374374{
375375   toaplan2_sub_cpu = CPU_2_HD647180;
376   sub_cpu = devtag_get_device(machine, "mcu");
376   sub_cpu = machine->device("mcu");
377377   register_state_save(machine);
378378}
379379
380380static DRIVER_INIT( T2_V25 )
381381{
382382   toaplan2_sub_cpu = CPU_2_V25;
383   if (devtag_get_device(machine, "mcu") != NULL)
384      sub_cpu = devtag_get_device(machine, "mcu");
385   else if (devtag_get_device(machine, "audiocpu") != NULL)
386      sub_cpu = devtag_get_device(machine, "audiocpu");
383   if (machine->device("mcu") != NULL)
384      sub_cpu = machine->device("mcu");
385   else if (machine->device("audiocpu") != NULL)
386      sub_cpu = machine->device("audiocpu");
387387   register_state_save(machine);
388388}
389389
r8581r8582
395395
396396static DRIVER_INIT( fixeight )
397397{
398   sub_cpu = devtag_get_device(machine, "audiocpu");
398   sub_cpu = machine->device("audiocpu");
399399
400400   if (fixeight_sec_cpu_mem)
401401   {
r8581r8582
494494   }
495495
496496   toaplan2_sub_cpu = CPU_2_Z80;
497   sub_cpu = devtag_get_device(machine, "audiocpu");
497   sub_cpu = machine->device("audiocpu");
498498   register_state_save(machine);
499499}
500500
r8581r8582
502502{
503503   raizing_sndirq_line = 4;
504504   toaplan2_sub_cpu = CPU_2_Z80;
505   sub_cpu = devtag_get_device(machine, "audiocpu");
505   sub_cpu = machine->device("audiocpu");
506506   register_state_save(machine);
507507}
508508
r8581r8582
511511   bbakraid_unlimited_ver = 0;
512512   raizing_sndirq_line = 2;
513513   toaplan2_sub_cpu = CPU_2_Z80;
514   sub_cpu = devtag_get_device(machine, "audiocpu");
514   sub_cpu = machine->device("audiocpu");
515515   register_state_save(machine);
516516}
517517
r8581r8582
520520   bbakraid_unlimited_ver = 1;
521521   raizing_sndirq_line = 2;
522522   toaplan2_sub_cpu = CPU_2_Z80;
523   sub_cpu = devtag_get_device(machine, "audiocpu");
523   sub_cpu = machine->device("audiocpu");
524524   register_state_save(machine);
525525}
526526
r8581r8582
876876   if (ACCESSING_BITS_0_7)
877877   {
878878      mcu_data = data;
879      dogyuun_okisnd_w(devtag_get_device(space->machine, "oki"), data);
879      dogyuun_okisnd_w(space->machine->device("oki"), data);
880880   }
881881   logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",cpu_get_previouspc(space->cpu),mcu_data);
882882}
r8581r8582
914914      if (mcu_data & 0xff00)
915915      {
916916         mcu_data = (mcu_data & 0xff00) | (data & 0xff);
917         fixeight_okisnd_w(devtag_get_device(space->machine, "oki"), data);
917         fixeight_okisnd_w(space->machine->device("oki"), data);
918918      }
919919      else if (mcu_data == 0xff00)
920920      {
r8581r8582
957957   if (ACCESSING_BITS_0_7)
958958   {
959959      mcu_data = data;
960      batsugun_okisnd_w(devtag_get_device(space->machine, "oki"), data);
960      batsugun_okisnd_w(space->machine->device("oki"), data);
961961   }
962962   logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port %02x\n",cpu_get_previouspc(space->cpu),mcu_data,(offset*2));
963963}
r8581r8582
990990{
991991   if (ACCESSING_BITS_0_7)
992992   {
993      kbash_okisnd_w(devtag_get_device(space->machine, "oki"), data);
993      kbash_okisnd_w(space->machine->device("oki"), data);
994994   }
995995   logerror("PC:%06x Writing Sound command (%04x) to the NEC V25+ secondary CPU\n",cpu_get_previouspc(space->cpu),data);
996996}
src/mame/drivers/gaelco.c
r8581r8582
494494{
495495   gaelco_state *state = (gaelco_state *)machine->driver_data;
496496
497   state->audiocpu = devtag_get_device(machine, "audiocpu");
497   state->audiocpu = machine->device("audiocpu");
498498}
499499
500500static MACHINE_DRIVER_START( bigkarnk )
src/mame/drivers/wecleman.c
r8581r8582
697697
698698   int reg[8];
699699
700   sound[0] = devtag_get_device(space->machine, "konami1");
701   sound[1] = devtag_get_device(space->machine, "konami2");
702   sound[2] = devtag_get_device(space->machine, "konami3");
700   sound[0] = space->machine->device("konami1");
701   sound[1] = space->machine->device("konami2");
702   sound[2] = space->machine->device("konami3");
703703
704704   reg[offset] = data;
705705
r8581r8582
10491049
10501050static MACHINE_RESET( wecleman )
10511051{
1052   k007232_set_bank( devtag_get_device(machine, "konami"), 0, 1 );
1052   k007232_set_bank( machine->device("konami"), 0, 1 );
10531053}
10541054
10551055static MACHINE_DRIVER_START( wecleman )
src/mame/drivers/crbaloon.c
r8581r8582
159159
160160static WRITE8_HANDLER( port_sound_w )
161161{
162   running_device *discrete = devtag_get_device(space->machine, "discrete");
163   running_device *sn = devtag_get_device(space->machine, "snsnd");
162   running_device *discrete = space->machine->device("discrete");
163   running_device *sn = space->machine->device("snsnd");
164164
165165   /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
166   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), (data & 0x01) ? TRUE : FALSE);
166   cpu_interrupt_enable(space->machine->device("maincpu"), (data & 0x01) ? TRUE : FALSE);
167167   crbaloon_set_clear_collision_address((data & 0x01) ? TRUE : FALSE);
168168
169169   /* D1 - SOUND STOP */
r8581r8582
343343static MACHINE_RESET( crballoon )
344344{
345345   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
346   running_device *discrete = devtag_get_device(machine, "discrete");
346   running_device *discrete = machine->device("discrete");
347347
348348   pc3092_reset();
349349   port_sound_w(space, 0, 0);
src/mame/drivers/munchmo.c
r8581r8582
309309{
310310   munchmo_state *state = (munchmo_state *)machine->driver_data;
311311
312   state->maincpu = devtag_get_device(machine, "maincpu");
313   state->audiocpu = devtag_get_device(machine, "audiocpu");
312   state->maincpu = machine->device("maincpu");
313   state->audiocpu = machine->device("audiocpu");
314314
315315   state_save_register_global(machine, state->palette_bank);
316316   state_save_register_global(machine, state->flipscreen);
src/mame/drivers/btoads.c
r8581r8582
6868{
6969   main_to_sound_data = param;
7070   main_to_sound_ready = 1;
71   cpu_triggerint(devtag_get_device(machine, "audiocpu"));
71   cpu_triggerint(machine->device("audiocpu"));
7272
7373   /* use a timer to make long transfers faster */
7474   timer_set(machine, ATTOTIME_IN_USEC(50), NULL, 0, 0);
src/mame/drivers/lastduel.c
r8581r8582
476476{
477477   lastduel_state *state = (lastduel_state *)machine->driver_data;
478478
479   state->audiocpu = devtag_get_device(machine, "audiocpu");
479   state->audiocpu = machine->device("audiocpu");
480480
481481   state_save_register_global(machine, state->tilemap_priority);
482482   state_save_register_global_array(machine, state->scroll);
src/mame/drivers/drgnmst.c
r8581r8582
564564         data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3]));
565565         data |= (data_hi << 12) | (data_lo << 8);
566566
567         pic16c5x_set_config(devtag_get_device(machine, "audiocpu"), data);
567         pic16c5x_set_config(machine->device("audiocpu"), data);
568568
569569         src_pos = 0x7fff;      /* Force Exit */
570570      }
src/mame/drivers/boxer.c
r8581r8582
420420{
421421   boxer_state *state = (boxer_state *)machine->driver_data;
422422
423   state->maincpu = devtag_get_device(machine, "maincpu");
423   state->maincpu = machine->device("maincpu");
424424
425425   state_save_register_global(machine, state->pot_state);
426426   state_save_register_global(machine, state->pot_latch);
src/mame/drivers/redclash.c
r8581r8582
330330{
331331   ladybug_state *state = (ladybug_state *)machine->driver_data;
332332
333   state->maincpu = devtag_get_device(machine, "maincpu");
333   state->maincpu = machine->device("maincpu");
334334
335335   state_save_register_global(machine, state->star_speed);
336336   state_save_register_global(machine, state->gfxbank);
src/mame/drivers/xybots.c
r8581r8582
395395{
396396   xybots_state *state = (xybots_state *)machine->driver_data;
397397   state->h256 = 0x0400;
398   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x008000, 0, 107);
398   atarigen_slapstic_init(machine->device("maincpu"), 0x008000, 0, 107);
399399   atarijsa_init(machine, "FFE200", 0x0100);
400400}
401401
src/mame/drivers/speglsht.c
r8581r8582
257257   PORT_DIPSETTING(          0x00000030, DEF_STR( 1C_2C ) )
258258   PORT_DIPSETTING(          0x00000028, DEF_STR( 1C_3C ) )
259259   PORT_DIPSETTING(          0x00000000, "2C Start/1C Continue" )
260   PORT_DIPNAME( 0x00000040, 0x00000040, "Unkown / Unused" )
260   PORT_DIPNAME( 0x00000040, 0x00000040, "Unknown / Unused" )
261261   PORT_DIPSETTING(          0x00000040, DEF_STR( Off ) )
262262   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
263263   PORT_DIPNAME( 0x00000080, 0x00000080, "Bonus for PAR Play" )
src/mame/drivers/magicfly.c
r8581r8582
1616    **** NOTE ****
1717    This hardware was clearly designed for poker games.
1818    You can find a complete hardware & software analysis here:
19    http://www.mameworld.net/robbie
19    http://mamedev.emulab.it/robbie
2020
2121
2222*******************************************************************************
r8581r8582
542542*/
543543   input_selector = data & 0x0f;   /* Input Selector */
544544
545   dac_data_w(devtag_get_device(space->machine, "dac"), data & 0x80);      /* Sound DAC */
545   dac_data_w(space->machine->device("dac"), data & 0x80);      /* Sound DAC */
546546
547547   coin_counter_w(space->machine, 0, data & 0x40);   /* Coin1 */
548548   coin_counter_w(space->machine, 1, data & 0x10);   /* Coin2 */
src/mame/drivers/centiped.c
r8581r8582
19771977static DRIVER_INIT( caterplr )
19781978{
19791979   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1980   running_device *device = devtag_get_device(machine, "pokey");
1980   running_device *device = machine->device("pokey");
19811981   memory_install_readwrite8_device_handler(space, device, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w);
19821982   memory_install_read8_device_handler(space, device, 0x1780, 0x1780, 0, 0, caterplr_rand_r);
19831983}
r8581r8582
19861986static DRIVER_INIT( magworm )
19871987{
19881988   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1989   running_device *device = devtag_get_device(machine, "pokey");
1989   running_device *device = machine->device("pokey");
19901990   memory_install_write8_device_handler(space, device, 0x1001, 0x1001, 0, 0, ay8910_address_w);
19911991   memory_install_readwrite8_device_handler(space, device, 0x1003, 0x1003, 0, 0, ay8910_r, ay8910_data_w);
19921992}
src/mame/drivers/wgp.c
r8581r8582
955955
956956   memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000);
957957
958   state->maincpu = devtag_get_device(machine, "maincpu");
959   state->audiocpu = devtag_get_device(machine, "audiocpu");
960   state->subcpu = devtag_get_device(machine, "sub");
961   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
962   state->tc0100scn = devtag_get_device(machine, "tc0100scn");
958   state->maincpu = machine->device("maincpu");
959   state->audiocpu = machine->device("audiocpu");
960   state->subcpu = machine->device("sub");
961   state->tc0140syt = machine->device("tc0140syt");
962   state->tc0100scn = machine->device("tc0100scn");
963963
964964   state_save_register_global(machine, state->cpua_ctrl);
965965   state_save_register_global(machine, state->banknum);
src/mame/drivers/scregg.c
r8581r8582
204204{
205205   btime_state *state = (btime_state *)machine->driver_data;
206206
207   state->maincpu = devtag_get_device(machine, "maincpu");
207   state->maincpu = machine->device("maincpu");
208208   state->audiocpu = NULL;
209209
210210   state_save_register_global(machine, state->btime_palette);
src/mame/drivers/taitoair.c
r8581r8582
616616
617617   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
618618
619   state->audiocpu = devtag_get_device(machine, "audiocpu");
620   state->dsp = devtag_get_device(machine, "dsp");
621   state->tc0080vco = devtag_get_device(machine, "tc0080vco");
619   state->audiocpu = machine->device("audiocpu");
620   state->dsp = machine->device("dsp");
621   state->tc0080vco = machine->device("tc0080vco");
622622
623623   state_save_register_global(machine, state->banknum);
624624   state_save_register_global(machine, state->q.col);
src/mame/drivers/aquarium.c
r8581r8582
342342{
343343   aquarium_state *state = (aquarium_state *)machine->driver_data;
344344
345   state->audiocpu = devtag_get_device(machine, "audiocpu");
345   state->audiocpu = machine->device("audiocpu");
346346
347347   state_save_register_global(machine, state->aquarium_snd_ack);
348348}
src/mame/drivers/metro.c
r8581r8582
35993599   metro_state *state = (metro_state *)machine->driver_data;
36003600
36013601   if (state->irq_line == -1)
3602      cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), metro_irq_callback);
3602      cpu_set_irq_callback(machine->device("maincpu"), metro_irq_callback);
36033603}
36043604
36053605
src/mame/drivers/angelkds.c
r8581r8582
116116
117117
118118--- Team Japump!!! ---
119http://www.rainemu.com/japump/
120http://japump.i.am/
121119Dumped by Chackn
12212002/25/2000
123121
r8581r8582
579577{
580578   angelkds_state *state = (angelkds_state *)machine->driver_data;
581579
582   state->subcpu = devtag_get_device(machine, "sub");
580   state->subcpu = machine->device("sub");
583581
584582   state_save_register_global(machine, state->layer_ctrl);
585583   state_save_register_global(machine, state->txbank);
src/mame/drivers/jrpacman.c
r8581r8582
106106
107107static WRITE8_HANDLER( jrpacman_interrupt_vector_w )
108108{
109   cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data);
109   cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data);
110110   cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
111111}
112112
src/mame/drivers/nightgal.c
r8581r8582
829829{
830830   nightgal_state *state = (nightgal_state *)machine->driver_data;
831831
832   state->maincpu = devtag_get_device(machine, "maincpu");
833   state->subcpu = devtag_get_device(machine, "sub");
832   state->maincpu = machine->device("maincpu");
833   state->subcpu = machine->device("sub");
834834
835835   state_save_register_global(machine, state->nsc_latch);
836836   state_save_register_global(machine, state->z80_latch);
r8581r8582
10001000
10011001dumped by sayu
10021002--- Team Japump!!! ---
1003http://japump.i.am/
10041003
10051004
10061005*/
src/mame/drivers/maygayv1.c
r8581r8582
969969
970970//  duart_68681_init(DUART_CLOCK, duart_irq_handler, duart_tx);
971971
972   i8051_set_serial_tx_callback(devtag_get_device(machine, "soundcpu"), data_from_i8031);
973   i8051_set_serial_rx_callback(devtag_get_device(machine, "soundcpu"), data_to_i8031);
972   i8051_set_serial_tx_callback(machine->device("soundcpu"), data_from_i8031);
973   i8051_set_serial_rx_callback(machine->device("soundcpu"), data_to_i8031);
974974}
975975
976976static MACHINE_RESET( maygayv1 )
977977{
978978   // ?
979   maygayv1_devices.duart68681 = devtag_get_device( machine, "duart68681" );
979   maygayv1_devices.duart68681 = machine->device( "duart68681" );
980980   memset(i82716.dram, 0, 0x40000);
981981   i82716.r[RWBA] = 0x0200;
982982}
src/mame/drivers/surpratk.c
r8581r8582
209209
210210   machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
211211
212   state->maincpu = devtag_get_device(machine, "maincpu");
213   state->k053244 = devtag_get_device(machine, "k053244");
214   state->k053251 = devtag_get_device(machine, "k053251");
215   state->k052109 = devtag_get_device(machine, "k052109");
212   state->maincpu = machine->device("maincpu");
213   state->k053244 = machine->device("k053244");
214   state->k053251 = machine->device("k053251");
215   state->k052109 = machine->device("k052109");
216216
217217   state_save_register_global(machine, state->videobank);
218218   state_save_register_global(machine, state->sprite_colorbase);
r8581r8582
226226   surpratk_state *state = (surpratk_state *)machine->driver_data;
227227   int i;
228228
229   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), surpratk_banking);
229   konami_configure_set_lines(machine->device("maincpu"), surpratk_banking);
230230
231231   for (i = 0; i < 3; i++)
232232   {
src/mame/drivers/zaccaria.c
r8581r8582
2828  0-3 are connected to regular devices (6400-6407 has 4-bit RAM, while 6c00-6c07
2929  has a 4-bit input port).
3030
31- The 6802 driving the TMS5220 has a push button connected to the NMI line. Test?
31- The 6802 driving the TMS5220 has a push button connected to the NMI line. On
32  Zaccaria pinballs, when pressed, this causes the speech 6802 and the slave
33  sound 6802 to play a few speech effects and sound effects;
34  This currently doesn't work in MAME, and tracing the code it seems the code is
35  possibly broken, made up of nonfunctional leftovers of some of the pinball test
36  mode code.
3237
3338***************************************************************************/
3439
r8581r8582
105110   /* 150 below to scale to volume 100 */
106111   v = (150 * table[ba]) / (4700 + table[ba]);
107112   //printf("dac1w %02d %04d\n", ba, v);
108   ay8910_set_volume(devtag_get_device(device->machine, "ay2"), 1, v);
113   ay8910_set_volume(device->machine->device("ay2"), 1, v);
109114}
110115
111116
r8581r8582
121126
122127static READ8_DEVICE_HANDLER( zaccaria_port0a_r )
123128{
124   return ay8910_r(devtag_get_device(device->machine, (active_8910 == 0) ? "ay1" : "ay2"), 0);
129   return ay8910_r(device->machine->device((active_8910 == 0) ? "ay1" : "ay2"), 0);
125130}
126131
127132static WRITE8_DEVICE_HANDLER( zaccaria_port0a_w )
r8581r8582
136141   if ((last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
137142   {
138143      /* bit 0 goes to the 8910 #0 BC1 pin */
139      ay8910_data_address_w(devtag_get_device(device->machine, "ay1"), last_port0b, port0a);
144      ay8910_data_address_w(device->machine->device("ay1"), last_port0b, port0a);
140145   }
141146   else if ((last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
142147   {
r8581r8582
148153   if ((last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
149154   {
150155      /* bit 2 goes to the 8910 #1 BC1 pin */
151      ay8910_data_address_w(devtag_get_device(device->machine, "ay2"), last_port0b >> 2, port0a);
156      ay8910_data_address_w(device->machine->device("ay2"), last_port0b >> 2, port0a);
152157   }
153158   else if ((last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
154159   {
r8581r8582
162167
163168static INTERRUPT_GEN( zaccaria_cb1_toggle )
164169{
165   running_device *pia0 = devtag_get_device(device->machine, "pia0");
170   running_device *pia0 = device->machine->device("pia0");
166171   static int toggle = 0;
167172
168   pia6821_cb1_w(pia0,0, toggle & 1);
173   pia6821_cb1_w(pia0, toggle & 1);
169174   toggle ^= 1;
170175}
171176
172177static WRITE8_DEVICE_HANDLER( zaccaria_port1b_w )
173178{
174   running_device *tms = devtag_get_device(device->machine, "tms");
179   running_device *tms = device->machine->device("tms");
175180
176181   // bit 0 = /RS
177182   tms5220_rsq_w(tms, (data >> 0) & 0x01);
r8581r8582
194199
195200static WRITE8_HANDLER( sound1_command_w )
196201{
197   running_device *pia0 = devtag_get_device(space->machine, "pia0");
198   pia6821_ca1_w(pia0, 0, data & 0x80);
202   running_device *pia0 = space->machine->device("pia0");
203   pia6821_ca1_w(pia0, data & 0x80);
199204   soundlatch2_w(space, 0, data);
200205}
201206
r8581r8582
282287   AM_RANGE(0x8000, 0xdfff) AM_ROM
283288ADDRESS_MAP_END
284289
290/* slave sound cpu, produces music and sound effects */
291/* mapping:
292   A15 A14 A13 A12 A11 A10 A09 A08 A07 A06 A05 A04 A03 A02 A01 A00
293     0   0   0   0   0   0   0   0   0   *   *   *   *   *   *   *  RW 6802 internal ram
294     0   0   0   x   x   x   x   x   x   x   x   x   x   x   x   x  Open bus (for area that doesn't overlap ram)
295     0   0   1   x   x   x   x   x   x   x   x   x   x   x   x   x  Open bus
296     0   1   0   x   x   x   x   x   x   x   x   x   0   0   x   x  Open bus
297     0   1   0   x   x   x   x   x   x   x   x   x   0   1   x   x  Open bus
298     0   1   0   x   x   x   x   x   x   x   x   x   1   0   x   x  Open bus
299     0   1   0   x   x   x   x   x   x   x   x   x   1   1   *   *  RW 6821 PIA @ 4I
300     0   1   1   x   x   x   x   x   x   x   x   x   x   x   x   x  Open bus
301     1   0   %   %   *   *   *   *   *   *   *   *   *   *   *   *  R /CS4A: Enable Rom 13
302     1   1   %   %   *   *   *   *   *   *   *   *   *   *   *   *  R /CS5A: Enable Rom 9
303     note that the % bits go to pins 2 (6802 A12) and 26 (6802 A13) of the roms
304     monymony and jackrabt both use 2764 roms, which use pin 2 as A12 and pin 26 as N/C don't care
305     hence for actual chips used, the mem map is:
306     1   0   x   *   *   *   *   *   *   *   *   *   *   *   *   *  R /CS4A: Enable Rom 13
307     1   1   x   *   *   *   *   *   *   *   *   *   *   *   *   *  R /CS5A: Enable Rom 9
308
309     6821 PIA: CA1 comes from the master sound cpu's latch bit 7 (which is also connected to the AY chip at 4G's IOB1); CB1 comes from a periodic counter clocked by the 6802's clock, divided by 4096. CA2 and CB2 are disconnected. PA0-7 connect to the data busses of the AY-3-8910 chips; PB0 and PB1 connect to the BC1 and BDIR pins of the AY chip at 4G; PB2 and PB3 connect to the BC1 and BDIR pins of the AY chip at 4H.
310*/
285311static ADDRESS_MAP_START( sound_map_1, ADDRESS_SPACE_PROGRAM, 8 )
286312   AM_RANGE(0x0000, 0x007f) AM_RAM
287   AM_RANGE(0x500c, 0x500f) AM_DEVREADWRITE("pia0", pia6821_r, pia6821_w)
288   AM_RANGE(0xa000, 0xbfff) AM_ROM
289   AM_RANGE(0xe000, 0xffff) AM_ROM
313   AM_RANGE(0x500c, 0x500f) AM_DEVREADWRITE("pia0", pia6821_r, pia6821_w) AM_MIRROR(0x1ff0)
314   AM_RANGE(0x8000, 0x9fff) AM_ROM AM_MIRROR(0x2000) // rom 13
315   AM_RANGE(0xc000, 0xdfff) AM_ROM AM_MIRROR(0x2000) // rom 9
290316ADDRESS_MAP_END
291317
318/* master sound cpu, controls speech directly */
319/* mapping:
320   A15 A14 A13 A12 A11 A10 A09 A08 A07 A06 A05 A04 A03 A02 A01 A00
321     0   0   0   0   0   0   0   0   0   *   *   *   *   *   *   *  RW 6802 internal ram
322**** x   0   0   0   x   x   x   x   1   x   x   0   x   x   *   *  Open bus (test mode writes as if there was another PIA here)
323     x   0   0   0   x   x   x   x   1   x   x   1   x   x   *   *  RW 6821 PIA @ 1I
324     x   0   0   1   0   0   x   x   x   x   x   x   x   x   x   x  W  MC1408 DAC
325     x   x   0   1   0   1   x   x   x   x   x   x   x   x   x   x  W  Command to slave sound1 cpu
326     x   x   0   1   1   0   x   x   x   x   x   x   x   x   x   x  R  Command read latch from z80
327     x   x   0   1   1   1   x   x   x   x   x   x   x   x   x   x  Open bus
328     %   %   1   0   *   *   *   *   *   *   *   *   *   *   *   *  R /CS1A: Enable Rom 8
329     %   %   1   1   *   *   *   *   *   *   *   *   *   *   *   *  R /CS0A: Enable Rom 7
330     note that the % bits go to pins 2 (6802 A14) and 26 (6802 A15) of the roms
331     monymony and jackrabt both use 2764 roms, which use pin 2 as A12 and pin 26 as N/C don't care
332     hence for actual chips used, the mem map is:
333     x   *   1   0   *   *   *   *   *   *   *   *   *   *   *   *  R /CS1A: Enable Rom 8
334     x   *   1   1   *   *   *   *   *   *   *   *   *   *   *   *  R /CS0A: Enable Rom 7
335
336     6821 PIA: PA0-7, CA2 and CB1 connect to the TMS5200; CA1 and CB2 are disconnected, though the test mode assumes there's something connected to CB2 (possibly another LED like the one connected to PB4); PB3 connects to 'ACS' which goes to the z80.
337*/
292338static ADDRESS_MAP_START( sound_map_2, ADDRESS_SPACE_PROGRAM, 8 )
293   AM_RANGE(0x0000, 0x007f) AM_RAM
294   AM_RANGE(0x0090, 0x0093) AM_DEVREADWRITE("pia1", pia6821_r, pia6821_w)
295   AM_RANGE(0x1000, 0x1000) AM_DEVWRITE("dac2", mc1408_data_w)   /* MC1408 */
296   AM_RANGE(0x1400, 0x1400) AM_WRITE(sound1_command_w)
297   AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r)
298   AM_RANGE(0xa000, 0xbfff) AM_ROM
299   AM_RANGE(0xe000, 0xffff) AM_ROM
339   AM_RANGE(0x0000, 0x007f) AM_RAM /* 6802 internal ram */
340   AM_RANGE(0x0090, 0x0093) AM_DEVREADWRITE("pia1", pia6821_r, pia6821_w) AM_MIRROR(0x8F6C)
341   AM_RANGE(0x1000, 0x1000) AM_DEVWRITE("dac2", mc1408_data_w) AM_MIRROR(0x83FF) /* MC1408 */
342   AM_RANGE(0x1400, 0x1400) AM_WRITE(sound1_command_w) AM_MIRROR(0xC3FF)
343   AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r) AM_MIRROR(0xC3FF)
344   AM_RANGE(0x2000, 0x2fff) AM_ROM AM_MIRROR(0x8000) // rom 8 with A12 low
345   AM_RANGE(0x3000, 0x3fff) AM_ROM AM_MIRROR(0x8000) // rom 7 with A12 low
346   AM_RANGE(0x6000, 0x6fff) AM_ROM AM_MIRROR(0x8000) // rom 8 with A12 high
347   AM_RANGE(0x7000, 0x7fff) AM_ROM AM_MIRROR(0x8000) // rom 7 with A12 high
300348ADDRESS_MAP_END
301349
302350
r8581r8582
532580
533581static const tms5220_interface tms5220_config =
534582{
535   DEVCB_DEVICE_HANDLER("pia1", pia6821_cb1_w),   /* IRQ handler */
536   DEVCB_DEVICE_HANDLER("pia1", pia6821_ca2_w)      /* READYQ handler */
583   DEVCB_DEVICE_LINE("pia1", pia6821_cb1_w),   /* IRQ handler */
584   DEVCB_DEVICE_LINE("pia1", pia6821_ca2_w)      /* READYQ handler */
537585};
538586
539587
r8581r8582
618666   ROM_CONTINUE(             0xd000, 0x1000 )
619667
620668   ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for first 6802 */
621   ROM_LOAD( "snd13.2g",           0xa000, 0x2000, CRC(78b01b98) SHA1(2aabed56cdae9463deb513c0c5021f6c8dfd271e) )
622   ROM_LOAD( "snd9.1i",           0xe000, 0x2000, CRC(94e3858b) SHA1(04961f67b95798b530bd83355dec612389f22255) )
669   ROM_LOAD( "snd13.2g",           0x8000, 0x2000, CRC(78b01b98) SHA1(2aabed56cdae9463deb513c0c5021f6c8dfd271e) )
670   ROM_LOAD( "snd9.1i",           0xc000, 0x2000, CRC(94e3858b) SHA1(04961f67b95798b530bd83355dec612389f22255) )
623671
624672   ROM_REGION( 0x10000, "audio2", 0 ) /* 64k for second 6802 */
625   ROM_LOAD( "snd8.1h",           0xa000, 0x1000, CRC(aad76193) SHA1(e08fc184efced392ee902c4cc9daaaf3310cdfe2) )
626   ROM_CONTINUE(             0xe000, 0x1000 )
627   ROM_LOAD( "snd7.1g",           0xb000, 0x1000, CRC(1e8ffe3e) SHA1(858ee7abe88d5801237e519cae2b50ae4bf33a58) )
628   ROM_CONTINUE(             0xf000, 0x1000 )
673   ROM_LOAD( "snd8.1h",           0x2000, 0x1000, CRC(aad76193) SHA1(e08fc184efced392ee902c4cc9daaaf3310cdfe2) )
674   ROM_CONTINUE(             0x6000, 0x1000 )
675   ROM_LOAD( "snd7.1g",           0x3000, 0x1000, CRC(1e8ffe3e) SHA1(858ee7abe88d5801237e519cae2b50ae4bf33a58) )
676   ROM_CONTINUE(             0x7000, 0x1000 )
629677
630678   ROM_REGION( 0x6000, "gfx1", 0 )
631679   ROM_LOAD( "bg1.2d",           0x0000, 0x2000, CRC(82ab4d1a) SHA1(5aaf42a508df236f2e7c844d377132d73053907b) )
r8581r8582
653701   ROM_LOAD( "cpu-01.6h",    0xd000, 0x1000, CRC(dd5979cf) SHA1(e9afe7002b2258a1c3132bdd951c6e20d473fb6a) )
654702
655703   ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for first 6802 */
656   ROM_LOAD( "13snd.2g",     0xa000, 0x2000, CRC(fc05654e) SHA1(ed9c66672fe89c41e320e1d27b53f5efa92dce9c) )
657   ROM_LOAD( "9snd.1i",      0xe000, 0x2000, CRC(3dab977f) SHA1(3e79c06d2e70b050f01b7ac58be5127ba87904b0) )
704   ROM_LOAD( "13snd.2g",     0x8000, 0x2000, CRC(fc05654e) SHA1(ed9c66672fe89c41e320e1d27b53f5efa92dce9c) )
705   ROM_LOAD( "9snd.1i",      0xc000, 0x2000, CRC(3dab977f) SHA1(3e79c06d2e70b050f01b7ac58be5127ba87904b0) )
658706
659707   ROM_REGION( 0x10000, "audio2", 0 ) /* 64k for second 6802 */
660   ROM_LOAD( "8snd.1h",      0xa000, 0x1000, CRC(f4507111) SHA1(0513f0831b94aeda84aa4f3b4a7c60dfc5113b2d) )
661   ROM_CONTINUE(             0xe000, 0x1000 )
662   ROM_LOAD( "7snd.1g",      0xb000, 0x1000, CRC(c722eff8) SHA1(d8d1c091ab80ea2d6616e4dc030adc9905c0a496) )
663   ROM_CONTINUE(             0xf000, 0x1000 )
708   ROM_LOAD( "8snd.1h",      0x2000, 0x1000, CRC(f4507111) SHA1(0513f0831b94aeda84aa4f3b4a7c60dfc5113b2d) )
709   ROM_CONTINUE(             0x6000, 0x1000 )
710   ROM_LOAD( "7snd.1g",      0x3000, 0x1000, CRC(c722eff8) SHA1(d8d1c091ab80ea2d6616e4dc030adc9905c0a496) )
711   ROM_CONTINUE(             0x7000, 0x1000 )
664712
665713   ROM_REGION( 0x6000, "gfx1", 0 )
666714   ROM_LOAD( "1bg.2d",       0x0000, 0x2000, CRC(9f880ef5) SHA1(0ee20fb7c794f6dafdaf2c9ee8456221c9d668c5) )
r8581r8582
692740   ROM_CONTINUE(             0xd000, 0x1000 )
693741
694742   ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for first 6802 */
695   ROM_LOAD( "13snd.2g",     0xa000, 0x2000, CRC(fc05654e) SHA1(ed9c66672fe89c41e320e1d27b53f5efa92dce9c) )
696   ROM_LOAD( "9snd.1i",      0xe000, 0x2000, CRC(3dab977f) SHA1(3e79c06d2e70b050f01b7ac58be5127ba87904b0) )
743   ROM_LOAD( "13snd.2g",     0x8000, 0x2000, CRC(fc05654e) SHA1(ed9c66672fe89c41e320e1d27b53f5efa92dce9c) )
744   ROM_LOAD( "9snd.1i",      0xc000, 0x2000, CRC(3dab977f) SHA1(3e79c06d2e70b050f01b7ac58be5127ba87904b0) )
697745
698746   ROM_REGION( 0x10000, "audio2", 0 ) /* 64k for second 6802 */
699   ROM_LOAD( "8snd.1h",      0xa000, 0x1000, CRC(f4507111) SHA1(0513f0831b94aeda84aa4f3b4a7c60dfc5113b2d) )
700   ROM_CONTINUE(             0xe000, 0x1000 )
701   ROM_LOAD( "7snd.1g",      0xb000, 0x1000, CRC(c722eff8) SHA1(d8d1c091ab80ea2d6616e4dc030adc9905c0a496) )
702   ROM_CONTINUE(             0xf000, 0x1000 )
747   ROM_LOAD( "8snd.1h",      0x2000, 0x1000, CRC(f4507111) SHA1(0513f0831b94aeda84aa4f3b4a7c60dfc5113b2d) )
748   ROM_CONTINUE(             0x6000, 0x1000 )
749   ROM_LOAD( "7snd.1g",      0x3000, 0x1000, CRC(c722eff8) SHA1(d8d1c091ab80ea2d6616e4dc030adc9905c0a496) )
750   ROM_CONTINUE(             0x7000, 0x1000 )
703751
704752   ROM_REGION( 0x6000, "gfx1", 0 )
705753   ROM_LOAD( "1bg.2d",       0x0000, 0x2000, CRC(9f880ef5) SHA1(0ee20fb7c794f6dafdaf2c9ee8456221c9d668c5) )
r8581r8582
727775   ROM_CONTINUE(             0xd000, 0x1000 )
728776
729777   ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for first 6802 */
730   ROM_LOAD( "13snd.2g",     0xa000, 0x2000, CRC(fc05654e) SHA1(ed9c66672fe89c41e320e1d27b53f5efa92dce9c) )
731   ROM_LOAD( "9snd.1i",      0xe000, 0x2000, CRC(3dab977f) SHA1(3e79c06d2e70b050f01b7ac58be5127ba87904b0) )
778   ROM_LOAD( "13snd.2g",     0x8000, 0x2000, CRC(fc05654e) SHA1(ed9c66672fe89c41e320e1d27b53f5efa92dce9c) )
779   ROM_LOAD( "9snd.1i",      0xc000, 0x2000, CRC(3dab977f) SHA1(3e79c06d2e70b050f01b7ac58be5127ba87904b0) )
732780
733781   ROM_REGION( 0x10000, "audio2", 0 ) /* 64k for second 6802 */
734   ROM_LOAD( "8snd.1h",      0xa000, 0x1000, CRC(f4507111) SHA1(0513f0831b94aeda84aa4f3b4a7c60dfc5113b2d) )
735   ROM_CONTINUE(             0xe000, 0x1000 )
736   ROM_LOAD( "7snd.1g",      0xb000, 0x1000, CRC(c722eff8) SHA1(d8d1c091ab80ea2d6616e4dc030adc9905c0a496) )
737   ROM_CONTINUE(             0xf000, 0x1000 )
782   ROM_LOAD( "8snd.1h",      0x2000, 0x1000, CRC(f4507111) SHA1(0513f0831b94aeda84aa4f3b4a7c60dfc5113b2d) )
783   ROM_CONTINUE(             0x6000, 0x1000 )
784   ROM_LOAD( "7snd.1g",      0x3000, 0x1000, CRC(c722eff8) SHA1(d8d1c091ab80ea2d6616e4dc030adc9905c0a496) )
785   ROM_CONTINUE(             0x7000, 0x1000 )
738786
739787   ROM_REGION( 0x6000, "gfx1", 0 )
740788   ROM_LOAD( "1bg.2d",       0x0000, 0x2000, CRC(9f880ef5) SHA1(0ee20fb7c794f6dafdaf2c9ee8456221c9d668c5) )
src/mame/drivers/eolith.c
r8581r8582
419419      IS61C1024    - ISSI 128k x4 High Speed CMOS Static RAM (SOJ32)
420420      KM6161002    - Samsung 64k x4 Ultra High Speed CMOS Video Static RAM (SOJ44)
421421      QS1000       - QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
422                     see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
423422      QS1001A      - QDSP QS1001A 512k x8 MaskROM (SOP32)
424423      EV0514-001   - Custom Eolith IC (QFP100)
425424      VSync        - 60Hz
r8581r8582
553552      KM6161002    - Samsung 64k x16 Ultra High Speed CMOS Video Static RAM (SOJ44)
554553      TDA1519      - Audio Power AMP
555554      QS1000       - QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
556                     see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
557555      QS1001A      - QDSP QS1001A 512k x8 MaskROM (SOP32)
558556      EV0514-001   - Custom Eolith IC (QFP100)
559557      VSync        - 60Hz
r8581r8582
626624      KM6161002    - Samsung 64k x16 Ultra High Speed CMOS Video Static RAM (SOJ44)
627625      TDA1519      - Audio Power AMP
628626      QS1000       - QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
629                     see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
630627      QS1001A      - QDSP QS1001A 512k x8 MaskROM (SOP32)
631628      EV0514-001   - Custom Eolith IC (QFP100)
632629      VSync        - 60Hz
r8581r8582
716713      KM6161002    - Samsung 64k x16 Ultra High Speed CMOS Video Static RAM (SOJ44)
717714      KA22065      - Audio Power AMP
718715      QS1000       - QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
719                     see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
720716      QS1001A      - QDSP QS1001A 512k x8 MaskROM (SOP32)
721717      EV0514-001   - Custom Eolith IC (QFP100)
722718      VSync        - 60Hz
r8581r8582
989985      KM6161002    - Samsung 64k x16 Ultra High Speed CMOS Video Static RAM (SOJ44)
990986      TDA1519      - Audio Power AMP
991987      QS1000       - QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
992                     see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
993988      QS1001A      - QDSP QS1001A 512k x8 MaskROM (SOP32)
994989      EV0514-001   - Custom Eolith IC (QFP100)
995990      VSync        - 60Hz
src/mame/drivers/chihiro.c
r8581r8582
129129ROM_START( chihiro )
130130   CHIHIRO_BIOS
131131
132   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
133
134132   DISK_REGION( "gdrom" )
135133
136134   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
r8581r8582
141139ROM_START( hotd3 )
142140   CHIHIRO_BIOS
143141
144   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
145
146142   DISK_REGION( "gdrom" )
147143   DISK_IMAGE_READONLY( "gdx-0001", 0,  SHA1(174c72f851d0c97e8993227467f16b0781ed2f5c) )
148144
r8581r8582
153149ROM_START( outr2 )
154150   CHIHIRO_BIOS
155151
156   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
157
158152   DISK_REGION( "gdrom" )
159153   DISK_IMAGE_READONLY( "gdx-0004a", 0, SHA1(27acd2d0680e6bafa0d052f60b4372adc37224fd) )
160154
r8581r8582
183177ROM_START( ghostsqu )
184178   CHIHIRO_BIOS
185179
186   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
187
188180   DISK_REGION( "gdrom" )
189181   DISK_IMAGE_READONLY( "gdx-0012a", 0,  SHA1(d7d78ce4992cb16ee5b4ac6ca7a37c46b07e8c14) )
190182
r8581r8582
192184   ROM_LOAD("317-0398-com.data", 0x00, 0x50, CRC(8c5391a2) SHA1(e64cadeb30c94c3cd4002630cd79cc76c7bde2ed) )
193185ROM_END
194186
187
188ROM_START( gundamos )
189   CHIHIRO_BIOS
190
191   DISK_REGION( "gdrom" )
192   DISK_IMAGE_READONLY( "gdx-0013", 0, SHA1(96b3dafcc2d2d6803fe3bf43a245d43ee5e0e5a6) )
193
194   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
195   ROM_LOAD("gdx-0013.data", 0x00, 0x50, CRC(0479c383) SHA1(7e86a037d2f9d09cec61a38cb19de510bf9482b3) )
196ROM_END
197
195198/*
196199
197200Title   VIRTUA COP 3
r8581r8582
219222ROM_START( vcop3 )
220223   CHIHIRO_BIOS
221224
222   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
223
224225   DISK_REGION( "gdrom" )
225226   DISK_IMAGE_READONLY( "gdx-0003a", 0,  SHA1(cdfec1d2ef02ae9e29cb1462f08904177bc4c9ea) )
226227
r8581r8582
232233ROM_START( mj2 )
233234   CHIHIRO_BIOS
234235
235   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
236
237236   DISK_REGION( "gdrom" )
238237   DISK_IMAGE_READONLY( "gdx-0006c", 0, SHA1(505653117a73ed8b256ccf19450e7573a4dc57e9) )
239238
r8581r8582
241240   ROM_LOAD("gdx-0006c.pic_data", 0x00, 0x50, NO_DUMP )
242241ROM_END
243242
243ROM_START( ollie )
244   CHIHIRO_BIOS
244245
246   DISK_REGION( "gdrom" )
247   DISK_IMAGE_READONLY( "gdx-0007", 0, SHA1(8898a571a427936bffcecd3ef27cb79087d22798) )
248
249   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
250   ROM_LOAD("gdx-0007.data", 0x00, 0x50, CRC(d2a8b31f) SHA1(e9ee2df30031826db6bc4bd91969e6680255dcf9) )
251ROM_END
252
253
254
245255ROM_START( wangmid )
246256   CHIHIRO_BIOS
247257
248   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
249
250258   DISK_REGION( "gdrom" )
251259   DISK_IMAGE_READONLY( "gdx-0009b", 0, SHA1(e032b9fd8d5d09255592f02f7531a608e8179c9c) )
252260
r8581r8582
258266ROM_START( wangmid2 )
259267   CHIHIRO_BIOS
260268
261   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
262
263269   DISK_REGION( "gdrom" )
264270   DISK_IMAGE_READONLY( "gdx-0015", 0, SHA1(259483fd211a70c23205ffd852316d616c5a2740) )
265271
r8581r8582
271277ROM_START( mj3 )
272278   CHIHIRO_BIOS
273279
274   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
275
276280   DISK_REGION( "gdrom" )
277281   DISK_IMAGE_READONLY( "gdx-0017d", 0, SHA1(cfbbd452c8f4efe0e99f398f5521fc3574b913bb) )
278282
r8581r8582
280284   ROM_LOAD("gdx-0017d.pic_data", 0x00, 0x50, NO_DUMP )
281285ROM_END
282286
287ROM_START( scg06nt )
288   CHIHIRO_BIOS
283289
290   DISK_REGION( "gdrom" )
291   DISK_IMAGE_READONLY( "gdx-0018a", 0, SHA1(e6f3dc8066392854ad7d83f81d3cbc81a5e340b3) )
292
293   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
294   ROM_LOAD("gdx-0018.data", 0x00, 0x50, CRC(1a210abd) SHA1(43a54d028315d2dfa9f8ea6fb59265e0b980b02f) )
295ROM_END
296
297
298
299
300
284301GAME( 200?, chihiro,  0,       chihiro_base, chihiro,    0, ROT0, "Sega",           "Chihiro Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
285GAME( 2002, hotd3,    chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "The House of the Dead III [GDX-0001]", GAME_NO_SOUND|GAME_NOT_WORKING )
286GAME( 2002, outr2,    chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Out Run 2 (Rev. A) [GDX-0004A]", GAME_NO_SOUND|GAME_NOT_WORKING )
287GAME( 2005, mj2,      chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Sega Network Taisen Mahjong MJ 2 (Rev C) [GDX-0006C]", GAME_NO_SOUND|GAME_NOT_WORKING )
302GAME( 2002, hotd3,    chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "The House of the Dead III (GDX-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
303GAME( 2003, outr2,    chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Out Run 2 (Rev. A) (GDX-0004A)", GAME_NO_SOUND|GAME_NOT_WORKING )
304GAME( 2005, mj2,      chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Sega Network Taisen Mahjong MJ 2 (Rev C) (GDX-0006C)", GAME_NO_SOUND|GAME_NOT_WORKING )
305GAME( 2005, ollie,    chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Ollie King (GDX-0007)", GAME_NO_SOUND|GAME_NOT_WORKING )
288306GAME( 2005, wangmid,  chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Wangan Midnight Maximum Tune (Rev. B) (Export) (GDX-0009B)", GAME_NO_SOUND|GAME_NOT_WORKING )
289307GAME( 2005, wangmid2, chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Wangan Midnight Maximum Tune 2 (Export) (GDX-0015)", GAME_NO_SOUND|GAME_NOT_WORKING )
290308GAME( 2005, ghostsqu, chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Ghost Squad (Ver. A?) (GDX-0012A)", GAME_NO_SOUND|GAME_NOT_WORKING )
309GAME( 2005, gundamos, chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Gundam Battle Operating Simulator (GDX-0013)", GAME_NO_SOUND|GAME_NOT_WORKING )
291310GAME( 2003, vcop3,    chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Virtua Cop 3 (GDX-0003A)", GAME_NO_SOUND|GAME_NOT_WORKING )
292GAME( 2005, mj3,      chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Sega Network Taisen Mahjong MJ 3 (Rev D) [GDX-0017D]", GAME_NO_SOUND|GAME_NOT_WORKING )
311GAME( 2005, mj3,      chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Sega Network Taisen Mahjong MJ 3 (Rev D) (GDX-0017D)", GAME_NO_SOUND|GAME_NOT_WORKING )
312GAME( 2006, scg06nt,  chihiro, chihirogd,    chihiro,    0, ROT0, "Sega",           "Sega Club Golf 2006 Next Tours (Rev A) (GDX-0018A)", GAME_NO_SOUND|GAME_NOT_WORKING )
293313
src/mame/drivers/commando.c
r8581r8582
228228{
229229   commando_state *state = (commando_state *)machine->driver_data;
230230
231   state->audiocpu = devtag_get_device(machine, "audiocpu");
231   state->audiocpu = machine->device("audiocpu");
232232
233233   state_save_register_global_array(machine, state->scroll_x);
234234   state_save_register_global_array(machine, state->scroll_y);
src/mame/drivers/atarisy2.c
r8581r8582
196196      /* generate the 32V interrupt (IRQ 2) */
197197      if ((scanline % 64) == 0)
198198         if (state->interrupt_enable & 4)
199            atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
199            atarigen_scanline_int_gen(screen.machine->device("maincpu"));
200200   }
201201}
202202
r8581r8582
243243   atarigen_eeprom_reset(&state->atarigen);
244244   slapstic_reset();
245245   atarigen_interrupt_reset(&state->atarigen, update_interrupts);
246   atarigen_sound_io_reset(devtag_get_device(machine, "soundcpu"));
246   atarigen_sound_io_reset(machine->device("soundcpu"));
247247   atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 64);
248248   memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), atarisy2_direct_handler);
249249
r8581r8582
379379
380380   if (state->atarigen.cpu_to_sound_ready) result |= 0x01;
381381   if (state->atarigen.sound_to_cpu_ready) result |= 0x02;
382   if ((state->has_tms5220) && (tms5220_readyq_r(devtag_get_device(space->machine, "tms")) == 0))
382   if ((state->has_tms5220) && (tms5220_readyq_r(space->machine->device("tms")) == 0))
383383      result &= ~0x04;
384384   if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10;
385385
r8581r8582
394394   if (state->has_tms5220)
395395   {
396396      data = 12 | ((data >> 5) & 1);
397      tms5220_set_frequency(devtag_get_device(space->machine, "tms"), MASTER_CLOCK/4 / (16 - data) / 2);
397      tms5220_set_frequency(space->machine->device("tms"), MASTER_CLOCK/4 / (16 - data) / 2);
398398   }
399399}
400400
r8581r8582
623623      return;
624624
625625   /* a large number of signals are reset when this happens */
626   atarigen_sound_io_reset(devtag_get_device(space->machine, "soundcpu"));
626   atarigen_sound_io_reset(space->machine->device("soundcpu"));
627627   devtag_reset(space->machine, "ymsnd");
628628   if (state->has_tms5220)
629629   {
r8581r8582
684684   atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
685685   if (state->has_tms5220)
686686   {
687      tms5220_data_w(devtag_get_device(space->machine, "tms"), 0, data);
687      tms5220_data_w(space->machine->device("tms"), 0, data);
688688   }
689689}
690690
r8581r8582
693693   atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
694694   if (state->has_tms5220)
695695   {
696      tms5220_wsq_w(devtag_get_device(space->machine, "tms"), 1-(offset & 1));
696      tms5220_wsq_w(space->machine->device("tms"), 1-(offset & 1));
697697   }
698698}
699699
r8581r8582
30533053
30543054   state->pedal_count = 0;
30553055   state->has_tms5220 = 1;
3056   tms5220_rsq_w(devtag_get_device(machine, "tms"),  1); // /RS is tied high on sys2 hw
3056   tms5220_rsq_w(machine->device("tms"),  1); // /RS is tied high on sys2 hw
30573057}
30583058
30593059
r8581r8582
30943094
30953095   state->pedal_count = -1;
30963096   state->has_tms5220 = 1;
3097   tms5220_rsq_w(devtag_get_device(machine, "tms"),  1); // /RS is tied high on sys2 hw
3097   tms5220_rsq_w(machine->device("tms"),  1); // /RS is tied high on sys2 hw
30983098}
30993099
31003100
r8581r8582
32503250
32513251   state->pedal_count = 2;
32523252   state->has_tms5220 = 1;
3253   tms5220_rsq_w(devtag_get_device(machine, "tms"),  1); // /RS is tied high on sys2 hw
3253   tms5220_rsq_w(machine->device("tms"),  1); // /RS is tied high on sys2 hw
32543254}
32553255
32563256
src/mame/drivers/skydiver.c
r8581r8582
147147
148148static INTERRUPT_GEN( skydiver_interrupt )
149149{
150   running_device *discrete = devtag_get_device(device->machine, "discrete");
150   running_device *discrete = device->machine->device("discrete");
151151
152152   /* Convert range data to divide value and write to sound */
153153   discrete_sound_w(discrete, SKYDIVER_RANGE_DATA, (0x01 << (~skydiver_videoram[0x394] & 0x07)) & 0xff);   // Range 0-2
src/mame/drivers/ninjakd2.c
r8581r8582
227227
228228static WRITE8_HANDLER( ninjakd2_pcm_play_w )
229229{
230   running_device *samples = devtag_get_device(space->machine, "pcm");
230   running_device *samples = space->machine->device("pcm");
231231   const UINT8* const rom = memory_region(space->machine, "pcm");
232232
233233   // only Ninja Kid II uses this
src/mame/drivers/mjsister.c
r8581r8582
452452
453453   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000);
454454
455   state->maincpu = devtag_get_device(machine, "maincpu");
456   state->dac = devtag_get_device(machine, "dac");
455   state->maincpu = machine->device("maincpu");
456   state->dac = machine->device("dac");
457457
458458   state_save_register_global(machine, state->dac_busy);
459459   state_save_register_global(machine, state->flip_screen);
src/mame/drivers/yunsung8.c
r8581r8582
480480   memory_configure_bank(machine, "bank2", 0, 3, &AUDIO[0x00000], 0x4000);
481481   memory_configure_bank(machine, "bank2", 3, 5, &AUDIO[0x10000], 0x4000);
482482
483   state->audiocpu = devtag_get_device(machine, "audiocpu");
483   state->audiocpu = machine->device("audiocpu");
484484
485485   state_save_register_global_pointer(machine, state->videoram, 0x4000);
486486   state_save_register_global(machine, state->layers_ctrl);
src/mame/drivers/warpwarp.c
r8581r8582
291291         break;
292292      case 6:
293293         warpwarp_ball_on = data & 1;
294         cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), data & 1);
294         cpu_interrupt_enable(space->machine->device("maincpu"), data & 1);
295295         if (~data & 1)
296296            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
297297         break;
src/mame/drivers/wheelfir.c
r8581r8582
1/* Wheels & Fire */
1/****************************************************************
22
3/* driver by
3Wheels & Fire
4
5driver by
46 David Haywood
57 Tomasz Slanina
6*/
78
8/*
99
10TODO:
11- sound comms
12- eeprom
13- various gfx size/pos glitches (gaps, extra rows of pixels here and there)
14- real gfx zoom, based on the zoom params, not lookup table
15- apply double buffering (sometimes gfx is displayed at y+256 every other frame (extra bits are currently masked out))
16- fix road/sky (extra bits in teh scroll reg. are there two bitmap buffers? )
17- bitmap layer clearing
18- fix wrong coords of sprites rendered into the bitmap layer (intro car)
19- is toggle_bit really a vblank  bit ? or somethign else (blitter status ?)
20- implement(and find) layer enable/disable bits
21
22
23
24
25----------------------------------
1026Produttore  TCH
1127N.revisione E133
1228
r8581r8582
4460level 3 interrupt = vblank interrupt
4561level 1 interrupt = blitter interrupt
4662
47something is missing, currently needs a hack to boot
4863
64Blitter data foramt ( offset in words, offset in bytes, offset inside ram data table )
65
66
67        fedcba9876543210
68
690  0  0
70        --------76543210    dest_x0 bits 0-7
71        76543210--------    src_x0  bits 0-7
72
731  2  2
74        --------76543210    dest_x1 bits 0-7
75
76
77
782  4  4
79        --------76543210    dest_y0 bits 0-7
80        76543210--------    src_y0  bits 0-7
813  6  6
82        --------76543210    dest_y1 bits 0-7
83
844  8
855  a
866  c  8
87        ??------????????    image flags (directly copied from image info table, page and ?)
88        --3210----------    image page
89        -------8--------    src_x0 bit 8
90        ------8---------    src_y0 bit 8
917  e  a
92        ????????--?-----    flags
93        ---------------X    X direction (src?)
94        --------------Y-    Y direction (src?)
95        ---------8------    dest_x0 bit 8
96        --------8-------    dest_y0 bit 8
97        -----------L----    dest layer
98        ------------??--    unknown bits, set usually when rendering target = bitmap layer
99
100
1018 10  c
102        -------5--------    x scale data1 bit 5
103        ------5---------    y scale data1 bit 5
104        -----5----------    x scale data2 bit 5
105        ----5-----------    y scala data2 bit 5
106        ---D------------    x scale >200%
107        --D-------------    y scale >200%
108        -x--------------    X direction (dest?)
109        Y---------------    Y direction (dest?)
110        ---------8------    scroll x bit 8
111        --------8-------    scroll y bit 8
112        ----------?-----    set for road ? buffer num (is there double buffering ? or two bitmap layers?)
113
1149 12  e
115        ---------------H    x scale < 50%
116        --------------H-    y scale < 50%
117        -------------8--    dest_x1 bit 8
118        ------------8---    dest_y1 bit 8
119
120
121a 14 10
122        ---43210--------    x scale data1 bits 0-4
123        -4--------------    y scale data1 bit 4
124        --------76543210    scroll x of bitmap layer
125
126b 16 12
127        ---43210--------    x scale data2 bits 0-4
128        10--------------    y scale data1 bits 0-1
129        --------76543210    scroll y of bitmap layer
130c 18 14
131        ---43210--------    y scale data2 bits 0-4
132        32--------------    y scale data1 bits 2-3
133d 1a
134e 1c
135f 1e
136
137
138
139
140X Scale Table:
14176543210
142
143---ABCDE
144---FGHIJ
145--------
146---K-L-M
147-------N
148
149Y Scale Table:
15076543210
151
152-A------
153DE------
154BC-FGHIJ
155--K-L-M-
156------N-
157
158
159BITS ABCDE = DATA1 (0-31)
160BITS FGHIJ = DATA2 (0-31)
161BIT K - ( scale > 200% ) ? 1 : 0
162BIT L - ( DATA2 != 0) ? 1 : 0  (or DATA2 MSB)
163BIT M - ( DATA1 != 0) ? 1 : 0  (or DATA1 MSB)
164BIT N - ( scale < 50% ) ? 1 : 0
165
166
167pcb linking
168-----------
169
170suspicious code:
171
172
173(write/read (exchange data))
174
1750A535C: 48E7 6080                  movem.l D1-D2/A0, -(A7)
1760A5360: 41F9 0078 0000             lea     $780000.l, A0
1770A5366: D040                       add.w   D0, D0
1780A5368: 3181 0000                  move.w  D1, (A0,D0.w)  ; write data
179
1800A536C: 3239 007E 0000             move.w  $7e0000.l, D1
1810A5372: 0801 000D                  btst    #$d, D1
1820A5376: 67F4                       beq     $a536c
183
1840A5378: 3230 0000                  move.w  (A0,D0.w), D1 ; read data
1850A537C: 0241 00FF                  andi.w  #$ff, D1
186
187(unk., maybe sync or config ?)
188
1890A53C2: 2F08                       move.l  A0, -(A7)
1900A53C4: 3F01                       move.w  D1, -(A7)
1910A53C6: 41F9 0078 0000             lea     $780000.l, A0
1920A53CC: D040                       add.w   D0, D0
1930A53CE: 3180 0000                  move.w  D0, (A0,D0.w) ; write offset
1940A53D2: 3180 0000                  move.w  D0, (A0,D0.w) ; again
195
1960A53D6: 3239 007E 0000             move.w  $7e0000.l, D1
1970A53DC: 0801 000D                  btst    #$d, D1   ; flag test
1980A53E0: 67F4                       beq     $a53d6
199
2000A53E2: 3030 0000                  move.w  (A0,D0.w), D0
2010A53E6: 0240 00FF                  andi.w  #$ff, D0
2020A53EA: 321F                       move.w  (A7)+, D1
2030A53EC: 205F                       movea.l (A7)+, A0
2040A53EE: 4E75                       rts
205
206
49207*/
50208
51209
52210#include "emu.h"
211#include "machine/eeprom.h"
53212#include "cpu/m68000/m68000.h"
54#include "deprecat.h"
213#include "sound/dac.h"
55214
56static int toggle_bit;
215static const int ZOOM_TABLE_SIZE=1<<14;
216static const int NUM_SCANLINES=256-8;
217static const int NUM_VBLANK_LINES=8;
218static const int LAYER_BG=0;
219static const int LAYER_FG=1;
220static const int NUM_COLORS=256;
57221
58static READ16_HANDLER( wheelfir_rand1 )
222struct scroll_info
59223{
60   return input_port_read(space->machine, "IN0") ^ toggle_bit;   // mame_rand(space->machine);
61}
224    INT32 x,y,unkbits;
225};
62226
63static READ16_HANDLER( wheelfir_rand2 )
227
228class wheelfir_state
64229{
65   return input_port_read(space->machine, "IN1");      // mame_rand(space->machine);
66}
230public:
231   static void *alloc(running_machine &machine)
232   {
233      return auto_alloc_clear(&machine, wheelfir_state(machine));
234   }
67235
236   wheelfir_state(running_machine &machine) { }
68237
69static READ16_HANDLER( wheelfir_rand4 )
70{
71   return mame_rand(space->machine);
72}
238   running_device *maincpu;
239   running_device *subcpu;
240   running_device *screen;
241   running_device *eeprom;
73242
74static UINT16 *wheelfir_myram;
75static UINT16 wheelfir_blitdata[16];
76static bitmap_t *wheelfir_tmp_bitmap[3];
243   INT32 *zoom_table;
244   UINT16 *blitter_data;
77245
78/*
246   UINT8 *palette;
247   INT32 palpos;
79248
80A 30f7 - 3150 - 0059 - 0d5c - 0066 - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - A
81B
82C 48f7 - 4971 - 007a - 0d28 - 0032 - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - C
83C 48f7 - 4945 - 004e - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - C
84D 54f7 - 559d - 00a6 - 0d76 - 0080 - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - D
85E 1ff8 - 209d - 00a5 - 2728 - 0032 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - E
86F
87G 60f7 - 6145 - 004e - 0d5c - 0066 - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - G
88H 6cf7 - 6d7c - 0085 - 0d28 - 0032 - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - H
89I 3efd - 3f5e - 0061 - 2d28 - 0032 - 0000 - 0000 - 3400 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - I
90I 3efd - 3f5e - 0061 - 2d42 - 004c - 0000 - 0000 - 3400 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - I
91I 3efd - 3fa0 - 00a3 - 2d42 - 004c - 0000 - 0000 - 3400 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - I
92J
93K
94L 40f8 - 415b - 0063 - 2776 - 0080 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - L
95M 3cf6 - 3d5a - 0064 - eac4 - 00ce - 0000 - 0000 - 3b00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - M
96N 84f7 - 8566 - 006f - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - N
97N 84f7 - 85b3 - 00bc - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - N
98O 90f7 - 9150 - 0059 - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - O
99O 90f7 - 917c - 0085 - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - O
100O 90f7 - 91a8 - 00b1 - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - O
101P f0f7 - f187 - 0090 - 0d42 - 004c - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - P
102Q
103R fcf7 - fd71 - 007a - 0d76 - 0080 - 0000 - 0000 - 3c00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - R
104S 4bf8 - 4c45 - 004d - 2728 - 0032 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - S
105S 4bf8 - 4ca8 - 00b0 - 2728 - 0032 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - S
106S 4bf8 - 4cbe - 00c6 - 2742 - 004c - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - S
107T 08f7 - 0966 - 006f - 0d28 - 0032 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - T
108T 08f7 - 0992 - 009b - 0d28 - 0032 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - T
109T 08f7 - 09b3 - 00bc - 0d28 - 0032 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - T
110T 08f7 - 0992 - 009b - 0d42 - 004c - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - T
111U 14f7 - 155b - 0064 - 0d90 - 009a - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - U
112V 20f7 - 21d4 - 00dd - 0d76 - 0080 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - V
113W 20f3 - 214e - 005b - b628 - 0032 - 0000 - 0000 - 3a00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - W
114X 2cf7 - 2d50 - 0059 - 0dde - 00e8 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - X
115Y 38f7 - 3921 - 002a - 0d76 - 0080 - 0000 - 0000 - 3d00 - 00d7 - c000 - 000c - 0000 - 0000 - 0000 - 00ff - ffff - ffff - Y
116Z
117    extra test mode reads..
249   INT32 current_scanline;
250   scroll_info *scanlines;
118251
119    ????
120    GAME OPTIONS
121    COIN OPTIONS
122    COLOR AND CONVERGENCY
123    SOUND
124    STATISTICS
125    COMUNICATION
126    EXIT
252   INT32 soundlatch;
127253
128U 14f7 - 155b - 0064 - 0d90 - 009a - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - U
129V 20f7 - 21d4 - 00dd - 0d76 - 0080 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - V
130X 2cf7 - 2d50 - 0059 - 0dde - 00e8 - 0000 - 0000 - 3d00 - 0097 - c000 - 0008 - 0000 - 0000 - 0000 - 00ff - ffff - ffff - X
131Y 38f7 - 3921 - 002a - 0d76 - 0080 - 0000 - 0000 - 3d00 - 00d7 - c000 - 000c - 0000 - 0000 - 0000 - 00ff - ffff - ffff - Y
254   INT32 direct_write_x0;
255   INT32 direct_write_x1;
256   INT32 direct_write_y0;
257   INT32 direct_write_y1;
258   INT32 direct_write_idx;
132259
133by the grouping of the characters the test mode font should clearly be the one seen at the start of the last page. and
134scattered over the previous page.  letters are 12x12, and U/V/X/Y are +0x0c00 from each other in this data.
260   INT32 toggle_bit;
261   INT16 scanline_cnt;
135262
136263
137by using 0xffff at 0xf as the draw command we seem to lose some data.. maybe its not right.
264   bitmap_t *tmp_bitmap[2];
138265
139*/
266   INT32 get_scale(INT32 index)
267   {
268      while(index<ZOOM_TABLE_SIZE)
269      {
270         if(zoom_table[index]>=0)
271         {
272            return zoom_table[index];
273         }
274         ++index;
275      }
276      return 0;
277   }
278};
140279
141/* each 512x512 page is
142 0x40000 bytes long
280static timer_device* scanline_timer;
143281
144therefore a 512x256 page is
145 0x20000 bytes...
282static READ16_HANDLER( wheelfir_status_r )
283{
284/*
285    fedcba9876543210
286    x---------------  vblank ?
287    --x-------------  ? must be 1
288    --------------x-  ? eeprom
289    ---------------x  ? eeprom
146290
147291*/
292   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
293   return state->toggle_bit| (mame_rand(space->machine)&0x2000);
294}
148295
149/* it draws the background and road with direct writes to port 6... but where does this really go? an extra blit source page? */
150static int wheelfir_six_pos = 0;
151static bitmap_t* render_bitmap;
296static WRITE16_HANDLER( wheelfir_scanline_cnt_w )
297{
298   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
299   COMBINE_DATA(&state->scanline_cnt);
300}
152301
302
153303static WRITE16_HANDLER(wheelfir_blit_w)
154304{
155   //wheelfir_blitdata[offset]=data;
156   int width = space->machine->primary_screen->width();
157   int height = space->machine->primary_screen->height();
158   int vpage=0;
159   COMBINE_DATA(&wheelfir_blitdata[offset]);
305   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
160306
161   /* a bit of a hack really .. */
162   if(offset==0x6)
307   COMBINE_DATA(&state->blitter_data[offset]);
308
309   if(!ACCESSING_BITS_8_15 && offset==0x6)  //LSB only!
163310   {
164      int sixdat = data&0xff;
165311      int x,y;
166312
167      x = wheelfir_six_pos % 512;
168      y = wheelfir_six_pos / 512;
169313
170      x &= 511;
171      y &= 511;
314      int direct_width=state->direct_write_x1-state->direct_write_x0+1;
315      int direct_height=state->direct_write_y1-state->direct_write_y0+1;
172316
173      wheelfir_six_pos++;
317      int sixdat = data&0xff;
174318
175      *BITMAP_ADDR16(wheelfir_tmp_bitmap[2], y, x) = sixdat;
319      if(direct_width>0 && direct_height>0)
320      {
321         x= state->direct_write_idx % direct_width;
322         y = (state->direct_write_idx / direct_width) %direct_height;
323
324         x+=state->direct_write_x0;
325         y+=state->direct_write_y0;
326
327         if(x<512 && y <512)
328         {
329            *BITMAP_ADDR16(state->tmp_bitmap[LAYER_BG], y, x) = sixdat;
330         }
331      }
332
333      ++state->direct_write_idx;
334
176335      return;
336
177337   }
178338
339   int yscroll=-1;
340   int xscroll=-1;
179341
180   /* probably wrong, see above! */
342   if(offset==0x0a && ACCESSING_BITS_0_7)
343   {
344      xscroll = (state->blitter_data[0xa]&0x00ff) | (state->blitter_data[0x8]&0x0040) << 2;
345   }
346
347   if(offset==0x0b && ACCESSING_BITS_0_7)
348   {
349      yscroll = (state->blitter_data[0xb]&0x00ff) | (state->blitter_data[0x8]&0x0080) << 1;
350   }
351
352   if(offset==0x8 && ACCESSING_BITS_0_7)
353   {
354      xscroll = (state->blitter_data[0xa]&0x00ff) | (state->blitter_data[0x8]&0x0040) << 2;
355      yscroll = (state->blitter_data[0xb]&0x00ff) | (state->blitter_data[0x8]&0x0080) << 1;
356   }
357
358   if(xscroll>=0)
359   {
360      int scl=state->current_scanline>=NUM_SCANLINES?0:state->current_scanline;
361      state->scanlines[scl].x=xscroll;
362      state->scanlines[scl].unkbits=state->blitter_data[0x8]&0xff;
363   }
364
365   if(yscroll>=0)
366   {
367      int scl=state->current_scanline>=NUM_SCANLINES?0:state->current_scanline;
368      state->scanlines[scl].y=yscroll;
369      state->scanlines[scl].unkbits=state->blitter_data[0x8]&0xff;
370   }
371
372
181373   if(offset==0xf && data==0xffff)
182374   {
183375
376      cputag_set_input_line(space->machine, "maincpu", 1, HOLD_LINE);
184377
185      int x,y;
186      int xsize,ysize;
187      UINT8 *rom = memory_region(space->machine, "gfx1");
188      int dir=0;
378      {
379         UINT8 *rom = memory_region(space->machine, "gfx1");
189380
381         int width = space->machine->primary_screen->width();
382         int height = space->machine->primary_screen->height();
190383
191      wheelfir_six_pos = 0;
384         int src_x0=(state->blitter_data[0]>>8)+((state->blitter_data[6]&0x100)?256:0);
385         int src_y0=(state->blitter_data[2]>>8)+((state->blitter_data[6]&0x200)?256:0);
192386
193      mame_printf_debug("XX %.4x - ",wheelfir_blitdata[0]-wheelfir_blitdata[1]);
194      mame_printf_debug("YY %.4x - ",wheelfir_blitdata[2]-wheelfir_blitdata[3]);
387         int dst_x0=(state->blitter_data[0]&0xff)+((state->blitter_data[7]&0x40)?256:0);
388         int dst_y0=(state->blitter_data[2]&0xff)+((state->blitter_data[7]&0x80)?256:0);
195389
390         int dst_x1=(state->blitter_data[1]&0xff)+((state->blitter_data[9]&4)?256:0);
391         int dst_y1=(state->blitter_data[3]&0xff)+((state->blitter_data[9]&8)?256:0);
196392
197      for(x=0;x<16;x++)
198         mame_printf_debug("%x-",wheelfir_blitdata[x]);
393         int x_dst_step=(state->blitter_data[7]&0x1)?1:-1;
394         int y_dst_step=(state->blitter_data[7]&0x2)?1:-1;
199395
200      mame_printf_debug("\n");
396         int x_src_step=(state->blitter_data[8]&0x4000)?1:-1;
397         int y_src_step=(state->blitter_data[8]&0x8000)?1:-1;
201398
202      xsize = ((wheelfir_blitdata[1]&0xff)-(wheelfir_blitdata[0]&0xff))&0xff;
203      ysize = ((wheelfir_blitdata[3]&0xff)-(wheelfir_blitdata[2]&0xff))&0x0ff;
399         int page=((state->blitter_data[6])>>10)*0x40000;
204400
205401
402         if(page>=0x400000) /* src set to  unav. page before direct write to the framebuffer */
403         {
206404
405               state->direct_write_x0=dst_x0;
406               state->direct_write_x1=dst_x1;
407               state->direct_write_y0=dst_y0;
408               state->direct_write_y1=dst_y1;
409               state->direct_write_idx=0;
207410
208      if(wheelfir_blitdata[7]&0x1)
209         dir=1;
210      else
211      {
212         dir=-1;
213         xsize=0x100-xsize;
214      }
411         }
215412
216      for(y=0;y<=ysize+1/*((wheelfir_blitdata[9]?wheelfir_blitdata[9]:16)*/;y++)
217         for(x=0;x<=xsize+1/*(wheelfir_blitdata[9]?wheelfir_blitdata[9]:16)*/;x++)
413         if(x_dst_step<0)
218414         {
219            int destx=wheelfir_blitdata[0]&0xff;
220            int desty=wheelfir_blitdata[2]&0xff;
221415
222            int pagenumber = (wheelfir_blitdata[6]&0x3e00)>>9;
223            int gfxbase = pagenumber * 0x20000;
224            int xbit = (wheelfir_blitdata[6]&0x0100)>>8;
416            if(dst_x0<=dst_x1)
417            {
225418
419               return;
420            }
226421
227            int offs;
228            int pix;
229            int diffx,diffy;
422         }
423         else
424         {
230425
231            if (wheelfir_blitdata[7]&0x0040)destx +=0x100;
232         //  if (wheelfir_blitdata[7]&0x0080) desty +=0x100;
426            if(dst_x0>=dst_x1)
427            {
428               return;
429            }
233430
234//              if (wheelfir_blitdata[9]&0x0004) destx +=0x100;
235//              if (wheelfir_blitdata[9]&0x0008) desty +=0x100;
431         }
236432
237            diffx=wheelfir_blitdata[0]>>8;
238            diffy=wheelfir_blitdata[2]>>8;
433         if(y_dst_step<0)
434         {
435            if(dst_y0<=dst_y1)
436            {
437               return;
438            }
439         }
440         else
441         {
239442
240         //  diffx-=0xf700;
241         //  diffx&=511;
443            if(dst_y0>=dst_y1)
444            {
445               return;
446            }
242447
448         }
243449
244         //  diffy-=0xf400;
245//              diffy&=1023;
246450
451         //additional checks
247452
248            diffx &= 0xff;
249            diffy &= 0xff;
250            if (xbit) diffx+=0x100;
453         int d1, d2, hflag, dflag, index;
251454
252            diffx+=x;
253            diffy+=y;
455         d1=((state->blitter_data[0x0a]&0x1f00)>>8);
254456
457         d2=((state->blitter_data[0x0b]&0x1f00)>>8);
255458
256            destx+=x*dir;
257            desty+=y;
258459
259            offs=gfxbase+diffy*512+diffx;
460         d1|=((state->blitter_data[0x8]&0x100)>>3);
461         d2|=((state->blitter_data[0x8]&0x400)>>5);
462         hflag=(state->blitter_data[0x9]&0x1)?1:0;
463         dflag=(state->blitter_data[0x8]&0x1000)?1:0;
464         index=d1|(d2<<6)|(hflag<<12)|(dflag<<13);
260465
261            offs&=0x3fffff;
262466
263            pix = rom[offs];
467         float scale_x=state->get_scale(index);
264468
469         d1=((state->blitter_data[0x0b]&0xc000)>>14) |
470            ((state->blitter_data[0x0c]&0xc000)>>12) |
471            ((state->blitter_data[0x0a]&0x4000)>>10);
265472
266            if(pix && destx >0 && desty >0 && destx<width && desty <height)
267               *BITMAP_ADDR16(wheelfir_tmp_bitmap[vpage], desty, destx) = pix;
268         }
269   }
473         d2=((state->blitter_data[0x0c]&0x1f00)>>8);
270474
271475
476         d1|=((state->blitter_data[0x8]&0x200)>>4);
477         d2|=((state->blitter_data[0x8]&0x800)>>6);
272478
273}
479         hflag=(state->blitter_data[0x9]&0x2)?1:0;
480         dflag=(state->blitter_data[0x8]&0x2000)?1:0;
481         index=d1|(d2<<6)|(hflag<<12)|(dflag<<13);
274482
275static VIDEO_START(wheelfir)
276{
277483
278   wheelfir_tmp_bitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
279   wheelfir_tmp_bitmap[1] = machine->primary_screen->alloc_compatible_bitmap();
280   wheelfir_tmp_bitmap[2] = machine->primary_screen->alloc_compatible_bitmap();
484         float scale_y=state->get_scale(index);
281485
282   render_bitmap =          machine->primary_screen->alloc_compatible_bitmap();
283486
284}
487         if(scale_x==0 || scale_y==0) return;
285488
286static UINT8 wheelfir_palette[8192];
287static int wheelfir_palpos = 0;
288/* Press R to show a page of gfx, Q / E to move between pages, and W to clear the framebuffer */
289static VIDEO_UPDATE(wheelfir)
290{
291#if 0
292    int x,y;
293    static int base = 0;
294489
295    if ( input_code_pressed_once(screen->machine, KEYCODE_E) )
296        base += 512*512;
490         float scale_x_step=100.f/scale_x;
491         float scale_y_step=100.f/scale_y;
297492
298    if ( input_code_pressed_once(screen->machine, KEYCODE_Q) )
299        base -= 512*512;
300493
301    if (base<0x000000) base = 0x000000;
302    if (base>0x3c0000) base = 0x3c0000;
303494
304    copybitmap(bitmap, wheelfir_tmp_bitmap[2], 0, 0, 0, 0, cliprect);
305    //copybitmap_trans(bitmap, wheelfir_tmp_bitmap[1], 0, 0, 0, 0, cliprect, 0);
306    copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0);
307    bitmap_fill(wheelfir_tmp_bitmap[0], screen->visible_area(),0);
495         int x,y;
496         float idx_x,idx_y;
308497
309    if ( input_code_pressed(screen->machine, KEYCODE_R) )
310    {
311        const UINT8 *gfx = memory_region(machine, "gfx1");
312        for (y=0;y<128;y++)
313        {
314            for (x=0;x<512;x++)
315            {
316                int romoffs;
317                UINT8 romdata;
498         int vpage=LAYER_FG;
499         if(state->blitter_data[0x7]&0x10)
500         {
501            vpage=LAYER_BG;
502/*
503                printf("bg -> %d %d   %d %d  %d %d @ %x\n",dst_x0,dst_y0, dst_x1,dst_y1, dst_x1-dst_x0, dst_y1-dst_y0,cpu_get_pc(space->cpu));
318504
319                romoffs = base+y*512+x;
505                for(int i=0;i<16;++i)
506                {
507                    printf("%x = %.4x\n",i,state->blitter_data[i]);
508                }
320509
321                romdata = gfx[romoffs];
510                printf("\n");
511*/
512         }
322513
323                *BITMAP_ADDR16(bitmap, y, x) = romdata;
324            }
325        }
326    }
327#endif
514         bool endx=false;
515         bool endy=false;
328516
329   copybitmap(bitmap, render_bitmap, 0, 0, 0, 0, cliprect);
330   copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0);
517         if(state->blitter_data[0x7]&0x0c)
518         {
519            //???
520         }
331521
522         for( x=dst_x0, idx_x=0 ; !endx;x+=x_dst_step, idx_x+=scale_x_step )
523         {
524            endy=false;
525            for( y=dst_y0, idx_y=0 ; !endy;y+=y_dst_step, idx_y+=scale_y_step)
526            {
527                endx=(x==dst_x1);
528                endy=(y==dst_y1);
529
530
531               int xx=src_x0+x_src_step*idx_x;
532               int yy=src_y0+y_src_step*idx_y;
533
534               int address=page+yy*512+xx;
535
536               int pix = rom[address&(0x1000000-1)];
537
538               int screen_x=x;
539               int screen_y=y;
540
541
542               if(page>=0x400000)
543               {
544                  //hack for clear
545                  if(screen_x >0 && screen_y >0 && screen_x < width && screen_y <height)
546                  {
547               //      *BITMAP_ADDR16(state->tmp_bitmap[vpage], screen_y , screen_x ) =0;
548                  }
549               }
550               else
551               {
552                  screen_y&=0xff;
553
554                  if(pix && screen_x >0 && screen_y >0 && screen_x < width && screen_y <height)
555                  {
556                     *BITMAP_ADDR16(state->tmp_bitmap[vpage], screen_y , screen_x ) = pix;
557                  }
558               }
559            }
560         }
561      }
562   }
563}
564
565static VIDEO_START(wheelfir)
566{
567   wheelfir_state *state = (wheelfir_state *)machine->driver_data;
568   state->tmp_bitmap[0] = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16);
569   state->tmp_bitmap[1] = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16);
570}
571
572static VIDEO_UPDATE(wheelfir)
573{
574   wheelfir_state *state = (wheelfir_state *)screen->machine->driver_data;
575
576   bitmap_fill(bitmap, cliprect,0);
577
578   for(int y=0;y<NUM_SCANLINES;++y)
332579   {
333      int x;
334      for (x=0;x<8192;x+=3)
580      UINT16 *source = BITMAP_ADDR16(state->tmp_bitmap[LAYER_BG],( (state->scanlines[y].y)&511), 0);
581      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
582
583      for (int x=0;x<336;x++)
335584      {
336         //int paldat = (wheelfir_palette[x]<<8) | wheelfir_palette[x+1];
337         int b,g,r;
338585
339         r = wheelfir_palette[x];
340         g = wheelfir_palette[x+1];
341         b = wheelfir_palette[x+2];
342         palette_set_color(screen->machine,x/3,MAKE_RGB(r,g,b));
586         dest[x] = source[ (x+(state->scanlines[y].x)) &511];
587
343588      }
344589   }
345#if 0
590
591   copybitmap_trans(bitmap, state->tmp_bitmap[LAYER_FG], 0, 0, 0, 0, cliprect, 0);
592
593/*
346594    {
347        FILE* fp;
348        fp=fopen("wheelfir_pal.dmp", "w+b");
349        if (fp)
350        {
351            fwrite(wheelfir_palette, 1024, 1, fp);
352            fclose(fp);
353        }
595        bitmap_fill(state->tmp_bitmap[LAYER_BG], &screen->visible_area(),0);
596
354597    }
355#endif
598*/
356599
357600   return 0;
358601}
359602
603static VIDEO_EOF( wheelfir )
604{
605   wheelfir_state *state = (wheelfir_state *)machine->driver_data;
606   bitmap_fill(state->tmp_bitmap[LAYER_FG], &machine->primary_screen->visible_area(),0);
607}
608
609
360610static WRITE16_HANDLER( pal_reset_pos_w )
361611{
362   wheelfir_palpos = 0;
612   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
613   state->palpos = 0;
363614}
364615
365616static WRITE16_HANDLER( pal_data_w )
366617{
367   wheelfir_palette[wheelfir_palpos] = data & 0xff;
368   wheelfir_palpos ++;
618   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
619   int color=state->palpos/3;
620   state->palette[state->palpos] = data & 0xff;
621   ++state->palpos;
369622
370   wheelfir_palpos &=8191;
623   state->palpos %=NUM_COLORS*3;
624
625   {
626      int r = state->palette[color*3];
627      int g = state->palette[color*3+1];
628      int b = state->palette[color*3+2];
629      palette_set_color(space->machine, color, MAKE_RGB(r,g,b));
630   }
631
371632}
372633
634static WRITE16_HANDLER(wheelfir_7c0000_w)
635{
636   /* seems to be scanline width/2 (used for scanline int timing ? or real width of scanline ?) */
637}
373638
639static WRITE16_HANDLER(wheelfir_snd_w)
640{
641   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
642   COMBINE_DATA(&state->soundlatch);
643   cputag_set_input_line(space->machine, "subcpu", 1, HOLD_LINE); /* guess, tested also with periodic interrupts and latch clear*/
644   timer_call_after_resynch(space->machine, NULL, 0, 0);
645}
374646
647static READ16_HANDLER( wheelfir_snd_r )
648{
649   wheelfir_state *state = (wheelfir_state *)space->machine->driver_data;
650   return state->soundlatch;
651}
652
653static WRITE16_HANDLER(coin_cnt_w)
654{
655   /* bits 0/1 coin counters */
656   coin_counter_w(space->machine, 0, data & 0x01);
657   coin_counter_w(space->machine, 1, data & 0x02);
658}
659
660
375661static ADDRESS_MAP_START( wheelfir_main, ADDRESS_SPACE_PROGRAM, 16 )
376662   AM_RANGE(0x000000, 0x0fffff) AM_ROM
377   AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_BASE (&wheelfir_myram)
663   AM_RANGE(0x200000, 0x20ffff) AM_RAM
378664
379   AM_RANGE(0x7c0000, 0x7c0001) AM_READ(wheelfir_rand1)
380   AM_RANGE(0x780000, 0x780001) AM_READ(wheelfir_rand2)
665   AM_RANGE(0x700000, 0x70001f) AM_WRITE(wheelfir_blit_w)
666   AM_RANGE(0x720000, 0x720001) AM_WRITE(pal_reset_pos_w)
667   AM_RANGE(0x720002, 0x720003) AM_WRITE(pal_data_w)
668   AM_RANGE(0x720004, 0x720005) AM_WRITENOP // always ffff?
669   AM_RANGE(0x740000, 0x740001) AM_WRITE(wheelfir_snd_w)
670   AM_RANGE(0x780000, 0x78000f) AM_READNOP /* net comms ? */
671   AM_RANGE(0x760000, 0x760001) AM_WRITE(coin_cnt_w)
672   AM_RANGE(0x7a0000, 0x7a0001) AM_WRITE(wheelfir_scanline_cnt_w)
673   AM_RANGE(0x7c0000, 0x7c0001) AM_READWRITE(wheelfir_status_r, wheelfir_7c0000_w)
381674   AM_RANGE(0x7e0000, 0x7e0001) AM_READ_PORT("P1")
382675   AM_RANGE(0x7e0002, 0x7e0003) AM_READ_PORT("P2")
383676
384
385   AM_RANGE(0x700000, 0x70001f) AM_WRITE(wheelfir_blit_w) // blitter stuff
386   AM_RANGE(0x720000, 0x720001) AM_WRITE(pal_reset_pos_w) // always 0?
387   AM_RANGE(0x720002, 0x720003) AM_WRITE(pal_data_w) // lots of different values.. also blitter? palette?
388//  AM_RANGE(0x720004, 0x720005) AM_WRITENOP // always ffff?
389
390//  AM_RANGE(0x740000, 0x740001) AM_WRITENOP
391//  AM_RANGE(0x760000, 0x760001) AM_WRITENOP
392//  AM_RANGE(0x740000, 0x740001) AM_WRITENOP
393//  AM_RANGE(0x7a0000, 0x7a0001) AM_WRITENOP
394//  AM_RANGE(0x7c0000, 0x7c0001) AM_WRITENOP
395
396677  ADDRESS_MAP_END
397678
398679
r8581r8582
401682   AM_RANGE(0x000000, 0x0fffff) AM_ROM
402683   AM_RANGE(0x200000, 0x20ffff) AM_RAM
403684
404   AM_RANGE(0x780000, 0x780001) AM_READ(wheelfir_rand4)
405   AM_RANGE(0x700000, 0x700001) AM_WRITENOP
406   AM_RANGE(0x740000, 0x740001) AM_WRITENOP
685   AM_RANGE(0x780000, 0x780001) AM_READ(wheelfir_snd_r)
686
687   AM_RANGE(0x700000, 0x700001) AM_DEVWRITE8("dac1", dac_w, 0xff00) //guess for now
688   AM_RANGE(0x740000, 0x740001) AM_DEVWRITE8("dac2", dac_w, 0xff00)
407689ADDRESS_MAP_END
408690
409691
410692static INPUT_PORTS_START( wheelfir )
411   PORT_START("IN0")   /* 16bit */
412   PORT_DIPNAME( 0x0001, 0x0001, "0" )
413   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
414   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
415   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
416   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
417   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
418   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
419   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
420   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
421   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
422   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
423   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
424   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
425   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
426   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
427   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
428   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
429   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
430   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
431   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
432   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
433   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
434   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
435   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
436   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
437   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
438   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
439   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
440   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
441   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
442   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
443   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
444   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
445   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
446   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
447   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
448   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
449   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
450   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
451   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
452   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
453   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
454   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
455   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
456   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
457   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
458   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
459   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
460
461   PORT_START("IN1")   /* 16bit */
462   PORT_DIPNAME( 0x0001, 0x0001, "1" )
463   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
464   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
465   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
466   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
467   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
468   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
469   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
470   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
471   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
472   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
473   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
474   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
475   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
476   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
477   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
478   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
479   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
480   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
481   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
482   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
483   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
484   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
485   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
486   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
487   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
488   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
489   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
490   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
491   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
492   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
493   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
494   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
495   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
496   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
497   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
498   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
499   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
500   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
501   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
502   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
503   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
504   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
505   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
506   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
507   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
508   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
509   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
510
511693   PORT_START("P1")   /* 16bit */
512694   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
513695   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r8581r8582
524706   PORT_DIPNAME( 0x1000, 0x1000, "Test / Game?"  )
525707   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
526708   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
527   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
709   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) /* net comm flag ? */
528710   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
529711   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
530712
r8581r8582
540722   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
541723INPUT_PORTS_END
542724
543static timer_device* frame_timer;
544static timer_device* scanline_timer;
545
546static TIMER_DEVICE_CALLBACK( frame_timer_callback )
547{
548   /* callback */
549}
550
551static int scanline_counter = 0;
552static int total_scanlines = 262;
553
554static void render_background_to_render_buffer(int scanline)
555{
556   int x;
557   UINT16 yscroll = (wheelfir_blitdata[0xb]&0x00ff) | (wheelfir_blitdata[0x8]&0x0080) << 1;
558   UINT16 xscroll = (wheelfir_blitdata[0xa]&0x00ff) | (wheelfir_blitdata[0x8]&0x0040) << 2;
559
560   UINT16 *source = BITMAP_ADDR16(wheelfir_tmp_bitmap[2], (scanline+yscroll)&511, 0);
561   UINT16 *dest = BITMAP_ADDR16(render_bitmap, scanline, 0);
562
563//  if (scanline==100)
564//      printf("%04x %04x %04x %04x\n", wheelfir_blitdata[0x8],wheelfir_blitdata[0x9],wheelfir_blitdata[0xa],wheelfir_blitdata[0xb]);
565
566   for (x=0;x<336;x++)
567   {
568      dest[x] = source[ (x+xscroll) &511];
569   }
570
571}
572
573725static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
574726{
727   wheelfir_state *state = (wheelfir_state *)timer.machine->driver_data;
575728   timer_call_after_resynch(timer.machine, NULL, 0, 0);
729   state->current_scanline=param;
576730
577   if (scanline_counter != (total_scanlines - 1))
731   if(state->current_scanline<NUM_SCANLINES)
578732   {
579      scanline_counter++;
580      cputag_set_input_line(timer.machine, "maincpu", 5, HOLD_LINE); // raster IRQ, changes scroll values for road
581      timer.adjust(attotime_div(ATTOTIME_IN_HZ(60), total_scanlines));
733      //visible scanline
582734
583      if (scanline_counter < 256)
584      {
585         render_background_to_render_buffer(scanline_counter);
586      }
735      state->toggle_bit = 0x0000;
587736
588      if (scanline_counter == 256)
737      --state->scanline_cnt;
738
739      if(state->current_scanline>0)
589740      {
590         cputag_set_input_line(timer.machine, "maincpu", 3, HOLD_LINE); // vblank IRQ?
591         toggle_bit = 0x8000; // must toggle..
741         //copy scanline offset
742         state->scanlines[state->current_scanline].x=(state->scanlines[state->current_scanline-1].x);
743         state->scanlines[state->current_scanline].y=(state->scanlines[state->current_scanline-1].y+1);
744         state->scanlines[state->current_scanline].unkbits=state->scanlines[state->current_scanline-1].unkbits;
592745      }
593746
594      if (scanline_counter == 0)
747      if(state->scanline_cnt==0) //<=0 ?
595748      {
596         toggle_bit = 0x0000; // must toggle..
749         cputag_set_input_line(timer.machine, "maincpu", 5, HOLD_LINE); // raster IRQ, changes scroll values for road
597750      }
598751
599   //  printf("scanline %d\n",scanline_counter);
600752   }
601   else /* pretend we're still on the same scanline to compensate for rounding errors */
753   else
602754   {
603      scanline_counter = total_scanlines-1;
755      if(state->current_scanline==NUM_SCANLINES) /* vblank */
756      {
757         state->toggle_bit = 0x8000;
758         cputag_set_input_line(timer.machine, "maincpu", 3, HOLD_LINE);
759      }
604760   }
605761}
606762
607static VIDEO_EOF( wheelfir )
608{
609   scanline_counter = -1;
610   bitmap_fill(wheelfir_tmp_bitmap[0], &machine->primary_screen->visible_area(),0);
611763
612   frame_timer->reset();
613   scanline_timer->reset();
614}
615
616764static MACHINE_RESET(wheelfir)
617765{
618   frame_timer = machine->device<timer_device>("frame_timer");
766
619767   scanline_timer = machine->device<timer_device>("scan_timer");
620   frame_timer->reset();
621   scanline_timer->reset();
622   scanline_counter = -1;
623768}
624769
625static INTERRUPT_GEN( wheelfir_irq )
770static MACHINE_START( wheelfir )
626771{
627   // we seem to need this interrupt at least once for every object drawn on the screen, otherwise things flicker + slowdown
628   cpu_set_input_line(device, 1, HOLD_LINE); // blitter IRQ?
772   wheelfir_state *state = (wheelfir_state *)machine->driver_data;
773
774   state->maincpu = machine->device( "maincpu");
775   state->subcpu = machine->device(  "subcpu");
776   state->screen = machine->device(  "screen");
777   state->eeprom = machine->device(  "eeprom");
778
779   state->zoom_table = auto_alloc_array(machine, INT32, ZOOM_TABLE_SIZE);
780   state->blitter_data = auto_alloc_array(machine, UINT16, 16);
781
782   state->scanlines = reinterpret_cast<scroll_info*>(auto_alloc_array(machine, UINT8, sizeof(scroll_info)*(NUM_SCANLINES+NUM_VBLANK_LINES)));
783   state->palette=auto_alloc_array(machine, UINT8, NUM_COLORS*3);
784
785
786   for(int i=0;i<(ZOOM_TABLE_SIZE);++i)
787   {
788      state->zoom_table[i]=-1;
789   }
790
791   UINT16 *ROM = (UINT16 *)memory_region(machine, "maincpu");
792
793   for(int j=0;j<400;++j)
794   {
795      int i=j<<3;
796      int d1=ROM[0x200+i]&0x1f;
797      int d0=(ROM[0x200+i]>>8)&0x1f;
798
799      d0|=(ROM[0x200+1+i]&1)?0x20:0;
800      d1|=(ROM[0x200+1+i]&4)?0x20:0;
801
802      int hflag=(ROM[0x200+2+i]&0x100)?1:0;
803      int dflag=(ROM[0x200+1+i]&0x10)?1:0;
804
805      int index=d0|(d1<<6)|(hflag<<12)|(dflag<<13);
806      state->zoom_table[index]=j;
807   }
629808}
630809
631810
632811static MACHINE_DRIVER_START( wheelfir )
633   MDRV_CPU_ADD("maincpu", M68000, 32000000)
812   MDRV_DRIVER_DATA(wheelfir_state)
813
814   MDRV_CPU_ADD("maincpu", M68000, 32000000/2)
634815   MDRV_CPU_PROGRAM_MAP(wheelfir_main)
635   MDRV_CPU_VBLANK_INT_HACK(wheelfir_irq,256)  // 1,3,5 valid
636816
637   MDRV_CPU_ADD("sub", M68000, 32000000/2)
817   MDRV_CPU_ADD("subcpu", M68000, 32000000/2)
638818   MDRV_CPU_PROGRAM_MAP(wheelfir_sub)
639   MDRV_CPU_VBLANK_INT("screen", irq1_line_hold) // 1 valid
819   //MDRV_CPU_VBLANK_INT_HACK(irq1_line_hold,256)
640820
821   MDRV_QUANTUM_TIME(HZ(12000))
822
641823   MDRV_MACHINE_RESET (wheelfir)
642824
643   MDRV_TIMER_ADD("frame_timer", frame_timer_callback)
644   MDRV_TIMER_ADD("scan_timer", scanline_timer_callback)
825   MDRV_TIMER_ADD_SCANLINE("scan_timer", scanline_timer_callback, "screen", 0, 1)
645826
646827   MDRV_SCREEN_ADD("screen", RASTER)
647828   MDRV_SCREEN_REFRESH_RATE(60)
648   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
829
830
649831   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
650   MDRV_SCREEN_SIZE(64*8, 64*8)
651   MDRV_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 0*8, 32*8-1)
832   MDRV_SCREEN_SIZE(336, NUM_SCANLINES+NUM_VBLANK_LINES)
833   MDRV_SCREEN_VISIBLE_AREA(0,335, 0, NUM_SCANLINES-1)
652834
653   MDRV_PALETTE_LENGTH(8192)
835   MDRV_PALETTE_LENGTH(NUM_COLORS)
654836
837   MDRV_EEPROM_93C46_ADD("eeprom")
838
839   MDRV_MACHINE_START(wheelfir)
840
655841   MDRV_VIDEO_START(wheelfir)
656842   MDRV_VIDEO_UPDATE(wheelfir)
657843   MDRV_VIDEO_EOF(wheelfir)
844
845   /* sound hardware */
846   MDRV_SPEAKER_STANDARD_MONO("mono")
847
848   MDRV_SOUND_ADD("dac1", DAC, 0)
849   MDRV_SOUND_ADD("dac2", DAC, 0)
850   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
851
658852MACHINE_DRIVER_END
659853
660854
r8581r8582
663857   ROM_LOAD16_BYTE( "tch1.u19", 0x00001, 0x80000, CRC(33bbbc67) SHA1(c2ecc0ab522ee442076ea7b9536aee6e1fad0540) )
664858   ROM_LOAD16_BYTE( "tch2.u21", 0x00000, 0x80000, CRC(ed6b9e8a) SHA1(214c5aaf55963a219db33dd5d530492e09ad5e07) )
665859
666   ROM_REGION( 0x100000, "sub", 0 ) /* 68000 Code + sound samples */
860   ROM_REGION( 0x100000, "subcpu", 0 ) /* 68000 Code + sound samples */
667861   ROM_LOAD16_BYTE( "tch3.u83",  0x00001, 0x80000, CRC(43c014a6) SHA1(6c01a08dda204f36e8768795dd5d405576a49140) )
668862   ROM_LOAD16_BYTE( "tch11.u65", 0x00000, 0x80000, CRC(fc894b2e) SHA1(ebe6d1adf889731fb6f53b4ce5f09c60e2aefb97) )
669863
670   ROM_REGION( 0x400000, "gfx1", 0 ) // 512x512 gfx pages
864   ROM_REGION( 0x1000000, "gfx1", ROMREGION_ERASE00 ) // 512x512 gfx pages
671865   ROM_LOAD( "tch4.u52", 0x000000, 0x80000, CRC(fe4bc2c7) SHA1(33a2ef79cb13f9e7e7d513915c6e13c4e7fe0188) )
672866   ROM_LOAD( "tch5.u53", 0x080000, 0x80000, CRC(a38b9ca5) SHA1(083c9f700b9df1039fb553e918e205c6d32057ad) )
673867   ROM_LOAD( "tch6.u54", 0x100000, 0x80000, CRC(2733ae6b) SHA1(ebd91e123b670159f79be19a552d1ae0c8a0faff) )
r8581r8582
675869   ROM_LOAD( "tch8.u56", 0x200000, 0x80000, CRC(22b661fe) SHA1(b6edf8e1e8b479ee8813502157615f54627dc7c1) )
676870   ROM_LOAD( "tch9.u57", 0x280000, 0x80000, CRC(83c66de3) SHA1(50deaf3338d590340b928f891548c47ba8f3ca38) )
677871   ROM_LOAD( "tch10.u58",0x300000, 0x80000, CRC(2036ed80) SHA1(910381e2ccdbc2d06f873021d8af02795d22f595) )
678   ROM_LOAD( "tch12.u59",0x380000, 0x80000, CRC(cce2e675) SHA1(f3d8916077b2e057169d0f254005cd959789a3b3) ) // font is in here
872   ROM_LOAD( "tch12.u59",0x380000, 0x80000, CRC(cce2e675) SHA1(f3d8916077b2e057169d0f254005cd959789a3b3) )
679873ROM_END
680874
681875static DRIVER_INIT(wheelfir)
682876{
683877   UINT16 *RAM = (UINT16 *)memory_region(machine, "maincpu");
684   RAM[0xdd3da/2] = 0x4e71; // hack!
878   RAM[0xdd3da/2] = 0x4e71; //hack
685879}
686880
687881GAME( 199?, wheelfir,    0, wheelfir,    wheelfir,    wheelfir, ROT0,  "TCH", "Wheels & Fire", GAME_NOT_WORKING|GAME_NO_SOUND )
882
src/mame/drivers/onetwo.c
r8581r8582
348348
349349   memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
350350
351   state->maincpu = devtag_get_device(machine, "maincpu");
352   state->audiocpu = devtag_get_device(machine, "audiocpu");
351   state->maincpu = machine->device("maincpu");
352   state->audiocpu = machine->device("audiocpu");
353353}
354354
355355static MACHINE_DRIVER_START( onetwo )
src/mame/drivers/nbmj8891.c
r8581r8582
37973797
37983798dumped by sayu
37993799--- Team Japump!!! ---
3800http://japump.i.am/
38013800
38023801*/
38033802
src/mame/drivers/liberate.c
r8581r8582
801801{
802802   liberate_state *state = (liberate_state *)machine->driver_data;
803803
804   state->maincpu = devtag_get_device(machine, "maincpu");
805   state->audiocpu = devtag_get_device(machine, "audiocpu");
804   state->maincpu = machine->device("maincpu");
805   state->audiocpu = machine->device("audiocpu");
806806
807807   state_save_register_global(machine, state->background_disable);
808808   state_save_register_global(machine, state->background_color);
src/mame/drivers/laserbat.c
r8581r8582
676676{
677677   laserbat_state *state = (laserbat_state *)device->machine->driver_data;
678678
679   pia6821_cb1_w(state->pia, 0, state->cb1_toggle & 1);
679   pia6821_cb1_w(state->pia, state->cb1_toggle & 1);
680680   state->cb1_toggle ^= 1;
681681}
682682
r8581r8582
706706{
707707   laserbat_state *state = (laserbat_state *)machine->driver_data;
708708
709   state->audiocpu = devtag_get_device(machine, "audiocpu");
710   state->s2636_1 = devtag_get_device(machine, "s2636_1");
711   state->s2636_2 = devtag_get_device(machine, "s2636_2");
712   state->s2636_3 = devtag_get_device(machine, "s2636_3");
713   state->pia = devtag_get_device(machine, "pia");
714   state->sn = devtag_get_device(machine, "snsnd");
715   state->tms1 = devtag_get_device(machine, "tms1");
716   state->tms2 = devtag_get_device(machine, "tms2");
717   state->ay1 = devtag_get_device(machine, "ay1");
718   state->ay2 = devtag_get_device(machine, "ay2");
709   state->audiocpu = machine->device("audiocpu");
710   state->s2636_1 = machine->device("s2636_1");
711   state->s2636_2 = machine->device("s2636_2");
712   state->s2636_3 = machine->device("s2636_3");
713   state->pia = machine->device("pia");
714   state->sn = machine->device("snsnd");
715   state->tms1 = machine->device("tms1");
716   state->tms2 = machine->device("tms2");
717   state->ay1 = machine->device("ay1");
718   state->ay2 = machine->device("ay2");
719719
720720   state_save_register_global(machine, state->video_page);
721721   state_save_register_global(machine, state->input_mux);
src/mame/drivers/tp84.c
r8581r8582
116116   C = 0;
117117   if (offset & 0x008) C +=  47000;   /*  47000pF = 0.047uF */
118118   if (offset & 0x010) C += 470000;   /* 470000pF = 0.47uF */
119   filter_rc_set_RC(devtag_get_device(space->machine, "filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
119   filter_rc_set_RC(space->machine->device("filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
120120
121121   /* 76489 #1 (optional) */
122122   C = 0;
123123   if (offset & 0x020) C +=  47000;   /*  47000pF = 0.047uF */
124124   if (offset & 0x040) C += 470000;   /* 470000pF = 0.47uF */
125//  filter_rc_set_RC(devtag_get_device(space->machine, "filter2"),1000,2200,1000,C);
125//  filter_rc_set_RC(space->machine->device("filter2"),1000,2200,1000,C);
126126
127127   /* 76489 #2 */
128128   C = 0;
129129   if (offset & 0x080) C += 470000;   /* 470000pF = 0.47uF */
130   filter_rc_set_RC(devtag_get_device(space->machine, "filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
130   filter_rc_set_RC(space->machine->device("filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
131131
132132   /* 76489 #3 */
133133   C = 0;
134134   if (offset & 0x100) C += 470000;   /* 470000pF = 0.47uF */
135   filter_rc_set_RC(devtag_get_device(space->machine, "filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
135   filter_rc_set_RC(space->machine->device("filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
136136}
137137
138138static WRITE8_HANDLER( tp84_sh_irqtrigger_w )
src/mame/drivers/naomi.c
r8581r8582
171171
172172NAOMI ROM cart usage
173173-------------------------
174There are 3 know types of carts manufactured by Sega: 171-7919A, 171-7978B, 171-8132B
174There are 4 known types of carts manufactured by Sega: 171-7919A, 171-7978B, 171-8132B, 171-8346C
175175There are also 2 types of carts manufactured by Namco: MASK-B, MASK-C
176176
177177837-13668  171-7919A (C) Sega 1998
r8581r8582
192192      The other side of the cart PCB just has more locations for
193193      SOP44 MASKROMs... IC12S to IC21S (ROM12 to ROM21)
194194
195  IC1-IC21S - MaskROM (SOP44), either 32M or 64M. Not all positions are populated.
195  IC1-IC21S - MaskROM (SOP44), either 32Mb or 64Mb. Not all positions are populated.
196196      IC22  - EPROM (DIP42), either 27C160 or 27C322
197197      JP1   - JUMPER Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M
198198      IC37  - FLASHROM (SOIC8) Xicor X76F100 Secure SerialFlash
r8581r8582
283283      IC13S - EEPROM (SOIC8) 25LC040 serial EEPROM
284284      IC14  - 256 x 9 AsyncFIFO, 5.0V (SOP28)
285285      IC15  - SRAM (SOJ28) 32kx8, IDT71256
286IC17S-IC38S - MaskROM (SOP44), either 32M or 64M
286IC17S-IC38S - MaskROM (SOP44), either 32Mb or 64Mb
287287   CN1/2/3  - connectors joining to main board
288288
289289Games known to use this PCB include....
r8581r8582
316316|                                                          |
317317|        ----CN3----                    ----CN1----        |
318318|----------------------------------------------------------|
319
320319Notes:
320      The female side of the cart PCB only has traces
321321
322322      OSC1  - oscillator 28.000MHz
323  IC1-IC11  - MaskROM (TSOP48), 128M
323  IC1-IC11  - MaskROM (TSOP48), 128Mb
324324      IC22  - EPROM (DIP42), either 27C160 or 27C322
325325      JP1   - JUMPER Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M
326326      IC27  - PLD Sega 315-6319A ALTERA EPM7032 (PLCC44)
r8581r8582
349349
350350
351351
352171-8346C (C) Sega 2005
353|---------------------------------------------------------|
354|  IC12          IC8                    ----CN2----       -|
355|             (IC22,1-7)                    IC7            |
356|                          IC6                             |
357|  IC13          IC9                              IC4      |
358|             (IC8-15)                                     |
359|                            IC5            IC2      IC3   | male side
360|  IC14          IC10             JP1             IC16     |
361|             (IC16-21)           JP2                      |
362|                                           IC1            |
363|  IC15          IC11                                      |
364|        ----CN3----                    ----CN1----        |
365|----------------------------------------------------------|
366Notes:
367      The female side of the cart PCB only has traces
368
369      IC1   - 74LVCH16245A (16bit transceiver with direction pin)
370      IC2   - XC3S50 Xilinx Spartan FPGA (TQFP144)
371      IC3   - PIC16C621A EPROM-Based 8-Bit CMOS Microcontroller (PDIP18) with internal memory.
372              On the end of the number, -JPN means it requires Japanese BIOS, -COM will run with any BIOS
373      IC4   - XCF01SVG Xilinx Platform Flash In-System Programmable Configuration PROMS (TSSOP20)
374      IC5   - 74LVC08A (Quad 2-input AND gate)
375      IC6   - 74LVCH16245A (16bit transceiver with direction pin)
376      IC7   - empty socket for EPROM (DIP42), either 27C160 or 27C322
377  IC8-IC15  - S29GL512N FlashROM (TSOP56), 512Mb.
378      IC16  - R3112N431A Low voltage detector with output delay (SOT-23-5)
379      JP1   - JUMPER Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M
380      JP2   - JUMPER unknown function
381   CN1/2/3  - connectors joining to main board
382      CN4   - 6 legs connector for ISP programming
383
384   Games known to use this PCB include....
385                          Sticker    EPROM        # of SOP56
386Game                      on cart    IC7#         FLASHROMs   IC2#    IC3#          IC4#    Notes
387-----------------------------------------------------------------------------------------------------------------------
388Touch De Zunou (Rev A)    840-0166C  unpopulated   2 (512Mb)  XC3S50  317-0435-JPN  XCF01S  IC4# is marked "18"
389
390
352391      Note! Generally, games that require a special I/O board or controller will not boot at all with a
353392            standard NAOMI I/O board. Usually they display a message saying the I/O board is not acceptable
354393            or not connected properly.
r8581r8582
18161855static MACHINE_RESET( naomi )
18171856{
18181857   MACHINE_RESET_CALL(dc);
1819   aica_set_ram_base(devtag_get_device(machine, "aica"), dc_sound_ram, 8*1024*1024);
1858   aica_set_ram_base(machine->device("aica"), dc_sound_ram, 8*1024*1024);
18201859}
18211860
18221861/*
r8581r8582
46334672   NAOMIGD_BIOS
46344673   NAOMI_DEFAULT_EEPROM
46354674
4636   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4637
46384675   DISK_REGION( "gdrom" )
46394676   DISK_IMAGE_READONLY( "gdl-0001", 0, SHA1(615e19c22f32096f3aad557019a14313b60a4070) )
46404677
r8581r8582
46534690   NAOMIGD_BIOS
46544691   NAOMI_DEFAULT_EEPROM
46554692
4656   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4657
46584693   DISK_REGION( "gdrom" )
46594694   DISK_IMAGE_READONLY( "gdl-0002", 0, SHA1(af4669fdd7ce8e6ec4a170748d401e322a3d7ae8) )
46604695
r8581r8582
46714706   NAOMIGD_BIOS
46724707   NAOMI_DEFAULT_EEPROM
46734708
4674   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4675
46764709   DISK_REGION( "gdrom" )
46774710   DISK_IMAGE_READONLY( "gdl-0004", 0,  SHA1(7a7fba0fbbc769c5120b08e6d692f1ac63a42225) )
46784711
r8581r8582
46904723   NAOMIGD_BIOS
46914724   NAOMI_DEFAULT_EEPROM
46924725
4693   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4694
46954726   DISK_REGION( "gdrom" )
46964727   DISK_IMAGE_READONLY( "gdl-0006", 0, SHA1(b28d6598711b5a9c744bbf07ad03fc60962d2e28) )
46974728
r8581r8582
47094740   NAOMIGD_BIOS
47104741   NAOMI_DEFAULT_EEPROM
47114742
4712   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4713
47144743   DISK_REGION( "gdrom" )
47154744   DISK_IMAGE_READONLY( "gdl-0007a", 0, SHA1(56510390667b39b3915d8bc078660cbe093cf566) )
47164745
r8581r8582
47274756   NAOMIGD_BIOS
47284757   NAOMI_DEFAULT_EEPROM
47294758
4730   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4731
47324759   DISK_REGION( "gdrom" )
47334760   DISK_IMAGE_READONLY( "gdl-0010", 0, SHA1(65dcc22dd9e9b70975096464ad8e31a4a73dc5fd) )
47344761
r8581r8582
47464773   NAOMIGD_BIOS
47474774   NAOMI_DEFAULT_EEPROM
47484775
4749   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4750
47514776   DISK_REGION( "gdrom" )
47524777   DISK_IMAGE_READONLY( "gdl-0011", 0, SHA1(b7328eb2c588d55284bdcea0fe89bb8e629a8669) )
47534778
r8581r8582
47674792   NAOMIGD_BIOS
47684793   NAOMI_DEFAULT_EEPROM
47694794
4770   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4771
47724795   DISK_REGION( "gdrom" )
47734796   DISK_IMAGE_READONLY( "gdl-0012", 0, SHA1(aae4c1321fdee37d5405c6cbe648e0596624ed13) )
47744797
r8581r8582
47854808   NAOMIGD_BIOS
47864809   NAOMI_DEFAULT_EEPROM
47874810
4788   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
47894811
4812
47904813   DISK_REGION( "gdrom" )
47914814   DISK_IMAGE_READONLY( "gdl-0013", 0, SHA1(c8869069c28bc8eec96d820886bc388d69d46143) )
47924815
r8581r8582
48044827   NAOMIGD_BIOS
48054828   NAOMI_DEFAULT_EEPROM
48064829
4807   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
48084830
4831
48094832   DISK_REGION( "gdrom" )
48104833   DISK_IMAGE_READONLY( "gdl-0014a", 0, SHA1(f88d8203c8692f51c9492d5549a3ad7d9583dc6f) )
48114834
r8581r8582
48234846   NAOMIGD_BIOS
48244847   NAOMI_DEFAULT_EEPROM
48254848
4826   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
48274849
4850
48284851   DISK_REGION( "gdrom" )
48294852   DISK_IMAGE_READONLY( "gdl-0017", 0, SHA1(94a9319633388968611892e36691b45c94b4f83f) )
48304853
r8581r8582
48414864   NAOMIGD_BIOS
48424865   NAOMI_DEFAULT_EEPROM
48434866
4844   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
48454867
4868
48464869   DISK_REGION( "gdrom" )
48474870   DISK_IMAGE_READONLY( "gdl-0018", 0, SHA1(3e40ca7d43173fe7048d199fdc127b9411e10360) )
48484871
r8581r8582
48564879   NAOMIGD_BIOS
48574880   NAOMI_DEFAULT_EEPROM
48584881
4859   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
48604882
4883
48614884   DISK_REGION( "gdrom" )
48624885   DISK_IMAGE_READONLY( "gdl-0019a", 0, SHA1(d44906505ff698eda6feee6c2b9402e19f64e5d3) )
48634886
r8581r8582
48754898   NAOMIGD_BIOS
48764899   NAOMI_DEFAULT_EEPROM
48774900
4878   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
48794901
4902
48804903   DISK_REGION( "gdrom" )
48814904   DISK_IMAGE_READONLY( "gdl-0020", 0, SHA1(7b2ef47ca2038d6a93615b760b03e8f7cb1b83c2) )
48824905
r8581r8582
48944917   NAOMIGD_BIOS
48954918   NAOMI_DEFAULT_EEPROM
48964919
4897   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
48984920
4921
48994922   DISK_REGION( "gdrom" )
49004923   DISK_IMAGE_READONLY( "gdl-0021", 0, SHA1(f5036711a28a211e8d71400a8322db3172c5733f) )
49014924
r8581r8582
49134936   NAOMIGD_BIOS
49144937   NAOMI_DEFAULT_EEPROM
49154938
4916   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49174939
4940
49184941   DISK_REGION( "gdrom" )
49194942   DISK_IMAGE_READONLY( "gdl-0022", 0, SHA1(45deba05a12abbf6390c0fc0e4cdeaedfa7d2ca5) )
49204943
r8581r8582
49324955   NAOMIGD_BIOS
49334956   NAOMI_DEFAULT_EEPROM
49344957
4935   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49364958
4959
49374960   DISK_REGION( "gdrom" )
49384961   DISK_IMAGE_READONLY( "gdl-0023a", 0, SHA1(caac915104d61f2122f5afe27da1ef5fa9cf9f9a) )
49394962
r8581r8582
49524975   NAOMIGD_BIOS
49534976   NAOMI_DEFAULT_EEPROM
49544977
4955   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49564978
4979
49574980   DISK_REGION( "gdrom" )
49584981   DISK_IMAGE_READONLY( "gdl-0024", 0,  SHA1(d346762036fb1c40a261a434b50e63459f306f14) )
49594982
r8581r8582
49714994   NAOMIGD_BIOS
49724995   NAOMI_DEFAULT_EEPROM
49734996
4974   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49754997
4998
49764999   DISK_REGION( "gdrom" )
49775000   DISK_IMAGE_READONLY( "gdl-0025", 0, SHA1(be0d88eb4f48403a2ceaa7ef588ed60b96ba93bf) )
49785001
r8581r8582
49915014   NAOMIGD_BIOS
49925015   NAOMI_DEFAULT_EEPROM
49935016
4994   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49955017
5018
49965019   DISK_REGION( "gdrom" )
49975020   DISK_IMAGE_READONLY( "gdl-0026", 0, SHA1(e4c1e51292a7923b25bfc61d38fe386bf596002a) )
49985021
r8581r8582
50115034   NAOMIGD_BIOS
50125035   NAOMI_DEFAULT_EEPROM
50135036
5014   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
50155037
5038
50165039   DISK_REGION( "gdrom" )
50175040   DISK_IMAGE_READONLY( "gdl-0028c", 0, SHA1(66de09738551e351784cc9695a58b35fdf6b6c4b) )
50185041
r8581r8582
50305053   NAOMIGD_BIOS
50315054   NAOMI_DEFAULT_EEPROM
50325055
5033   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
50345056
5057
50355058   DISK_REGION( "gdrom" )
50365059   DISK_IMAGE_READONLY( "gdl-0030a", 0,  SHA1(1f7ade47e37a0026451b5baf3ba746400de8d156) )
50375060
r8581r8582
50485071   NAOMIGD_BIOS
50495072   NAOMI_DEFAULT_EEPROM
50505073
5051   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
50525074
5075
50535076   DISK_REGION( "gdrom" )
50545077   DISK_IMAGE_READONLY( "gdl-0030", 0,  SHA1(c7f25c05f47a490c5da9369c588b6136e93c280e) )
50555078
r8581r8582
50675090   NAOMIGD_BIOS
50685091   NAOMI_DEFAULT_EEPROM
50695092
5070   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5071
50725093   DISK_REGION( "gdrom" )
50735094   DISK_IMAGE_READONLY( "gdl-0031", 0, SHA1(83697f45f0ffbb964f0504b19171c554499cd709) )
50745095
r8581r8582
50865107   NAOMIGD_BIOS
50875108   NAOMI_DEFAULT_EEPROM
50885109
5089   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5090
50915110   DISK_REGION( "gdrom" )
50925111   DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(6091525845fc2042ed43cae5a1b60c603e16cf97) )
50935112
r8581r8582
51055124   NAOMIGD_BIOS
51065125   NAOMI_DEFAULT_EEPROM
51075126
5108   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5109
51105127   DISK_REGION( "gdrom" )
51115128   DISK_IMAGE_READONLY( "gdl-0032", 0, SHA1(ebd7a40e59082e660ebf9a2d4ae7cb64371dae8d) )
51125129
r8581r8582
51245141   NAOMIGD_BIOS
51255142   NAOMI_DEFAULT_EEPROM
51265143
5127   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5128
51295144   DISK_REGION( "gdrom" )
51305145   DISK_IMAGE_READONLY( "gdl-0033a", 0, SHA1(29de69ae97a9099b1bbe936dfa965bb4a3195f68) )
51315146
r8581r8582
51445159   NAOMIGD_BIOS
51455160   NAOMI_DEFAULT_EEPROM
51465161
5147   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5148
51495162   DISK_REGION( "gdrom" )
51505163   DISK_IMAGE_READONLY( "gdl-0034", 0, SHA1(10fd7edb0b620133c003d686e5af2ed27004fa09) )
51515164
r8581r8582
51635176   NAOMIGD_BIOS
51645177   NAOMI_DEFAULT_EEPROM
51655178
5166   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5167
51685179   DISK_REGION( "gdrom" )
51695180   DISK_IMAGE_READONLY( "gdl-0035", 0, SHA1(91da482a6a082e48bee5b3bd20d9c92d23936965) )
51705181
r8581r8582
51825193   NAOMIGD_BIOS
51835194   NAOMI_DEFAULT_EEPROM
51845195
5185   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5186
51875196   DISK_REGION( "gdrom" )
51885197   DISK_IMAGE_READONLY( "gdl-0036a", 0, SHA1(91f1e19136997cb1e2edfb1ad342b9427d1d3bfb) )
51895198
r8581r8582
52015210   NAOMIGD_BIOS
52025211   NAOMI_DEFAULT_EEPROM
52035212
5204   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5205
52065213   DISK_REGION( "gdrom" )
52075214   DISK_IMAGE_READONLY( "gdl-0037", 0, SHA1(99ffe2987e3002b3871daf276d2be45f2e9c6e74) )
52085215
5209
52105216   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
52115217   //ROM_LOAD("317-5122-jpn.data", 0x00, 0x50, CRC(0b85b7e4) SHA1(f4e419682ddc4b98a330e5ae543f9276c9bde030) )
52125218
r8581r8582
52215227   NAOMIGD_BIOS
52225228   NAOMI_DEFAULT_EEPROM
52235229
5224   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5225
52265230   DISK_REGION( "gdrom" )
52275231   DISK_IMAGE_READONLY( "gdl-0038", 0, SHA1(430572f7e76c4fe009e2de91bf891d85613366b7) )
52285232
5229
52305233   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
52315234
52325235   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
r8581r8582
52405243   NAOMIGD_BIOS
52415244   NAOMI_DEFAULT_EEPROM
52425245
5243   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5244
52455246   DISK_REGION( "gdrom" )
52465247   DISK_IMAGE_READONLY( "gdl-0039", 0, SHA1(ffc7f6e113ad69422a4f22f318bdf9b1dc5c25db) )
52475248
r8581r8582
52585259   NAOMIGD_BIOS
52595260   NAOMI_DEFAULT_EEPROM
52605261
5261   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5262
52635262   DISK_REGION( "gdrom" )
52645263   DISK_IMAGE_READONLY( "gdl-0039a", 0, SHA1(e6aa3d65b43a20606e6754bcb8665438770a1f8c) )
52655264
r8581r8582
52775276   NAOMIGD_BIOS
52785277   NAOMI_DEFAULT_EEPROM
52795278
5280   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5281
52825279   DISK_REGION( "gdrom" )
52835280   DISK_IMAGE_READONLY( "gdl-0040", 0, SHA1(a62c8d4b6c5be44a4aeeea1a1a94f3d0fe542593) )
52845281
r8581r8582
53175314   NAOMIGD_BIOS
53185315   NAOMI_DEFAULT_EEPROM
53195316
5320   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5321
53225317   DISK_REGION( "gdrom" )
53235318   DISK_IMAGE_READONLY( "gdl-0041", 0, SHA1(3a589e1c79ead971c821a7566032b0187e339684) )
53245319
r8581r8582
53355330   NAOMIGD_BIOS
53365331   NAOMI_DEFAULT_EEPROM
53375332
5338   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5339
53405333   DISK_REGION( "gdrom" )
53415334   DISK_IMAGE_READONLY( "gdl-0042", 0, SHA1(984a4fa012d83dd8c748304958c847c9867f4125) )
53425335
r8581r8582
53775370   NAOMIGD_BIOS
53785371   NAOMI_DEFAULT_EEPROM
53795372
5380   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5381
53825373   DISK_REGION( "gdrom" )
53835374   DISK_IMAGE_READONLY( "gds-0001", 0, SHA1(bd05f197ba8643577883dd25d9d5a74c91b27ca9) )
53845375
r8581r8582
53945385   NAOMIGD_BIOS
53955386   NAOMI_DEFAULT_EEPROM
53965387
5397   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5398
53995388   DISK_REGION( "gdrom" )
54005389   DISK_IMAGE_READONLY( "gds-0003", 0, SHA1(caaba214c1faca78b3370bcd4190eb2853d7f825) )
54015390
r8581r8582
54135402   NAOMIGD_BIOS
54145403   NAOMI_DEFAULT_EEPROM
54155404
5416   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5417
54185405   DISK_REGION( "gdrom" )
54195406   DISK_IMAGE_READONLY( "gds-0004", 0, SHA1(3cce788393ed194ba9b603f9896ff893691d6b00) )
54205407
r8581r8582
54325419   NAOMIGD_BIOS
54335420   NAOMI_DEFAULT_EEPROM
54345421
5435   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5436
54375422   DISK_REGION( "gdrom" )
54385423   DISK_IMAGE_READONLY( "gds-0005", 0, SHA1(d1c3fb2350e4a89372373e7f629c42b741af29b3) )
54395424
r8581r8582
54725457   NAOMIGD_BIOS
54735458   NAOMI_DEFAULT_EEPROM
54745459
5475   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5476
54775460   DISK_REGION( "gdrom" )
54785461   DISK_IMAGE_READONLY( "gds-0008", 0, SHA1(2fadcd141bdbde77b2b335b270959a516af44d99) )
54795462
r8581r8582
55205503   ROM_REGION( 0x10000, "io_board", 0)
55215504   ROM_LOAD("epr-22084.ic3", 0x0000, 0x10000, CRC(18cf58bb) SHA1(1494f8215231929e41bbe2a133658d01882fbb0f) )
55225505
5523   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5524
55255506   DISK_REGION( "gdrom" )
5526   DISK_IMAGE_READONLY( "gds-0009", 0, SHA1(d502155ddaf881c2c9505528004b9904aa32a59c) )
5507   DISK_IMAGE_READONLY( "gds-0009a", 0, SHA1(d502155ddaf881c2c9505528004b9904aa32a59c) )
55275508
55285509   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
55295510   //ROM_LOAD("317-0308-com.data", 0x00, 0x50,  CRC(56f63af0) SHA1(3c453226fc53d2f700b3634db3ef8ce206d94392) )
r8581r8582
55395520   NAOMIGD_BIOS
55405521   NAOMI_DEFAULT_EEPROM
55415522
5542   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5543
55445523   DISK_REGION( "gdrom" )
55455524   DISK_IMAGE_READONLY( "gds-0010", 0,  SHA1(c3135ede3a8bdadab91aed49abacbfbde8037069) )
55465525
r8581r8582
55585537   NAOMIGD_BIOS
55595538   NAOMI_DEFAULT_EEPROM
55605539
5561   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5562
55635540   DISK_REGION( "gdrom" )
55645541   DISK_IMAGE_READONLY( "gds-0011", 0,  SHA1(b778403d73c8cdd13383691c9be2094ddfc1ba84) )
55655542
r8581r8582
55765553   NAOMIGD_BIOS
55775554   NAOMI_DEFAULT_EEPROM
55785555
5579   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5580
55815556   DISK_REGION( "gdrom" )
55825557   DISK_IMAGE_READONLY( "gds-0017", 0, SHA1(fb86eff3ef38de7fd78cfde897d5332d2092c172) )
55835558
r8581r8582
55945569   NAOMIGD_BIOS
55955570   NAOMI_DEFAULT_EEPROM
55965571
5597   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5598
55995572   DISK_REGION( "gdrom" )
56005573   DISK_IMAGE_READONLY( "gds-0019", 0, SHA1(955d3c0cb991be3057138c562cff69c5ef887787) )
56015574
r8581r8582
56365609   NAOMIGD_BIOS
56375610   NAOMI_DEFAULT_EEPROM
56385611
5639   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5640
56415612   DISK_REGION( "gdrom" )
56425613   DISK_IMAGE_READONLY( "gds-0015a", 0, SHA1(c6e9c9901bd4f075454b7f18baf08df81bc2f1ad) )
56435614
r8581r8582
56545625   NAOMIGD_BIOS
56555626   NAOMI_DEFAULT_EEPROM
56565627
5657   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5658
56595628   DISK_REGION( "gdrom" )
56605629   DISK_IMAGE_READONLY( "gds-0018", 0, SHA1(0633a99a666f363ab30450a76b9753685d6b1f57) )
56615630
r8581r8582
56715640   NAOMIGD_BIOS
56725641   NAOMI_DEFAULT_EEPROM
56735642
5674   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5675
56765643   DISK_REGION( "gdrom" )
56775644   DISK_IMAGE_READONLY( "gds-0021a", 0,  SHA1(15c6f9434494a31693cbb8e33da36e0e8a8f7c62) )
56785645
r8581r8582
57125679   NAOMIGD_BIOS
57135680   NAOMI_DEFAULT_EEPROM
57145681
5715   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5716
57175682   DISK_REGION( "gdrom" )
57185683   DISK_IMAGE_READONLY( "gds-0022", 0, SHA1(70b41745225006e7876176cbd239edecd4c3f8b6) )
57195684
r8581r8582
57305695   NAOMIGD_BIOS
57315696   NAOMI_DEFAULT_EEPROM
57325697
5733   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5734
57355698   DISK_REGION( "gdrom" )
57365699   DISK_IMAGE_READONLY( "gds-0023a", 0, SHA1(cd9d808b59eb8f40673ec4353d476f2b9c7f783c) )
57375700
r8581r8582
57495712   NAOMIGD_BIOS
57505713   NAOMI_DEFAULT_EEPROM
57515714
5752   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5753
57545715   DISK_REGION( "gdrom" )
57555716   DISK_IMAGE_READONLY( "gds-0023c", 0, SHA1(1fcb5530748886f4c4f45487d047859182ff7496))
57565717
r8581r8582
57685729   NAOMIGD_BIOS
57695730   NAOMI_DEFAULT_EEPROM
57705731
5771   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5772
57735732   DISK_REGION( "gdrom" )
57745733   DISK_IMAGE_READONLY( "gds-0031", 0, SHA1(da2d421da9472b149619b6931bb2fe624be75fa2) )
57755734
r8581r8582
58525811//GDS-0006 Virtua Striker 3 (NAOMI 2)
58535812//GDS-0007 Shakatto Tambourine Motto Norinori Shinkyoku Tsuika
58545813GAME( 2001, monkeyba,  naomigd,  naomigd,  naomi,    naomi,  ROT0, "Sega",          "Monkey Ball (GDS-0008)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5855GAME( 2001, dygolf,    naomigd,  naomigd,  naomi,    naomi,  ROT0, "Sega",          "Virtua Golf / Dynamic Golf (GDS-0009)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5814GAME( 2001, dygolf,    naomigd,  naomigd,  naomi,    naomi,  ROT0, "Sega",          "Virtua Golf / Dynamic Golf (Rev A) (GDS-0009A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
58565815GAME( 2001, wsbbgd,    naomigd,  naomigd,  naomi,    naomi,  ROT0, "Sega",          "World Series Baseball / Super Major League (GDS-0010)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
58575816GAME( 2001, vtennisg,  naomigd,  naomigd,  naomi,    naomi,  ROT0, "Sega",          "Virtua Tennis (GDS-0011)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
58585817//GDS-0012 Virtua Fighter 4 (NAOMI 2)
r8581r8582
60255984   NAOMI2_BIOS
60265985   NAOMI_DEFAULT_EEPROM
60275986
6028   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6029
60305987   DISK_REGION( "gdrom" )
60315988   DISK_IMAGE_READONLY( "gds-0006", 0, SHA1(aca09a88506f5e462ad3fb33eac5478a2a010609) )
60325989
r8581r8582
60436000   NAOMI2_BIOS
60446001   NAOMI_DEFAULT_EEPROM
60456002
6046   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6047
60486003   DISK_REGION( "gdrom" )
60496004   DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(c34588f59c6091cd1c3ef235171dad8d5247e707) )
60506005
r8581r8582
60626017   NAOMI2_BIOS
60636018   NAOMI_DEFAULT_EEPROM
60646019
6065   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6066
60676020   DISK_REGION( "gdrom" )
60686021   DISK_IMAGE_READONLY( "gds-0012b", 0, SHA1(9b8e05c3d28a09323b13c198dfcc2b771bba67cd) )
60696022
r8581r8582
60816034   NAOMI2_BIOS
60826035   NAOMI_DEFAULT_EEPROM
60836036
6084   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6085
60866037   DISK_REGION( "gdrom" )
60876038   DISK_IMAGE_READONLY( "gds-0012c", 0, SHA1(0ec149d7edfb326777cdc45a2ac8ad578a32aba1) )
60886039
r8581r8582
61016052   NAOMI2_BIOS
61026053   NAOMI_DEFAULT_EEPROM
61036054
6104   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6105
61066055   DISK_REGION( "gdrom" )
61076056   DISK_IMAGE_READONLY( "gds-0024b", 0, SHA1(a829169542f3bed76095ad6bfbbde7d494d04d72) )
61086057
r8581r8582
61206069   NAOMI2_BIOS
61216070   NAOMI_DEFAULT_EEPROM
61226071
6123   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6124
61256072   DISK_REGION( "gdrom" )
61266073   DISK_IMAGE_READONLY( "gds-0024a", 0, SHA1(6225e778d73db18be26f882d4f9cd3b3a136d1c9) )
61276074
r8581r8582
61386085   NAOMI2_BIOS
61396086   NAOMI_DEFAULT_EEPROM
61406087
6141   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6142
61436088   DISK_REGION( "gdrom" )
61446089   DISK_IMAGE_READONLY( "gds-0026", 0, SHA1(253acede106b7fbf49e24458e7fda868720e9549) )
61456090
r8581r8582
61516096   NAOMI2_BIOS
61526097   NAOMI_DEFAULT_EEPROM
61536098
6154   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6155
61566099   DISK_REGION( "gdrom" )
61576100   DISK_IMAGE_READONLY( "gds-0036f", 0, SHA1(ea35d6ecdf94e5c9a545952758da80f658755df0) )
61586101
r8581r8582
61696112   NAOMI2_BIOS
61706113   NAOMI_DEFAULT_EEPROM
61716114
6172   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6173
61746115   DISK_REGION( "gdrom" )
61756116   DISK_IMAGE_READONLY( "gds-0036d", 0, SHA1(2f7654307a4c978c5af6c8238c44e70275dd34f9) )
61766117
r8581r8582
61896130   NAOMI2_BIOS
61906131   NAOMI_DEFAULT_EEPROM
61916132
6192   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6193
61946133   DISK_REGION( "gdrom" )
61956134   DISK_IMAGE_READONLY( "gds-0036a", 0, SHA1(cd630fc4e8f7ed5641b85c609584d7efe0eac137) )
61966135
r8581r8582
62306169
62316170ROM_START( beachspi )
62326171   NAOMI2_BIOS
6233//  NAOMIGD_BIOS
62346172   NAOMI_DEFAULT_EEPROM
62356173
6236   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6237
62386174   DISK_REGION( "gdrom" )
62396175   DISK_IMAGE_READONLY( "gds-0014", 0, SHA1(1ebb3695196c11a86276e034df2e1c8d7fa6b96f) )
62406176
r8581r8582
62506186
62516187ROM_START( initd )
62526188   NAOMI2_BIOS
6253//  NAOMIGD_BIOS
62546189   NAOMI_DEFAULT_EEPROM
62556190
6256   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6257
62586191   DISK_REGION( "gdrom" )
62596192   DISK_IMAGE_READONLY( "gds-0020b", 0, SHA1(c0e901623ef4fcd97b7e4d29ae556e6f2e91b8ad) )
62606193
r8581r8582
62726205
62736206ROM_START( initdexp )
62746207   NAOMI2_BIOS
6275//  NAOMIGD_BIOS
62766208   NAOMI_DEFAULT_EEPROM
62776209
6278   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6279
62806210   DISK_REGION( "gdrom" )
62816211   DISK_IMAGE_READONLY( "gds-0025", 0, SHA1(8ea92cf6b493f21b9453832edad7cbc5e5b350c1) )
62826212
r8581r8582
62896219
62906220ROM_START( initdv3j )
62916221   NAOMI2_BIOS
6292//  NAOMIGD_BIOS
62936222   NAOMI_DEFAULT_EEPROM
62946223
6295   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
6296
62976224   DISK_REGION( "gdrom" )
62986225   DISK_IMAGE_READONLY( "gds-0032b", 0, SHA1(568411aa72ca308a03a6b5b61c79833464b88bc6) )
62996226
src/mame/drivers/cheekyms.c
r8581r8582
113113{
114114   cheekyms_state *state = (cheekyms_state *)machine->driver_data;
115115
116   state->maincpu = devtag_get_device(machine, "maincpu");
117   state->dac = devtag_get_device(machine, "dac");
116   state->maincpu = machine->device("maincpu");
117   state->dac = machine->device("dac");
118118}
119119
120120static MACHINE_DRIVER_START( cheekyms )
src/mame/drivers/stv.c
r8581r8582
9494-Add the RS232c interface (serial port),needed by fhboxers.
9595-(PCB owners) check if the clocks documented in the manuals are really right for ST-V.
9696-SCSP to master irq: see if there is a sound cpu mask bit.
97-Does the cpu_set_clock really works?Investigate.
97-Does the device_set_clock really works?Investigate.
9898-We need to check every game if can be completed or there are any hanging/crash/protection
9999 issues on them.
100100-Memo: Some tests done on the original & working PCB,to be implemented:
r8581r8582
477477      return_data = input_port_read(space->machine, "DSW1");
478478
479479   if (offset == 0x77)//PDR2 read
480      return_data=  (0xfe | eeprom_read_bit(devtag_get_device(space->machine, "eeprom")));
480      return_data=  (0xfe | eeprom_read_bit(space->machine->device("eeprom")));
481481
482482//  if (offset == 0x33) //country code
483483//      return_data = input_port_read(machine, "FAKE");
r8581r8582
19711971   logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data);
19721972   cpuexec_boost_interleave(space->machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost));
19731973   cpuexec_trigger(space->machine, 1000);
1974   sh2_set_frt_input(devtag_get_device(space->machine, "slave"), PULSE_LINE);
1974   sh2_set_frt_input(space->machine->device("slave"), PULSE_LINE);
19751975}
19761976
19771977static WRITE32_HANDLER( sinit_w )
19781978{
19791979   logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data);
19801980   cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost));
1981   sh2_set_frt_input(devtag_get_device(space->machine, "maincpu"), PULSE_LINE);
1981   sh2_set_frt_input(space->machine->device("maincpu"), PULSE_LINE);
19821982}
19831983
19841984
r8581r8582
23552355   // do strict overwrite verification - maruchan and rsgun crash after coinup without this.
23562356   // cottonbm needs strict PCREL
23572357   // todo: test what games need this and don't turn it on for them...
2358   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
2359   sh2drc_set_options(devtag_get_device(machine, "slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
2358   sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
2359   sh2drc_set_options(machine->device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
23602360
23612361   /* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */
23622362   memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write );
r8581r8582
25972597   stv_slave = machine->device<cpu_device>("slave");
25982598   stv_audiocpu = machine->device<cpu_device>("audiocpu");
25992599
2600   scsp_set_ram_base(devtag_get_device(machine, "scsp"), sound_ram);
2600   scsp_set_ram_base(machine->device("scsp"), sound_ram);
26012601
26022602   // save states
26032603   state_save_register_global_pointer(machine, smpc_ram, 0x80);
src/mame/drivers/megatech.c
r8581r8582
489489//attotime_never
490490static VIDEO_UPDATE(mtnew)
491491{
492   running_device *megadriv_screen = devtag_get_device(screen->machine, "megadriv");
493   running_device *menu_screen     = devtag_get_device(screen->machine, "menu");
492   running_device *megadriv_screen = screen->machine->device("megadriv");
493   running_device *menu_screen     = screen->machine->device("menu");
494494
495495   if (screen == megadriv_screen)
496496   {
src/mame/drivers/vamphalf.c
r8581r8582
854854Vamp 1/2 (Semi Vamp)
855855Danbi, 1999
856856
857Official page here...
858http://f2.co.kr/eng/product/intro1-17.asp
859857
860
861858PCB Layout
862859----------
863860             KA12    VROM1.
src/mame/drivers/bishi.c
r8581r8582
402402{
403403   bishi_state *state = (bishi_state *)machine->driver_data;
404404
405   state->maincpu = devtag_get_device(machine, "maincpu");
406   state->k056832 = devtag_get_device(machine, "k056832");
407   state->k054338 = devtag_get_device(machine, "k054338");
408   state->k055555 = devtag_get_device(machine, "k055555");
405   state->maincpu = machine->device("maincpu");
406   state->k056832 = machine->device("k056832");
407   state->k054338 = machine->device("k054338");
408   state->k055555 = machine->device("k055555");
409409
410410   state_save_register_global(machine, state->cur_control);
411411   state_save_register_global(machine, state->cur_control2);
src/mame/drivers/1942.c
r8581r8582
238238{
239239   _1942_state *state = (_1942_state *)machine->driver_data;
240240
241   state->audiocpu = devtag_get_device(machine, "audiocpu");
241   state->audiocpu = machine->device("audiocpu");
242242
243243   state_save_register_global(machine, state->palette_bank);
244244   state_save_register_global_array(machine, state->scroll);
src/mame/drivers/galaxia.c
r8581r8582
3838   bitmap_t *s2636_1_bitmap;
3939   bitmap_t *s2636_2_bitmap;
4040
41   running_device *s2636_0 = devtag_get_device(screen->machine, "s2636_0");
42   running_device *s2636_1 = devtag_get_device(screen->machine, "s2636_1");
43   running_device *s2636_2 = devtag_get_device(screen->machine, "s2636_2");
41   running_device *s2636_0 = screen->machine->device("s2636_0");
42   running_device *s2636_1 = screen->machine->device("s2636_1");
43   running_device *s2636_2 = screen->machine->device("s2636_2");
4444
4545   count = 0;
4646
src/mame/drivers/fromanc2.c
r8581r8582
517517{
518518   fromanc2_state *state = (fromanc2_state *)machine->driver_data;
519519
520   state->audiocpu = devtag_get_device(machine, "audiocpu");
521   state->subcpu = devtag_get_device(machine, "sub");
522   state->eeprom = devtag_get_device(machine, "eeprom");
523   state->left_screen = devtag_get_device(machine, "lscreen");
524   state->right_screen = devtag_get_device(machine, "rscreen");
520   state->audiocpu = machine->device("audiocpu");
521   state->subcpu = machine->device("sub");
522   state->eeprom = machine->device("eeprom");
523   state->left_screen = machine->device("lscreen");
524   state->right_screen = machine->device("rscreen");
525525
526526   state_save_register_global(machine, state->portselect);
527527   state_save_register_global(machine, state->sndcpu_nmi_flag);
src/mame/drivers/rallyx.c
r8581r8582
241241
242242      case 0x02:   /* SOUND ON */
243243         /* this doesn't work in New Rally X so I'm not supporting it */
244//          pacman_sound_enable_w(devtag_get_device(space->machine, "namco"), bit);
244//          pacman_sound_enable_w(space->machine->device("namco"), bit);
245245         break;
246246
247247      case 0x03:   /* FLIP */
r8581r8582
877877   timeplt_state *state = (timeplt_state *)machine->driver_data;
878878
879879   state->maincpu = machine->device<cpu_device>("maincpu");
880   state->samples = devtag_get_device(machine, "samples");
880   state->samples = machine->device("samples");
881881
882882   state_save_register_global(machine, state->last_bang);
883883   state_save_register_global(machine, state->stars_enable);
src/mame/drivers/bnstars.c
r8581r8582
489489
490490static VIDEO_UPDATE(bnstars)
491491{
492   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
493   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
492   running_device *left_screen  = screen->machine->device("lscreen");
493   running_device *right_screen = screen->machine->device("rscreen");
494494
495495   bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
496496
r8581r8582
12931293{
12941294   irqreq = 0;
12951295   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
1296   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
1296   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
12971297}
12981298
12991299static void irq_raise(running_machine *machine, int level)
src/mame/drivers/diverboy.c
r8581r8582
247247{
248248   diverboy_state *state = (diverboy_state *)machine->driver_data;
249249
250   state->audiocpu = devtag_get_device(machine, "audiocpu");
250   state->audiocpu = machine->device("audiocpu");
251251}
252252
253253static MACHINE_DRIVER_START( diverboy )
src/mame/drivers/superchs.c
r8581r8582
150150
151151         if (ACCESSING_BITS_0_7)
152152         {
153            running_device *device = devtag_get_device(space->machine, "eeprom");
153            running_device *device = space->machine->device("eeprom");
154154            eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
155155            eeprom_write_bit(device, data & 0x40);
156156            eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/xain.c
r8581r8582
288288   from_main = data;
289289   _mcu_accept = 0;
290290
291   if (devtag_get_device(space->machine, "mcu") != NULL)
291   if (space->machine->device("mcu") != NULL)
292292      cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
293293}
294294
r8581r8582
378378{
379379   UINT8 res = 0;
380380
381   if (devtag_get_device(field->port->machine, "mcu") != NULL)
381   if (field->port->machine->device("mcu") != NULL)
382382   {
383383      if (_mcu_ready == 1)
384384         res |= 0x01;
r8581r8582
398398   _mcu_ready = 1;
399399   _mcu_accept = 1;
400400
401   if (devtag_get_device(space->machine, "mcu") != NULL)
401   if (space->machine->device("mcu") != NULL)
402402      cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
403403
404404   return 0xff;
src/mame/drivers/namcos1.c
r8581r8582
384384
385385static void namcos1_update_DACs(running_machine *machine)
386386{
387   dac_signed_data_16_w(devtag_get_device(machine, "dac"),0x8000 + (dac0_value * dac0_gain) + (dac1_value * dac1_gain));
387   dac_signed_data_16_w(machine->device("dac"),0x8000 + (dac0_value * dac0_gain) + (dac1_value * dac1_gain));
388388}
389389
390390void namcos1_init_DACs(void)
src/mame/drivers/firefox.c
r8581r8582
100100
101101static WRITE8_HANDLER( audio_enable_w )
102102{
103   sound_set_output_gain(devtag_get_device(space->machine, "ldsound"), ~offset & 1, (data & 0x80) ? 1.0 : 0.0);
103   sound_set_output_gain(space->machine->device("ldsound"), ~offset & 1, (data & 0x80) ? 1.0 : 0.0);
104104}
105105
106106static WRITE8_HANDLER( firefox_disc_reset_w )
r8581r8582
304304
305305static WRITE8_DEVICE_HANDLER( riot_porta_w )
306306{
307   running_device *tms = devtag_get_device(device->machine, "tms");
307   running_device *tms = device->machine->device("tms");
308308
309309   /* handle 5220 read */
310310   tms5220_rsq_w(tms, (data>>1) & 1);
r8581r8582
430430static MACHINE_START( firefox )
431431{
432432   memory_configure_bank(machine, "bank1", 0, 32, memory_region(machine, "maincpu") + 0x10000, 0x1000);
433   nvram_1c = devtag_get_device(machine, "nvram_1c");
434   nvram_1d = devtag_get_device(machine, "nvram_1d");
433   nvram_1c = machine->device("nvram_1c");
434   nvram_1d = machine->device("nvram_1d");
435435
436   laserdisc = devtag_get_device(machine, "laserdisc");
436   laserdisc = machine->device("laserdisc");
437437   vp931_set_data_ready_callback(laserdisc, firq_gen);
438438
439439   control_num = 0;
src/mame/drivers/mainevt.c
r8581r8582
422422
423423   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
424424
425   state->maincpu = devtag_get_device(machine, "maincpu");
426   state->audiocpu = devtag_get_device(machine, "audiocpu");
427   state->upd = devtag_get_device(machine, "upd");
428   state->k007232 = devtag_get_device(machine, "k007232");
429   state->k052109 = devtag_get_device(machine, "k052109");
430   state->k051960 = devtag_get_device(machine, "k051960");
425   state->maincpu = machine->device("maincpu");
426   state->audiocpu = machine->device("audiocpu");
427   state->upd = machine->device("upd");
428   state->k007232 = machine->device("k007232");
429   state->k052109 = machine->device("k052109");
430   state->k051960 = machine->device("k051960");
431431
432432   state_save_register_global(machine, state->nmi_enable);
433433}
src/mame/drivers/junofrst.c
r8581r8582
283283   timeplt_state *state = (timeplt_state *)machine->driver_data;
284284
285285   state->maincpu = machine->device<cpu_device>("maincpu");
286   state->i8039 = devtag_get_device(machine, "mcu");
286   state->i8039 = machine->device("mcu");
287287   state->soundcpu = machine->device<cpu_device>("audiocpu");
288   state->filter_0_0 = devtag_get_device(machine, "filter.0.0");
289   state->filter_0_1 = devtag_get_device(machine, "filter.0.1");
290   state->filter_0_2 = devtag_get_device(machine, "filter.0.2");
288   state->filter_0_0 = machine->device("filter.0.0");
289   state->filter_0_1 = machine->device("filter.0.1");
290   state->filter_0_2 = machine->device("filter.0.2");
291291
292292   state_save_register_global(machine, state->i8039_status);
293293   state_save_register_global(machine, state->last_irq);
src/mame/drivers/nbmj8688.c
r8581r8582
34653465
34663466dumped by sayu
34673467--- Team Japump!!! ---
3468http://japump.i.am/
34693468
34703469*/
34713470
src/mame/drivers/taito_h.c
r8581r8582
529529
530530   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
531531
532   state->audiocpu = devtag_get_device(machine, "audiocpu");
533   state->tc0220ioc = devtag_get_device(machine, "tc0220ioc");
534   state->tc0080vco = devtag_get_device(machine, "tc0080vco");
532   state->audiocpu = machine->device("audiocpu");
533   state->tc0220ioc = machine->device("tc0220ioc");
534   state->tc0080vco = machine->device("tc0080vco");
535535
536536   state_save_register_global(machine, state->banknum);
537537   state_save_register_postload(machine, taitoh_postload, NULL);
src/mame/drivers/ginganin.c
r8581r8582
306306{
307307   ginganin_state *state = (ginganin_state *)machine->driver_data;
308308
309   state->audiocpu = devtag_get_device(machine, "audiocpu");
309   state->audiocpu = machine->device("audiocpu");
310310
311311   state_save_register_global(machine, state->layers_ctrl);
312312   state_save_register_global(machine, state->flipscreen);
src/mame/drivers/tail2nos.c
r8581r8582
214214   memory_configure_bank(machine, "bank3", 0, 2, &ROM[0x10000], 0x8000);
215215   memory_set_bank(machine, "bank3", 0);
216216
217   state->maincpu = devtag_get_device(machine, "maincpu");
218   state->audiocpu = devtag_get_device(machine, "audiocpu");
219   state->k051316 = devtag_get_device(machine, "k051316");
217   state->maincpu = machine->device("maincpu");
218   state->audiocpu = machine->device("audiocpu");
219   state->k051316 = machine->device("k051316");
220220
221221   state_save_register_global(machine, state->charbank);
222222   state_save_register_global(machine, state->charpalette);
src/mame/drivers/slapshot.c
r8581r8582
538538
539539   memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000);
540540
541   state->maincpu = devtag_get_device(machine, "maincpu");
542   state->audiocpu = devtag_get_device(machine, "audiocpu");
543   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
544   state->tc0480scp = devtag_get_device(machine, "tc0480scp");
545   state->tc0360pri = devtag_get_device(machine, "tc0360pri");
546   state->tc0640fio = devtag_get_device(machine, "tc0640fio");
541   state->maincpu = machine->device("maincpu");
542   state->audiocpu = machine->device("audiocpu");
543   state->tc0140syt = machine->device("tc0140syt");
544   state->tc0480scp = machine->device("tc0480scp");
545   state->tc0360pri = machine->device("tc0360pri");
546   state->tc0640fio = machine->device("tc0640fio");
547547
548548   state->banknum = 0;
549549   state_save_register_global(machine, state->banknum);
src/mame/drivers/meritm.c
r8581r8582
963963
964964static MACHINE_START(merit_common)
965965{
966   meritm_z80pio[0] = devtag_get_device( machine, "z80pio_0" );
967   meritm_z80pio[1] = devtag_get_device( machine, "z80pio_1" );
966   meritm_z80pio[0] = machine->device( "z80pio_0" );
967   meritm_z80pio[1] = machine->device( "z80pio_1" );
968968
969969   z80pio_astb_w(meritm_z80pio[0], 1);
970970   z80pio_bstb_w(meritm_z80pio[0], 1);
src/mame/drivers/vsnes.c
r8581r8582
155155static WRITE8_HANDLER( sprite_dma_0_w )
156156{
157157   int source = ( data & 7 );
158   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu1"), source );
158   ppu2c0x_spriteram_dma( space, space->machine->device("ppu1"), source );
159159}
160160
161161static WRITE8_HANDLER( sprite_dma_1_w )
162162{
163163   int source = ( data & 7 );
164   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu2"), source );
164   ppu2c0x_spriteram_dma( space, space->machine->device("ppu2"), source );
165165}
166166
167167static WRITE8_HANDLER( vsnes_coin_counter_w )
src/mame/drivers/missile.c
r8581r8582
679679
680680   /* POKEY */
681681   else if (offset < 0x4800)
682      pokey_w(devtag_get_device(space->machine, "pokey"), offset & 0x0f, data);
682      pokey_w(space->machine->device("pokey"), offset & 0x0f, data);
683683
684684   /* OUT0 */
685685   else if (offset < 0x4900)
r8581r8582
738738
739739   /* POKEY */
740740   else if (offset < 0x4800)
741      result = pokey_r(devtag_get_device(space->machine, "pokey"), offset & 0x0f);
741      result = pokey_r(space->machine->device("pokey"), offset & 0x0f);
742742
743743   /* IN0 */
744744   else if (offset < 0x4900)
src/mame/drivers/go2000.c
r8581r8582
1414 3 Windbond W24257AK-15 (near TM29F550ZX)
1515 2 UM61256AK-15 (near Z80)
1616
17P1, P2 & P3 4-pin connectors (unkown purpose)
17P1, P2 & P3 4-pin connectors (unknown purpose)
1818
19192008-08:
2020Added Dips and Dip locations based on Service Mode.
r8581r8582
316316
317317   memory_set_bank(machine, "bank1", 0);
318318
319   state->soundcpu = devtag_get_device(machine, "soundcpu");
319   state->soundcpu = machine->device("soundcpu");
320320}
321321
322322static MACHINE_DRIVER_START( go2000 )
src/mame/drivers/dogfgt.c
r8581r8582
5353
5454   /* bit 5 goes to 8910 #0 BDIR pin  */
5555   if ((state->last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00)
56      ay8910_data_address_w(devtag_get_device(space->machine, "ay1"), state->last_snd_ctrl >> 4, state->soundlatch);
56      ay8910_data_address_w(space->machine->device("ay1"), state->last_snd_ctrl >> 4, state->soundlatch);
5757
5858   /* bit 7 goes to 8910 #1 BDIR pin  */
5959   if ((state->last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00)
60      ay8910_data_address_w(devtag_get_device(space->machine, "ay2"), state->last_snd_ctrl >> 6, state->soundlatch);
60      ay8910_data_address_w(space->machine->device("ay2"), state->last_snd_ctrl >> 6, state->soundlatch);
6161
6262   state->last_snd_ctrl = data;
6363}
r8581r8582
217217{
218218   dogfgt_state *state = (dogfgt_state *)machine->driver_data;
219219
220   state->subcpu = devtag_get_device(machine, "sub");
220   state->subcpu = machine->device("sub");
221221
222222   state_save_register_global(machine, state->bm_plane);
223223   state_save_register_global(machine, state->lastflip);
src/mame/drivers/taitosj.c
r8581r8582
19381938
19391939
19401940ROM_START( junglek )
1941    ROM_REGION( 0x12000, "maincpu", 0 )
1942    ROM_LOAD( "kn21-1.bin",   0x00000, 0x1000, CRC(45f55d30) SHA1(bb9518d7728938f673a663801e47ae0438cdbea1) )
1943    ROM_LOAD( "kn22-1.bin",   0x01000, 0x1000, CRC(07cc9a21) SHA1(3fe35935e0a430ab0edc6a762623972fa37ea926) )
1944    ROM_LOAD( "kn43.bin",     0x02000, 0x1000, CRC(a20e5a48) SHA1(af961b671dc4c865d0181d08a70b902bb96f29d0) )
1945    ROM_LOAD( "kn24.bin",     0x03000, 0x1000, CRC(19ea7f83) SHA1(2399cc89f73811575c3f644d5c04ef13ceec6838) )
1946    ROM_LOAD( "kn25.bin",     0x04000, 0x1000, CRC(844365ea) SHA1(af34712620e4b784a5014283d3111048c5f81a56) )
1947    ROM_LOAD( "kn46.bin",     0x05000, 0x1000, CRC(27a95fd5) SHA1(160ee5d11126ac4155b479e43ec1bd6a4e9e21e7) )
1948    ROM_LOAD( "kn47.bin",     0x06000, 0x1000, CRC(5c3199e0) SHA1(c57dec92998b971d76aecd23674c25cf7b8be667) )
1949    ROM_LOAD( "kn28.bin",     0x07000, 0x1000, CRC(194a2d09) SHA1(88999493e470acdcf932efff71cd6155387a63d0) )
1950    /* 10000-10fff space for another banked ROM (not used) */
1951    ROM_LOAD( "kn60.bin",     0x11000, 0x1000, CRC(1a9c0a26) SHA1(82f4cebeba90419e83a00427b671985824babd7a) ) /* banked at 7000 */
1941   ROM_REGION( 0x12000, "maincpu", 0 )
1942   ROM_LOAD( "kn21-1.bin",   0x00000, 0x1000, CRC(45f55d30) SHA1(bb9518d7728938f673a663801e47ae0438cdbea1) )
1943   ROM_LOAD( "kn22-1.bin",   0x01000, 0x1000, CRC(07cc9a21) SHA1(3fe35935e0a430ab0edc6a762623972fa37ea926) )
1944   ROM_LOAD( "kn43.bin",     0x02000, 0x1000, CRC(a20e5a48) SHA1(af961b671dc4c865d0181d08a70b902bb96f29d0) )
1945   ROM_LOAD( "kn24.bin",     0x03000, 0x1000, CRC(19ea7f83) SHA1(2399cc89f73811575c3f644d5c04ef13ceec6838) )
1946   ROM_LOAD( "kn25.bin",     0x04000, 0x1000, CRC(844365ea) SHA1(af34712620e4b784a5014283d3111048c5f81a56) )
1947   ROM_LOAD( "kn46.bin",     0x05000, 0x1000, CRC(27a95fd5) SHA1(160ee5d11126ac4155b479e43ec1bd6a4e9e21e7) )
1948   ROM_LOAD( "kn47.bin",     0x06000, 0x1000, CRC(5c3199e0) SHA1(c57dec92998b971d76aecd23674c25cf7b8be667) )
1949   ROM_LOAD( "kn28.bin",     0x07000, 0x1000, CRC(194a2d09) SHA1(88999493e470acdcf932efff71cd6155387a63d0) )
1950   /* 10000-10fff space for another banked ROM (not used) */
1951   ROM_LOAD( "kn60.bin",     0x11000, 0x1000, CRC(1a9c0a26) SHA1(82f4cebeba90419e83a00427b671985824babd7a) ) /* banked at 7000 */
19521952
1953    ROM_REGION( 0x10000, "audiocpu", 0 )
1954    ROM_LOAD( "kn37.bin",     0x0000, 0x1000, CRC(dee7f5d4) SHA1(cd8179a17ccd054fb470c4eee97192c2dd226397) )
1955    ROM_LOAD( "kn38.bin",     0x1000, 0x1000, CRC(bffd3d21) SHA1(a2b3393e9694d6979d39ab0f1ab82b7ef892b3da) )
1956    ROM_LOAD( "kn59-1.bin",   0x2000, 0x1000, CRC(cee485fc) SHA1(1e0c52ec6b1d3cfd47247db71bcf3fe476c32039) )
1953   ROM_REGION( 0x10000, "audiocpu", 0 )
1954   ROM_LOAD( "kn37.bin",     0x0000, 0x1000, CRC(dee7f5d4) SHA1(cd8179a17ccd054fb470c4eee97192c2dd226397) )
1955   ROM_LOAD( "kn38.bin",     0x1000, 0x1000, CRC(bffd3d21) SHA1(a2b3393e9694d6979d39ab0f1ab82b7ef892b3da) )
1956   ROM_LOAD( "kn59-1.bin",   0x2000, 0x1000, CRC(cee485fc) SHA1(1e0c52ec6b1d3cfd47247db71bcf3fe476c32039) )
19571957
1958    ROM_REGION( 0x8000, "gfx1", 0 )   /* graphic ROMs used at runtime */
1958   ROM_REGION( 0x8000, "gfx1", 0 )   /* graphic ROMs used at runtime */
19591959   ROM_LOAD( "kn29.bin",     0x0000, 0x1000, CRC(8f83c290) SHA1(aa95ed2d2e15f573e092e8eed7d80479512d9409) )
19601960   ROM_LOAD( "kn30.bin",     0x1000, 0x1000, CRC(89fd19f1) SHA1(fc7dfe3a1d78ac37a036fa9d8ebf3a33a2f4cbe8) )
19611961   ROM_LOAD( "kn51.bin",     0x2000, 0x1000, CRC(70e8fc12) SHA1(505c90c662d372d28cb38201433054b8e3d723d1) )
r8581r8582
19661966   ROM_LOAD( "kn56.bin",     0x7000, 0x1000, CRC(932eb667) SHA1(4bf7c01ab212b616931a21a43a453521aa01ff36) )
19671967
19681968   ROM_REGION( 0x0100, "proms", 0 )      /* layer PROM */
1969    ROM_LOAD( "eb16.22",      0x0000, 0x0100, CRC(b833b5ea) SHA1(d233f1bf8a3e6cd876853ffd721b9b64c61c9047) )
1969   ROM_LOAD( "eb16.22",      0x0000, 0x0100, CRC(b833b5ea) SHA1(d233f1bf8a3e6cd876853ffd721b9b64c61c9047) )
19701970ROM_END
19711971
19721972ROM_START( junglekj2 )
r8581r8582
26572657   ROM_LOAD( "a20-12",       0x2000, 0x1000, CRC(e7eeb933) SHA1(26f3904f6d4dc814318221f1c9cd5dcc671fe05a) )
26582658
26592659   ROM_REGION( 0x0800, "mcu", 0 )       /* 2k for the microcontroller */
2660   ROM_LOAD( "a20-13",       0x0000, 0x0800, CRC(11e23c5c) SHA1(cf2fcdc70d616508dd7ae630bad6a5e4ff91cdad) )
2660   ROM_LOAD( "a20-13.ic91",  0x0000, 0x0800, CRC(3fb6c4fb) SHA1(04b9458f21a793444cd587055e2e3ccfa3f835a2) )
26612661
26622662   ROM_REGION( 0x8000, "gfx1", 0 )       /* graphic ROMs used at runtime */
26632663   ROM_LOAD( "a20-06",       0x0000, 0x2000, CRC(6582fc89) SHA1(a902f4f2d3c9e352ac2f49f33b9f30be931f2be1) )
src/mame/drivers/m63.c
r8581r8582
703703{
704704   m63_state *state = (m63_state *)machine->driver_data;
705705
706   state->soundcpu = devtag_get_device(machine, "soundcpu");
707   state->ay1 = devtag_get_device(machine, "ay1");
708   state->ay2 = devtag_get_device(machine, "ay2");
709   state->samples = devtag_get_device(machine, "samples");
706   state->soundcpu = machine->device("soundcpu");
707   state->ay1 = machine->device("ay1");
708   state->ay2 = machine->device("ay2");
709   state->samples = machine->device("samples");
710710
711711   state_save_register_global(machine, state->pal_bank);
712712   state_save_register_global(machine, state->fg_flag);
src/mame/drivers/topshoot.c
r8581r8582
147147   ROM_REGION( 0x200000, "maincpu", 0 )
148148   ROM_LOAD16_BYTE( "tc574000ad_u11_2.bin", 0x000000, 0x080000, CRC(b235c4d9) SHA1(fbb308a5f6e769f3277824cb6a3b50c308969ac2) )
149149   ROM_LOAD16_BYTE( "tc574000ad_u12_1.bin", 0x000001, 0x080000, CRC(e826f6ad) SHA1(23ec8bb608f954d3b915f061e7076c0c63b8259e) )
150
151   // not hooked up yet
152   ROM_REGION( 0x1000, "mcu", 0 )
153   ROM_LOAD( "89c51.bin", 0x0000, 0x1000, CRC(595475c8) SHA1(8313819ba06cc92b54f88c1ca9f34be8d1ec94d0) )
150154ROM_END
151155
152156static READ16_HANDLER(topshoot_200051_r)
src/mame/drivers/tatsumi.c
r8581r8582
851851   cputag_set_input_line(machine, "sub2", INPUT_LINE_RESET, ASSERT_LINE); // TODO
852852
853853   /* Hook the RESET line, which resets the Z80 */
854   m68k_set_reset_callback(devtag_get_device(machine, "sub"), apache3_68000_reset);
854   m68k_set_reset_callback(machine->device("sub"), apache3_68000_reset);
855855}
856856
857857
src/mame/drivers/supbtime.c
r8581r8582
334334{
335335   supbtime_state *state = (supbtime_state *)machine->driver_data;
336336
337   state->maincpu = devtag_get_device(machine, "maincpu");
338   state->audiocpu = devtag_get_device(machine, "audiocpu");
339   state->deco16ic = devtag_get_device(machine, "deco_custom");
337   state->maincpu = machine->device("maincpu");
338   state->audiocpu = machine->device("audiocpu");
339   state->deco16ic = machine->device("deco_custom");
340340}
341341
342342static MACHINE_DRIVER_START( supbtime )
src/mame/drivers/toratora.c
r8581r8582
152152      generic_pulse_irq_line(device, 0);
153153   }
154154   pia6821_set_input_a(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x0f, 0);
155   pia6821_ca1_w(state->pia_u1, 0, input_port_read(device->machine, "INPUT") & 0x10);
156   pia6821_ca2_w(state->pia_u1, 0, input_port_read(device->machine, "INPUT") & 0x20);
155   pia6821_ca1_w(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x10);
156   pia6821_ca2_w(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x20);
157157}
158158
159159static READ8_HANDLER( timer_r )
r8581r8582
376376{
377377   toratora_state *state = (toratora_state *)machine->driver_data;
378378
379   state->maincpu = devtag_get_device(machine, "maincpu");
380   state->pia_u1 = devtag_get_device(machine, "pia_u1");
381   state->pia_u2 = devtag_get_device(machine, "pia_u2");
382   state->pia_u3 = devtag_get_device(machine, "pia_u3");
379   state->maincpu = machine->device("maincpu");
380   state->pia_u1 = machine->device("pia_u1");
381   state->pia_u2 = machine->device("pia_u2");
382   state->pia_u3 = machine->device("pia_u3");
383383
384384   state_save_register_global(machine, state->timer);
385385   state_save_register_global(machine, state->last);
src/mame/drivers/segamsys.c
r8581r8582
16441644   /* INIT THE PORTS *********************************************************************************************/
16451645
16461646   const address_space *io = cputag_get_address_space(machine, tag, ADDRESS_SPACE_IO);
1647   running_device *sn = devtag_get_device(machine, "snsnd");
1647   running_device *sn = machine->device("snsnd");
16481648
16491649   memory_install_readwrite8_handler(io, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w);
16501650
src/mame/drivers/gbusters.c
r8581r8582
282282
283283   machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
284284
285   state->maincpu = devtag_get_device(machine, "maincpu");
286   state->audiocpu = devtag_get_device(machine, "audiocpu");
287   state->k052109 = devtag_get_device(machine, "k052109");
288   state->k051960 = devtag_get_device(machine, "k051960");
289   state->k007232 = devtag_get_device(machine, "k007232");
285   state->maincpu = machine->device("maincpu");
286   state->audiocpu = machine->device("audiocpu");
287   state->k052109 = machine->device("k052109");
288   state->k051960 = machine->device("k051960");
289   state->k007232 = machine->device("k007232");
290290
291291   state_save_register_global(machine, state->palette_selected);
292292   state_save_register_global(machine, state->priority);
r8581r8582
298298   gbusters_state *state = (gbusters_state *)machine->driver_data;
299299   UINT8 *RAM = memory_region(machine, "maincpu");
300300
301   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), gbusters_banking);
301   konami_configure_set_lines(machine->device("maincpu"), gbusters_banking);
302302
303303   /* mirror address for banked ROM */
304304   memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000);
src/mame/drivers/bogeyman.c
r8581r8582
3737
3838   // bit 5 goes to 8910 #0 BDIR pin
3939   if ((state->last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
40      ay8910_data_address_w(devtag_get_device(space->machine, "ay1"), state->last_write >> 4, state->psg_latch);
40      ay8910_data_address_w(space->machine->device("ay1"), state->last_write >> 4, state->psg_latch);
4141
4242   // bit 7 goes to 8910 #1 BDIR pin
4343   if ((state->last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
44      ay8910_data_address_w(devtag_get_device(space->machine, "ay2"), state->last_write >> 6, state->psg_latch);
44      ay8910_data_address_w(space->machine->device("ay2"), state->last_write >> 6, state->psg_latch);
4545
4646   state->last_write = data;
4747}
src/mame/drivers/r2dtank.c
r8581r8582
7373
7474static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
7575{
76   running_device *pia0 = devtag_get_device(device->machine, "pia_main");
77   running_device *pia1 = devtag_get_device(device->machine, "pia_audio");
76   running_device *pia0 = device->machine->device("pia_main");
77   running_device *pia1 = device->machine->device("pia_audio");
7878   int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) |
7979                   pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
8080
r8581r8582
150150   UINT8 ret = 0;
151151
152152   if (AY8910_selected & 0x08)
153      ret = ay8910_r(devtag_get_device(device->machine, "ay1"), 0);
153      ret = ay8910_r(device->machine->device("ay1"), 0);
154154
155155   if (AY8910_selected & 0x10)
156      ret = ay8910_r(devtag_get_device(device->machine, "ay2"), 0);
156      ret = ay8910_r(device->machine->device("ay2"), 0);
157157
158158   return ret;
159159}
r8581r8582
162162static WRITE8_DEVICE_HANDLER( AY8910_port_w )
163163{
164164   if (AY8910_selected & 0x08)
165      ay8910_data_address_w(devtag_get_device(device->machine, "ay1"), AY8910_selected >> 2, data);
165      ay8910_data_address_w(device->machine->device("ay1"), AY8910_selected >> 2, data);
166166
167167   if (AY8910_selected & 0x10)
168      ay8910_data_address_w(devtag_get_device(device->machine, "ay2"), AY8910_selected >> 2, data);
168      ay8910_data_address_w(device->machine->device("ay2"), AY8910_selected >> 2, data);
169169}
170170
171171
r8581r8582
206206
207207static WRITE8_DEVICE_HANDLER( ttl74123_output_changed )
208208{
209   running_device *pia = devtag_get_device(device->machine, "pia_main");
210   pia6821_ca1_w(pia, 0, data);
209   running_device *pia = device->machine->device("pia_main");
210   pia6821_ca1_w(pia, data);
211211   ttl74123_output = data;
212212}
213213
r8581r8582
362362
363363static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
364364{
365   ttl74123_a_w(devtag_get_device(device->machine, "74123"), 0, state);
365   ttl74123_a_w(device->machine->device("74123"), 0, state);
366366}
367367
368368
r8581r8582
383383
384384static VIDEO_UPDATE( r2dtank )
385385{
386   running_device *mc6845 = devtag_get_device(screen->machine, "crtc");
386   running_device *mc6845 = screen->machine->device("crtc");
387387   mc6845_update(mc6845, bitmap, cliprect);
388388
389389   return 0;
src/mame/drivers/m72.c
r8581r8582
322322   const address_space *program = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
323323   const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
324324   const address_space *sndio = cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_IO);
325   running_device *dac = devtag_get_device(machine, "dac");
325   running_device *dac = machine->device("dac");
326326
327327   protection_ram = auto_alloc_array(machine, UINT16, 0x10000/2);
328328   memory_install_read_bank(program, 0xb0000, 0xbffff, 0, 0, "bank1");
r8581r8582
406406   const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
407407   int sample = m72_sample_r(space,0);
408408   if (sample)
409      m72_sample_w(devtag_get_device(device->machine, "dac"),0,sample);
409      m72_sample_w(device->machine->device("dac"),0,sample);
410410}
411411
412412
src/mame/drivers/crgolf.c
r8581r8582
5252{
5353   crgolf_state *state = (crgolf_state *)machine->driver_data;
5454
55   state->maincpu = devtag_get_device(machine, "maincpu");
56   state->audiocpu = devtag_get_device(machine, "audiocpu");
55   state->maincpu = machine->device("maincpu");
56   state->audiocpu = machine->device("audiocpu");
5757
5858   /* configure the banking */
5959   memory_configure_bank(machine, "bank1", 0, 16, memory_region(machine, "maincpu") + 0x10000, 0x2000);
r8581r8582
603603
604604static DRIVER_INIT( crgolfhi )
605605{
606   running_device *msm = devtag_get_device(machine, "msm");
606   running_device *msm = machine->device("msm");
607607   memory_install_write8_device_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), msm, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w);
608608}
609609
src/mame/drivers/mastboy.c
r8581r8582
609609
610610static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w )
611611{
612   running_device *adpcm = devtag_get_device(space->machine, "msm");
612   running_device *adpcm = space->machine->device("msm");
613613
614614   mastboy_m5205_sambit0 = data & 1;
615615   msm5205_playmode_w(adpcm,  (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) );
r8581r8582
619619
620620static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w )
621621{
622   running_device *adpcm = devtag_get_device(space->machine, "msm");
622   running_device *adpcm = space->machine->device("msm");
623623
624624   mastboy_m5205_sambit1 = data & 1;
625625
r8581r8582
849849   memset( mastboy_vram, 0x00, 0x10000);
850850
851851   mastboy_m5205_part = 0;
852   msm5205_reset_w(devtag_get_device(machine, "msm"),1);
852   msm5205_reset_w(machine->device("msm"),1);
853853   mastboy_irq0_ack = 0;
854854}
855855
src/mame/drivers/topspeed.c
r8581r8582
652652
653653   memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000);
654654
655   state->maincpu = devtag_get_device(machine, "maincpu");
656   state->subcpu = devtag_get_device(machine, "sub");
657   state->audiocpu = devtag_get_device(machine, "audiocpu");
658   state->tc0220ioc = devtag_get_device(machine, "tc0220ioc");
659   state->pc080sn_1 = devtag_get_device(machine, "pc080sn_1");
660   state->pc080sn_2 = devtag_get_device(machine, "pc080sn_2");
655   state->maincpu = machine->device("maincpu");
656   state->subcpu = machine->device("sub");
657   state->audiocpu = machine->device("audiocpu");
658   state->tc0220ioc = machine->device("tc0220ioc");
659   state->pc080sn_1 = machine->device("pc080sn_1");
660   state->pc080sn_2 = machine->device("pc080sn_2");
661661
662662   state_save_register_global(machine, state->cpua_ctrl);
663663   state_save_register_global(machine, state->ioc220_port);
src/mame/drivers/segae.c
r8581r8582
364364   /* INIT THE PORTS *********************************************************************************************/
365365
366366   const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
367   running_device *sn1 = devtag_get_device(machine, "sn1");
368   running_device *sn2 = devtag_get_device(machine, "sn2");
367   running_device *sn1 = machine->device("sn1");
368   running_device *sn2 = machine->device("sn2");
369369
370370   memory_install_write8_device_handler(io, sn2, 0x7b, 0x7b, 0, 0, sn76496_w);
371371   memory_install_write8_device_handler(io, sn1, 0x7e, 0x7f, 0, 0, sn76496_w);
src/mame/drivers/amspdwy.c
r8581r8582
254254{
255255   amspdwy_state *state = (amspdwy_state *)machine->driver_data;
256256
257   state->audiocpu = devtag_get_device(machine, "audiocpu");
257   state->audiocpu = machine->device("audiocpu");
258258
259259   state_save_register_global(machine, state->flipscreen);
260260   state_save_register_global_array(machine, state->wheel_old);
src/mame/drivers/fantland.c
r8581r8582
829829{
830830   fantland_state *state = (fantland_state *)machine->driver_data;
831831
832   state->audio_cpu = devtag_get_device(machine, "audiocpu");
832   state->audio_cpu = machine->device("audiocpu");
833833
834834   state_save_register_global(machine, state->nmi_enable);
835835}
r8581r8582
978978
979979   MACHINE_START_CALL(fantland);
980980
981   state->msm1 = devtag_get_device(machine, "msm1");
982   state->msm2 = devtag_get_device(machine, "msm2");
983   state->msm3 = devtag_get_device(machine, "msm3");
984   state->msm4 = devtag_get_device(machine, "msm4");
981   state->msm1 = machine->device("msm1");
982   state->msm2 = machine->device("msm2");
983   state->msm3 = machine->device("msm3");
984   state->msm4 = machine->device("msm4");
985985
986986   state_save_register_global_array(machine, state->old_x);
987987   state_save_register_global_array(machine, state->old_y);
r8581r8582
10161016      state->adpcm_nibble[i] = 0;
10171017   }
10181018
1019   borntofi_adpcm_stop(devtag_get_device(machine, "msm1"), 0);
1020   borntofi_adpcm_stop(devtag_get_device(machine, "msm2"), 1);
1021   borntofi_adpcm_stop(devtag_get_device(machine, "msm3"), 2);
1022   borntofi_adpcm_stop(devtag_get_device(machine, "msm4"), 3);
1019   borntofi_adpcm_stop(machine->device("msm1"), 0);
1020   borntofi_adpcm_stop(machine->device("msm2"), 1);
1021   borntofi_adpcm_stop(machine->device("msm3"), 2);
1022   borntofi_adpcm_stop(machine->device("msm4"), 3);
10231023}
10241024
10251025static MACHINE_DRIVER_START( borntofi )
src/mame/drivers/atarig1.c
r8581r8582
11801180      state_save_register_postload(machine, pitfightb_state_postload, NULL);
11811181   }
11821182   else if (slapstic != 0)
1183      atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), slapstic_base, 0, slapstic);
1183      atarigen_slapstic_init(machine->device("maincpu"), slapstic_base, 0, slapstic);
11841184   atarijsa_init(machine, "IN0", 0x4000);
11851185
11861186   state->is_pitfight = is_pitfight;
src/mame/drivers/midas.c
r8581r8582
298298{
299299   if (ACCESSING_BITS_0_7)
300300   {
301      ticket_dispenser_w(devtag_get_device(space->machine, "prize1"), 0, (data & 0x0001) << 7);
302      ticket_dispenser_w(devtag_get_device(space->machine, "prize2"), 0, (data & 0x0002) << 6);
303      ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 0x0010) << 3);
301      ticket_dispenser_w(space->machine->device("prize1"), 0, (data & 0x0001) << 7);
302      ticket_dispenser_w(space->machine->device("prize2"), 0, (data & 0x0002) << 6);
303      ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x0010) << 3);
304304      // data & 0x0080 ?
305305   }
306306#ifdef MAME_DEBUG
src/mame/drivers/aristmk4.c
r8581r8582
380380
381381    if (ay8910_1&0x03) // SW1 read.
382382    {
383       psg_ret = ay8910_r(devtag_get_device(device->machine, "ay1"), 0);
383       psg_ret = ay8910_r(device->machine->device("ay1"), 0);
384384       //logerror("PSG porta ay1 returned %02X\n",psg_ret);
385385    }
386386
387387   else if (ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok.
388388   {
389      psg_ret = ay8910_r(devtag_get_device(device->machine, "ay2"), 0);
389      psg_ret = ay8910_r(device->machine->device("ay2"), 0);
390390      //logerror("PSG porta ay2 returned %02X\n",psg_ret);
391391   }
392392   return psg_ret;
r8581r8582
493493
494494      case 0x06:  //WRITE
495495        {
496           ay8910_data_w( devtag_get_device(device->machine, "ay1"), 0 , psg_data );
496           ay8910_data_w( device->machine->device("ay1"), 0 , psg_data );
497497           //logerror("VIA Port A write data ay1: %02X\n",psg_data);
498498           break;
499499        }
500500
501501      case 0x07:  //LATCH Address (set register)
502502        {
503           ay8910_address_w( devtag_get_device(device->machine, "ay1"), 0 , psg_data );
503           ay8910_address_w( device->machine->device("ay1"), 0 , psg_data );
504504           //logerror("VIA Port B write register ay1: %02X\n",psg_data);
505505           break;
506506        }
r8581r8582
526526
527527      case 0x06:  //WRITE
528528        {
529           ay8910_data_w( devtag_get_device(device->machine, "ay2"), 0 , psg_data );
529           ay8910_data_w( device->machine->device("ay2"), 0 , psg_data );
530530           //logerror("VIA Port A write data ay2: %02X\n",psg_data);
531531           break;
532532        }
533533
534534      case 0x07:  //LATCH Address (set register)
535535        {
536            ay8910_address_w( devtag_get_device(device->machine, "ay2"), 0 , psg_data );
536            ay8910_address_w( device->machine->device("ay2"), 0 , psg_data );
537537            //logerror("VIA Port B write register ay2: %02X\n",psg_data);
538538            break;
539539        }
r8581r8582
11421142static MACHINE_START( aristmk4 )
11431143{
11441144
1145   samples = devtag_get_device(machine, "samples");
1145   samples = machine->device("samples");
11461146    state_save_register_global_pointer(machine, nvram,0x1000); // nvram
11471147}
11481148
r8581r8582
11531153    switch(input_port_read(machine, "LK13"))  // cpu speed cotrol.. 3mhz or 1.5mhz
11541154    {
11551155        case  0x00:
1156            cpu_set_clock(devtag_get_device(machine, "maincpu"), MAIN_CLOCK/4);  // 3 Mhz
1156            machine->device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4);  // 3 Mhz
11571157            break;
11581158        case  0x10:
1159            cpu_set_clock(devtag_get_device(machine, "maincpu"), MAIN_CLOCK/8);  // 1.5 Mhz
1159            machine->device("maincpu")->set_unscaled_clock(MAIN_CLOCK/8);  // 1.5 Mhz
11601160            break;
11611161    }
11621162
src/mame/drivers/thunderx.c
r8581r8582
631631
632632   machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
633633
634   state->maincpu = devtag_get_device(machine, "maincpu");
635   state->audiocpu = devtag_get_device(machine, "audiocpu");
636   state->k007232 = devtag_get_device(machine, "k007232");
637   state->k052109 = devtag_get_device(machine, "k052109");
638   state->k051960 = devtag_get_device(machine, "k051960");
634   state->maincpu = machine->device("maincpu");
635   state->audiocpu = machine->device("audiocpu");
636   state->k007232 = machine->device("k007232");
637   state->k052109 = machine->device("k052109");
638   state->k051960 = machine->device("k051960");
639639
640640   state_save_register_global(machine, state->priority);
641641   state_save_register_global(machine, state->_1f98_data);
r8581r8582
674674
675675static MACHINE_RESET( thunderx )
676676{
677   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), thunderx_banking);
677   konami_configure_set_lines(machine->device("maincpu"), thunderx_banking);
678678
679679   MACHINE_RESET_CALL(scontra);
680680}
src/mame/drivers/videopin.c
r8581r8582
6666
6767static MACHINE_RESET( videopin )
6868{
69   running_device *discrete = devtag_get_device(machine, "discrete");
69   running_device *discrete = machine->device("discrete");
7070
7171   timer_set(machine, machine->primary_screen->time_until_pos(32), NULL, 32, interrupt_callback);
7272
src/mame/drivers/tumbleb.c
r8581r8582
19871987{
19881988   tumbleb_state *state = (tumbleb_state *)machine->driver_data;
19891989
1990   state->maincpu = devtag_get_device(machine, "maincpu");
1991   state->audiocpu = devtag_get_device(machine, "audiocpu");
1992   state->oki = devtag_get_device(machine, "oki");
1990   state->maincpu = machine->device("maincpu");
1991   state->audiocpu = machine->device("audiocpu");
1992   state->oki = machine->device("oki");
19931993
19941994   state_save_register_global(machine, state->music_command);
19951995   state_save_register_global(machine, state->music_bank);
r8581r8582
33483348
33493349static DRIVER_INIT( tumbleb2 )
33503350{
3351   running_device *oki = devtag_get_device(machine, "oki");
3351   running_device *oki = machine->device("oki");
33523352
33533353   tumblepb_gfx1_rearrange(machine);
33543354
r8581r8582
37283728GAME( 1994, metlsavr, 0,       metlsavr,  metlsavr, chokchok, ROT0, "First Amusement", "Metal Saver", GAME_SUPPORTS_SAVE )
37293729GAME( 1994, pangpang, 0,       pangpang,  tumblepb, tumbleb2, ROT0, "Dong Gue La Mi Ltd.", "Pang Pang", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  ) // PIC is protected, sound simulation not 100%
37303730GAME( 1994, suprtrio, 0,       suprtrio,  suprtrio, suprtrio, ROT0, "Gameace", "Super Trio", GAME_SUPPORTS_SAVE )
3731// Should also be 'Magicball Fighting' (c)1994  see  http://kmrb.or.kr/Game_Image/1999/%EC%A0%9C1248%ED%98%B8.jpg
3731// Should also be 'Magicball Fighting' (c)1994
37323732GAME( 1995, htchctch, 0,       htchctch,  htchctch, htchctch, ROT0, "SemiCom", "Hatch Catch" , GAME_SUPPORTS_SAVE ) // not 100% sure about gfx offsets
37333733GAME( 1995, cookbib,  0,       cookbib,   cookbib,  htchctch, ROT0, "SemiCom", "Cookie & Bibi" , GAME_SUPPORTS_SAVE ) // not 100% sure about gfx offsets
37343734GAME( 1995, chokchok, 0,       cookbib,   chokchok, chokchok, ROT0, "SemiCom", "Choky! Choky!", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE  ) // corruption during attract mode (tmap disable?)
src/mame/drivers/toypop.c
r8581r8582
6767
6868static READ8_HANDLER( toypop_main_interrupt_enable_r )
6969{
70   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), 1);
70   cpu_interrupt_enable(space->machine->device("maincpu"), 1);
7171   return 0;
7272}
7373
7474static WRITE8_HANDLER( toypop_main_interrupt_enable_w )
7575{
76   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), 1);
76   cpu_interrupt_enable(space->machine->device("maincpu"), 1);
7777   cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
7878}
7979
8080static WRITE8_HANDLER( toypop_main_interrupt_disable_w )
8181{
82   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), 0);
82   cpu_interrupt_enable(space->machine->device("maincpu"), 0);
8383}
8484
8585static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w )
8686{
87   cpu_interrupt_enable(devtag_get_device(space->machine, "audiocpu"), 1);
87   cpu_interrupt_enable(space->machine->device("audiocpu"), 1);
8888   cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
8989}
9090
9191static WRITE8_HANDLER( toypop_sound_interrupt_disable_w )
9292{
93   cpu_interrupt_enable(devtag_get_device(space->machine, "audiocpu"), 0);
93   cpu_interrupt_enable(space->machine->device("audiocpu"), 0);
9494}
9595
9696static TIMER_CALLBACK( namcoio_run )
9797{
98   running_device *io58xx = devtag_get_device(machine, "58xx");
99   running_device *io56xx_1 = devtag_get_device(machine, "56xx_1");
100   running_device *io56xx_2 = devtag_get_device(machine, "56xx_2");
98   running_device *io58xx = machine->device("58xx");
99   running_device *io56xx_1 = machine->device("56xx_1");
100   running_device *io56xx_2 = machine->device("56xx_2");
101101
102102   switch (param)
103103   {
r8581r8582
115115
116116static INTERRUPT_GEN( toypop_main_interrupt )
117117{
118   running_device *namcoio_0 = devtag_get_device(device->machine, "58xx");
119   running_device *namcoio_1 = devtag_get_device(device->machine, "56xx_1");
120   running_device *namcoio_2 = devtag_get_device(device->machine, "56xx_2");
118   running_device *namcoio_0 = device->machine->device("58xx");
119   running_device *namcoio_1 = device->machine->device("56xx_1");
120   running_device *namcoio_2 = device->machine->device("56xx_2");
121121
122122   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
123123                        // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
r8581r8582
156156static TIMER_CALLBACK( disable_interrupts )
157157{
158158   toypop_state *state = (toypop_state *)machine->driver_data;
159   cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0);
159   cpu_interrupt_enable(machine->device("maincpu"), 0);
160160   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
161   cpu_interrupt_enable(devtag_get_device(machine, "audiocpu"), 0);
161   cpu_interrupt_enable(machine->device("audiocpu"), 0);
162162   cputag_set_input_line(machine, "audiocpu", 0, CLEAR_LINE);
163163   state->interrupt_enable_68k = 0;
164164}
src/mame/drivers/kchamp.c
r8581r8582
393393{
394394   kchamp_state *state = (kchamp_state *)machine->driver_data;
395395
396   state->audiocpu = devtag_get_device(machine, "audiocpu");
396   state->audiocpu = machine->device("audiocpu");
397397
398398   state_save_register_global(machine, state->nmi_enable);
399399   state_save_register_global(machine, state->sound_nmi_enable);
src/mame/drivers/tugboat.c
r8581r8582
444444GAME( 1982, tugboat,  0, tugboat, tugboat,  0, ROT90, "ETM", "Tugboat",    GAME_IMPERFECT_GRAPHICS )
445445GAME( 1983, noahsark, 0, tugboat, noahsark, 0, ROT90, "Enter-Tech", "Noah's Ark", GAME_IMPERFECT_GRAPHICS )
446446GAME( 1984, berenstn, 0, tugboat, noahsark, 0, ROT90, "Enter-Tech", "The Berenstain Bears in Big Paw's Cave", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS )
447
src/mame/drivers/lastfght.c
r8581r8582
527527{
528528   lastfght_state *state = (lastfght_state *)machine->driver_data;
529529
530   state->maincpu = devtag_get_device(machine, "maincpu");
530   state->maincpu = machine->device("maincpu");
531531
532532   state_save_register_global(machine, state->clr_offset);
533533   state_save_register_global(machine, state->dest);
src/mame/drivers/superqix.c
r8581r8582
5252Prebillian :
5353------------
5454
55PCB Layout (Prebillian, from The Guru ( http://unemulated.emuunlim.com/ )
55PCB Layout (Prebillian, from The Guru ( http://guru.mameworld.info )
5656
5757 M6100211A
5858 -------------------------------------------------------------------
r8581r8582
147147
148148static WRITE8_HANDLER( pbillian_sample_trigger_w )
149149{
150   running_device *samples = devtag_get_device(space->machine, "samples");
150   running_device *samples = space->machine->device("samples");
151151   int start,end;
152152
153153   start = data << 7;
src/mame/drivers/dday.c
r8581r8582
224224{
225225   dday_state *state = (dday_state *)machine->driver_data;
226226
227   state->ay1 = devtag_get_device(machine, "ay1");
227   state->ay1 = machine->device("ay1");
228228
229229   state_save_register_global(machine, state->control);
230230   state_save_register_global(machine, state->sl_enable);
src/mame/drivers/cyberbal.c
r8581r8582
6565   atarigen_slapstic_reset(&state->atarigen);
6666   atarigen_interrupt_reset(&state->atarigen, update_interrupts);
6767   atarigen_scanline_timer_reset(*machine->primary_screen, cyberbal_scanline_update, 8);
68   atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
68   atarigen_sound_io_reset(machine->device("audiocpu"));
6969
7070   cyberbal_sound_reset(machine);
7171
r8581r8582
999999{
10001000   cyberbal_state *state = (cyberbal_state *)machine->driver_data;
10011001   state->atarigen.eeprom_default = default_eeprom;
1002   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x018000, 0, 0);
1002   atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 0);
10031003}
10041004
10051005
r8581r8582
10071007{
10081008   cyberbal_state *state = (cyberbal_state *)machine->driver_data;
10091009   state->atarigen.eeprom_default = default_eeprom;
1010   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x018000, 0, 116);
1010   atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 116);
10111011}
10121012
10131013
src/mame/drivers/lockon.c
r8581r8582
466466{
467467   lockon_state *state = (lockon_state *)machine->driver_data;
468468
469   state->maincpu = devtag_get_device(machine, "maincpu");
470   state->audiocpu = devtag_get_device(machine, "audiocpu");
471   state->ground = devtag_get_device(machine, "ground");
472   state->object = devtag_get_device(machine, "object");
473   state->f2203_1l = devtag_get_device(machine, "f2203.1l");
474   state->f2203_2l = devtag_get_device(machine, "f2203.2l");
475   state->f2203_3l = devtag_get_device(machine, "f2203.3l");
476   state->f2203_1r = devtag_get_device(machine, "f2203.1r");
477   state->f2203_2r = devtag_get_device(machine, "f2203.2r");
478   state->f2203_3r = devtag_get_device(machine, "f2203.3r");
469   state->maincpu = machine->device("maincpu");
470   state->audiocpu = machine->device("audiocpu");
471   state->ground = machine->device("ground");
472   state->object = machine->device("object");
473   state->f2203_1l = machine->device("f2203.1l");
474   state->f2203_2l = machine->device("f2203.2l");
475   state->f2203_3l = machine->device("f2203.3l");
476   state->f2203_1r = machine->device("f2203.1r");
477   state->f2203_2r = machine->device("f2203.2r");
478   state->f2203_3r = machine->device("f2203.3r");
479479
480480   state_save_register_global(machine, state->ground_ctrl);
481481   state_save_register_global(machine, state->scroll_h);
src/mame/drivers/gijoe.c
r8581r8582
237237   KONAMI16_MSB_40(2, IPT_BUTTON3 )
238238   PORT_DIPNAME( 0x8000, 0x8000, "Coin mechanism" )   PORT_DIPLOCATION("SW1:2")
239239   PORT_DIPSETTING(      0x8000, "Common" )
240   PORT_DIPSETTING(      0x0000, "Independant" )
240   PORT_DIPSETTING(      0x0000, "Independent" )
241241
242242   PORT_START("P3_P4")
243243   KONAMI16_LSB_40(3, IPT_BUTTON3 )
r8581r8582
278278{
279279   gijoe_state *state = (gijoe_state *)machine->driver_data;
280280
281   state->maincpu = devtag_get_device(machine, "maincpu");
282   state->audiocpu = devtag_get_device(machine, "audiocpu");
283   state->k054539 = devtag_get_device(machine, "k054539");
284   state->k056832 = devtag_get_device(machine, "k056832");
285   state->k053246 = devtag_get_device(machine, "k053246");
286   state->k053251 = devtag_get_device(machine, "k053251");
281   state->maincpu = machine->device("maincpu");
282   state->audiocpu = machine->device("audiocpu");
283   state->k054539 = machine->device("k054539");
284   state->k056832 = machine->device("k056832");
285   state->k053246 = machine->device("k053246");
286   state->k053251 = machine->device("k053251");
287287
288288   state->dmadelay_timer = timer_alloc(machine, dmaend_callback, NULL);
289289
src/mame/drivers/gei.c
r8581r8582
150150   set_led_status(device->machine, 9,data & 0x08);
151151
152152   /* bit 5 - ticket out in trivia games */
153   ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, (data & 0x20)<< 2);
153   ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x20)<< 2);
154154
155155   /* bit 6 enables NMI */
156156   interrupt_enable_w(space, 0, data & 0x40);
157157
158158   /* bit 7 goes directly to the sound amplifier */
159   dac_data_w(devtag_get_device(device->machine, "dac"), ((data & 0x80) >> 7) * 255);
159   dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255);
160160}
161161
162162static WRITE8_DEVICE_HANDLER( sound2_w )
r8581r8582
173173   set_led_status(device->machine, 12,data & 0x20);
174174
175175   /* bit 7 goes directly to the sound amplifier */
176   dac_data_w(devtag_get_device(device->machine, "dac"), ((data & 0x80) >> 7) * 255);
176   dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255);
177177}
178178
179179static WRITE8_DEVICE_HANDLER( lamps2_w )
src/mame/drivers/badlands.c
r8581r8582
192192   if (scanline & 32)
193193      atarigen_6502_irq_ack_r(space, 0);
194194   else if (!(input_port_read(screen.machine, "FE4000") & 0x40))
195      atarigen_6502_irq_gen(devtag_get_device(screen.machine, "audiocpu"));
195      atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
196196}
197197
198198
r8581r8582
216216   atarigen_interrupt_reset(&state->atarigen, update_interrupts);
217217   atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
218218
219   atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
219   atarigen_sound_io_reset(machine->device("audiocpu"));
220220   memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
221221}
222222
r8581r8582
695695//  if (scanline & 32)
696696//      atarigen_6502_irq_ack_r(screen->machine, 0);
697697//  else if (!(input_port_read(machine, "FE4000") & 0x40))
698//      atarigen_6502_irq_gen(devtag_get_device(screen->machine, "audiocpu"));
698//      atarigen_6502_irq_gen(screen->machine->device("audiocpu"));
699699}
700700
701701
r8581r8582
709709   atarigen_interrupt_reset(&state->atarigen, update_interrupts_bootleg);
710710   atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update_bootleg, 32);
711711
712//  atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
712//  atarigen_sound_io_reset(machine->device("audiocpu"));
713713//  memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
714714}
715715
src/mame/drivers/psikyosh.c
r8581r8582
802802{
803803   psikyosh_state *state = (psikyosh_state *)machine->driver_data;
804804
805   state->maincpu = devtag_get_device(machine, "maincpu");
805   state->maincpu = machine->device("maincpu");
806806
807807   memory_configure_bank(machine, "bank2", 0, 0x1000, memory_region(machine, "gfx1"), 0x20000);
808808
r8581r8582
11961196
11971197static DRIVER_INIT( soldivid )
11981198{
1199   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1199   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12001200}
12011201
12021202static DRIVER_INIT( s1945ii )
12031203{
1204   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1204   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12051205}
12061206
12071207static DRIVER_INIT( daraku )
12081208{
12091209   UINT8 *RAM = memory_region(machine, "maincpu");
12101210   memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
1211   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1211   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12121212}
12131213
12141214static DRIVER_INIT( sbomberb )
12151215{
1216   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1216   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12171217}
12181218
12191219static DRIVER_INIT( gunbird2 )
12201220{
12211221   UINT8 *RAM = memory_region(machine, "maincpu");
12221222   memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
1223   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1223   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12241224}
12251225
12261226static DRIVER_INIT( s1945iii )
12271227{
12281228   UINT8 *RAM = memory_region(machine, "maincpu");
12291229   memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
1230   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1230   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12311231}
12321232
12331233static DRIVER_INIT( dragnblz )
12341234{
1235   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1235   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12361236}
12371237
12381238static DRIVER_INIT( gnbarich )
12391239{
1240   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1240   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12411241}
12421242
12431243static DRIVER_INIT( tgm2 )
12441244{
1245   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1245   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12461246}
12471247
12481248static DRIVER_INIT( mjgtaste )
12491249{
1250   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
1250   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
12511251   /* needs to install mahjong controls too (can select joystick in test mode tho) */
12521252   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x03000000, 0x03000003, 0, 0, mjgtaste_input_r);
12531253}
src/mame/drivers/astinvad.c
r8581r8582
228228{
229229   astinvad_state *state = (astinvad_state *)machine->driver_data;
230230
231   state->maincpu = devtag_get_device(machine, "maincpu");
232   state->ppi8255_0 = devtag_get_device(machine, "ppi8255_0");
233   state->ppi8255_1 = devtag_get_device(machine, "ppi8255_1");
234   state->samples = devtag_get_device(machine, "samples");
231   state->maincpu = machine->device("maincpu");
232   state->ppi8255_0 = machine->device("ppi8255_0");
233   state->ppi8255_1 = machine->device("ppi8255_1");
234   state->samples = machine->device("samples");
235235
236236   state->int_timer = timer_alloc(machine, kamizake_int_gen, NULL);
237237   timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(128), 128);
r8581r8582
256256{
257257   astinvad_state *state = (astinvad_state *)machine->driver_data;
258258
259   state->maincpu = devtag_get_device(machine, "maincpu");
260   state->samples = devtag_get_device(machine, "samples");
259   state->maincpu = machine->device("maincpu");
260   state->samples = machine->device("samples");
261261
262262   state_save_register_global(machine, state->screen_flip);
263263   state_save_register_global_array(machine, state->sound_state);
src/mame/drivers/neodrvr.c
r8581r8582
11/***************************************************************************
22
3    Neo-Geo hardware
3    neodrvr.c
44
5    Neo Geo hardware
56    This file contains all game specific overrides
67
7****************************************************************************/
88
9    In 2010, SNK Playmore, the successor of SNK, released a title catalogue which lists the released
10    games (MVS/AES/CD) including their release dates in Japan. It is not 100% complete.
11    The included title catalogue is the english one.
912
10/* Game specific input definitions */
13    Title catalogue
14    (source: http://neogeomuseum.snkplaymore.co.jp/english/catalogue/index.php)
1115
12static INPUT_PORTS_START( svcpcb )
13   STANDARD_IN0
16    Game Title                                                  Genre           Publisher       Date Released (in Japan)
17    =================================================================================================================================
18    NAM-1975                                                    3D Action       SNK             MVS Cartridge:1990/04/26
19                                                                                                NEOGEO ROM-cart:1991/07/01
20                                                                                                NEOGEO CD:1994/09/09
21    MAHJONG KYORETSUDEN                                         Mahjong         SNK             MVS Cartridge:1990/04/26
22                                                                                                NEOGEO ROM-cart:1991/07/01
23                                                                                                NEOGEO CD:1994/09/09
24    MAGICIAN LORD                                               Action          ADK             MVS Cartridge:1990/04/26
25                                                                                                NEOGEO ROM-cart:1991/07/01
26                                                                                                NEOGEO CD:1994/10/31
27    BASEBALL STARS PROFESSIONAL                                 Sports          SNK             MVS Cartridge:1990/04/26
28                                                                                                NEOGEO ROM-cart:1991/07/01
29                                                                                                NEOGEO CD:1995/04/21
30    TOP PLAYER'S GOLF                                           Sports          SNK             MVS Cartridge:1990/05/23
31                                                                                                NEOGEO ROM-cart:1991/07/01
32                                                                                                NEOGEO CD:1994/09/09
33    NINJA COMBAT                                                Action          ADK             MVS Cartridge:1990/07/24
34                                                                                                NEOGEO ROM-cart:1991/07/01
35                                                                                                NEOGEO CD:1994/10/31
36    RIDING HERO                                                 3D Racing       SNK             MVS Cartridge:1990/07/24
37                                                                                                NEOGEO ROM-cart:1991/07/01
38                                                                                                NEOGEO CD:1995/05/26
39    THE SUPER SPY                                               3D Action       SNK             MVS Cartridge:1990/10/08
40                                                                                                NEOGEO ROM-cart:1991/07/01
41                                                                                                NEOGEO CD:1994/09/09
42    CYBER-LIP                                                   Action          SNK             MVS Cartridge:1990/11/07
43                                                                                                NEOGEO ROM-cart:1991/07/01
44                                                                                                NEOGEO CD:1995/04/21
45    PUZZLED                                                     Puzzle          SNK             MVS Cartridge:1990/11/20
46                                                                                                NEOGEO ROM-cart:1991/07/01
47                                                                                                NEOGEO CD:1994/09/09
48    LEAGUE BOWLING                                              Sports          SNK             MVS Cartridge:1990/12/10
49                                                                                                NEOGEO ROM-cart:1991/07/01
50                                                                                                NEOGEO CD:1994/09/09
51    GHOST PILOTS                                                Shooter         SNK             MVS Cartridge:1991/01/25
52                                                                                                NEOGEO ROM-cart:1991/07/01
53                                                                                                NEOGEO CD:1995/03/17
54    SENGOKU                                                     Action          SNK             MVS Cartridge:1991/02/12
55                                                                                                NEOGEO ROM-cart:1991/07/01
56                                                                                                NEOGEO CD:1995/03/17
57    KING OF THE MONSTERS                                        Fighting        SNK             MVS Cartridge:1991/02/25
58                                                                                                NEOGEO ROM-cart:1991/07/01
59    BLUE'S JOURNEY                                              Action          ADK             MVS Cartridge:1991/03/14
60                                                                                                NEOGEO ROM-cart:1991/07/01
61                                                                                                NEOGEO CD:1994/10/31
62    ALPHA MISSION II                                            Shooter         SNK             MVS Cartridge:1991/03/25
63                                                                                                NEOGEO ROM-cart:1991/07/01
64                                                                                                NEOGEO CD:1994/09/09
65    BURNING FIGHT                                               Action          SNK             MVS Cartridge:1991/05/20
66                                                                                                NEOGEO ROM-cart:1991/08/09
67                                                                                                NEOGEO CD:1994/09/09
68    MINNASAN NO OKAGESAMA DESU                                  Table           Monolith        MVS Cartridge:1991/07/25
69                                                                                                NEOGEO ROM-cart:1991/07/21
70    CROSSED SWORDS                                              Action          ADK             MVS Cartridge:1991/07/25
71                                                                                                NEOGEO ROM-cart:1991/10/01
72                                                                                                NEOGEO CD:1994/10/31
73    LEGEND OF SUCCESS JOE                                       Action          Wave            MVS Cartridge:1991/07
74                                                                                                NEOGEO ROM-cart:1991/08/30
75    QUIZ DAISUSA SEN: THE LAST COUNT DOWN                       Quiz            SNK             MVS Cartridge:1991/07
76                                                                                                NEOGEO ROM-cart:1991/08/30
77    SUPER BASEBALL 2020                                         Sports          SNK             MVS Cartridge:1991/09/20
78                                                                                                NEOGEO ROM-cart:1991/10/25
79                                                                                                NEOGEO CD:1995/02/25
80    ROBO ARMY                                                   Action          SNK             MVS Cartridge:1991/10/30
81                                                                                                NEOGEO ROM-cart:1991/12/20
82                                                                                                NEOGEO CD:1995/04/21
83    THRASH RALLY                                                Racing          ADK             MVS Cartridge:1991/11/08
84                                                                                                NEOGEO ROM-cart:1991/12/20
85                                                                                                NEOGEO CD:1994/10/31
86    EIGHT MAN                                                   Action          SNK             NEOGEO ROM-cart:1991/11/20
87    FATAL FURY                                                  Fighting        SNK             MVS Cartridge:1991/11/25
88                                                                                                NEOGEO ROM-cart:1991/12/20
89                                                                                                NEOGEO CD:1994/09/09
90    BAKATONO-SAMA MAHJONG MAN'YUKI                              Mahjong         Monolith        MVS Cartridge:1991/11
91                                                                                                NEOGEO ROM-cart:1991/12/13
92    THRASH RALLY                                                Racing          ADK             NEOGEO ROM-cart:1991/12/20
93    FOOTBALL FRENZY                                             Sports          SNK             MVS Cartridge:1992/01/31
94                                                                                                NEOGEO ROM-cart:1992/02/21
95                                                                                                NEOGEO CD:1994/09/09
96    SOCCER BRAWL                                                Sports          SNK             MVS Cartridge:1992/02/14
97                                                                                                NEOGEO ROM-cart:1992/03/13
98                                                                                                NEOGEO CD:1995/03/31
99    MUTATION NATION                                             Action          SNK             MVS Cartridge:1992/03/16
100                                                                                                NEOGEO ROM-cart:1992/04/17
101                                                                                                NEOGEO CD:1995/02/25
102    LAST RESORT                                                 Shooter         SNK             MVS Cartridge:1992/03/23
103                                                                                                NEOGEO ROM-cart:1992/04/24
104                                                                                                NEOGEO CD:1994/09/09
105    QUIZ MEITANTEI NEO & GEO: QUIZ DAISOUSASEN PART 2           Quiz            SNK             MVS Cartridge:1992/03
106                                                                                                NEOGEO ROM-cart:1991/04/24
107    BASEBALL STARS 2                                            Sports          SNK             MVS Cartridge:1992/04/15
108                                                                                                NEOGEO ROM-cart:1992/04/28
109                                                                                                NEOGEO CD:1994/09/09
110    NINJA COMMANDO                                              Shooter         ADK             MVS Cartridge:1992/04/30
111                                                                                                NEOGEO ROM-cart:1992/05/29
112                                                                                                NEOGEO CD:1994/10/31
113    KING OF THE MONSTERS 2                                      Fighting        SNK             MVS Cartridge:1992/05/25
114                                                                                                NEOGEO ROM-cart:1992/06/19
115                                                                                                NEOGEO CD:1994/09/09
116    ANDRO DUNOS                                                 Shooter         Visco           MVS Cartridge:1992/06/15
117                                                                                                NEOGEO ROM-cart:1992/07/17
118    WORLD HEROES                                                Fighting        ADK             MVS Cartridge:1992/07/28
119                                                                                                NEOGEO ROM-cart:1992/09/11
120                                                                                                NEOGEO CD:1995/03/17
121    ART OF FIGHTING                                             Fighting        SNK             MVS Cartridge:1992/09/24
122                                                                                                NEOGEO ROM-cart:1992/12/11
123                                                                                                NEOGEO CD:1994/09/09
124    VIEWPOINT                                                   Shooter         Sammy           MVS Cartridge:1992/11/20
125                                                                                                NEOGEO ROM-cart:1992/12/11
126                                                                                                NEOGEO CD:1995/02/25
127    FATAL FURY 2                                                Fighting        SNK             MVS Cartridge:1992/12/10
128                                                                                                NEOGEO ROM-cart:1993/03/05
129                                                                                                NEOGEO CD:1994/09/09
130    SUPER SIDEKICKS                                             Sports          SNK             MVS Cartridge:1992/12/14
131                                                                                                NEOGEO ROM-cart:1993/02/19
132                                                                                                NEOGEO CD:1995/03/31
133    SENGOKU 2                                                   Action          SNK             MVS Cartridge:1993/02/18
134                                                                                                NEOGEO ROM-cart:1993/04/09
135                                                                                                NEOGEO CD:1995/03/17
136    3 COUNT BOUT                                                Fighting        SNK             MVS Cartridge:1993/03/25
137                                                                                                NEOGEO ROM-cart:1993/04/23
138                                                                                                NEOGEO CD:1995/04/21
139    WORLD HEROES 2                                              Fighting        ADK             MVS Cartridge:1993/04/26
140                                                                                                NEOGEO ROM-cart:1993/06/04
141                                                                                                NEOGEO CD:1995/04/14
142    SAMURAI SHODOWN                                             Fighting        SNK             MVS Cartridge:1993/07/07
143                                                                                                NEOGEO ROM-cart:1993/08/11
144                                                                                                NEOGEO CD:1994/09/09
145    FATAL FURY SPECIAL                                          Fighting        SNK             MVS Cartridge:1993/09/16
146                                                                                                NEOGEO ROM-cart:1993/12/22
147                                                                                                NEOGEO CD:1994/09/09
148    SPINMASTER                                                  Sideview Action Data East       MVS Cartridge:1993/12/16
149                                                                                                NEOGEO ROM-cart:1994/02/18
150    ART OF FIGHTING 2                                           Fighting        SNK             MVS Cartridge:1994/02/03
151                                                                                                NEOGEO ROM-cart:1994/03/11
152                                                                                                NEOGEO CD:1994/09/09
153    WINDJAMMERS                                                 Sports          Data East       MVS Cartridge:1994/02/17
154                                                                                                NEOGEO ROM-cart:1994/04/08
155                                                                                                NEOGEO CD:1995/01/20
156    KARNOV'S REVENGE                                            Fighting        Data East       MVS Cartridge:1994/03/17
157                                                                                                NEOGEO ROM-cart:1994/04/28
158                                                                                                NEOGEO CD:1994/12/22
159    SUPER SIDEKICKS 2                                           Sports          SNK             MVS Cartridge:1994/04/19
160                                                                                                NEOGEO ROM-cart:1994/05/27
161                                                                                                NEOGEO CD:1994/09/09
162    WORLD HEROES 2 JET                                          Fighting        ADK             MVS Cartridge:1994/04/26
163                                                                                                NEOGEO ROM-cart:1994/06/10
164                                                                                                NEOGEO CD:1994/11/11
165    TOP HUNTER                                                  Action          SNK             MVS Cartridge:1994/05/18
166                                                                                                NEOGEO ROM-cart:1994/06/24
167                                                                                                NEOGEO CD:1994/09/29
168    GURURIN                                                     Puzzle          Face            MVS Cartridge:1994/05/25
169    FIGHT FEVER                                                 Fighting        VICCOM          MVS Cartridge:1994/06/28
170    JANSHIN DENSETSU: QUEST OF JONGMASTER                       Mahjong         Aicom           MVS Cartridge:1994/06/29
171                                                                                                NEOGEO CD:1995/03/31
172    AERO FIGHTERS 2                                             Topview Shooter Video System    MVS Cartridge:1994/07/18
173                                                                                                NEOGEO ROM-cart:1994/08/26
174                                                                                                NEOGEO CD:1994/09/29
175    AGGRESSORS OF DARK KOMBAT                                   Fighting        ADK             MVS Cartridge:1994/07/26
176                                                                                                NEOGEO ROM-cart:1994/08/26
177                                                                                                NEOGEO CD:1995/01/13
178    THE KING OF FIGHTERS '94                                    Fighting        SNK             MVS Cartridge:1994/08/25
179                                                                                                NEOGEO ROM-cart:1994/10/01
180                                                                                                NEOGEO CD:1994/11/02
181    ZED BLADE                                                   Shooter         NMK             MVS Cartridge:1994/09/13
182    POWER SPIKES II                                             Sports          Video System    MVS Cartridge:1994/10/19
183                                                                                                NEOGEO CD:1995/03/18
184    SAMURAI SHODOWN II                                          Fighting        SNK             MVS Cartridge:1994/10/28
185                                                                                                NEOGEO ROM-cart:1994/12/02
186                                                                                                NEOGEO CD:1994/12/15
187    STREET HOOP                                                 Sports          Data East       MVS Cartridge:1994/12/08
188                                                                                                NEOGEO ROM-cart:1994/12/09
189                                                                                                NEOGEO CD:1995/01/20
190    PUZZLE BOBBLE                                               Puzzle          TAITO           MVS Cartridge:1994/12/21
191                                                                                                NEOGEO CD:1995/05/02
192    SUPER VOLLEY '94                                            Sports          TAITO           MVS Cartridge:1994
193    BOMBERMAN: PANIC BOMBER                                     Puzzle          Eighting        MVS Cartridge:1995/01/18
194    GALAXY FIGHT: UNIVERSAL WARRIORS                            Fighting        Sunsoft         MVS Cartridge:1995/01/24
195                                                                                                NEOGEO ROM-cart:1995/02/25
196                                                                                                NEOGEO CD:1995/04/21
197    QUIZ KING OF FIGHTERS                                       Quiz            Saurus          MVS Cartridge:1995/02/01
198                                                                                                NEOGEO ROM-cart:1995/03/10
199                                                                                                NEOGEO CD:1995/04/07
200    DOUBLE DRAGON                                               Fighting        Technos         MVS Cartridge:1995/03/03
201                                                                                                NEOGEO ROM-cart:1995/03/31
202                                                                                                NEOGEO CD:1995/06/02
203    SUPER SIDEKICKS 3                                           Sports          SNK             MVS Cartridge:1995/03/07
204                                                                                                NEOGEO ROM-cart:1995/04/07
205                                                                                                NEOGEO CD:1995/06/23
206    FATAL FURY 3                                                Fighting        SNK             MVS Cartridge:1995/03/27
207                                                                                                NEOGEO ROM-cart:1995/04/21
208                                                                                                NEOGEO CD:1995/04/28
209    SAVAGE REIGN                                                Fighting        SNK             MVS Cartridge:1995/04/25
210                                                                                                NEOGEO ROM-cart:1995/03/10
211                                                                                                NEOGEO CD:1995/06/16
212    CROSSED SWORDS II                                           Action          ADK             NEOGEO CD:1995/05/02
213    WORLD HEROES PERFECT                                        Fighting        ADK             MVS Cartridge:1995/05/25
214                                                                                                NEOGEO ROM-cart:1995/06/30
215                                                                                                NEOGEO CD:1995/07/21
216    FAR EAST OF EDEN: KABUKI KLASH                              Fighting        Hudson Soft     MVS Cartridge:1995/06/20
217                                                                                                NEOGEO ROM-cart:1995/07/28
218                                                                                                NEOGEO CD:1995/11/24
219    THE KING OF FIGHTERS '95                                    Fighting        SNK             MVS Cartridge:1995/07/25
220                                                                                                NEOGEO ROM-cart:1995/09/01
221                                                                                                NEOGEO CD:1995/09/29
222    IDOL MAHJONG FINAL ROMANCE 2                                Mahjong         Video System    NEOGEO CD:1995/08/25
223    PULSTAR                                                     Sidevi. Shooter Aicom           MVS Cartridge:1995/08/28
224                                                                                                NEOGEO ROM-cart:1995/09/29
225                                                                                                NEOGEO CD:1995/10/27
226    VOLTAGE FIGHTER GOWCAIZER                                   Fighting        Technos         MVS Cartridge:1995/09/18
227                                                                                                NEOGEO ROM-cart:1995/10/20
228                                                                                                NEOGEO CD:1995/11/24
229    STAKES WINNER                                               Action          Saurus          MVS Cartridge:1995/09/27
230                                                                                                NEOGEO ROM-cart:1995/10/27
231                                                                                                NEOGEO CD:1996/03/22
232    SHOGI NO TATSUJIN - MASTER OF SYOUGI                        Japanese chess  ADK             MVS Cartridge:1995/09/28
233                                                                                                NEOGEO ROM-cart:1995/10/13
234                                                                                                NEOGEO CD:1995/10/20
235    AERO FIGHTERS 3                                             Topview Action  Video System    MVS Cartridge:1995/10/12
236                                                                                                NEOGEO ROM-cart:1995/11/17
237                                                                                                NEOGEO CD:1995/12/08
238    ADK WORLD                                                   Variety         ADK             NEOGEO CD:1995/11/10
239    SAMURAI SHODOWN III                                         Fighting        SNK             MVS Cartridge:1995/11/15
240                                                                                                NEOGEO ROM-cart:1995/12/01
241                                                                                                NEOGEO CD:1995/12/29
242    CHIBI MARUKO-CHAN DELUXE QUIZ                               Variety         Takara          MVS Cartridge:1995/11/27
243                                                                                                NEOGEO ROM-cart:1996/01/26
244    PUZZLE DE PON!                                              Puzzle          Visco           MVS Cartridge:1995/11/28
245    REAL BOUT FATAL FURY                                        Fighting        SNK             MVS Cartridge:1995/12/21
246                                                                                                NEOGEO ROM-cart:1996/01/26
247                                                                                                NEOGEO CD:1996/02/23
248    NEO-GEO CD SPECIAL                                          Variety         SNK             NEOGEO CD:1995/12/22
249    NEO TURF MASTERS                                            Sports          Nazca           MVS Cartridge:1996/01/29
250                                                                                                NEOGEO ROM-cart:1996/03/01
251                                                                                                NEOGEO CD:1996/05/03
252    ART OF FIGHTING 3                                           Fighting        SNK             MVS Cartridge:1996/03/12
253                                                                                                NEOGEO ROM-cart:1996/04/26
254                                                                                                NEOGEO CD:1996/06/14
255    MAGICAL DROP II                                             Puzzle          Data East       MVS Cartridge:1996/03/21
256                                                                                                NEOGEO ROM-cart:1996/04/19
257                                                                                                NEOGEO CD:1996/05/24
258    OSHIDASHI JIN TRICK                                         Puzzle          ADK             NEOGEO CD:1996/03/22
259    NEO DRIFT OUT                                               Racing          Visco           MVS Cartridge:1996/03/28
260                                                                                                NEOGEO CD:1996/07/26
261    METAL SLUG                                                  Action          Nazca           MVS Cartridge:1996/04/19
262                                                                                                NEOGEO ROM-cart:1996/05/24
263                                                                                                NEOGEO CD:1996/07/05
264    OVER TOP                                                    Racing          ADK             MVS Cartridge:1996/04/26
265                                                                                                NEOGEO ROM-cart:1996/06/07
266                                                                                                NEOGEO CD:1996/07/26
267    NINJA MASTER'S                                              Fighting        ADK             MVS Cartridge:1996/05/27
268                                                                                                NEOGEO ROM-cart:1996/06/28
269                                                                                                NEOGEO CD:1996/09/27
270    RAGNAGARD                                                   Fighting        Saurus          MVS Cartridge:1996/06/13
271                                                                                                NEOGEO ROM-cart:1996/07/26
272                                                                                                NEOGEO CD:1996/08/23
273    FUTSAL                                                      Sports          Saurus          NEOGEO CD:1996/07/19
274    THE KING OF FIGHTERS '96                                    Fighting        SNK             MVS Cartridge:1996/07/30
275                                                                                                NEOGEO ROM-cart:1996/09/27
276                                                                                                NEOGEO CD:1996/10/25
277    KIZUNA ENCOUNTER SUPER TAG BATTLE                           Fighting        SNK             MVS Cartridge:1996/09/20
278                                                                                                NEOGEO ROM-cart:1996/11/08
279    CHOUTETSU BURIKINGA                                         Shooter         Saurus          NEOGEO CD:1996/09/20
280    STAKES WINNER 2                                             Real Jockey Act Saurus          MVS Cartridge:1996/09/24
281                                                                                                NEOGEO ROM-cart:1996/12/13
282    THE ULTIMATE 11                                             Sports          SNK             MVS Cartridge:1996/10/16
283                                                                                                NEOGEO ROM-cart:1996/12/20
284    SAMURAI SHODOWN IV                                          Fighting        SNK             MVS Cartridge:1996/10/25
285                                                                                                NEOGEO ROM-cart:1996/11/29
286                                                                                                NEOGEO CD:1996/12/27
287    WAKU WAKU 7                                                 Fighting        Sunsoft         MVS Cartridge:1996/11/21
288                                                                                                NEOGEO ROM-cart:1996/12/27
289    TWINKLE STAR SPRITES                                        Shooter         ADK             MVS Cartridge:1996/11/25
290                                                                                                NEOGEO ROM-cart:1997/01/31
291                                                                                                NEOGEO CD:1997/02/21
292    BREAKERS                                                    Fighting        Visco           MVS Cartridge:1996/12/17
293                                                                                                NEOGEO ROM-cart:1997/03/21
294                                                                                                NEOGEO CD:1997/04/25
295    MONEY IDOL EXCHANGER                                        Puzzle          Face            MVS Cartridge:1997/01/15
296    Real Bout FATAL FURY SPECIAL                                Fighting        SNK             MVS Cartridge:1997/01/28
297                                                                                                NEOGEO ROM-cart:1997/02/28
298                                                                                                NEOGEO CD:1997/03/03
299    THE KING OF FIGHTERS '96 NEOGEO COLLECTION                  Variety         SNK             NEOGEO CD:1997/02/14
300    MAGICAL DROP III                                            Puzzle          Data East       MVS Cartridge:1997/02/25
301                                                                                                NEOGEO ROM-cart:1997/04/25
302    NEO BOMBERMAN                                               Action          Hudson Soft     MVS Cartridge:1997/05/01
303    NEO MR.DO!                                                  Action          Visco           MVS Cartridge:1997/06/26
304    SHINSETSU SAMURAI SHODOWN BUSHIDO RETSUDEN                  Role-playing    SNK             NEOGEO CD:1997/06/27
305    THE KING OF FIGHTERS '97                                    Fighting        SNK             MVS Cartridge:1997/07/28
306                                                                                                NEOGEO ROM-cart:1997/09/25
307                                                                                                NEOGEO CD:1997/10/30
308    UCCHAN NANCHAN NO HONO NO CHALLENGER ULTRA DENRYU IRAIRABOU Action          Saurus          MVS Cartridge:1997/08/25
309    SHOCK TROOPERS                                              Shooter         Saurus          MVS Cartridge:1997/11/11
310    THE LAST BLADE                                              Fighting        SNK             MVS Cartridge:1997/12/05
311                                                                                                NEOGEO ROM-cart:1998/01/29
312                                                                                                NEOGEO CD:1998/03/26
313    BLAZING STAR                                                Shooter         Yumekobo        MVS Cartridge:1998/01/19
314                                                                                                NEOGEO ROM-cart:1998/02/26
315    METAL SLUG 2                                                Action          SNK             MVS Cartridge:1998/02/23
316                                                                                                NEOGEO ROM-cart:1998/04/02
317                                                                                                NEOGEO CD:1998/06/25
318    REAL BOUT FATAL FURY 2                                      Fighting        SNK             MVS Cartridge:1998/03/20
319                                                                                                NEOGEO ROM-cart:1998/04/29
320                                                                                                NEOGEO CD:1998/07/23
321    NEOGEO CUP '98                                              Sports          SNK             MVS Cartridge:1998/05/28
322                                                                                                NEOGEO ROM-cart:1998/07/30
323    BREAKERS REVENGE                                            Fighting        Visco           MVS Cartridge:1998/07/03
324                                                                                                NEOGEO ROM-cart:
325    THE KING OF FIGHTERS '98                                    Fighting        SNK             MVS Cartridge:1998/07/23
326                                                                                                NEOGEO ROM-cart:1998/09/23
327                                                                                                NEOGEO CD:1998/12/23
328    SHOCK TROOPERS 2nd Squad                                    Action Shooter  Saurus          MVS Cartridge:1998/11/06
329                                                                                                NEOGEO ROM-cart:1999/06/24
330    THE LAST BLADE 2                                            Fighting        SNK             MVS Cartridge:1998/11/25
331                                                                                                NEOGEO ROM-cart:1999/01/28
332                                                                                                NEOGEO CD:1999/02/27
333    FLIP SHOT                                                   Action          Visco           MVS Cartridge:1998/12/08
334    METAL SLUG X                                                Action          SNK             MVS Cartridge:1999/03/19
335                                                                                                NEOGEO ROM-cart:1999/05/27
336    CAPTAIN TOMADAY                                             Shooter         Visco           MVS Cartridge:1999/05/27
337    THE KING OF FIGHTERS '99                                    Fighting        SNK             MVS Cartridge:1999/07/22
338                                                                                                NEOGEO ROM-cart:1999/09/23
339                                                                                                NEOGEO CD:1999/12/02
340    PREHISTORIC ISLE 2                                          Shooter         Yumekobo        MVS Cartridge:1999/09/27
341    GAROU: MARK OF THE WOLVES                                   Fighting        SNK             MVS Cartridge:1999/11/26
342                                                                                                NEOGEO ROM-cart:2000/02/25
343    STRIKERS 1945 PLUS                                          Shooter         Psikyo          MVS Cartridge:1999/12/24
344    METAL SLUG 3                                                Action Shooter  SNK             MVS Cartridge:2000/03/23
345                                                                                                NEOGEO ROM-cart:2000/06/01
346    THE KING OF FIGHTERS 2000                                   Fighting        SNK             MVS Cartridge:2000/07/26
347                                                                                                NEOGEO ROM-cart:2000/12/21
348    NIGHTMARE IN THE DARK                                       Horror Action   Gavaking        MVS Cartridge:2001
349    ZUPAPA!                                                     Comical Action  Video System    MVS Cartridge:2001
350    SENGOKU 3                                                   Action          SNK PLAYMORE    MVS Cartridge:2001/07/18
351                                                                                                NEOGEO ROM-cart:2001/10/25
352    THE KING OF FIGHTERS 2001                                   Fighting        SNK PLAYMORE    MVS Cartridge:2001/11/15
353                                                                                                NEOGEO ROM-cart:2002/03/14
354    METAL SLUG 4                                                Action Shooter  SNK PLAYMORE    MVS Cartridge:2002/03/27
355                                                                                                NEOGEO ROM-cart:2002/06/13
356    RAGE OF THE DRAGONS                                         Fighting        Evoga           MVS Cartridge:2002/06/06
357                                                                                                NEOGEO ROM-cart:2002/09/26
358    THE KING OF FIGHTERS 2002                                   Fighting        SNK PLAYMORE    MVS Cartridge:2002/10/10
359                                                                                                NEOGEO ROM-cart:2002/12/19
360    POWER INSTINCT MATRIMELEE                                   Fighting        ATLUS/NOISE FA. MVS Cartridge:2003/03/20
361                                                                                                NEOGEO ROM-cart:2003/05/29
362    SNK VS. CAPCOM: SVC CHAOS                                   Fighting        SNK PLAYMORE    MV-0:2003/07/24
363                                                                                                NEOGEO ROM-cart:2003/11/13
364    SAMURAI SHODOWN V                                           Fighting        SNK P/Yuki Ent  MVS Cartridge:2003/10/10
365                                                                                                NEOGEO ROM-cart:2003/12/11
366    METAL SLUG 5                                                Action Shooter  SNK PLAYMORE    MV-0:2003/11/14
367                                                                                                NEOGEO ROM-cart:2004/02/19
368    THE KING OF FIGHTERS 2003                                   Fighting        SNK PLAYMORE    MV-0:2003/12/12
369                                                                                                NEOGEO ROM-cart:2004/03/18
370    POCHI & NYAA                                                Puzzle          Aiky            MVS Cartridge:2003/12/24
371    SAMURAI SHODOWN V SPECIAL                                   Fighting        SNK P/Yuki Ent  MVS Cartridge:2004/04/22
372                                                                                                NEOGEO ROM-cart:2004/07/15
14373
15   STANDARD_IN1
16374
17   STANDARD_IN2
375    Neo Geo game PCB infos:
376    =======================
18377
19   STANDARD_IN3
378    The Neo Geo games for AES (home) and MVS (arcade) systems are cartridge based.
20379
21   STANDARD_IN4
380    Each cartridge consists of two PCBs: CHA and PROG.
381    .CHA PCB contains gfx data ('C' - rom), text layer data ('S' - rom) and sound driver ('M' - rom).
382    .PROG PCB contains sample data ('V' - rom) and program code ('P' - rom).
22383
23   /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */
24   PORT_START("HARDDIP")
25   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3")
26   PORT_DIPSETTING(   0x00, DEF_STR( Asia ) )
27   PORT_DIPSETTING(   0x01, DEF_STR( Japan ) )
28INPUT_PORTS_END
384    On most PCBs various custom/protection chips can also be found:
29385
386    CHA:
387    . NEO-273
388    . NEO-CMC
389    . NEO-ZMC
390    . NEO-ZMC2
391    . PRO-CT0
392    . SNK-9201
30393
31static INPUT_PORTS_START( ms5pcb )
32   STANDARD_IN0
394    PROG:
395    . 0103 (QFP144)
396    . ALTERA (EPM7128SQC100-15)
397    . NEO-COMA
398    . NEO-PCM2 (SNK 1999)
399    . NEO-PCM2 (PLAYMORE 2002)
400    . NEO-PVC
401    . NEO-SMA
402    . PCM
403    . PRO-CT0
404    . SNK-9201
33405
34   STANDARD_IN1
35406
36   STANDARD_IN2
407    Known PCBs:
408    ============
37409
38   STANDARD_IN3
410    MVS CHA:
411    -- SNK --
412    . NEO-MVS CHA-32
413    . NEO-MVS CHA-8M
414    . NEO-MVS CHA42G
415    . NEO-MVS CHA42G-1
416    . NEO-MVS CHA 42G-2
417    . NEO-MVS CHA 42G-3
418    . NEO-MVS CHA42G-3B
419    . NEO-MVS CHA256
420    . NEO-MVS CHA256B
421    . NEO-MVS PSTM CHA136
422    . NEO-MVS CHA512Y
423    . NEO-MVS CHAFIO (1999.6.14) - used with NEO-CMC 90G06C7042 or NEO-CMC 90G06C7050
424    . MVS CHAFIO REV1.0 (KOF-2001)
425    . NEO-MVS CHAFIO (SNK 2002) - MADE IN KOREA
426    -- SNKPLAYMORE --
427    . NEO-MVS CHAFIO (2003.7.24)
39428
40   STANDARD_IN4
429    MVS PROG:
430    -- SNK --
431    . NEO-MVS PROG-NAM
432    . NEO-MVS PROG-HERO
433    . NEO-MVS PROG-EP
434    . NEO-MVS PROG-8MB
435    . NEO-MVS PROG8M42
436    . NEO-MVS PROG16
437    . NEO-MVS PROG42G
438    . NEO-MVS PROG42G-COM
439    . NEO-MVS PROG42G-1
440    . NEO-MVS PROG-G2
441    . NEO-MVS PROG 4096
442    . NEO-MVS PROG 4096 B
443    . NEO-MVS PROGGSC
444    . NEO-MVS PROGSM
445    . NEO-MVS PROGSS3
446    . NEO-MVS PROGTOP
447    . NEO-MVS PROGSF1 (1998.6.17)
448    . NEO-MVS PROGEOP (1999.2.2)
449    . NEO-MVS PROGLBA (1999.4.12) - LBA-SUB (2000.2.24)
450    . NEO-MVS PROGBK1
451    . NEO-MVS PROGBK2 (2000.3.21)
452    . MVS PROGBK2 REV1.0 (KOF-2001)
453    . NEO-MVS PROGBK2 (SNK 2002) - MADE IN KOREA
454    -- SNKPLAYMORE --
455    . NEO-MVS PROGBK2R (2003.8.26) - NEO-HYCS (2003.9.29)
456    . NEO-MVS PROGBK3R (2003.9.2) - NEO-HYCS (2003.9.29)
457    . NEO-MVS PROGBK3S (2003.10.1)
458    . NEO-MVS PROGBK2S (2003.10.18)
41459
42   /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */
43   PORT_START("HARDDIP")
44   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3")
45   PORT_DIPSETTING(   0x00, DEF_STR( Asia ) )
46   PORT_DIPSETTING(   0x01, DEF_STR( Japan ) )
47INPUT_PORTS_END
48460
461    AES CHA:
462    -- SNK --
463    . NEO-AEG CHA-32
464    . NEO-AEG CHA-8M
465    . NEO-AEG CHA42G
466    . NEO-AEG CHA42G-1
467    . NEO-AEG CHA42G-2B
468    . NEO-AEG CHA42G-3
469    . NEO-AEG CHA42G-4
470    . NEO-AEG CHA256
471    . NEO-AEG CHA256[B]
472    . NEO-AEG CHA256RY
473    . NEO-AEG CHA512Y
474    . NEO-AEG CHAFIO (1999.8.10) - used with NEO-CMC 90G06C7042 or NEO-CMC 90G06C7050
475    -- SNKPLAYMORE --
476    . NEO-AEG CHAFIO (2003.7.24) - used only with NEO-CMC 90G06C7050
49477
50static INPUT_PORTS_START( kog )
51   STANDARD_IN0
478    AES PROG:
479    -- SNK --
480    . NEO-AEG PROG-NAM
481    . NEO-AEG PROG-HERO
482    . NEO-AEG PROG-4A
483    . NEO-AEG PROG-4B
484    . NEO-AEG PROG 8M42
485    . NEO-AEG PROG B
486    . NEO-AEG PROG16
487    . NEO-AEG PROG42G
488    . NEO-AEG PROG42G-COM
489    . NEO-AEG PROG42G-1
490    . NEO-AEG PROG-G2
491    . NEO-AEG PROG4096 B
492    . NEO-AEG PROGGS
493    . NEO-AEG PROGTOP2
494    . NEO-AEG PROGLBA (1999.7.6)
495    . NEO-AEG PROGRK
496    . NEO-AEG PROGRKB
497    . NEO-AEG PROGBK1Y
498    . NEO-AEG PROGBK1F
499    -- PLAYMORE --
500    . NEO-AEG PROGBK2 (2002.4.1) - used with NEO-PCM2 (1999 SNK) or NEO-PCM2 (2002 PLAYMORE)
501    -- SNKPLAYMORE --
502    . NEO-AEG PROGBK3R (2003.8.29) - NEO-HYCS (2003.9.29)
503    . NEO-AEG PROGBK3S (2003.10.6)
504    . NEO-AEG PROGBK2S (2003.10.16)
52505
53   STANDARD_IN1
54506
55   STANDARD_IN2
507    Cartridge colours:
508    ==================
56509
57   STANDARD_IN3
510    MVS cartridges were produced in different colours.
58511
59   STANDARD_IN4
512    Known cartridge colours:
513    . Black
514    . Blue
515    . Green
516    . Grey
517    . Red
518    . Transparent
519    . Transparent Blue
520    . Transparent Green
521    . White
522    . Yellow
60523
61   /* a jumper on the pcb overlays a ROM address, very strange but that's how it works. */
62   PORT_START("JUMPER")
63   PORT_DIPNAME( 0x0001, 0x0001, "Title Language" ) PORT_DIPLOCATION("CART-JUMPER:1")
64   PORT_DIPSETTING(     0x0001, DEF_STR( English ) )
65   PORT_DIPSETTING(     0x0000, "Non-English" )
66   PORT_BIT( 0x00fe, IP_ACTIVE_HIGH, IPT_UNUSED )
67   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
68INPUT_PORTS_END
524    The above listed only covers SNK / PLAYMORE / SNKPLAYMORE PCBs. There also exists a
525    wide range of 'bootleg' PCBs.
69526
70527
71static INPUT_PORTS_START( mjneogeo )
72   PORT_START("IN0")
73   PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1")
74   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
75   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
76   PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2")
77   PORT_DIPSETTING(     0x0000, "1?" )
78   PORT_DIPSETTING(     0x0002, "2?" )
79   PORT_DIPNAME( 0x0004, 0x0000, "Mahjong Control Panel" ) PORT_DIPLOCATION("SW:3")
80   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
81   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
82   PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5")
83   PORT_DIPSETTING(     0x0018, "1" )
84   PORT_DIPSETTING(     0x0008, "2" )
85   PORT_DIPSETTING(     0x0010, "3" )
86   PORT_DIPSETTING(     0x0000, "4" )
87   PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6")
88   PORT_DIPSETTING(     0x0020, DEF_STR( Off ) )
89   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
90   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7")
91   PORT_DIPSETTING(     0x0040, DEF_STR( Off ) )
92   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
93   PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8")
94   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
95   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
96   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_controller_r, NULL)
528    Neo Geo game PCB infos by Johnboy
97529
98   STANDARD_IN1
99530
100   STANDARD_IN2
531****************************************************************************/
101532
102   STANDARD_IN3
533   /* Neo Geo bios */
103534
104   STANDARD_IN4
535/*
536    These are the known Bios Roms, Set options.bios to the one you want.
105537
106   PORT_START("MAHJONG1")
107   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
108   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_B )
109   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_C )
110   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_D )
111   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_E )
112   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_F )
113   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_G )
114   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
115   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
538    The Universe bios roms are supported because they're now used on enough PCBs
539    to be considered 'in active arcade use' rather than just homebrew hacks.
540    Some may be missing, there have been multiple CRCs reported for the same
541    revision in some cases (the Universe bios has an option for entering / displaying
542    a serial number; these should be noted as such if they're added).
116543
117   PORT_START("MAHJONG2")
118   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_H )
119   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_I )
120   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
121   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K )
122   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_L )
123   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_M )
124   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_N )
125   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
126   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
544    The 'japan-hotel' BIOS is a dump of an MVS which could be found in some japanese
545    hotels. it is a custom MVS mobo which uses MVS carts but it hasn't jamma
546    connector and it's similar to a console with a coin mechanism, so it's a sort
547    of little coin op console installed in hotels.
127548
128   PORT_START("MAHJONG3")
129   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
130   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
131   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
132   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
133   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
134   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
135   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )
136   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 )
137   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
549    The current Neo Geo MVS system set (SFIX/SM1/000-LO) used is from a NEO-MVH MV1FS board.
550    Other boards (MV1xx / MV2x / MV4x /MV6) other system sets?
138551
139   PORT_START("MAHJONG4")
140   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
141   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
142   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
143   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
144   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
145   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
146   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
147   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
148   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
149INPUT_PORTS_END
552    Zoom ROM (LO)    128K   TC531000CP      1x 128Kx8   Zoom look-up table ROM
553    Fix ROM (SFIX)   128K   27C1000         1x 128Kx8   Text layer graphics ROM
554    Sound ROM (SM1)  128K   27C1000/23C1000 1x 128Kx8   Z80 program ROM
150555
556*/
151557
152static INPUT_PORTS_START( irrmaze )
153   PORT_START("IN0")
154   STANDARD_DIPS
155   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multiplexed_controller_r, (void *)0)
156
157   PORT_START("IN1")
158   PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
159   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
160   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
161   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
162   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
163
164   PORT_START("IN2")
165   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
166   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
167   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
168   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )
169   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
170   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
171   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
172
173   STANDARD_IN3
174
175   PORT_START("IN4")
176   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
177   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
178   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
179   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
180   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
181   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN )
182   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )  /* this bit is used.. */
183   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2)
184   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
185
186   PORT_START("IN0-0")
187   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(20) PORT_REVERSE
188
189   PORT_START("IN0-1")
190   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(10) PORT_KEYDELTA(20) PORT_REVERSE
191INPUT_PORTS_END
192
193
194static INPUT_PORTS_START( popbounc )
195   PORT_START("IN0")
196   STANDARD_DIPS
197   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multiplexed_controller_r, (void *)0)
198
199   PORT_START("IN1")
200   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
201   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multiplexed_controller_r, (void *)1)
202
203   STANDARD_IN2
204
205   STANDARD_IN3
206
207   STANDARD_IN4
208
209   /* Fake inputs read by CUSTOM_INPUT handlers */
210   PORT_START("IN0-0")
211   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
212
213   PORT_START("IN0-1")
214   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
215   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
216   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
217   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
218   PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* note it needs it from 0x80 when using paddle */
219   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
220   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
221
222   PORT_START("IN1-0")
223   PORT_BIT( 0xff, 0x00, IPT_DIAL  ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(2)
224
225   PORT_START("IN1-1")
226   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
227   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
228   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
229   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
230   PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* note it needs it from 0x80 when using paddle */
231   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
232   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
233INPUT_PORTS_END
234
235
236static INPUT_PORTS_START( vliner )
237   PORT_START("IN0")
238   STANDARD_DIPS
239   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
240   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
241   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
242   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
243   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("View Payout Table/Big")
244   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet/Small")
245   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop/Double Up")
246   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Start/Collect")
247
248   PORT_START("IN1")
249   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
250
251   PORT_START("IN2")
252   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
253   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
254   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
255   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
256   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
257   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
258   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
259
260   PORT_START("IN3")
261   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
262   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, NULL)
263   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, NULL)
264
265   STANDARD_IN4
266
267   PORT_START("IN5")
268   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
269   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
270   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
271   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
272   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Operator Menu") PORT_CODE(KEYCODE_F1)
273   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Clear Credit")
274   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
275   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Hopper Out")
276   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
277
278   /* not sure what any of these bits are */
279   PORT_START("IN6")
280   PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_UNKNOWN )
281   PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
282INPUT_PORTS_END
283
284
285static INPUT_PORTS_START( jockeygp )
286   STANDARD_IN0
287
288   STANDARD_IN1
289
290   PORT_START("IN2")
291   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
292   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */
293   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7)
294   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */
295   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8)
296   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
297   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
298
299   STANDARD_IN3
300
301   STANDARD_IN4
302INPUT_PORTS_END
303
304
305/* Neo-Geo bios */
306
307/******************************************************************************
308
309 These are the known Bios Roms, Set options.bios to the one you want
310
311 The Universe bios roms are supported because they're now used on enough PCBs
312 to be considered 'in active arcade use' rather than just homebrew hacks.
313  -- some may be missing, there have been multiple CRCs reported for the same
314     revision in some cases (the Universe bios has an option for entering / displaying
315     a serial number; these should be noted as such if they're added.
316
317 The 'japan-hotel' BIOS is a dump of an MVS which could be found in some japanese
318 hotels. it is a custom MVS mobo which uses MVS carts but it hasn't jamma
319 connector and it's similar to a console with a coin mechanism, so it's a sort
320 of little coin op console installed in hotels.
321
322 *****************************************************************************/
323
324558#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
325559      ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */
326560
r8581r8582
373607//  ROM_SYSTEM_BIOS(22, "jap-aes",   "Japan AES" )
374608//  ROM_LOAD16_WORD_SWAP_BIOS(22, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */
375609
376/* note you'll have to modify the last for lines of each block to use the extra bios roms,
377   they're hacks / homebrew / console bios roms so MAME doesn't list them by default */
610/*  Note you'll have to modify the last for lines of each block to use the extra bios roms,
611    they're hacks / homebrew / console bios roms so MAME doesn't list them by default. */
378612
379
380/******************************************************************************
381
382    The current Neo-Geo MVS system set (SFIX/SM1/000-LO) used is from a NEO-MVH MV1FS board.
383    Other boards (MV1xx / MV2x / MV4 /MV6) other system sets?
384
385    Zoom ROM (LO)    128K   TC531000CP      1x 128Kx8   Zoom look-up table ROM
386    Fix ROM (SFIX)   128K   27C1000         1x 128Kx8   Text layer graphics ROM
387    Sound ROM (SM1)  128K   27C1000/23C1000 1x 128Kx8   Z80 program ROM
388
389******************************************************************************/
390
391613#define NEO_BIOS_AUDIO_64K(name, hash)                                                         \
392614   NEOGEO_BIOS                                                                         \
393615                                                                                    \
r8581r8582
494716   ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) )
495717
496718
497/* AES and MVS cartridge information */
719/****************************************************************************/
498720
499/***************************************************************************
721   /* Official sets */
500722
501    Neo-Geo game pcb infos:
502    =======================
723/*
724    About supported sets:
503725
504    The Neo-Geo games for AES (home) and MVS (arcade) systems are cartridge based.
726    MVS carts (arcade) were released before the AES carts (home)
727    The actual codepath taken depends entirely on the BIOS rom, not the roms in the cartridge, which (with
728    a few exceptions) support both codepaths.
505729
506    Each cartridge consists of two pcb's: CHA and PROG.
730    The initial AES releases are therefore later revisions of the game, often with bug fixes over the
731    initial MVS releases. It isn't uncommon for later production runs and bootlegs to use these newer sets,
732    so all of them are supported in MAME.
507733
508    CHA pcb contains gfx data ('C' - rom), text layer data ('S' - rom) and sound driver ('M' - rom).
509    PROG pcb contains sample data ('V' - rom) and program code ('P' - rom).
734    Likewise, because the MVS carts were released first (and were produced in higher numbers and generally
735    have a lower cost) it's not uncommon for AES units to operate with converted MVS carts, so, with the
736    exception of the sets that specifically lock out the AES mode* these sets are all equally suitable
737    for MESS.
738    * nitd, kof2001 (initial release has no AES code), and a number of the hacked bootlegs.
510739
511    On most pcb's various custom/protection chips can also be found:
740    The 'MVS ONLY RELEASE' tagged sets were not officially released for the AES (home) system.
741    Information about this can be found at 'The NeoGeo Master List' (unofficial) - http://www.neo-geo.com
742    and the official NeoGeo museum - http://neogeomuseum.snkplaymore.co.jp/english/index.php
743    Several unofficial 'conversions' of these sets can be found across the internet.
744    For completeness sake: Some of these have sets have been relesead for the CD system.
512745
513    CHA:
514    . NEO-273
515    . NEO-CMC
516    . NEO-ZMC
517    . NEO-ZMC2
518    . PRO-CT0
519    . SNK-9201
520746
521    PROG:
522    . 0103 (QFP144)
523    . ALTERA (EPM7128SQC100-15)
524    . NEO-COMA
525    . NEO-PCM2 (SNK 1999)
526    . NEO-PCM2 (PLAYMORE 2002)
527    . NEO-PVC
528    . NEO-SMA
529    . PCM
530    . PRO-CT0
531    . SNK-9201
747    M1 (sound driver) rom information:
748    . Many 'M1' roms contain mirrored data (64k mirrored or 128k mirrored).
749    . Found on several early sets (ID 0001 ~ 0045) and on the last sets (ID 0267 ~ 0272).
750    . This caused some confusion and incorrect rom sizes.
751    . Minimum 'M1' size is 1mbit, maximum size 4mbit.
752    . The remaining 64k 'M1' are marked BAD_DUMP.
532753
533754
534    Known pcb's:
535    ============
755    S1 (text layer) rom information:
756    . All 'S1' roms found on prom are 1mbit.
757    . The remainig 64k 'S1' are marked BAD_DUMP.
536758
537    MVS CHA:
538    -- SNK --
539    . NEO-MVS CHA-32
540    . NEO-MVS CHA-8M
541    . NEO-MVS CHA42G
542    . NEO-MVS CHA42G-1
543    . NEO-MVS CHA 42G-2
544    . NEO-MVS CHA 42G-3
545    . NEO-MVS CHA42G-3B
546    . NEO-MVS CHA256
547    . NEO-MVS CHA256B
548    . NEO-MVS PSTM CHA136
549    . NEO-MVS CHA512Y
550    . NEO-MVS CHAFIO (1999.6.14)
551    . MVS CHAFIO REV1.0 (KOF-2001)
552    . NEO-MVS CHAFIO (SNK 2002) - MADE IN KOREA
553    -- SNKPLAYMORE --
554    . NEO-MVS CHAFIO (2003.7.24)
555759
556    MVS PROG:
557    -- SNK --
558    . NEO-MVS PROG-NAM
559    . NEO-MVS PROG-HERO
560    . NEO-MVS PROG-EP
561    . NEO-MVS PROG-8MB
562    . NEO-MVS PROG8M42
563    . NEO-MVS PROG16
564    . NEO-MVS PROG42G
565    . NEO-MVS PROG42G-COM
566    . NEO-MVS PROG42G-1
567    . NEO-MVS PROG-G2
568    . NEO-MVS PROG 4096
569    . NEO-MVS PROG 4096 B
570    . NEO-MVS PROGGSC
571    . NEO-MVS PROGSM
572    . NEO-MVS PROGSS3
573    . NEO-MVS PROGTOP
574    . NEO-MVS PROGSF1 (1998.6.17)
575    . NEO-MVS PROGEOP (1999.2.2)
576    . NEO-MVS PROGLBA (1999.4.12) - LBA-SUB (2000.2.24)
577    . NEO-MVS PROGBK1
578    . NEO-MVS PROGBK2 (2000.3.21)
579    . MVS PROGBK2 REV1.0 (KOF-2001)
580    . NEO-MVS PROGBK2 (SNK 2002) - MADE IN KOREA
581    -- SNKPLAYMORE --
582    . NEO-MVS PROGBK2R (2003.8.26) - NEO-HYCS (2003.9.29)
583    . NEO-MVS PROGBK3R (2003.9.2) - NEO-HYCS (2003.9.29)
584    . NEO-MVS PROGBK3S (2003.10.1)
585    . NEO-MVS PROGBK2S (2003.10.18)
760    MULTI PLAY MODE:
761    The NeoGeo has three games which support MULTI PLAY MODE (Riding Hero / League Bowling / Trash Rally).
762    This allows you to 'link' 4 games (MVS)/ 2 games (AES)using in game 'Multi-Play' option. To establish
763    a link between the carts you have to connect the carts to each other by a communicator cable. The communicatior
764    cable is a regular headphone cable with stereo pin jack. It has been reported that you can also 'link' MVS <-> AES.
586765
766    All three games use a special PROG board for MULTI PLAY MODE support:
767    . Riding Hero    (AES - NEO-AEG PROG-HERO   / MVS NEO-MVS PROG-HERO)
768    . League Bowling (AES - NEO-AEG PROG-HERO   / MVS NEO-MVS PROG-HERO)
769    . Trash Rally    (AES - NEO-AEG PROG42G-COM / NEO-MVS PROG42G-COM)
587770
588    AES CHA:
589    -- SNK --
590    . NEO-AEG CHA-32
591    . NEO-AEG CHA-8M
592    . NEO-AEG CHA42G
593    . NEO-AEG CHA42G-1
594    . NEO-AEG CHA42G-2B
595    . NEO-AEG CHA42G-3
596    . NEO-AEG CHA42G-4
597    . NEO-AEG CHA256
598    . NEO-AEG CHA256[B]
599    . NEO-AEG CHA256RY
600    . NEO-AEG CHA512Y
601    . NEO-AEG CHAFIO (1999.8.10)
602    -- SNKPLAYMORE --
603    . NEO-AEG CHAFIO (2003.7.24)
771    A HD6301V1P MCU on the above boards is used for establishing the 'link'. The MCU has a 4kb internal ROM which
772    is not dumped.
773    To use the MULTI PLAY MODE on your MVS you have to set the following hardware dips:
774    HARD DIP SETTING  4   5   6
775    CABINET 1:        OFF OFF ON
776    CABINET 2:        OFF ON  ON
777    CABINET 3:        ON  OFF ON
778    CABINET 4:        ON  ON  ON
604779
605    AES PROG:
606    -- SNK --
607    . NEO-AEG PROG-NAM
608    . NEO-AEG PROG-HERO
609    . NEO-AEG PROG-4A
610    . NEO-AEG PROG-4B
611    . NEO-AEG PROG 8M42
612    . NEO-AEG PROG B
613    . NEO-AEG PROG16
614    . NEO-AEG PROG42G
615    . NEO-AEG PROG42G-COM
616    . NEO-AEG PROG42G-1
617    . NEO-AEG PROG-G2
618    . NEO-AEG PROG4096 B
619    . NEO-AEG PROGGS
620    . NEO-AEG PROGTOP2
621    . NEO-AEG PROGLBA (1999.7.6)
622    . NEO-AEG PROGRK
623    . NEO-AEG PROGRKB
624    . NEO-AEG PROGBK1Y
625    . NEO-AEG PROGBK1F
626    -- PLAYMORE --
627    . NEO-AEG PROGBK2 (2002.4.1)
628    -- SNKPLAYMORE --
629    . NEO-AEG PROGBK3R (2003.8.29) - NEO-HYCS (2003.9.29)
630    . NEO-AEG PROGBK2S (2003.10.16)
631
632
633    Cartridge colours:
634    ==================
635
636    MVS cartridges were produced in different colours.
637
638    Known cartridge colours:
639    . Black
640    . Blue
641    . Green
642    . Grey
643    . Red
644    . Transparent
645    . Transparent Blue
646    . Transparent Green
647    . White
648    . Yellow
649
650    The above listed only covers SNK / PLAYMORE / SNKPLAYMORE pcb's. There also exists a
651    wide range of 'bootleg' pcb's.
652
653
654    Neo-Geo game pcb infos by Johnboy
655
656****************************************************************************/
657
658/****************************************************************************
659
660    General set notes:
661    ==================
662
663    NOTES BELOW APPLY TO OEM SETS ONLY!
664
665    Many 'M1' roms contain mirrored data (64k mirrored or 128k mirrored).
666    Found on several early sets (ID 0001 ~ 0045) and on the last sets (ID 0267 ~ 0272).
667    This caused some confusion and incorrect rom sizes.
668    Minimum 'M1' size is 1mbit, maximum size 4mbit.
669    The remaining 64k 'M1' are marked BAD_DUMP.
670
671    All 'S1' roms found on prom are 1mbit.
672    The remainig 64k 'S1' are marked BAD_DUMP.
673
674****************************************************************************/
675
676
677   /* OEM sets */
678
679
680/*
681    Missing (undumped) sets:
682    . Rage of the Dragons (AES)
683    . Last Blade 2 (early revisions) ?
684    . Power Spikes II (early revisions) ?
685    . Metal Slug 3 (rev. Mar/17/2000 1:36)
686    . Metal Slug 4 (AES)
687    . Metal Slug 4 (MVS, 1st revision)
688    . Metal Slug 5 (PCB)
689    . Sengoku 3 (alternate revision)
690
691    All rom labels need to be reverified
692
693    SMA protected sets:
694    On some SMA protected sets there is a small sub pcb found, LBA-SUB (2000.2.24), which replaces the
695    regular used 2x32mbit or 4x16mbit proms. LBA-SUB (2000.2.24) contains 4x16mbit mask proms.
696    MVS sets confirmed are garou, mslug3, mslug3a and kof2000.
697780*/
698781
699/*
700782
701  About supported sets:
702
703  MVS carts (arcade) were released before the AES carts (home)
704  The actual codepath taken depends entirely on the BIOS rom, not the roms in the cartridge, which (with
705  a few exceptions) support both codepaths.
706
707  The initial AES releases are therefore later revisions of the game, often with bug fixes over the
708  initial MVS releases.  It isn't uncommon for later production runs and bootlegs to use these newer sets,
709  so all of them are supported in MAME.
710
711  Likewise, because the MVS carts were released first (and were produced in higher numbers and generally
712  have a lower cost) it's not uncommon for AES units to operate with converted MVS carts, so, with the
713  exception of the sets that specifically lock out the AES mode* these sets are all equally suitable
714  for MESS.
715
716  * nitd, kof2001 (initial release has no AES code), and a number of the hacked bootlegs.
717
718*/
719
720783/* dummy entry for the dummy bios driver */
721784ROM_START( neogeo )
722785   NEOGEO_BIOS
r8581r8582
928991ROM_END
929992
930993ROM_START( ridhero )
994   /* HD6301V1P MCU for MULTI PLAY MODE missing */
931995   ROM_REGION( 0x100000, "maincpu", 0 )
932996   ROM_LOAD16_WORD_SWAP( "006-p1.bin", 0x000000, 0x080000, CRC(d4aaf597) SHA1(34d35b71adb5bd06f4f1b50ffd9c58ab9c440a84) )
933997
r8581r8582
9541018ROM_END
9551019
9561020ROM_START( ridheroh )
1021   /* HD6301V1P MCU for MULTI PLAY MODE missing */
9571022   ROM_REGION( 0x100000, "maincpu", 0 )
9581023   ROM_LOAD16_WORD_SWAP( "006-p1h.bin", 0x000000, 0x080000, CRC(52445646) SHA1(647bb31f2f68453c1366cb6e2e867e37d1df7a54) )
9591024
r8581r8582
10011066   ROM_LOAD16_BYTE( "007-c4.bin", 0x200001, 0x080000, CRC(7d588349) SHA1(a5ed789d7bbc25be5c5b2d99883b64d379c103a2) ) /* Plane 2,3 */
10021067ROM_END
10031068
1004ROM_START( ncombat )
1069ROM_START( ncombat ) /* MVS VERSION */
10051070   ROM_REGION( 0x100000, "maincpu", 0 )
10061071   ROM_LOAD16_WORD_SWAP( "009-p1.bin", 0x000000, 0x080000, CRC(b45fcfbf) SHA1(3872147dda2d1ba905d35f4571065d87b1958b4a) )
10071072
r8581r8582
10261091   ROM_LOAD16_BYTE( "009-c6.bin", 0x200001, 0x80000, CRC(2eca8b19) SHA1(16764ef10e404325ba0a1a2ad3a4c0af287be21f) ) /* Plane 2,3 */
10271092ROM_END
10281093
1029ROM_START( ncombath ) /* MVS AND AES VERSION */
1094ROM_START( ncombath ) /* AES VERSION */
10301095   ROM_REGION( 0x100000, "maincpu", 0 )
10311096   ROM_LOAD16_WORD_SWAP( "009-pg1.bin", 0x000000, 0x080000, CRC(8e9f0add) SHA1(d0b908a86a58f2537eea73a431038f1cd74a5a2f) )
10321097
r8581r8582
11231188   ROM_LOAD16_BYTE( "014-c4.bin", 0x200001, 0x100000, CRC(e4002651) SHA1(17e53a5f4708866a120415bf24f3b89621ad0bcc) ) /* Plane 2,3 */
11241189ROM_END
11251190
1126ROM_START( kotm )
1191ROM_START( kotm ) /* MVS VERSION */
11271192   ROM_REGION( 0x100000, "maincpu", 0 )
11281193   ROM_LOAD16_WORD_SWAP( "016-p1.bin", 0x000000, 0x080000, CRC(1b818731) SHA1(b98b1b33c0301fd79aac908f6b635dd00d1cb08d) )
11291194   ROM_LOAD16_WORD_SWAP( "016-p2.bin", 0x080000, 0x020000, CRC(12afdc2b) SHA1(3a95f5910cbb9f17e63ddece995c6e120fa2f622) )
r8581r8582
12581323ROM_END
12591324
12601325ROM_START( lbowling ) /* MVS AND AES VERSION */
1326   /* HD6301V1P MCU for MULTI PLAY MODE missing */
12611327   ROM_REGION( 0x100000, "maincpu", 0 )
12621328   ROM_LOAD16_WORD_SWAP( "019-p1.bin", 0x000000, 0x080000, CRC(a2de8445) SHA1(893d7ae72b4644123469de143fa35fac1cbcd61e) )
12631329
r8581r8582
15321598   ROM_LOAD16_BYTE( "030-c4.bin", 0x200001, 0x100000, CRC(780d1c4e) SHA1(2e2cf9de828e3b48642dd2203637103438c62142) ) /* Plane 2,3 */
15331599ROM_END
15341600
1535ROM_START( socbrawl )
1601ROM_START( socbrawl ) /* MVS VERSION */
15361602   ROM_REGION( 0x100000, "maincpu", 0 )
1537   ROM_LOAD16_WORD_SWAP( "031-p1.bin", 0x000000, 0x080000, CRC(a2801c24) SHA1(627d76ff0740ca29586f37b268f47fb469822529) )
1603   ROM_LOAD16_WORD_SWAP( "031-pg1.bin", 0x000000, 0x080000, CRC(17f034a7) SHA1(2e66c7bd93a08efe63c4894494db50bbf58f60e4) )
15381604
15391605   NEO_SFIX_128K( "031-s1.bin", CRC(4c117174) SHA1(26e52c4f628338a9aa1c159517cdf873f738fb98) )
15401606
r8581r8582
15541620   ROM_LOAD16_BYTE( "031-c4.bin", 0x200001, 0x080000, CRC(ed297de8) SHA1(616f8fa4c86231f3e79faf9f69f8bb909cbc35f0) ) /* Plane 2,3 */
15551621ROM_END
15561622
1557ROM_START( socbrawla ) /* MVS VERSION */
1623ROM_START( socbrawlh ) /* AES VERSION */
15581624   ROM_REGION( 0x100000, "maincpu", 0 )
1559   ROM_LOAD16_WORD_SWAP( "031-pg1.bin", 0x000000, 0x080000, CRC(17f034a7) SHA1(2e66c7bd93a08efe63c4894494db50bbf58f60e4) )
1625   ROM_LOAD16_WORD_SWAP( "031-p1.bin", 0x000000, 0x080000, CRC(a2801c24) SHA1(627d76ff0740ca29586f37b268f47fb469822529) )
15601626
15611627   NEO_SFIX_128K( "031-s1.bin", CRC(4c117174) SHA1(26e52c4f628338a9aa1c159517cdf873f738fb98) )
15621628
r8581r8582
17081774ROM_END
17091775
17101776ROM_START( trally ) /* MVS AND AES VERSION */
1777   /* HD6301V1P MCU for MULTI PLAY MODE missing */
17111778   ROM_REGION( 0x100000, "maincpu", 0 )
17121779   ROM_LOAD16_WORD_SWAP( "038-p1.bin", 0x000000, 0x080000, CRC(1e52a576) SHA1(a1cb56354c3378e955b0cd482c3c41ae15add952) )
17131780   ROM_LOAD16_WORD_SWAP( "038-p2.bin", 0x080000, 0x080000, CRC(a5193e2f) SHA1(96803480439e90da23cdca70d59ff519ee85beeb) )
r8581r8582
20102077   ROM_CONTINUE( 0x600001, 0x100000 )
20112078ROM_END
20122079
2013ROM_START( janshin )
2080ROM_START( janshin ) /* MVS ONLY RELEASE */
20142081   ROM_REGION( 0x100000, "maincpu", 0 )
20152082   ROM_LOAD16_WORD_SWAP( "048-p1.bin", 0x000000, 0x100000, CRC(7514cb7a) SHA1(da512c0a8e8160a9db7f956e351245327c38eaf1) )
20162083
r8581r8582
21822249   ROM_LOAD16_BYTE( "053-c4.bin", 0x200001, 0x100000, CRC(9270d954) SHA1(a2ef909868f6b06cdcc22a63ddf6c96be12b999c) ) /* Plane 2,3 */
21832250ROM_END
21842251
2185ROM_START( kof94 )
2252ROM_START( kof94 ) /* MVS AND AES VERSION */
21862253   ROM_REGION( 0x200000, "maincpu", 0 )
21872254   ROM_LOAD16_WORD_SWAP( "055-p1.bin", 0x100000, 0x100000, CRC(f10a2042) SHA1(d08a3f3c28be4b1793de7d362456281329fe1828) )
21882255   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
22092276   ROM_LOAD16_BYTE( "055-c8.bin", 0xc00001, 0x200000, CRC(fe0a235d) SHA1(a45c66836e4e3c77dfef9d4c6cc422cb59169149) ) /* Plane 2,3 */
22102277ROM_END
22112278
2212ROM_START( aof2 )
2279ROM_START( aof2 ) /* MVS AND AES RELEASE */
22132280   ROM_REGION( 0x200000, "maincpu", 0 )
22142281   ROM_LOAD16_WORD_SWAP( "056-p1.bin", 0x000000, 0x100000, CRC(a3b1d021) SHA1(ee42f3ca4516226b0088d0303ed28e3ecdabcd71) )
22152282
r8581r8582
22352302   ROM_LOAD16_BYTE( "056-c8.bin", 0xc00001, 0x200000, CRC(e546d7a8) SHA1(74a2fca994a5a93a5784a46c0f68193122456a09) ) /* Plane 2,3 */
22362303ROM_END
22372304
2238ROM_START( aof2a ) /* make parent? */
2305ROM_START( aof2a ) /* MVS AND AES RELEASE */
22392306   ROM_REGION( 0x200000, "maincpu", 0 )
22402307   ROM_LOAD16_WORD_SWAP( "056-p1.bin",  0x000000, 0x100000, CRC(a3b1d021) SHA1(ee42f3ca4516226b0088d0303ed28e3ecdabcd71) )
22412308   /* the rom below acts as a patch to the program rom in the cart, replacing the first 512kb */
r8581r8582
22632330   ROM_LOAD16_BYTE( "056-c8.bin", 0xc00001, 0x200000, CRC(e546d7a8) SHA1(74a2fca994a5a93a5784a46c0f68193122456a09) ) /* Plane 2,3 */
22642331ROM_END
22652332
2266ROM_START( wh2 )
2333ROM_START( wh2 ) /* MVS AND AES VERSION */
22672334   ROM_REGION( 0x200000, "maincpu", 0 )
22682335   ROM_LOAD16_WORD_SWAP( "057-p1.bin", 0x100000, 0x100000, CRC(65a891d9) SHA1(ff8d5ccb0dd22c523902bb3db3c645583a335056) )
22692336   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
22872354   ROM_LOAD16_BYTE( "057-c6.bin", 0x800001, 0x200000, CRC(b13d1de3) SHA1(7d749c23a33d90fe50279e884540d71cf1aaaa6b) ) /* Plane 2,3 */
22882355ROM_END
22892356
2290ROM_START( fatfursp )
2357ROM_START( fatfursp ) /* MVS AND AES RELEASE */
22912358   ROM_REGION( 0x180000, "maincpu", 0 )
22922359   ROM_LOAD16_WORD_SWAP( "058-p1.bin", 0x000000, 0x100000, CRC(2f585ba2) SHA1(429b4bf43fb9b1082c15d645ca328f9d175b976b) )
22932360   ROM_LOAD16_WORD_SWAP( "058-p2.bin", 0x100000, 0x080000, CRC(d7c71a6b) SHA1(b3428063031a2e5857da40a5d2ffa87fb550c1bb) )
r8581r8582
23122379   ROM_LOAD16_BYTE( "058-c6.bin", 0x800001, 0x200000, CRC(8ff1f43d) SHA1(6180ceb5412a3e2e34e9513a3283b9f63087f747) ) /* Plane 2,3 */
23132380ROM_END
23142381
2315ROM_START( fatfursa )
2382ROM_START( fatfursa ) /* MVS AND AES RELEASE */
23162383   ROM_REGION( 0x180000, "maincpu", 0 )
23172384   ROM_LOAD16_WORD_SWAP( "058-p1.bin", 0x000000, 0x100000, CRC(2f585ba2) SHA1(429b4bf43fb9b1082c15d645ca328f9d175b976b) )
23182385   ROM_LOAD16_WORD_SWAP( "058-p2.bin", 0x100000, 0x080000, CRC(d7c71a6b) SHA1(b3428063031a2e5857da40a5d2ffa87fb550c1bb) )
r8581r8582
23662433   ROM_LOAD16_BYTE( "059-c8.bin", 0xc00001, 0x200000, CRC(484ce3ba) SHA1(4f21ed20ce6e2b67e2b079404599310c94f591ff) ) /* Plane 2,3 */
23672434ROM_END
23682435
2369ROM_START( fightfev )
2436ROM_START( fightfev ) /* MVS ONLY RELEASE */
23702437   ROM_REGION( 0x200000, "maincpu", 0 )
23712438   ROM_LOAD16_WORD_SWAP( "060-p1.bin", 0x000000, 0x080000, CRC(3032041b) SHA1(4b8ed2e6f74579ea35a53e06ccac42d6905b0f51) )
23722439   ROM_LOAD16_WORD_SWAP( "060-p2.bin", 0x080000, 0x080000, CRC(b0801d5f) SHA1(085746d8f5d271d5f84ccbb7f577193c391f88d4) )
r8581r8582
23882455   ROM_LOAD16_BYTE( "060-c4.bin", 0x0400001, 0x200000, CRC(026f3b62) SHA1(d608483b70d60e7aa0e41f25a8b3fed508129eb7) ) /* Plane 2,3 */
23892456ROM_END
23902457
2391ROM_START( fightfeva ) /* MVS VERSION */
2458ROM_START( fightfeva ) /* MVS ONLY RELEASE */
23922459   ROM_REGION( 0x200000, "maincpu", 0 )
23932460   ROM_LOAD16_WORD_SWAP( "060-p1.rom", 0x0000000, 0x100000, CRC(2a104b50) SHA1(3eb663d3df7074e1cdf4c0e450a35c9cf55d8979) )
23942461   /* There was also a copy of the 060-p1.bin with the name 060-p2.bin maybe it should be loaded over the top or this
r8581r8582
26102677   ROM_LOAD16_BYTE( "066-c6.bin", 0x800001, 0x200000, CRC(c15c01ed) SHA1(7cf5583e6610bcdc3b332896cefc71df84fb3f19) ) /* Plane 2,3 */
26112678ROM_END
26122679
2613ROM_START( gururin )
2680ROM_START( gururin ) /* MVS ONLY RELEASE */
26142681   ROM_REGION( 0x100000, "maincpu", 0 )
26152682   ROM_LOAD16_WORD_SWAP( "067-p1.bin", 0x000000, 0x80000, CRC(4cea8a49) SHA1(cea4a35db8de898e30eb40dd339b3cbe77ac0856) )
26162683
r8581r8582
26282695   ROM_LOAD16_BYTE( "067-c2.bin", 0x000001, 0x200000, CRC(9db64084) SHA1(68a43c12f63f5e98d68ad0902a6551c5d30f8543) ) /* Plane 2,3 */
26292696ROM_END
26302697
2631ROM_START( pspikes2 ) /* MVS VERSION */
2698ROM_START( pspikes2 ) /* MVS ONLY RELEASE */
26322699   ROM_REGION( 0x100000, "maincpu", 0 )
26332700   ROM_LOAD16_WORD_SWAP( "068-pg1.bin", 0x000000, 0x100000, CRC(105a408f) SHA1(2ee51defa1c24c66c63a6498ee542ac26de3cfbb) )
26342701
r8581r8582
26772744   ROM_LOAD16_BYTE( "069-c6.bin", 0x1000001, 0x200000, CRC(69210441) SHA1(6d496c549dba65caabeaffe5b762e86f9d648a26) ) /* Plane 2,3 */
26782745ROM_END
26792746
2680ROM_START( zupapa ) /* Original Version - Encrypted GFX */
2747ROM_START( zupapa ) /* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */
26812748   ROM_REGION( 0x100000, "maincpu", 0 )
26822749   ROM_LOAD16_WORD_SWAP( "070-p1.bin", 0x000000, 0x100000, CRC(5a96203e) SHA1(49cddec9ca6cc51e5ecf8a34e447a23e1f8a15a1) )
26832750
r8581r8582
27022769   ROM_LOAD16_BYTE( "070-c2.bin", 0x0000001, 0x800000, CRC(70156dde) SHA1(06286bf043d50199b47df9a76ca91f39cb28cb90) ) /* Plane 2,3 */
27032770ROM_END
27042771
2705ROM_START( panicbom )
2772ROM_START( panicbom ) /* MVS ONLY RELEASE */
27062773   ROM_REGION( 0x100000, "maincpu", 0 )
27072774   ROM_LOAD16_WORD_SWAP( "073-p1.bin", 0x000000, 0x080000, CRC(adc356ad) SHA1(801e0a54b65d7a3500e6cef2d6bba40c6356dc1f) )
27082775
r8581r8582
27692836   ROM_LOAD16_BYTE( "075-c4.bin", 0x400001, 0x200000, CRC(1f777206) SHA1(e29c5ae65ebdcc1167a894306d2446ce909639da) ) /* Plane 2,3 */
27702837ROM_END
27712838
2772ROM_START( zedblade )
2839ROM_START( zedblade ) /* MVS ONLY RELEASE */
27732840   ROM_REGION( 0x100000, "maincpu", 0 )
27742841   ROM_LOAD16_WORD_SWAP( "076-p1.bin", 0x000000, 0x080000, CRC(d7c1effd) SHA1(485c2308a40baecd122be9ab4996044622bdcc7e) )
27752842
r8581r8582
29122979   ROM_LOAD16_BYTE( "082-c8.bin", 0xc00001, 0x100000, CRC(69a5fa37) SHA1(020e70e0e8b3c5d00a40fe97e418115a3187e50a) ) /* Plane 2,3 */
29132980ROM_END
29142981
2915ROM_START( pbobblen ) /* MVS VERSION */
2982ROM_START( pbobblen ) /* MVS ONLY RELEASE */
29162983   /* This set uses CHA and PROG board from Power Spikes II. Six Power Spikes II prom's are replaced with
29172984    Puzzle Bobble prom's. Confirmed on several original carts. Do other layouts also exist? */
29182985
r8581r8582
29993066   ROM_LOAD16_BYTE( "084-c8.bin", 0x1800001, 0x100000, CRC(78eb0f9b) SHA1(2925ea21ed2ce167f08a25589e94f28643379034) ) /* Plane 2,3 */
30003067ROM_END
30013068
3002ROM_START( tws96 )
3069ROM_START( tws96 ) /* MVS ONLY RELEASE */
30033070   ROM_REGION( 0x100000, "maincpu", 0 )
30043071   ROM_LOAD16_WORD_SWAP( "086-p1.bin", 0x000000, 0x100000, CRC(03e20ab6) SHA1(3a0a5a54649178ce7a6158980cb4445084b40fb5) )
30053072
r8581r8582
32013268   ROM_LOAD16_BYTE( "092-c4.bin", 0x800001, 0x400000, CRC(de07f997) SHA1(c27a4d4bef868eed38dc152ff37d4135b16cc991) ) /* Plane 2,3 */
32023269ROM_END
32033270
3204ROM_START( neobombe )
3271ROM_START( neobombe ) /* MVS ONLY RELEASE */
32053272   ROM_REGION( 0x100000, "maincpu", 0 )
32063273   ROM_LOAD16_WORD_SWAP( "093-p1.bin", 0x000000, 0x100000, CRC(a1a71d0d) SHA1(059284c84f61a825923d86d2f29c91baa2c439cd) )
32073274
r8581r8582
34293496   ROM_LOAD16_BYTE( "201-c4.bin", 0x800001, 0x400000, CRC(f4ad59a3) SHA1(4e94fda8ee63abf0f92afe08060a488546e5c280) ) /* Plane 2,3 */
34303497ROM_END
34313498
3432ROM_START( puzzledp )
3499ROM_START( puzzledp ) /* MVS ONLY RELEASE */
34333500   ROM_REGION( 0x100000, "maincpu", 0 )
34343501   ROM_LOAD16_WORD_SWAP( "202-p1.bin", 0x000000, 0x080000, CRC(2b61415b) SHA1(0e3e4faf2fd6e63407425e1ac788003e75aeeb4f) )
34353502
r8581r8582
34863553   ROM_LOAD16_BYTE( "206-c4.bin", 0x800001, 0x100000, CRC(55e1314d) SHA1(fffbc9eb9000ff5b1063af1817de7ea4a267fedd) ) /* Plane 2,3 */
34873554ROM_END
34883555
3489ROM_START( neomrdo )
3556ROM_START( neomrdo ) /* MVS ONLY RELEASE */
34903557   ROM_REGION( 0x100000, "maincpu", 0 )
34913558   ROM_LOAD16_WORD_SWAP( "207-p1.bin", 0x000000, 0x80000, CRC(39efdb82) SHA1(75fe68921f871872e5fc92594e43b4cd712e819b) )
34923559
r8581r8582
35043571   ROM_LOAD16_BYTE( "207-c2.bin", 0x000001, 0x200000, CRC(f57166d2) SHA1(bf3aa47d17156485c2177fb63cba093f050abb98) )
35053572ROM_END
35063573
3507ROM_START( sdodgeb )
3574ROM_START( sdodgeb ) /* MVS ONLY RELEASE */
35083575   ROM_REGION( 0x200000, "maincpu", 0 )
35093576   ROM_LOAD16_WORD_SWAP( "208-p1.bin", 0x100000, 0x100000, CRC(127f3d32) SHA1(18e77b79b1197a89371533ef9b1e4d682c44d875) )
35103577   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
35263593   ROM_LOAD16_BYTE( "208-c4.bin", 0x0800001, 0x200000, CRC(c7165f19) SHA1(221f03de893dca0e5305fa17aa94f96c67713818) ) /* Plane 2,3 */
35273594ROM_END
35283595
3529ROM_START( goalx3 )
3596ROM_START( goalx3 ) /* MVS ONLY RELEASE */
35303597   ROM_REGION( 0x200000, "maincpu", 0 )
35313598   ROM_LOAD16_WORD_SWAP( "209-p1.bin", 0x100000, 0x100000, CRC(2a019a79) SHA1(422a639e74284fef2e53e1b49cf8803b0a7e80c6) )
35323599   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
35703637   ROM_LOAD16_BYTE( "212-c6.bin", 0x1000001, 0x200000, CRC(0589c15e) SHA1(b1167caf7cb61f3e05a5d342290bfe00e02e9d38) ) /* Plane 2,3 */
35713638ROM_END
35723639
3573ROM_START( neodrift )
3640ROM_START( neodrift ) /* MVS ONLY RELEASE */
35743641   ROM_REGION( 0x200000, "maincpu", 0 )
35753642   ROM_LOAD16_WORD_SWAP( "213-p1.bin", 0x100000, 0x100000, CRC(e397d798) SHA1(10f459111db4bab7aaa63ca47e83304a84300812) )
35763643   ROM_CONTINUE( 0x000000, 0x100000)
r8581r8582
37503817   ROM_LOAD16_BYTE( "218-c8.bin", 0x1800001, 0x400000, CRC(d9b311f6) SHA1(ba61a7ab3f08bb7348ad6cd01e5d29ca5ee75074) ) /* Plane 2,3 */
37513818ROM_END
37523819
3753ROM_START( pgoal )
3820ROM_START( pgoal ) /* MVS ONLY RELEASE */
37543821   ROM_REGION( 0x200000, "maincpu", 0 )
37553822   ROM_LOAD16_WORD_SWAP( "219-p1.bin", 0x100000, 0x100000, CRC(6af0e574) SHA1(c3f0fed0d942e48c99c80b1713f271c033ce0f4f) )
37563823   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
39814048   ROM_LOAD16_BYTE( "230-c4.bin", 0x800001, 0x400000, CRC(63aeb74c) SHA1(9ff6930c0c3d79b46b86356e8565ce4fcd69ac38) ) /* Plane 2,3 */
39824049ROM_END
39834050
3984ROM_START( miexchng )
4051ROM_START( miexchng ) /* MVS ONLY RELEASE */
39854052   ROM_REGION( 0x100000, "maincpu", 0 )
39864053   ROM_LOAD16_WORD_SWAP( "231-p1.bin", 0x000000, 0x80000, CRC(61be1810) SHA1(1ab0e11352ca05329c6e3f5657b60e4a227fcbfb) )
39874054
r8581r8582
41504217   ROM_LOAD16_BYTE( "234-c6.bin", 0x2000001, 0x400000, CRC(beafd091) SHA1(55df9cc128eb0f00856de3996c946e3efe8f09a5) ) /* Plane 2,3 */
41514218ROM_END
41524219
4153ROM_START( puzzldpr )
4220ROM_START( puzzldpr ) /* MVS ONLY RELEASE */
41544221   ROM_REGION( 0x100000, "maincpu", 0 )
41554222   ROM_LOAD16_WORD_SWAP( "235-p1.bin", 0x000000, 0x080000, CRC(afed5de2) SHA1(a5d82c6dbe687505e8c8d7339908da45cd379a0b) )
41564223
r8581r8582
41684235   ROM_LOAD16_BYTE( "202-c2.bin", 0x000001, 0x100000, CRC(42371307) SHA1(df794f989e2883634bf7ffeea48d6bc3854529af) ) /* Plane 2,3 */
41694236ROM_END
41704237
4171ROM_START( irrmaze )
4238ROM_START( irrmaze ) /* MVS ONLY RELEASE */
41724239   ROM_REGION( 0x200000, "maincpu", 0 )
41734240   ROM_LOAD16_WORD_SWAP( "236-p1.bin", 0x000000, 0x200000, CRC(6d536c6e) SHA1(87d66683304a6617da8af7dfdfcbf4a3ab63056a) )
41744241
r8581r8582
41964263   ROM_LOAD16_BYTE( "236-c2.bin", 0x000001, 0x400000, CRC(e15f972e) SHA1(6a329559c57a67be73a6733513b59e9e6c8d61cc) ) /* Plane 2,3 */
41974264ROM_END
41984265
4199ROM_START( popbounc )
4266ROM_START( popbounc ) /* MVS ONLY RELEASE */
42004267   ROM_REGION( 0x100000, "maincpu", 0 )
42014268   ROM_LOAD16_WORD_SWAP( "237-p1.bin", 0x000000, 0x100000, CRC(be96e44f) SHA1(43679da8664fbb491103a1108040ddf94d59fc2b) )
42024269
r8581r8582
42144281   ROM_LOAD16_BYTE( "237-c2.bin", 0x000001, 0x200000, CRC(5e633c65) SHA1(9a82107caf027317c173c1c1ef676f0fdeea79b2) ) /* Plane 2,3 */
42154282ROM_END
42164283
4217ROM_START( shocktro )
4284ROM_START( shocktro ) /* MVS ONLY RELEASE */
42184285   ROM_REGION( 0x500000, "maincpu", 0 )
42194286   ROM_LOAD16_WORD_SWAP( "238-p1.bin", 0x000000, 0x100000, CRC(5677456f) SHA1(f76169fa5c90871d65e2a16fd1bb036c90533ac8) )
42204287   ROM_LOAD16_WORD_SWAP( "238-p2.bin", 0x100000, 0x400000, CRC(5b4a09c5) SHA1(de04036cba2da4bb2da73d902d1822b82b4f67a9) )
r8581r8582
42404307   ROM_LOAD16_BYTE( "238-c8.bin", 0x1800001, 0x400000, CRC(1c7c2efb) SHA1(b055ee43cbdaf9a3cb19e4e1f9dd2c40bde69d70) ) /* Plane 2,3 */
42414308ROM_END
42424309
4243ROM_START( shocktra )
4310ROM_START( shocktra ) /* MVS ONLY RELEASE */
42444311   ROM_REGION( 0x500000, "maincpu", 0 )
42454312   ROM_LOAD16_WORD_SWAP( "238-pg1.bin", 0x000000, 0x100000, CRC(efedf8dc) SHA1(f638df9bf7aa7d514ee2bccfc7f2adbf39ca83fc) )
42464313   ROM_LOAD16_WORD_SWAP( "238-p2.bin", 0x100000, 0x400000, CRC(5b4a09c5) SHA1(de04036cba2da4bb2da73d902d1822b82b4f67a9) )
r8581r8582
43054372   ROM_REGION( 0x0e00000, "ymsnd", 0 )
43064373   ROM_LOAD( "240-v1.bin", 0x000000, 0x400000, CRC(f796265a) SHA1(736dff37eb91fc856b4d189249fb0de9b6c0813a) )
43074374   ROM_LOAD( "240-v2.bin", 0x400000, 0x400000, CRC(2cb3f3bb) SHA1(697e677890892f4b028c9a27c66809ca0a8a9b18) )
4308   //ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(df77b7fa) SHA1(4df971ce20bdb8c1ce8cc1692a32ac69505ffa9a) ) // bad?
43094375   ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(8fe1367a) SHA1(093d7a4ac2b54ad7ffb2dc316fe29415f7a99535) )
43104376   ROM_LOAD( "240-v4.bin", 0xc00000, 0x200000, CRC(996704d8) SHA1(0bf7a1d0660199dedf3c25be757eeab75cc6147e) )
43114377
r8581r8582
43334399   ROM_REGION( 0x0e00000, "ymsnd", 0 )
43344400   ROM_LOAD( "240-v1.bin", 0x000000, 0x400000, CRC(f796265a) SHA1(736dff37eb91fc856b4d189249fb0de9b6c0813a) )
43354401   ROM_LOAD( "240-v2.bin", 0x400000, 0x400000, CRC(2cb3f3bb) SHA1(697e677890892f4b028c9a27c66809ca0a8a9b18) )
4336   //ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(df77b7fa) SHA1(4df971ce20bdb8c1ce8cc1692a32ac69505ffa9a) ) // bad?
43374402   ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(8fe1367a) SHA1(093d7a4ac2b54ad7ffb2dc316fe29415f7a99535) )
43384403   ROM_LOAD( "240-v4.bin", 0xc00000, 0x200000, CRC(996704d8) SHA1(0bf7a1d0660199dedf3c25be757eeab75cc6147e) )
43394404
r8581r8582
43614426   ROM_REGION( 0x0e00000, "ymsnd", 0 )
43624427   ROM_LOAD( "240-v1.bin", 0x000000, 0x400000, CRC(f796265a) SHA1(736dff37eb91fc856b4d189249fb0de9b6c0813a) )
43634428   ROM_LOAD( "240-v2.bin", 0x400000, 0x400000, CRC(2cb3f3bb) SHA1(697e677890892f4b028c9a27c66809ca0a8a9b18) )
4364   //ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(df77b7fa) SHA1(4df971ce20bdb8c1ce8cc1692a32ac69505ffa9a) ) // bad?
43654429   ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(8fe1367a) SHA1(093d7a4ac2b54ad7ffb2dc316fe29415f7a99535) )
43664430   ROM_LOAD( "240-v4.bin", 0xc00000, 0x200000, CRC(996704d8) SHA1(0bf7a1d0660199dedf3c25be757eeab75cc6147e) )
43674431
r8581r8582
45604624   ROM_LOAD16_BYTE( "244-c2.bin", 0x000001, 0x800000, CRC(33aa0f35) SHA1(3443c7765c6aa177003d42bbfcac9f31d1e12575) ) /* Plane 2,3 */
45614625ROM_END
45624626
4563ROM_START( breakrev )
4627ROM_START( breakrev ) /* MVS ONLY RELEASE */
45644628   ROM_REGION( 0x200000, "maincpu", 0 )
45654629   ROM_LOAD16_WORD_SWAP( "245-p1.bin", 0x100000, 0x100000, CRC(c828876d) SHA1(1dcba850e5cf8219d0945612cfded6d20ca8682a) )
45664630   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
46104674   ROM_LOAD16_BYTE( "246-c6.bin", 0x2000001, 0x800000, CRC(7e2caae1) SHA1(d9de14e3e323664a8c5b7f1df1ba9ec7dd0e6a46) ) /* Plane 2,3 */
46114675ROM_END
46124676
4613ROM_START( flipshot )
4677ROM_START( flipshot ) /* MVS ONLY RELEASE */
46144678   ROM_REGION( 0x100000, "maincpu", 0 )
46154679   ROM_LOAD16_WORD_SWAP( "247-p1.bin", 0x000000, 0x080000, BAD_DUMP CRC(d2e7a7e3) SHA1(1ff4f070fcc658bbc7dc69e16c87f82d7392d100) )
46164680
r8581r8582
46284692   ROM_LOAD16_BYTE( "247-c2.bin", 0x000001, 0x200000, CRC(7d6d6e87) SHA1(6475b58b9f91c20d1f465f3e892de0c68e12a92b) ) /* Plane 2,3 */
46294693ROM_END
46304694
4631ROM_START( pbobbl2n )
4695ROM_START( pbobbl2n ) /* MVS ONLY RELEASE */
46324696   ROM_REGION( 0x100000, "maincpu", 0 )
46334697   ROM_LOAD16_WORD_SWAP( "248-p1.bin", 0x000000, 0x100000, CRC(9d6c0754) SHA1(95c70c2d51fc4de01e768e03cc800a850aaad5dc) )
46344698
r8581r8582
46494713   ROM_LOAD16_BYTE( "248-c4.bin", 0x800001, 0x100000, CRC(8efead3f) SHA1(f577d2f7c6f850b3d100c36947ad15e33dfa0bed) ) /* Plane 2,3 */
46504714ROM_END
46514715
4652ROM_START( ctomaday )
4716ROM_START( ctomaday ) /* MVS ONLY RELEASE */
46534717   ROM_REGION( 0x200000, "maincpu", 0 )
46544718   ROM_LOAD16_WORD_SWAP( "249-p1.bin", 0x100000, 0x100000, CRC(c9386118) SHA1(5554662c7bc8605889cac4a67fee05bbb4eb786f) )
46554719   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
48044868   ROM_LOAD16_BYTE( "251-c8.bin", 0x3000001, 0x800000, CRC(8d921c68) SHA1(42acf1d27d52a8e3b6262eb7df50693c0b135565) ) /* Plane 2,3 */
48054869ROM_END
48064870
4807ROM_START( kof99n ) /* Original Version - Encrypted GFX */
4808   /* If chip label / ID correct: Korean Version ? */
4871ROM_START( kof99k ) /* Original Version - Encrypted GFX */ /* KOREAN VERSION */
48094872   ROM_REGION( 0x500000, "maincpu", 0 )
48104873   ROM_LOAD16_WORD_SWAP( "152-p1.bin", 0x000000, 0x100000, CRC(f2c7ddfa) SHA1(d592eecc53d442c55c2f26a6a721fdf2924d2a5b) )
48114874   ROM_LOAD16_WORD_SWAP( "152-p2.bin", 0x100000, 0x400000, CRC(274ef47a) SHA1(98654b68cc85c19d4a90b46f3110f551fa2e5357) )
r8581r8582
48714934   ROM_LOAD16_BYTE( "251-c8p.bin", 0x3000001, 0x800000, CRC(ead513ce) SHA1(e9b07a0b01fdeb3004755a479df059c81b4d0ed6) ) /* Plane 2,3 */
48724935ROM_END
48734936
4874ROM_START( ganryu ) /* Original Version - Encrypted GFX */
4937ROM_START( ganryu ) /* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */
48754938   ROM_REGION( 0x200000, "maincpu", 0 )
48764939   ROM_LOAD16_WORD_SWAP( "252-p1.bin", 0x100000, 0x100000, CRC(4b8ac4fb) SHA1(93d90271bff281862b03beba3809cf95a47a1e44) )
48774940   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
49995062   ROM_LOAD16_BYTE( "253-c8p.bin", 0x3000001, 0x800000, CRC(f778fe99) SHA1(c963f6ba90a36d02991728b44ffcf174ca18268a) ) /* Plane 2,3 */
50005063ROM_END
50015064
5002ROM_START( s1945p ) /* Original Version, Encrypted GFX Roms */
5065ROM_START( s1945p ) /* Original Version, Encrypted GFX Roms */ /* MVS ONLY RELEASE */
50035066   ROM_REGION( 0x500000, "maincpu", 0 )
50045067   ROM_LOAD16_WORD_SWAP( "254-p1.bin", 0x000000, 0x100000, CRC(ff8efcff) SHA1(dcaeaca573385c172ecc43ee6bee355359091893) )
50055068   ROM_LOAD16_WORD_SWAP( "254-p2.bin", 0x100000, 0x400000, CRC(efdfd4dd) SHA1(254f3e1b546eed788f7ae919be9d1bf9702148ce) )
r8581r8582
50335096   ROM_LOAD16_BYTE( "254-c8.bin", 0x3000001, 0x800000, CRC(66848c7d) SHA1(24d4ed627940a4cf8129761c1da15556e52e199c) ) /* Plane 2,3 */
50345097ROM_END
50355098
5036ROM_START( preisle2 ) /* Original Version, Encrypted GFX */
5099ROM_START( preisle2 ) /* Original Version, Encrypted GFX */ /* MVS ONLY RELEASE */
50375100   ROM_REGION( 0x500000, "maincpu", 0 )
50385101   ROM_LOAD16_WORD_SWAP( "255-p1.bin", 0x000000, 0x100000, CRC(dfa3c0f3) SHA1(793c6a46f3a794536dc0327a3f3fad20e25ab661) )
50395102   ROM_LOAD16_WORD_SWAP( "255-p2.bin", 0x100000, 0x400000, CRC(42050b80) SHA1(0981a8295d43b264c2b95e5d7568bdda4e64c976) )
r8581r8582
50645127   ROM_LOAD16_BYTE( "255-c6.bin", 0x2000001, 0x800000, CRC(b001bdd3) SHA1(394ba8004644844ee97a120cfda48aeac685af8a) ) /* Plane 2,3 */
50655128ROM_END
50665129
5067ROM_START( mslug3 ) /* Original Version - Encrypted Code & GFX */ /* revision 2000.4.1 */
5130ROM_START( mslug3 ) /* Original Version - Encrypted Code & GFX */ /* revision 2000.4.1 */ /* MVS VERSION */
50685131   ROM_REGION( 0x900000, "maincpu", 0 )
50695132   ROM_LOAD16_WORD_SWAP( "256-sma.bin", 0x0c0000, 0x040000, CRC(9cd55736) SHA1(d6efb2b313127c2911d47d9324626b3f1e7c6ccb) )   /* stored in the custom chip */
5070   ROM_LOAD16_WORD_SWAP( "256-p1.bin",  0x100000, 0x400000, CRC(b07edfd5) SHA1(dcbd9e500bfae98d754e55cdbbbbf9401013f8ee) )
5071   ROM_LOAD16_WORD_SWAP( "256-p2.bin",  0x500000, 0x400000, CRC(6097c26b) SHA1(248ec29d21216f29dc6f5f3f0e1ad1601b3501b6) )
5133   /* The SMA for this release has a green colour marking; the older revision has a white colour marking */
5134   ROM_LOAD16_WORD_SWAP( "256-pg1.bin",  0x100000, 0x400000, CRC(b07edfd5) SHA1(dcbd9e500bfae98d754e55cdbbbbf9401013f8ee) )
5135   ROM_LOAD16_WORD_SWAP( "256-pg2.bin",  0x500000, 0x400000, CRC(6097c26b) SHA1(248ec29d21216f29dc6f5f3f0e1ad1601b3501b6) )
50725136
50735137   ROM_Y_ZOOM
50745138
r8581r8582
51005164   ROM_LOAD16_BYTE( "256-c8.bin", 0x3000001, 0x800000, CRC(4d9be34c) SHA1(a737bdfa2b815aea7067e7af2636e83a9409c414) ) /* Plane 2,3 */
51015165ROM_END
51025166
5103ROM_START( mslug3h ) /* Original Version - Encrypted GFX */ /* MVS AND AES VERSION */
5167ROM_START( mslug3h ) /* Original Version - Encrypted GFX */ /* revision 2000.3.17 */ /* AES VERSION */
51045168   ROM_REGION( 0x500000, "maincpu", 0 )
51055169   ROM_LOAD16_WORD_SWAP( "256-ph1.bin", 0x000000, 0x100000, CRC(9c42ca85) SHA1(7a8f77a89867b889295ae9b9dfd4ba28f02d234d) )
51065170   ROM_LOAD16_WORD_SWAP( "256-ph2.bin", 0x100000, 0x400000, CRC(1f3d8ce8) SHA1(08b05a8abfb86ec09a5e758d6273acf1489961f9) )
r8581r8582
51355199   ROM_LOAD16_BYTE( "256-c8.bin", 0x3000001, 0x800000, CRC(4d9be34c) SHA1(a737bdfa2b815aea7067e7af2636e83a9409c414) ) /* Plane 2,3 */
51365200ROM_END
51375201
5138ROM_START( kof2000 ) /* Original Version, Encrypted Code + Sound + GFX Roms */
5202ROM_START( kof2000 ) /* Original Version, Encrypted Code + Sound + GFX Roms */ /* MVS AND AES VERSION */
51395203   ROM_REGION( 0x900000, "maincpu", 0 )
51405204   ROM_LOAD16_WORD_SWAP( "257-sma.bin", 0x0c0000, 0x040000, CRC(71c6e6bb) SHA1(1bd29ded4c6b29780db8e8b772c452189699ca89) )   /* stored in the custom chip */
51415205   ROM_LOAD16_WORD_SWAP( "257-p1.bin",  0x100000, 0x400000, CRC(60947b4c) SHA1(5faa0a7ac7734d6c8e276589bd12dd574264647d) )
r8581r8582
52065270   ROM_LOAD16_BYTE( "257-c8.bin", 0x3000001, 0x800000, CRC(b1afa60b) SHA1(b916184f5cfe4121752270f4f65abf35d8eb0519) ) /* Plane 2,3 */
52075271ROM_END
52085272
5209ROM_START( bangbead ) /* Original Version - Encrypted GFX */
5273ROM_START( bangbead ) /* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */
52105274   ROM_REGION( 0x200000, "maincpu", 0 )
52115275   ROM_LOAD16_WORD_SWAP( "259-p1.bin", 0x100000, 0x100000, CRC(88a37f8b) SHA1(566db84850fad5e8fe822e8bba910a33e083b550) )
52125276   ROM_CONTINUE( 0x000000, 0x100000 )
r8581r8582
52605324ROM_END
52615325#endif
52625326
5263ROM_START( nitd ) /* Original Version - Encrypted GFX */
5327ROM_START( nitd ) /* Original Version - Encrypted GFX */ /* MVS ONLY RELEASE */
52645328   ROM_REGION( 0x100000, "maincpu", 0 )
52655329   ROM_LOAD16_WORD_SWAP( "260-p1.bin", 0x000000, 0x080000, CRC(61361082) SHA1(441f3f41c1aa752c0e0a9a0b1d92711d9e636b85) )
52665330
r8581r8582
53905454ROM_END
53915455
53925456ROM_START( mslug4 ) /* Original Version - Encrypted GFX */ /* MVS VERSION */
5393   ROM_REGION( 0x500000, "maincpu", 0 )
53945457   /* There also exist carts where p1 label is pg1;
53955458    The PG1 revision has a Japanese cart label, SN 02Jxxxxx
53965459    The P1 revision has a US/EUR cart label, SN 02Txxxxx
53975460    Rom data on both is identical.
53985461    These carts were manufactured by Mega Enterprise, not SNK. */
5462   ROM_REGION( 0x500000, "maincpu", 0 )
53995463   ROM_LOAD16_WORD_SWAP( "263-p1.bin", 0x000000, 0x100000, CRC(27e4def3) SHA1(a08785e8145981bb6b5332a3b2df7eb321253cca) )
54005464   ROM_LOAD16_WORD_SWAP( "263-p2.bin", 0x100000, 0x400000, CRC(fdb7aed8) SHA1(dbeaec38f44e58ffedba99e70fa1439c2bf0dfa3) )
54015465
r8581r8582
55655629   ROM_LOAD16_BYTE( "266-c8.bin", 0x3000001, 0x800000, CRC(29873d33) SHA1(dc77f129ed49b8d40d0d4241feef3f6c2f19a987) ) /* Plane 2,3 */
55665630ROM_END
55675631
5568ROM_START( pnyaa ) /* Encrypted Set */ /* MVS VERSION */
5632ROM_START( pnyaa ) /* Encrypted Set */ /* MVS ONLY RELEASE */
55695633   ROM_REGION( 0x100000, "maincpu", 0 )
55705634   ROM_LOAD16_WORD_SWAP( "267-p1.bin", 0x000000, 0x100000, CRC(112fe2c0) SHA1(01420e051f0bdbd4f68ce306a3738161b96f8ba8) )
55715635
r8581r8582
58385902   ROM_LOAD16_BYTE( "271-c8k.bin", 0x3000001, 0x800000, CRC(312f528c) SHA1(b4ad75f54f730ada6cb00112b74022250f055725) ) /* Plane 2,3 */
58395903ROM_END
58405904
5841ROM_START( samsh5sp ) /* Encrypted Set */
5905ROM_START( samsh5sp ) /* Encrypted Set */ /* MVS VERSION */
58425906   ROM_REGION( 0x800000, "maincpu", 0 )
58435907   ROM_LOAD16_WORD_SWAP( "272-p1.bin", 0x000000, 0x400000, CRC(fb7a6bba) SHA1(f68c527208d8a55ca44b0caaa8ab66b3a0ffdfe5) )
58445908   ROM_LOAD16_WORD_SWAP( "272-p2.bin", 0x400000, 0x400000, CRC(63492ea6) SHA1(6ba946acb62c63ed61a42fe72b7fff3828883bcc) )
r8581r8582
58725936   ROM_LOAD16_BYTE( "272-c8.bin", 0x3000001, 0x800000, CRC(d49773cd) SHA1(cd8cf3b762d381c1f8f12919579c84a7ef7efb3f) ) /* Plane 2,3 */
58735937ROM_END
58745938
5875ROM_START( samsh5sph ) /* Encrypted Set */
5939ROM_START( samsh5sph ) /* Encrypted Set */ /* AES VERSION */
58765940   ROM_REGION( 0x800000, "maincpu", 0 )
58775941   ROM_LOAD16_WORD_SWAP( "272-p1c.bin", 0x000000, 0x400000, CRC(9291794d) SHA1(66588ff9b00ffad6508b03423548984e28a3209d) )
58785942   ROM_LOAD16_WORD_SWAP( "272-p2c.bin", 0x400000, 0x400000, CRC(fa1a7dd8) SHA1(62443dad76d6c1e18f515d7d4ef8e1295a4b7f1d) )
r8581r8582
59075971   ROM_LOAD16_BYTE( "272-c8.bin", 0x3000001, 0x800000, CRC(d49773cd) SHA1(cd8cf3b762d381c1f8f12919579c84a7ef7efb3f) ) /* Plane 2,3 */
59085972ROM_END
59095973
5910ROM_START( samsh5spn ) /* Encrypted Set */
5974ROM_START( samsh5spn ) /* Encrypted Set */ /* AES VERSION */
59115975   ROM_REGION( 0x800000, "maincpu", 0 )
59125976   ROM_LOAD16_WORD_SWAP( "272-p1ca.bin", 0x000000, 0x400000, CRC(c30a08dd) SHA1(66864954017c841d7ca8490112c3aa7a71a4da70) )
59135977   ROM_LOAD16_WORD_SWAP( "272-p2ca.bin", 0x400000, 0x400000, CRC(bd64a518) SHA1(aa259a168930f106377d680db444535411b3bce0) )
r8581r8582
59426006   ROM_LOAD16_BYTE( "272-c8.bin", 0x3000001, 0x800000, CRC(d49773cd) SHA1(cd8cf3b762d381c1f8f12919579c84a7ef7efb3f) ) /* Plane 2,3 */
59436007ROM_END
59446008
5945ROM_START( jockeygp )
6009ROM_START( jockeygp ) /* Officially licensed? Cart has a holographic 'SNK' sticker applied */
6010   /* PROG board used: MVS PROGV (2000.11.17)
6011    CHA board used: NEO-MVS CHAFIO (1999.6.14) */
59466012   ROM_REGION( 0x200000, "maincpu", 0 )
5947   ROM_LOAD16_WORD_SWAP( "jgp-p1.bin", 0x000000, 0x100000, CRC(2fb7f388) SHA1(e3c9b03944b4c10cf5081caaf9c8be1f08c06493) )
6013   ROM_LOAD16_WORD_SWAP( "008-epr.p1", 0x000000, 0x100000, CRC(2fb7f388) SHA1(e3c9b03944b4c10cf5081caaf9c8be1f08c06493) )
6014   /* P on eprom, correct chip label unknown */
59486015   ROM_FILL( 0x100000, 0x100000, 0xff )
59496016
59506017   ROM_Y_ZOOM
r8581r8582
59566023   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
59576024
59586025   /* Encrypted */
5959   NEO_BIOS_AUDIO_ENCRYPTED_512K( "jgp-m1.bin", CRC(d163c690) SHA1(1dfd04d20c5985037f07cd01000d0b04f3a8f4f4) )
6026   NEO_BIOS_AUDIO_ENCRYPTED_512K( "008-mg1.bin", CRC(d163c690) SHA1(1dfd04d20c5985037f07cd01000d0b04f3a8f4f4) )
59606027
59616028   ROM_REGION( 0x0200000, "ymsnd", 0 )
5962   ROM_LOAD( "jgp-v1.bin", 0x000000, 0x200000, CRC(443eadba) SHA1(3def3c22f0e276bc4c2fc7ff70ce473c08b0d2df) )
6029   ROM_LOAD( "008-v1.bin", 0x000000, 0x200000, CRC(443eadba) SHA1(3def3c22f0e276bc4c2fc7ff70ce473c08b0d2df) )
59636030
59646031   NO_DELTAT_REGION
59656032
59666033   ROM_REGION( 0x1000000, "sprites", 0 )
59676034   /* Encrypted */
5968   ROM_LOAD16_BYTE( "jgp-c1.bin", 0x0000000, 0x800000, CRC(a9acbf18) SHA1(d55122c70cbe78c2679598dc07863e1d1d1a31df) ) /* Plane 0,1 */
5969   ROM_LOAD16_BYTE( "jgp-c2.bin", 0x0000001, 0x800000, CRC(6289eef9) SHA1(a2ede77bb2468a2e1486d74745a22a5451026039) ) /* Plane 2,3 */
6035   ROM_LOAD16_BYTE( "008-c1.bin", 0x0000000, 0x800000, CRC(a9acbf18) SHA1(d55122c70cbe78c2679598dc07863e1d1d1a31df) ) /* Plane 0,1 */
6036   ROM_LOAD16_BYTE( "008-c2.bin", 0x0000001, 0x800000, CRC(6289eef9) SHA1(a2ede77bb2468a2e1486d74745a22a5451026039) ) /* Plane 2,3 */
59706037ROM_END
59716038
5972ROM_START( vliner )
6039ROM_START( vliner ) /* Officially licensed? Cart has a holographic 'SNK' sticker applied */
6040   /* PROG board used: MVS PROGV (2000.11.17)
6041    CHA board used: MVS CHAV (2000.10.26 */
59736042   ROM_REGION( 0x100000, "maincpu", 0 )
5974   ROM_LOAD16_WORD_SWAP( "vl-p1.bin", 0x000000, 0x080000, CRC(72a2c043) SHA1(b34bcc10ff33e4465126a6865fe8bf6b6a3d6cee) )
6043   ROM_LOAD16_WORD_SWAP( "epr.p1", 0x000000, 0x080000, CRC(72a2c043) SHA1(b34bcc10ff33e4465126a6865fe8bf6b6a3d6cee) )
6044   /* P on eprom, correct chip label unknown */
59756045
5976   NEO_SFIX_128K( "vl-s1.bin", CRC(972d8c31) SHA1(41f09ef28a3791668ea304c74b8b06c117a50e9a) )
6046   NEO_SFIX_128K( "s-1.s1", CRC(972d8c31) SHA1(41f09ef28a3791668ea304c74b8b06c117a50e9a) )
59776047
5978   NEO_BIOS_AUDIO_64K( "vl-m1.bin", CRC(9b92b7d1) SHA1(2c9b777feb9a8e43fa1bd942aba5afe3b5427d94) )
6048   NEO_BIOS_AUDIO_64K( "m-1.m1", CRC(9b92b7d1) SHA1(2c9b777feb9a8e43fa1bd942aba5afe3b5427d94) )
59796049
59806050   ROM_REGION( 0x200000, "ymsnd", ROMREGION_ERASE00 )
59816051
59826052   NO_DELTAT_REGION
59836053
59846054   ROM_REGION( 0x400000, "sprites", 0 )
5985   ROM_LOAD16_BYTE( "vl-c1.bin", 0x000000, 0x80000, CRC(5118f7c0) SHA1(b6fb6e9cbb660580d98e00780ebf248c0995145a) ) /* Plane 0,1 */
5986   ROM_LOAD16_BYTE( "vl-c2.bin", 0x000001, 0x80000, CRC(efe9b33e) SHA1(910c651aadce9bf59e51c338ceef62287756d2e8) ) /* Plane 2,3 */
6055   ROM_LOAD16_BYTE( "c-1.c1", 0x000000, 0x80000, CRC(5118f7c0) SHA1(b6fb6e9cbb660580d98e00780ebf248c0995145a) ) /* Plane 0,1 */
6056   ROM_LOAD16_BYTE( "c-2.c2", 0x000001, 0x80000, CRC(efe9b33e) SHA1(910c651aadce9bf59e51c338ceef62287756d2e8) ) /* Plane 2,3 */
59876057ROM_END
59886058
5989ROM_START( vlinero )
6059ROM_START( vlinero ) /* Officially licensed? Cart has a holographic 'SNK' sticker applied */
6060   /* PROG board used: MVS PROGV (2000.11.17)
6061    CHA board used: MVS CHAV (2000.10.26 */
59906062   ROM_REGION( 0x100000, "maincpu", 0 )
5991   ROM_LOAD16_WORD_SWAP( "vl-p1_54.bin", 0x000000, 0x080000, CRC(172efc18) SHA1(8ca739f8780a9e6fa19ac2c3e931d75871603f58) )
6063   ROM_LOAD16_WORD_SWAP( "epr_54.p1", 0x000000, 0x080000, CRC(172efc18) SHA1(8ca739f8780a9e6fa19ac2c3e931d75871603f58) )
6064   /* P on eprom, correct chip label unknown */
59926065
5993   NEO_SFIX_128K( "vl-s1.bin", CRC(972d8c31) SHA1(41f09ef28a3791668ea304c74b8b06c117a50e9a) )
6066   NEO_SFIX_128K( "s-1.s1", CRC(972d8c31) SHA1(41f09ef28a3791668ea304c74b8b06c117a50e9a) )
59946067
5995   NEO_BIOS_AUDIO_64K( "vl-m1.bin", CRC(9b92b7d1) SHA1(2c9b777feb9a8e43fa1bd942aba5afe3b5427d94) )
6068   NEO_BIOS_AUDIO_64K( "m-1.m1", CRC(9b92b7d1) SHA1(2c9b777feb9a8e43fa1bd942aba5afe3b5427d94) )
59966069
59976070   ROM_REGION( 0x200000, "ymsnd", ROMREGION_ERASE00 )
59986071
59996072   NO_DELTAT_REGION
60006073
60016074   ROM_REGION( 0x400000, "sprites", 0 )
6002   ROM_LOAD16_BYTE( "vl-c1.bin", 0x000000, 0x80000, CRC(5118f7c0) SHA1(b6fb6e9cbb660580d98e00780ebf248c0995145a) ) /* Plane 0,1 */
6003   ROM_LOAD16_BYTE( "vl-c2.bin", 0x000001, 0x80000, CRC(efe9b33e) SHA1(910c651aadce9bf59e51c338ceef62287756d2e8) ) /* Plane 2,3 */
6075   ROM_LOAD16_BYTE( "c-1.c1", 0x000000, 0x80000, CRC(5118f7c0) SHA1(b6fb6e9cbb660580d98e00780ebf248c0995145a) ) /* Plane 0,1 */
6076   ROM_LOAD16_BYTE( "c-2.c2", 0x000001, 0x80000, CRC(efe9b33e) SHA1(910c651aadce9bf59e51c338ceef62287756d2e8) ) /* Plane 2,3 */
60046077ROM_END
60056078
60066079
6080/****************************************************************************/
6081
60076082   /* Jamma PCB sets */
60086083
60096084
6010/******************************************************************************
6085/*
60116086    The following Jamma PCB boards are known:
60126087
60136088    SNK vs. CAPCOM SVC CHAOS (svcpcb)
r8581r8582
60216096
60226097    The King of Fighters 2003
60236098    NEO-MVH MVOC 2003.11.3
6024******************************************************************************/
6099*/
60256100
60266101
60276102/* complete redump required */
r8581r8582
61656240ROM_END
61666241
61676242
6243/****************************************************************************/
6244
61686245   /* Bootleg sets */
61696246
6170
61716247/*
6172    Most bootleg sets are incomplete (missing 'C', 'V' and 'M' roms).
6173    Verification required.
6248    About supported sets:
61746249
6250    For many bootleg sets, only P's (program rom), M1 (sound driver) and S1 (text layer) roms were dumped.
6251    For these sets it is assumed that the original V's (sound data) and C's (gfx data) are used.
6252    This requires verification.
6253
61756254*/
61766255
61776256
r8581r8582
71867265   ROM_LOAD16_BYTE( "dig-c2.bin", 0x000001, 0x080000, CRC(3e632161) SHA1(83711c4286fb1d9f3f91414ac6e5fed36618033e) ) /* Plane 2,3 */
71877266ROM_END
71887267
7189/* NeoPrint
71907268
7191Very little is known about the NeoPrint system at this time.
7269   /* NeoPrint */
71927270
7193The cartridges fit in a normal NeoGeo unit but they do not work.  They appear to be designed to work with a
7194different motherboard (and different bios rom)
7271/*
7272    Very little is known about the NeoPrint system at this time.
71957273
719698best44 is the only NeoPrint cart we've seen with a program rom.
7197Many of the others only contain graphic roms.  I'm speculating that the NeoPrint was a multi-slot system and
7198had a concept of Master and Slave cartridges, and the slave ones simply added new graphic themes.
7274    The cartridges fit in a normal Neo Geo unit but they do not work.  They appear to be designed to work with a
7275    different motherboard (and different bios rom)
71997276
7200If anybody has any actual factual information on the NeoPrint system, please contribute it.
7277    98best44 is the only NeoPrint cart we've seen with a program rom.
7278    Many of the others only contain graphic roms.  I'm speculating that the NeoPrint was a multi-slot system and
7279    had a concept of Master and Slave cartridges, and the slave ones simply added new graphic themes.
72017280
7281    If anybody has any actual factual information on the NeoPrint system, please contribute it.
72027282*/
72037283
7204/*
72057284
7206logo: Neo Print
7207
7208small text: Cassette supporting Neo Print and Neo Print Multi
7209
7210(cassette=cartridge)
7211
7212title: '98 NeoPri Best 44 version
7213
7214*/
7215
72167285ROM_START( 98best44 )
7286   /* logo: Neo Print
7287    small text: Cassette supporting Neo Print and Neo Print Multi
7288    (cassette=cartridge)
7289    title: '98 NeoPri Best 44 version */
72177290   ROM_REGION( 0x100000, "maincpu", 0 )
72187291   ROM_LOAD16_WORD_SWAP( "p060-ep1", 0x000000, 0x080000, CRC(d42e505d) SHA1(0ad6b0288f36c339832730a03e53cbc07dab4f82))
72197292
r8581r8582
72477320ROM_END
72487321
72497322
7250/* Game specific inits */
7323/****************************************************************************/
72517324
7325   /* Game specific input definitions */
7326
7327
7328static INPUT_PORTS_START( svcpcb )
7329   STANDARD_IN0
7330
7331   STANDARD_IN1
7332
7333   STANDARD_IN2
7334
7335   STANDARD_IN3
7336
7337   STANDARD_IN4
7338
7339   /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */
7340   PORT_START("HARDDIP")
7341   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3")
7342   PORT_DIPSETTING(   0x00, DEF_STR( Asia ) )
7343   PORT_DIPSETTING(   0x01, DEF_STR( Japan ) )
7344INPUT_PORTS_END
7345
7346
7347static INPUT_PORTS_START( ms5pcb )
7348   STANDARD_IN0
7349
7350   STANDARD_IN1
7351
7352   STANDARD_IN2
7353
7354   STANDARD_IN3
7355
7356   STANDARD_IN4
7357
7358   /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */
7359   PORT_START("HARDDIP")
7360   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3")
7361   PORT_DIPSETTING(   0x00, DEF_STR( Asia ) )
7362   PORT_DIPSETTING(   0x01, DEF_STR( Japan ) )
7363INPUT_PORTS_END
7364
7365
7366static INPUT_PORTS_START( kog )
7367   STANDARD_IN0
7368
7369   STANDARD_IN1
7370
7371   STANDARD_IN2
7372
7373   STANDARD_IN3
7374
7375   STANDARD_IN4
7376
7377   /* a jumper on the pcb overlays a ROM address, very strange but that's how it works. */
7378   PORT_START("JUMPER")
7379   PORT_DIPNAME( 0x0001, 0x0001, "Title Language" ) PORT_DIPLOCATION("CART-JUMPER:1")
7380   PORT_DIPSETTING(     0x0001, DEF_STR( English ) )
7381   PORT_DIPSETTING(     0x0000, "Non-English" )
7382   PORT_BIT( 0x00fe, IP_ACTIVE_HIGH, IPT_UNUSED )
7383   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
7384INPUT_PORTS_END
7385
7386
7387static INPUT_PORTS_START( mjneogeo )
7388   PORT_START("IN0")
7389   PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1")
7390   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
7391   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
7392   PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2")
7393   PORT_DIPSETTING(     0x0000, "1?" )
7394   PORT_DIPSETTING(     0x0002, "2?" )
7395   PORT_DIPNAME( 0x0004, 0x0000, "Mahjong Control Panel" ) PORT_DIPLOCATION("SW:3")
7396   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
7397   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
7398   PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5")
7399   PORT_DIPSETTING(     0x0018, "1" )
7400   PORT_DIPSETTING(     0x0008, "2" )
7401   PORT_DIPSETTING(     0x0010, "3" )
7402   PORT_DIPSETTING(     0x0000, "4" )
7403   PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6")
7404   PORT_DIPSETTING(     0x0020, DEF_STR( Off ) )
7405   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
7406   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7")
7407   PORT_DIPSETTING(     0x0040, DEF_STR( Off ) )
7408   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
7409   PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8")
7410   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
7411   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
7412   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_controller_r, NULL)
7413
7414   STANDARD_IN1
7415
7416   STANDARD_IN2
7417
7418   STANDARD_IN3
7419
7420   STANDARD_IN4
7421
7422   PORT_START("MAHJONG1")
7423   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
7424   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_B )
7425   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_C )
7426   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_D )
7427   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_E )
7428   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_F )
7429   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_G )
7430   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
7431   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
7432
7433   PORT_START("MAHJONG2")
7434   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_H )
7435   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_I )
7436   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
7437   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K )
7438   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_L )
7439   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_M )
7440   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_N )
7441   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
7442   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
7443
7444   PORT_START("MAHJONG3")
7445   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
7446   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
7447   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
7448   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
7449   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
7450   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
7451   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )
7452   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 )
7453   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
7454
7455   PORT_START("MAHJONG4")
7456   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
7457   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
7458   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
7459   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
7460   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
7461   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
7462   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
7463   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
7464   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
7465INPUT_PORTS_END
7466
7467
7468static INPUT_PORTS_START( irrmaze )
7469   PORT_START("IN0")
7470   STANDARD_DIPS
7471   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multiplexed_controller_r, (void *)0)
7472
7473   PORT_START("IN1")
7474   PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED )
7475   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
7476   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
7477   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
7478   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
7479
7480   PORT_START("IN2")
7481   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
7482   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
7483   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
7484   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )
7485   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
7486   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
7487   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
7488
7489   STANDARD_IN3
7490
7491   PORT_START("IN4")
7492   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7493   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7494   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7495   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7496   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7497   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7498   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )  /* this bit is used.. */
7499   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2)
7500   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
7501
7502   PORT_START("IN0-0")
7503   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(20) PORT_REVERSE
7504
7505   PORT_START("IN0-1")
7506   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(10) PORT_KEYDELTA(20) PORT_REVERSE
7507INPUT_PORTS_END
7508
7509
7510static INPUT_PORTS_START( popbounc )
7511   PORT_START("IN0")
7512   STANDARD_DIPS
7513   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multiplexed_controller_r, (void *)0)
7514
7515   PORT_START("IN1")
7516   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
7517   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multiplexed_controller_r, (void *)1)
7518
7519   STANDARD_IN2
7520
7521   STANDARD_IN3
7522
7523   STANDARD_IN4
7524
7525   /* Fake inputs read by CUSTOM_INPUT handlers */
7526   PORT_START("IN0-0")
7527   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
7528
7529   PORT_START("IN0-1")
7530   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
7531   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
7532   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
7533   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
7534   PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* note it needs it from 0x80 when using paddle */
7535   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
7536   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
7537
7538   PORT_START("IN1-0")
7539   PORT_BIT( 0xff, 0x00, IPT_DIAL  ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(2)
7540
7541   PORT_START("IN1-1")
7542   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
7543   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
7544   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
7545   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
7546   PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* note it needs it from 0x80 when using paddle */
7547   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
7548   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
7549INPUT_PORTS_END
7550
7551
7552static INPUT_PORTS_START( vliner )
7553   PORT_START("IN0")
7554   STANDARD_DIPS
7555   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
7556   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
7557   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
7558   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
7559   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("View Payout Table/Big")
7560   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet/Small")
7561   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop/Double Up")
7562   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Start/Collect")
7563
7564   PORT_START("IN1")
7565   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
7566
7567   PORT_START("IN2")
7568   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
7569   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
7570   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
7571   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
7572   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
7573   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
7574   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
7575
7576   PORT_START("IN3")
7577   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
7578   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, NULL)
7579   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, NULL)
7580
7581   STANDARD_IN4
7582
7583   PORT_START("IN5")
7584   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
7585   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
7586   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
7587   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
7588   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Operator Menu") PORT_CODE(KEYCODE_F1)
7589   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Clear Credit")
7590   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
7591   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Hopper Out")
7592   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
7593
7594   /* not sure what any of these bits are */
7595   PORT_START("IN6")
7596   PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_UNKNOWN )
7597   PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
7598INPUT_PORTS_END
7599
7600
7601static INPUT_PORTS_START( jockeygp )
7602   STANDARD_IN0
7603
7604   STANDARD_IN1
7605
7606   PORT_START("IN2")
7607   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
7608   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */
7609   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7)
7610   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */
7611   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8)
7612   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
7613   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
7614
7615   STANDARD_IN3
7616
7617   STANDARD_IN4
7618INPUT_PORTS_END
7619
7620
7621/****************************************************************************/
7622
7623   /* Game specific inits */
7624
72527625static DRIVER_INIT( fatfury2 )
72537626{
72547627   DRIVER_INIT_CALL(neogeo);
r8581r8582
72787651   kof99_install_protection(machine);
72797652}
72807653
7281static DRIVER_INIT( kof99n )
7654static DRIVER_INIT( kof99k )
72827655{
72837656   neogeo_state *state = (neogeo_state *)machine->driver_data;
72847657   DRIVER_INIT_CALL(neogeo);
r8581r8582
78568229   DRIVER_INIT_CALL(neogeo);
78578230}
78588231
7859/***********************************************************************/
78608232
8233/****************************************************************************/
78618234
78628235/*    YEAR  NAME       PARENT    MACHINE   INPUT     INIT      MONITOR  */
78638236GAME( 1990, neogeo,    0,        neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT | GAME_SUPPORTS_SAVE )
r8581r8582
78918264GAME( 1991, 2020bb,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", GAME_SUPPORTS_SAVE )
78928265GAME( 1991, 2020bba,   2020bb,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", GAME_SUPPORTS_SAVE )
78938266GAME( 1991, 2020bbh,   2020bb,   neogeo,   neogeo,   neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", GAME_SUPPORTS_SAVE )
7894GAME( 1991, socbrawl,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (AES cart)", GAME_SUPPORTS_SAVE )
7895GAME( 1991, socbrawla, socbrawl, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 2)", GAME_SUPPORTS_SAVE )
8267GAME( 1991, socbrawl,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 1)", GAME_SUPPORTS_SAVE )
8268GAME( 1991, socbrawlh, socbrawl, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 2)", GAME_SUPPORTS_SAVE )
78968269GAME( 1991, fatfury1,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", GAME_SUPPORTS_SAVE )
78978270GAME( 1991, roboarmy,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army", GAME_SUPPORTS_SAVE )
78988271//GAME( 1991, roboarma,  roboarmy, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army (set 2)", GAME_SUPPORTS_SAVE )
r8581r8582
79588331GAME( 1999, kof99,     neogeo,   neogeo,   neogeo,   kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */
79598332GAME( 1999, kof99a,    kof99,    neogeo,   neogeo,   kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX, crashes going into attract demo */
79608333GAME( 1999, kof99e,    kof99,    neogeo,   neogeo,   kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */
7961GAME( 1999, kof99n,    kof99,    neogeo,   neogeo,   kof99n,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , GAME_SUPPORTS_SAVE )   /* Encrypted GFX */
8334GAME( 1999, kof99k,    kof99,    neogeo,   neogeo,   kof99k,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (Korean release)" , GAME_SUPPORTS_SAVE )   /* Encrypted GFX */
79628335GAME( 1999, kof99p,    kof99,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", GAME_SUPPORTS_SAVE )
79638336GAME( 1999, garou,     neogeo,   neogeo,   neogeo,   garou,    ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */
79648337GAME( 1999, garouo,    garou,    neogeo,   neogeo,   garouo,   ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code & GFX */
src/mame/drivers/esh.c
r8581r8582
272272
273273static MACHINE_START( esh )
274274{
275   laserdisc = devtag_get_device(machine, "laserdisc");
275   laserdisc = machine->device("laserdisc");
276276}
277277
278278
src/mame/drivers/fromance.c
r8581r8582
965965
966966   memory_configure_bank(machine, "bank1", 0, 0x100, &ROM[0x10000], 0x4000);
967967
968   state->subcpu = devtag_get_device(machine, "sub");
968   state->subcpu = machine->device("sub");
969969
970970   state_save_register_global(machine, state->directionflag);
971971   state_save_register_global(machine, state->commanddata);
src/mame/drivers/skykid.c
r8581r8582
9090static WRITE8_HANDLER( skykid_irq_1_ctrl_w )
9191{
9292   int bit = !BIT(offset,11);
93   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
93   cpu_interrupt_enable(space->machine->device("maincpu"), bit);
9494   if (!bit)
9595      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
9696}
r8581r8582
9898static WRITE8_HANDLER( skykid_irq_2_ctrl_w )
9999{
100100   int bit = !BIT(offset,13);
101   cpu_interrupt_enable(devtag_get_device(space->machine, "mcu"), bit);
101   cpu_interrupt_enable(space->machine->device("mcu"), bit);
102102   if (!bit)
103103      cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
104104}
src/mame/drivers/djmain.c
r8581r8582
175175   UINT16 ret = 0;
176176
177177   if (ACCESSING_BITS_0_7)
178      ret |= k054539_r(devtag_get_device(space->machine, "konami2"), offset);
178      ret |= k054539_r(space->machine->device("konami2"), offset);
179179   if (ACCESSING_BITS_8_15)
180      ret |= k054539_r(devtag_get_device(space->machine, "konami1"), offset)<<8;
180      ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
181181
182182   return ret;
183183}
r8581r8582
185185static WRITE16_HANDLER( dual539_w )
186186{
187187   if (ACCESSING_BITS_0_7)
188      k054539_w(devtag_get_device(space->machine, "konami2"), offset, data);
188      k054539_w(space->machine->device("konami2"), offset, data);
189189   if (ACCESSING_BITS_8_15)
190      k054539_w(devtag_get_device(space->machine, "konami1"), offset, data>>8);
190      k054539_w(space->machine->device("konami1"), offset, data>>8);
191191}
192192
193193
r8581r8582
246246
247247static READ32_HANDLER( v_rom_r )
248248{
249   running_device *k056832 = devtag_get_device(space->machine, "k056832");
249   running_device *k056832 = space->machine->device("k056832");
250250   UINT8 *mem8 = memory_region(space->machine, "gfx2");
251251   int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
252252
r8581r8582
11781178   PORT_DIPSETTING(    0x00, "8" )
11791179
11801180#define POPN_DSW2_GAUGEDECREMENT \
1181   PORT_DIPNAME( 0x0c, 0x0c, "Guage Decrement Level" ) PORT_DIPLOCATION("SW2:6,5") \
1181   PORT_DIPNAME( 0x0c, 0x0c, "Gauge Decrement Level" ) PORT_DIPLOCATION("SW2:6,5") \
11821182   PORT_DIPSETTING(    0x04, "0" ) \
11831183   PORT_DIPSETTING(    0x0c, "1" ) \
11841184   PORT_DIPSETTING(    0x08, "2" ) \
11851185   PORT_DIPSETTING(    0x00, "3" )
11861186
11871187#define POPN_DSW2_GAUGEINCREMENT \
1188   PORT_DIPNAME( 0x03, 0x03, "Guage Increment Level" ) PORT_DIPLOCATION("SW2:8,7") \
1188   PORT_DIPNAME( 0x03, 0x03, "Gauge Increment Level" ) PORT_DIPLOCATION("SW2:8,7") \
11891189   PORT_DIPSETTING(    0x01, "0" ) \
11901190   PORT_DIPSETTING(    0x03, "1" ) \
11911191   PORT_DIPSETTING(    0x02, "2" ) \
r8581r8582
13431343   PORT_DIPSETTING(    0x80, DEF_STR ( Medium ) )
13441344   PORT_DIPSETTING(    0x40, DEF_STR ( Low ) )
13451345   PORT_DIPSETTING(    0x00, "Silent" )
1346   PORT_DIPNAME( 0x30, 0x30, "Guage Decrement Level" ) PORT_DIPLOCATION("SW1:4,3")
1346   PORT_DIPNAME( 0x30, 0x30, "Gauge Decrement Level" ) PORT_DIPLOCATION("SW1:4,3")
13471347   PORT_DIPSETTING(    0x20, "0" )
13481348   PORT_DIPSETTING(    0x30, "1" )
13491349   PORT_DIPSETTING(    0x10, "2" )
13501350   PORT_DIPSETTING(    0x00, "3" )
1351   PORT_DIPNAME( 0x0c, 0x0c, "Guage Increment Level" ) PORT_DIPLOCATION("SW1:6,5")
1351   PORT_DIPNAME( 0x0c, 0x0c, "Gauge Increment Level" ) PORT_DIPLOCATION("SW1:6,5")
13521352   PORT_DIPSETTING(    0x08, "0" )
13531353   PORT_DIPSETTING(    0x0c, "1" )
13541354   PORT_DIPSETTING(    0x04, "2" )
r8581r8582
14371437
14381438static MACHINE_START( djmain )
14391439{
1440   running_device *ide = devtag_get_device(machine, "ide");
1440   running_device *ide = machine->device("ide");
14411441
14421442   if (ide != NULL && ide_master_password != NULL)
14431443      ide_set_master_password(ide, ide_master_password);
src/mame/drivers/segas16a.c
r8581r8582
218218   state->lamp_changed_w = NULL;
219219   state->i8751_vblank_hook = NULL;
220220
221   state->maincpu = devtag_get_device(machine, "maincpu");
222   state->soundcpu = devtag_get_device(machine, "soundcpu");
223   state->mcu = devtag_get_device(machine, "mcu");
224   state->ymsnd = devtag_get_device(machine, "ymsnd");
225   state->ppi8255 = devtag_get_device(machine, "ppi8255");
226   state->n7751 = devtag_get_device(machine, "n7751");
221   state->maincpu = machine->device("maincpu");
222   state->soundcpu = machine->device("soundcpu");
223   state->mcu = machine->device("mcu");
224   state->ymsnd = machine->device("ymsnd");
225   state->ppi8255 = machine->device("ppi8255");
226   state->n7751 = machine->device("n7751");
227227}
228228
229229
r8581r8582
260260{
261261   segas1x_state *state = (segas1x_state *)machine->driver_data;
262262
263   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
263   fd1094_machine_init(machine->device("maincpu"));
264264
265265   /* if we have a fake i8751 handler, disable the actual 8751 */
266266   if (state->i8751_vblank_hook != NULL)
r8581r8582
33853385   ROM_LOAD( "317-wb35.key", 0x0000, 0x2000, BAD_DUMP CRC(8a2e0575) SHA1(e43a2c8ca102ec38871067685a860da53d748765) )
33863386ROM_END
33873387
3388ROM_START( wb35a )
3389   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
3390   ROM_LOAD16_BYTE( "epr-12120.43_alt", 0x000000, 0x10000, CRC(cbd8c99b) SHA1(2401aab80293bbe3b603a0b6af33ebc8834915e9) )
3391   ROM_LOAD16_BYTE( "epr-12118.26_alt", 0x000001, 0x10000, CRC(e9a3280c) SHA1(b7725171286915f8e1039d8063ba9e9f6ab40b56) )
3392   ROM_LOAD16_BYTE( "epr-12121.42",     0x020000, 0x10000, CRC(5e44c0a9) SHA1(4d4c9575a6cd571a7cf635164e92afd92d4b63fe) )
3393   ROM_LOAD16_BYTE( "epr-12119.25_alt", 0x020001, 0x10000, CRC(01ed3ef9) SHA1(29491a81a735198393f1cc2f06940cf40168ff59) )
3394
3395   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
3396   ROM_LOAD( "epr-12086.95", 0x00000, 0x10000, CRC(45b949df) SHA1(84390d16da00b775988e5f6c20950cb2304b1a74) )
3397   ROM_LOAD( "epr-12087.94", 0x10000, 0x10000, CRC(5fb761aa) SHA1(dcf88e68732a8ec122d0603d87f6ea1f1614adef) )
3398   ROM_LOAD( "epr-12088.83", 0x20000, 0x10000, CRC(00579c39) SHA1(12acdea75e3d040d60a9f32d05fd9e0191d38f21) )
3399
3400   ROM_REGION16_BE( 0x80000, "gfx2", 0 ) /* sprites */
3401   ROM_LOAD16_BYTE( "epr-12090.b1", 0x00001, 0x008000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
3402   ROM_CONTINUE(                    0x40001, 0x008000 )
3403   ROM_LOAD16_BYTE( "epr-12094.b5", 0x00000, 0x008000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
3404   ROM_CONTINUE(                    0x40000, 0x008000 )
3405   ROM_LOAD16_BYTE( "epr-12091.b2", 0x10001, 0x008000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
3406   ROM_CONTINUE(                    0x50001, 0x008000 )
3407   ROM_LOAD16_BYTE( "epr-12095.b6", 0x10000, 0x008000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) )
3408   ROM_CONTINUE(                    0x50000, 0x008000 )
3409   ROM_LOAD16_BYTE( "epr-12092.b3", 0x20001, 0x008000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) )
3410   ROM_CONTINUE(                    0x60001, 0x008000 )
3411   ROM_LOAD16_BYTE( "epr-12096.b7", 0x20000, 0x008000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) )
3412   ROM_CONTINUE(                    0x60000, 0x008000 )
3413   ROM_LOAD16_BYTE( "epr-12093.b4", 0x30001, 0x008000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) )
3414   ROM_CONTINUE(                    0x70001, 0x008000 )
3415   ROM_LOAD16_BYTE( "epr-12097.b8", 0x30000, 0x008000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) )
3416   ROM_CONTINUE(                    0x70000, 0x008000 )
3417
3418   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
3419   ROM_LOAD( "epr-12089.12", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
3420
3421   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
3422   ROM_LOAD( "317-wb35.key", 0x0000, 0x2000, BAD_DUMP CRC(8a2e0575) SHA1(e43a2c8ca102ec38871067685a860da53d748765) )
3423ROM_END
3424
3425
33883426/*************************************
33893427 *
33903428 *  Generic driver initialization
r8581r8582
35213559GAME( 1988, tetris3,    tetris,   system16a_no7751, tetris,     generic_16a, ROT0,   "Sega",           "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", GAME_SUPPORTS_SAVE )
35223560GAME( 1987, timescan1,  timescan, system16a,        timescan,   fd1089b_16a, ROT270, "Sega",           "Time Scanner (set 1, System 16A, FD1089B 317-0024)", GAME_SUPPORTS_SAVE )
35233561GAME( 1988, wb31,       wb3,      system16a_no7751, wb3,        generic_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 1, System 16A, FD1094 317-0084)", GAME_SUPPORTS_SAVE )
3524GAME( 1988, wb35,       wb3,      system16a_no7751, wb3,        fd1089a_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 5, System 16A, FD1089A 317-xxxx)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3562GAME( 1988, wb35,       wb3,      system16a_no7751, wb3,        fd1089a_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 5, System 16A, FD1089A 317-xxxx, bad dump?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3563GAME( 1988, wb35a,      wb3,      system16a_no7751, wb3,        fd1089a_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 6, System 16A, FD1089A 317-xxxx)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
src/mame/drivers/neogeo.c
r8581r8582
99        * This driver was made possible by the research done by
1010          Charles MacDonald.  For a detailed description of the Neo-Geo
1111          hardware, please visit his page at:
12          http://cgfm2.emuviews.com/temp/mvstech.txt
12          http://cgfm2.emuviews.com/txt/mvstech.txt
1313        * Presented to you by the Shin Emu Keikaku team.
1414        * The following people have all spent probably far
1515          too much time on this:
r8581r8582
681681   neogeo_state *state = (neogeo_state *)field->port->machine->driver_data;
682682   UINT32 ret = state->audio_result;
683683
684//  if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(devtag_get_device(field->port->machine, "maincpu")), ret);
684//  if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field->port->machine->device("maincpu")), ret);
685685
686686   return ret;
687687}
r8581r8582
10761076   state->irq3_pending = 1;
10771077
10781078   /* get devices */
1079   state->maincpu = devtag_get_device(machine, "maincpu");
1080   state->audiocpu = devtag_get_device(machine, "audiocpu");
1081   state->upd4990a = devtag_get_device(machine, "upd4990a");
1079   state->maincpu = machine->device("maincpu");
1080   state->audiocpu = machine->device("audiocpu");
1081   state->upd4990a = machine->device("upd4990a");
10821082
10831083   /* register state save */
10841084   state_save_register_global(machine, state->display_position_interrupt_control);
src/mame/drivers/segahang.c
r8581r8582
9797   /* reset the custom handlers and other pointers */
9898   state->i8751_vblank_hook = NULL;
9999
100   state->maincpu = devtag_get_device(machine, "maincpu");
101   state->soundcpu = devtag_get_device(machine, "soundcpu");
102   state->subcpu = devtag_get_device(machine, "sub");
103   state->mcu = devtag_get_device(machine, "mcu");
104   state->ppi8255_1 = devtag_get_device(machine, "ppi8255_1");
105   state->ppi8255_2 = devtag_get_device(machine, "ppi8255_2");
100   state->maincpu = machine->device("maincpu");
101   state->soundcpu = machine->device("soundcpu");
102   state->subcpu = machine->device("sub");
103   state->mcu = machine->device("mcu");
104   state->ppi8255_1 = machine->device("ppi8255_1");
105   state->ppi8255_2 = machine->device("ppi8255_2");
106106
107107   state_save_register_global(machine, state->adc_select);
108108}
r8581r8582
126126{
127127   segas1x_state *state = (segas1x_state *)machine->driver_data;
128128
129   fd1094_machine_init(devtag_get_device(machine, "sub"));
129   fd1094_machine_init(machine->device("sub"));
130130
131131   /* reset misc components */
132132   segaic16_tilemap_reset(machine, 0);
r8581r8582
19161916GAME( 1986, enduror1,  enduror,  enduror1, enduror,  enduror,  ROT0, "Sega",    "Enduro Racer (YM2203, FD1089B 317-0013A)", 0 )
19171917GAME( 1986, endurobl,  enduror,  enduror1, enduror,  endurobl, ROT0, "bootleg", "Enduro Racer (bootleg set 1)", 0 )
19181918GAME( 1986, endurob2,  enduror,  endurob2, enduror,  endurob2, ROT0, "bootleg", "Enduro Racer (bootleg set 2)", GAME_NOT_WORKING )
1919
src/mame/drivers/statriv2.c
r8581r8582
164164
165165static VIDEO_UPDATE( statriv2 )
166166{
167   if (tms9927_screen_reset(devtag_get_device(screen->machine, "tms")))
167   if (tms9927_screen_reset(screen->machine->device("tms")))
168168      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
169169   else
170170      tilemap_draw(bitmap, cliprect, statriv2_tilemap, 0, 0);
src/mame/drivers/ultraman.c
r8581r8582
195195{
196196   ultraman_state *state = (ultraman_state *)machine->driver_data;
197197
198   state->maincpu = devtag_get_device(machine, "maincpu");
199   state->audiocpu = devtag_get_device(machine, "audiocpu");
200   state->k051960 = devtag_get_device(machine, "k051960");
201   state->k051316_1 = devtag_get_device(machine, "k051316_1");
202   state->k051316_2 = devtag_get_device(machine, "k051316_2");
203   state->k051316_3 = devtag_get_device(machine, "k051316_3");
198   state->maincpu = machine->device("maincpu");
199   state->audiocpu = machine->device("audiocpu");
200   state->k051960 = machine->device("k051960");
201   state->k051316_1 = machine->device("k051316_1");
202   state->k051316_2 = machine->device("k051316_2");
203   state->k051316_3 = machine->device("k051316_3");
204204
205205   state_save_register_global(machine, state->bank0);
206206   state_save_register_global(machine, state->bank1);
src/mame/drivers/ladybug.c
r8581r8582
725725static MACHINE_START( ladybug )
726726{
727727   ladybug_state *state = (ladybug_state *)machine->driver_data;
728   state->maincpu = devtag_get_device(machine, "maincpu");
728   state->maincpu = machine->device("maincpu");
729729}
730730
731731static MACHINE_START( sraider )
732732{
733733   ladybug_state *state = (ladybug_state *)machine->driver_data;
734734
735   state->maincpu = devtag_get_device(machine, "maincpu");
735   state->maincpu = machine->device("maincpu");
736736
737737   state_save_register_global(machine, state->grid_color);
738738   state_save_register_global(machine, state->sound_low);
src/mame/drivers/blueprnt.c
r8581r8582
4040    8001      8910 #1 write
4141
4242
43    TODO:
44
45    - the cross hatch pattern test in service mode is too fast, each phase
46      should take 15 seconds according to the service manual
47
48
4943    DIP locations verified for:
5044    - blueprnt (manual)
5145
r8581r8582
289283{
290284   blueprnt_state *state = (blueprnt_state *)machine->driver_data;
291285
292   state->audiocpu = devtag_get_device(machine, "audiocpu");
286   state->audiocpu = machine->device("audiocpu");
293287
294288   state_save_register_global(machine, state->dipsw);
295289}
src/mame/drivers/ttchamp.c
r8581r8582
307307ROM_START( ttchampa )
308308   /* this is from a different board */
309309
310   ROM_REGION16_BE( 0x200000, "user1", 0 )
310   ROM_REGION16_LE( 0x200000, "user1", 0 )
311311   ROM_LOAD16_BYTE( "ttennis2.bin", 0x000000, 0x080000,  CRC(b060e72c) SHA1(376e71bb4b1687fec4b719cbc5a7b25b64d159ac) )
312312   ROM_LOAD16_BYTE( "ttennis3.bin", 0x000001, 0x080000,  CRC(33e085a8) SHA1(ea6af05690b4b0803c303a3c858df10e4d907fb1) )
313313   ROM_LOAD16_BYTE( "4.bin", 0x100000, 0x080000,  CRC(4388dead) SHA1(1965e4b84452b244e32c8d218aace8d287c67ec2) )
src/mame/drivers/stvinit.c
r8581r8582
7979void install_stvbios_speedups(running_machine *machine)
8080{
8181   // flushes 0 & 1 on both CPUs are for the BIOS speedups
82   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60154b2);
83   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013aee);
82   sh2drc_add_pcflush(machine->device("maincpu"), 0x60154b2);
83   sh2drc_add_pcflush(machine->device("maincpu"), 0x6013aee);
8484
85   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60154b2);
86   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6013aee);
85   sh2drc_add_pcflush(machine->device("slave"), 0x60154b2);
86   sh2drc_add_pcflush(machine->device("slave"), 0x6013aee);
8787}
8888
8989DRIVER_INIT(shienryu)
9090{
9191   // master
92   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60041c6);
92   sh2drc_add_pcflush(machine->device("maincpu"), 0x60041c6);
9393   // slave
94   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x600440e);
94   sh2drc_add_pcflush(machine->device("slave"), 0x600440e);
9595
9696   DRIVER_INIT_CALL(stv);
9797}
r8581r8582
106106    (loops for 263473 instructions)
107107*/
108108   // master
109   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6018640);
109   sh2drc_add_pcflush(machine->device("maincpu"), 0x6018640);
110110   // slave
111   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6018c6e);
111   sh2drc_add_pcflush(machine->device("slave"), 0x6018c6e);
112112
113113   DRIVER_INIT_CALL(stv);
114114
r8581r8582
136136
137137   (loops for 288688 instructions)
138138*/
139   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6010160);
139   sh2drc_add_pcflush(machine->device("maincpu"), 0x6010160);
140140
141141   DRIVER_INIT_CALL(stv);
142142}
r8581r8582
162162
163163DRIVER_INIT(puyosun)
164164{
165   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6021cf0);
165   sh2drc_add_pcflush(machine->device("maincpu"), 0x6021cf0);
166166
167   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60236fe);
167   sh2drc_add_pcflush(machine->device("slave"), 0x60236fe);
168168
169169   DRIVER_INIT_CALL(stv);
170170
r8581r8582
184184
185185DRIVER_INIT(mausuke)
186186{
187   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60461A0);
187   sh2drc_add_pcflush(machine->device("maincpu"), 0x60461A0);
188188
189189   DRIVER_INIT_CALL(stv);
190190
r8581r8582
194194
195195DRIVER_INIT(cottonbm)
196196{
197//  sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6030ee2);
198//  sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6032b52);
197//  sh2drc_add_pcflush(machine->device("maincpu"), 0x6030ee2);
198//  sh2drc_add_pcflush(machine->device("slave"), 0x6032b52);
199199
200200   DRIVER_INIT_CALL(stv);
201201
r8581r8582
204204
205205DRIVER_INIT(cotton2)
206206{
207   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6031c7a);
208   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60338ea);
207   sh2drc_add_pcflush(machine->device("maincpu"), 0x6031c7a);
208   sh2drc_add_pcflush(machine->device("slave"), 0x60338ea);
209209
210210   DRIVER_INIT_CALL(stv);
211211
r8581r8582
215215DRIVER_INIT(dnmtdeka)
216216{
217217   // install all 3 speedups on both master and slave
218   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6027c90);
219   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0xd04);
220   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60051f2);
218   sh2drc_add_pcflush(machine->device("maincpu"), 0x6027c90);
219   sh2drc_add_pcflush(machine->device("maincpu"), 0xd04);
220   sh2drc_add_pcflush(machine->device("maincpu"), 0x60051f2);
221221
222   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6027c90);
223   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0xd04);
224   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60051f2);
222   sh2drc_add_pcflush(machine->device("slave"), 0x6027c90);
223   sh2drc_add_pcflush(machine->device("slave"), 0xd04);
224   sh2drc_add_pcflush(machine->device("slave"), 0x60051f2);
225225
226226   DRIVER_INIT_CALL(stv);
227227}
r8581r8582
229229DRIVER_INIT(diehard)
230230{
231231   // install all 3 speedups on both master and slave
232   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6027c98);
233   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0xd04);
234   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60051f2);
232   sh2drc_add_pcflush(machine->device("maincpu"), 0x6027c98);
233   sh2drc_add_pcflush(machine->device("maincpu"), 0xd04);
234   sh2drc_add_pcflush(machine->device("maincpu"), 0x60051f2);
235235
236   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6027c98);
237   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0xd04);
238   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60051f2);
236   sh2drc_add_pcflush(machine->device("slave"), 0x6027c98);
237   sh2drc_add_pcflush(machine->device("slave"), 0xd04);
238   sh2drc_add_pcflush(machine->device("slave"), 0x60051f2);
239239
240240   DRIVER_INIT_CALL(stv);
241241}
242242
243243DRIVER_INIT(fhboxers)
244244{
245   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60041c2);
246   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x600bb0a);
247   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x600b31e);
245   sh2drc_add_pcflush(machine->device("maincpu"), 0x60041c2);
246   sh2drc_add_pcflush(machine->device("maincpu"), 0x600bb0a);
247   sh2drc_add_pcflush(machine->device("maincpu"), 0x600b31e);
248248
249249   DRIVER_INIT_CALL(stv);
250250}
251251
252252DRIVER_INIT( groovef )
253253{
254   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6005e7c);
255   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6005e86);
256   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60a4970);
254   sh2drc_add_pcflush(machine->device("maincpu"), 0x6005e7c);
255   sh2drc_add_pcflush(machine->device("maincpu"), 0x6005e86);
256   sh2drc_add_pcflush(machine->device("maincpu"), 0x60a4970);
257257
258   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60060c2);
258   sh2drc_add_pcflush(machine->device("slave"), 0x60060c2);
259259
260260   DRIVER_INIT_CALL(stv);
261261
r8581r8582
265265
266266DRIVER_INIT( danchih )
267267{
268   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6028b28);
269   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6028c8e);
270   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602ae26);
268   sh2drc_add_pcflush(machine->device("maincpu"), 0x6028b28);
269   sh2drc_add_pcflush(machine->device("maincpu"), 0x6028c8e);
270   sh2drc_add_pcflush(machine->device("slave"), 0x602ae26);
271271
272272   DRIVER_INIT_CALL(stv);
273273
r8581r8582
307307
308308DRIVER_INIT( astrass )
309309{
310   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60011b8);
311   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x605b9da);
310   sh2drc_add_pcflush(machine->device("maincpu"), 0x60011b8);
311   sh2drc_add_pcflush(machine->device("maincpu"), 0x605b9da);
312312
313313   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x06000770, 0x06000773, 0, 0, astrass_hack_r );
314314
r8581r8582
319319
320320DRIVER_INIT(thunt)
321321{
322   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602A024);
323   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013EEA);
324   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602AAF8);
322   sh2drc_add_pcflush(machine->device("maincpu"), 0x602A024);
323   sh2drc_add_pcflush(machine->device("maincpu"), 0x6013EEA);
324   sh2drc_add_pcflush(machine->device("slave"), 0x602AAF8);
325325
326326   DRIVER_INIT_CALL(stv);
327327
r8581r8582
330330
331331DRIVER_INIT(sandor)
332332{
333   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602a0f8);
334   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013fbe);
335   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602abcc);
333   sh2drc_add_pcflush(machine->device("maincpu"), 0x602a0f8);
334   sh2drc_add_pcflush(machine->device("maincpu"), 0x6013fbe);
335   sh2drc_add_pcflush(machine->device("slave"), 0x602abcc);
336336
337337   DRIVER_INIT_CALL(stv);
338338   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1);
r8581r8582
341341
342342DRIVER_INIT(grdforce)
343343{
344   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6041e32);
345   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6043aa2);
344   sh2drc_add_pcflush(machine->device("maincpu"), 0x6041e32);
345   sh2drc_add_pcflush(machine->device("slave"), 0x6043aa2);
346346
347347   DRIVER_INIT_CALL(stv);
348348
r8581r8582
351351
352352DRIVER_INIT(batmanfr)
353353{
354   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x60121c0);
355   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60125bc);
354   sh2drc_add_pcflush(machine->device("maincpu"), 0x60121c0);
355   sh2drc_add_pcflush(machine->device("slave"), 0x60125bc);
356356
357357   DRIVER_INIT_CALL(stv);
358358
r8581r8582
362362
363363DRIVER_INIT(colmns97)
364364{
365   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60298a2);
365   sh2drc_add_pcflush(machine->device("slave"), 0x60298a2);
366366
367367   DRIVER_INIT_CALL(stv);
368368
r8581r8582
372372
373373DRIVER_INIT(winterht)
374374{
375   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6098aea);
376   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x609ae4e);
375   sh2drc_add_pcflush(machine->device("maincpu"), 0x6098aea);
376   sh2drc_add_pcflush(machine->device("slave"), 0x609ae4e);
377377
378378   DRIVER_INIT_CALL(stv);
379379
r8581r8582
382382
383383DRIVER_INIT(seabass)
384384{
385   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602cbfa);
386   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60321ee);
385   sh2drc_add_pcflush(machine->device("maincpu"), 0x602cbfa);
386   sh2drc_add_pcflush(machine->device("slave"), 0x60321ee);
387387
388388   DRIVER_INIT_CALL(stv);
389389
r8581r8582
392392
393393DRIVER_INIT(vfremix)
394394{
395   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602c30c);
396   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x604c332);
395   sh2drc_add_pcflush(machine->device("maincpu"), 0x602c30c);
396   sh2drc_add_pcflush(machine->device("slave"), 0x604c332);
397397
398398   DRIVER_INIT_CALL(stv);
399399
r8581r8582
402402
403403DRIVER_INIT(sss)
404404{
405   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6026398);
406   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6028cd6);
405   sh2drc_add_pcflush(machine->device("maincpu"), 0x6026398);
406   sh2drc_add_pcflush(machine->device("slave"), 0x6028cd6);
407407
408408   install_sss_protection(machine);
409409
r8581r8582
414414
415415DRIVER_INIT(othellos)
416416{
417   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x602bcbe);
418   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602d92e);
417   sh2drc_add_pcflush(machine->device("maincpu"), 0x602bcbe);
418   sh2drc_add_pcflush(machine->device("slave"), 0x602d92e);
419419
420420   DRIVER_INIT_CALL(stv);
421421
r8581r8582
425425
426426DRIVER_INIT(sasissu)
427427{
428   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60710be);
428   sh2drc_add_pcflush(machine->device("slave"), 0x60710be);
429429
430430   DRIVER_INIT_CALL(stv);
431431
r8581r8582
434434
435435DRIVER_INIT(gaxeduel)
436436{
437   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6012ee4);
437   sh2drc_add_pcflush(machine->device("maincpu"), 0x6012ee4);
438438
439439   DRIVER_INIT_CALL(stv);
440440}
441441
442442DRIVER_INIT(suikoenb)
443443{
444   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6013f7a);
444   sh2drc_add_pcflush(machine->device("maincpu"), 0x6013f7a);
445445
446446   DRIVER_INIT_CALL(stv);
447447}
r8581r8582
456456
457457DRIVER_INIT(znpwfv)
458458{
459   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6012ec2);
460   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x60175a6);
459   sh2drc_add_pcflush(machine->device("maincpu"), 0x6012ec2);
460   sh2drc_add_pcflush(machine->device("slave"), 0x60175a6);
461461
462462   DRIVER_INIT_CALL(stv);
463463   minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500);
r8581r8582
465465
466466DRIVER_INIT(twcup98)
467467{
468   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x605edde);
469   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6062bca);
468   sh2drc_add_pcflush(machine->device("maincpu"), 0x605edde);
469   sh2drc_add_pcflush(machine->device("slave"), 0x6062bca);
470470
471471   DRIVER_INIT_CALL(stv);
472472   install_twcup98_protection(machine);
r8581r8582
476476
477477DRIVER_INIT(smleague)
478478{
479   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6063bf4);
480   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6062bca);
479   sh2drc_add_pcflush(machine->device("maincpu"), 0x6063bf4);
480   sh2drc_add_pcflush(machine->device("slave"), 0x6062bca);
481481
482482   DRIVER_INIT_CALL(stv);
483483
r8581r8582
486486
487487DRIVER_INIT(finlarch)
488488{
489   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6064d60);
489   sh2drc_add_pcflush(machine->device("maincpu"), 0x6064d60);
490490
491491   DRIVER_INIT_CALL(stv);
492492
r8581r8582
494494
495495DRIVER_INIT(maruchan)
496496{
497   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x601ba46);
498   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x601ba46);
497   sh2drc_add_pcflush(machine->device("maincpu"), 0x601ba46);
498   sh2drc_add_pcflush(machine->device("slave"), 0x601ba46);
499499
500500   DRIVER_INIT_CALL(stv);
501501
r8581r8582
504504
505505DRIVER_INIT(pblbeach)
506506{
507   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x605eb78);
507   sh2drc_add_pcflush(machine->device("maincpu"), 0x605eb78);
508508
509509   DRIVER_INIT_CALL(stv);
510510}
511511
512512DRIVER_INIT(shanhigw)
513513{
514   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6020c5c);
514   sh2drc_add_pcflush(machine->device("maincpu"), 0x6020c5c);
515515
516516   DRIVER_INIT_CALL(stv);
517517}
518518
519519DRIVER_INIT(elandore)
520520{
521   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x604eac0);
522   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x605340a);
521   sh2drc_add_pcflush(machine->device("maincpu"), 0x604eac0);
522   sh2drc_add_pcflush(machine->device("slave"), 0x605340a);
523523
524524   install_elandore_protection(machine);
525525
r8581r8582
530530
531531DRIVER_INIT(rsgun)
532532{
533   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6034d04);
534   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x6036152);
533   sh2drc_add_pcflush(machine->device("maincpu"), 0x6034d04);
534   sh2drc_add_pcflush(machine->device("slave"), 0x6036152);
535535
536536   install_rsgun_protection(machine);
537537
r8581r8582
555555
556556DRIVER_INIT(nameclv3)
557557{
558   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x601eb4c);
559   sh2drc_add_pcflush(devtag_get_device(machine, "slave"), 0x602b80e);
558   sh2drc_add_pcflush(machine->device("maincpu"), 0x601eb4c);
559   sh2drc_add_pcflush(machine->device("slave"), 0x602b80e);
560560
561561   DRIVER_INIT_CALL(stv);
562562}
src/mame/drivers/buggychl.c
r8581r8582
377377
378378   memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x2000);
379379
380   state->audiocpu = devtag_get_device(machine, "audiocpu");
381   state->mcu = devtag_get_device(machine, "mcu");
380   state->audiocpu = machine->device("audiocpu");
381   state->mcu = machine->device("mcu");
382382
383383   state_save_register_global(machine, state->sound_nmi_enable);
384384   state_save_register_global(machine, state->pending_nmi);
src/mame/drivers/gotcha.c
r8581r8582
252252{
253253   gotcha_state *state = (gotcha_state *)machine->driver_data;
254254
255   state->audiocpu = devtag_get_device(machine, "audiocpu");
255   state->audiocpu = machine->device("audiocpu");
256256
257257   state_save_register_global(machine, state->banksel);
258258   state_save_register_global_array(machine, state->gfxbank);
src/mame/drivers/taito_f2.c
r8581r8582
7070qcrayon2 TC0510NIO TC0360PRI TC0260DAR
7171driftout TC0510NIO TC0360PRI TC0260DAR TC0430GRW(zoom/rot)
7272
73A complete list of Taito Games can be still accessed with archive.org:
74http://web.archive.org/web/20010502131808/www.taito.co.jp/game-history/
7375
74
75F2 Game List
76------------
77. Final Blow                                                                       (1)
78. Don Doko Don                                                                     (2)
79. Mega Blast               http://www.taito.co.jp/game-history/80b/megabla.html    (3)
80. Quiz Torimonochou        http://www.taito.co.jp/game-history/90a/qui_tori.html   (4)
81. Quiz HQ                  http://www.taito.co.jp/game-history/90a/quiz_hq.html
82. Thunder Fox              http://www.taito.co.jp/game-history/90a/thu_fox.html
83. Liquid Kids              http://www.taito.co.jp/game-history/90a/miz_bak.html    (7)
84. SSI / Majestic 12        http://www.taito.co.jp/game-history/90a/mj12.html       (8)
85. Gun Frontier             http://www.taito.co.jp/game-history/90a/gunfro.html     (9)
86. Growl / Runark           http://www.taito.co.jp/game-history/90a/runark.html    (10)
87. Hat Trick Hero           http://www.taito.co.jp/game-history/90a/hthero.html    (11)
88. Mahjong Quest            http://www.taito.co.jp/game-history/90a/mahque.html    (12)
89. Yuu-yu no Quiz de Go!Go! http://www.taito.co.jp/game-history/90a/youyu.html     (13)
90. Ah Eikou no Koshien      http://www.taito.co.jp/game-history/90a/koshien.html   (14)
91. Ninja Kids               http://www.taito.co.jp/game-history/90a/ninjakids.html (15)
92. Quiz Quest               http://www.taito.co.jp/game-history/90a/q_quest.html
93. Metal Black              http://www.taito.co.jp/game-history/90a/metabla.html
94. Quiz Chikyu Boueigun     http://www.taito.co.jp/game-history/90a/qui_tik.html
95. Dinorex                  http://www.taito.co.jp/game-history/90a/dinorex.html
96. Pulirula
97. Dead Connection          http://www.taito.co.jp/game-history/90a/deadconn.html
98. Quiz Jinsei Gekijou      http://www.taito.co.jp/game-history/90a/qui_jin.html
99. Quiz Crayon Shinchan     http://www.taito.co.jp/game-history/90a/qcrashin.html
100. Crayon Shinchan Orato Asobo
101
102
103This list is translated version of
104http://www.aianet.or.jp/~eisetu/rom/rom_tait.html
105This page also contains info for other Taito boards.
106
10776F2 Motherboard ( Big ) K1100432A, J1100183A
10877               (Small) K1100608A, J1100242A
10978
r8581r8582
33793348{
33803349   taitof2_state *state = (taitof2_state *)machine->driver_data;
33813350
3382   state->maincpu = devtag_get_device(machine, "maincpu");
3383   state->audiocpu = devtag_get_device(machine, "audiocpu");;
3384   state->tc0100scn = devtag_get_device(machine, "tc0100scn");;
3385   state->tc0100scn_1 = devtag_get_device(machine, "tc0100scn_1");;
3386   state->tc0100scn_2 = devtag_get_device(machine, "tc0100scn_2");;
3387   state->tc0360pri = devtag_get_device(machine, "tc0360pri");;
3388   state->tc0280grd = devtag_get_device(machine, "tc0280grd");;
3389   state->tc0430grw = devtag_get_device(machine, "tc0430grw");;
3390   state->tc0480scp = devtag_get_device(machine, "tc0480scp");;
3351   state->maincpu = machine->device("maincpu");
3352   state->audiocpu = machine->device("audiocpu");;
3353   state->tc0100scn = machine->device("tc0100scn");;
3354   state->tc0100scn_1 = machine->device("tc0100scn_1");;
3355   state->tc0100scn_2 = machine->device("tc0100scn_2");;
3356   state->tc0360pri = machine->device("tc0360pri");;
3357   state->tc0280grd = machine->device("tc0280grd");;
3358   state->tc0430grw = machine->device("tc0430grw");;
3359   state->tc0480scp = machine->device("tc0480scp");;
33913360}
33923361
33933362static MACHINE_START( f2 )
src/mame/drivers/ddragon.c
r8581r8582
152152   /* configure banks */
153153   memory_configure_bank(machine, "bank1", 0, 8, memory_region(machine, "maincpu") + 0x10000, 0x4000);
154154
155   state->maincpu = devtag_get_device(machine, "maincpu");
156   state->sub_cpu = devtag_get_device(machine, "sub");
157   state->snd_cpu = devtag_get_device(machine, "soundcpu");
158   state->adpcm_1 = devtag_get_device(machine, "adpcm1");
159   state->adpcm_2 = devtag_get_device(machine, "adpcm2");
155   state->maincpu = machine->device("maincpu");
156   state->sub_cpu = machine->device("sub");
157   state->snd_cpu = machine->device("soundcpu");
158   state->adpcm_1 = machine->device("adpcm1");
159   state->adpcm_2 = machine->device("adpcm2");
160160
161161   /* register for save states */
162162   state_save_register_global(machine, state->dd_sub_cpu_busy);
src/mame/drivers/asterix.c
r8581r8582
253253{
254254   asterix_state *state = (asterix_state *)machine->driver_data;
255255
256   state->maincpu = devtag_get_device(machine, "maincpu");
257   state->audiocpu = devtag_get_device(machine, "audiocpu");
258   state->k053260 = devtag_get_device(machine, "k053260");
259   state->k056832 = devtag_get_device(machine, "k056832");
260   state->k053244 = devtag_get_device(machine, "k053244");
261   state->k053251 = devtag_get_device(machine, "k053251");
256   state->maincpu = machine->device("maincpu");
257   state->audiocpu = machine->device("audiocpu");
258   state->k053260 = machine->device("k053260");
259   state->k056832 = machine->device("k056832");
260   state->k053244 = machine->device("k053244");
261   state->k053251 = machine->device("k053251");
262262
263263   state_save_register_global(machine, state->cur_control2);
264264   state_save_register_global_array(machine, state->prot);
src/mame/drivers/acommand.c
r8581r8582
293293         return input_port_read(space->machine, "IN0");
294294      case 0x0014/2:
295295      case 0x0016/2:
296         return okim6295_r(devtag_get_device(space->machine, "oki1"),0);
296         return okim6295_r(space->machine->device("oki1"),0);
297297      case 0x0018/2:
298298      case 0x001a/2:
299         return okim6295_r(devtag_get_device(space->machine, "oki2"),0);
299         return okim6295_r(space->machine->device("oki2"),0);
300300      case 0x0040/2:
301301         /*
302302                "Upper switch / Under Switch"
r8581r8582
385385      case 0x14/2:
386386      case 0x16/2:
387387         if(ACCESSING_BITS_0_7)
388            okim6295_w(devtag_get_device(space->machine, "oki1"),0,data);
388            okim6295_w(space->machine->device("oki1"),0,data);
389389         break;
390390      case 0x18/2:
391391      case 0x1a/2:
392392         if(ACCESSING_BITS_0_7)
393            okim6295_w(devtag_get_device(space->machine, "oki2"),0,data);
393            okim6295_w(space->machine->device("oki2"),0,data);
394394         break;
395395      case 0x1c/2:
396396         /*IRQ mask?*/
src/mame/drivers/ppmast93.c
r8581r8582
196196   switch(offset&0xff)
197197   {
198198      case 0:
199      case 1: ym2413_w(devtag_get_device(space->machine, "ymsnd"),offset,data); break;
200      case 2: dac_data_w(devtag_get_device(space->machine, "dac"),data);break;
199      case 1: ym2413_w(space->machine->device("ymsnd"),offset,data); break;
200      case 2: dac_data_w(space->machine->device("dac"),data);break;
201201      default: logerror("%x %x - %x\n",offset,data,cpu_get_previouspc(space->cpu));
202202   }
203203}
src/mame/drivers/moo.c
r8581r8582
433433{
434434   moo_state *state = (moo_state *)machine->driver_data;
435435
436   state->maincpu = devtag_get_device(machine, "maincpu");
437   state->audiocpu = devtag_get_device(machine, "soundcpu");
438   state->k054539 = devtag_get_device(machine, "k054539");
439   state->k053246 = devtag_get_device(machine, "k053246");
440   state->k053251 = devtag_get_device(machine, "k053251");
441   state->k056832 = devtag_get_device(machine, "k056832");
442   state->k054338 = devtag_get_device(machine, "k054338");
436   state->maincpu = machine->device("maincpu");
437   state->audiocpu = machine->device("soundcpu");
438   state->k054539 = machine->device("k054539");
439   state->k053246 = machine->device("k053246");
440   state->k053251 = machine->device("k053251");
441   state->k056832 = machine->device("k056832");
442   state->k054338 = machine->device("k054338");
443443
444444   state_save_register_global(machine, state->cur_control2);
445445   state_save_register_global(machine, state->alpha_enabled);
src/mame/drivers/taito_l.c
r8581r8582
143143{
144144   taitol_state *state = (taitol_state *)machine->driver_data;
145145
146   state->maincpu = devtag_get_device(machine, "maincpu");
147   state->audiocpu = devtag_get_device(machine, "audiocpu");
146   state->maincpu = machine->device("maincpu");
147   state->audiocpu = machine->device("audiocpu");
148148
149149   state->rambanks = auto_alloc_array(machine, UINT8, 0x1000 * 12);
150150   state->palette_ram = auto_alloc_array(machine, UINT8, 0x1000);
src/mame/drivers/segald.c
r8581r8582
329329
330330static MACHINE_START( astron )
331331{
332   laserdisc = devtag_get_device(machine, "laserdisc");
332   laserdisc = machine->device("laserdisc");
333333}
334334
335335
src/mame/drivers/tickee.c
r8581r8582
262262
263263   if (offset == 3)
264264   {
265      ticket_dispenser_w(devtag_get_device(space->machine, "ticket1"), 0, (data & 8) << 4);
266      ticket_dispenser_w(devtag_get_device(space->machine, "ticket2"), 0, (data & 4) << 5);
265      ticket_dispenser_w(space->machine->device("ticket1"), 0, (data & 8) << 4);
266      ticket_dispenser_w(space->machine->device("ticket2"), 0, (data & 4) << 5);
267267   }
268268
269269   if (olddata != tickee_control[offset])
src/mame/drivers/m92.c
r8581r8582
320320
321321static TIMER_CALLBACK( setvector_callback )
322322{
323   if (!devtag_get_device(machine, "soundcpu"))
323   if (!machine->device("soundcpu"))
324324      return;
325325
326326   switch(param)
r8581r8582
333333   }
334334
335335   if (irqvector & 0x2)      /* YM2151 has precedence */
336      cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x18);
336      cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x18);
337337   else if (irqvector & 0x1)   /* V30 */
338      cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x19);
338      cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x19);
339339
340340   if (irqvector == 0)   /* no IRQs pending */
341341      cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);
r8581r8582
16751675   ROM_LOAD( "mr-da.bin", 0x000000, 0x040000, CRC(1a11fc59) SHA1(6d1f4ca688bf015ecbbe369fbc0eb5e2bcaefcfc) )
16761676ROM_END
16771677
1678ROM_START( mysticrib )
1679   ROM_REGION( 0x100000, "maincpu", 0 )
1680   ROM_LOAD16_BYTE( "h0", 0x000001, 0x040000, CRC(e38c1f56) SHA1(491f370c66c36ab56a4bee3f335fe7357ff5668b) )
1681   ROM_LOAD16_BYTE( "l0", 0x000000, 0x040000, CRC(77846e48) SHA1(c715136c4ed8dda24ec1ed634e6308d23c92ec05) )
1682   ROM_LOAD16_BYTE( "h1", 0x080001, 0x010000, CRC(4dcb085b) SHA1(7c053f5ef2978e574d3d2d9f5c12035473d13c3b) )
1683   ROM_LOAD16_BYTE( "l1", 0x080000, 0x010000, CRC(88df4f70) SHA1(f55769a107fe3f5446d8268f66e895b02727c61e) )
1684
1685   ROM_REGION( 0x100000, "soundcpu", 0 )   /* 1MB for the audio CPU - encrypted V30 = NANAO custom D80001 (?) */
1686   // older revision code? rev 3.31, doesn't work?
1687   ROM_LOAD16_BYTE( "sh0", 0x000001, 0x010000, CRC(fc7221ee) SHA1(4e714f31ce0d1bb2f6c649a26af748f96912848e) )
1688   ROM_LOAD16_BYTE( "sl0", 0x000000, 0x010000, CRC(65c809e6) SHA1(45a860b250219a15aa8a2177251f4d3f2e559b9e) )
1689
1690   ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */
1691   ROM_LOAD( "mr-c0.bin", 0x000000, 0x040000, CRC(872a8fad) SHA1(236406e5959c81a1cffe96fef02d637c2150ce1e) )
1692   ROM_LOAD( "mr-c1.bin", 0x040000, 0x040000, CRC(d2ffb27a) SHA1(fedfb430ce8a8953b2f78970d0b0dc5571de333c) )
1693   ROM_LOAD( "mr-c2.bin", 0x080000, 0x040000, CRC(62bff287) SHA1(cb7b73c4a26737f1a1f9cc9423ae51c284368b1b) )
1694   ROM_LOAD( "mr-c3.bin", 0x0c0000, 0x040000, CRC(d0da62ab) SHA1(96c7c8e1d8dafb797731652fa91d3048aa157185) )
1695
1696   ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */
1697   ROM_LOAD( "mr-o00.bin", 0x000000, 0x080000, CRC(a0f9ce16) SHA1(ae423313d189ebddc6d5d0785ac484e0cdf79112) )
1698   ROM_LOAD( "mr-o10.bin", 0x100000, 0x080000, CRC(4e70a9e9) SHA1(8f6b043b03420a590a1081c99311723169126332) )
1699   ROM_LOAD( "mr-o20.bin", 0x200000, 0x080000, CRC(b9c468fc) SHA1(dc42a5b80cad5373fce03cc416b9d742fcbec6e9) )
1700   ROM_LOAD( "mr-o30.bin", 0x300000, 0x080000, CRC(cc32433a) SHA1(a1a1ab09c4bd6c9ae85529c1aa5427ad3126b914) )
1701
1702   ROM_REGION( 0x40000, "irem", 0 )
1703   ROM_LOAD( "mr-da.bin", 0x000000, 0x040000, CRC(1a11fc59) SHA1(6d1f4ca688bf015ecbbe369fbc0eb5e2bcaefcfc) )
1704ROM_END
1705
1706
16781707ROM_START( uccops )
16791708   ROM_REGION( 0x100000, "maincpu", 0 )
16801709   ROM_LOAD16_BYTE( "uc_h0.rom", 0x000001, 0x040000, CRC(240aa5f7) SHA1(8d864bb1377e9f6d266631ed365c5809b9da33f8) )
r8581r8582
21992228GAME( 1992, uccopsj,  uccops,   uccops,        uccops,   uccops,   ROT0,   "Irem",         "Undercover Cops (Japan)", 0 )
22002229GAME( 1992, mysticri, 0,        mysticri,      mysticri, mysticri, ROT0,   "Irem",         "Mystic Riders (World)", 0 )
22012230GAME( 1992, gunhohki, mysticri, mysticri,      mysticri, mysticri, ROT0,   "Irem",         "Gun Hohki (Japan)", 0 )
2231// cheaply produced Korean board, has original chips, but lacks any proper labels - uses older revision sound program that doesn't work in MAME right now
2232// main code is also significantly different to the supported original set, so it might just be a legitimate early revision on a cheap board
2233GAME( 1992, mysticrib,mysticri, mysticri,      mysticri, mysticri, ROT0,   "Irem",         "Mystic Riders (bootleg?)", GAME_NO_SOUND )
22022234GAME( 1992, majtitl2, 0,        majtitl2,      majtitl2, majtitl2, ROT0,   "Irem",         "Major Title 2 (World)", 0 )
22032235GAME( 1992, majtitl2j,majtitl2, majtitl2,      majtitl2, majtitl2, ROT0,   "Irem",         "Major Title 2 (Japan)", 0 )
22042236GAME( 1992, skingame, majtitl2, majtitl2,      majtitl2, majtitl2, ROT0,   "Irem America", "The Irem Skins Game (US set 1)", 0 )
src/mame/drivers/destroyr.c
r8581r8582
436436{
437437   destroyr_state *state = (destroyr_state *)machine->driver_data;
438438
439   state->maincpu = devtag_get_device(machine, "maincpu");
439   state->maincpu = machine->device("maincpu");
440440
441441   state_save_register_global(machine, state->cursor);
442442   state_save_register_global(machine, state->wavemod);
src/mame/drivers/fcombat.c
r8581r8582
269269{
270270   fcombat_state *state = (fcombat_state *)machine->driver_data;
271271
272   state->maincpu = devtag_get_device(machine, "maincpu");
272   state->maincpu = machine->device("maincpu");
273273
274274   state_save_register_global(machine, state->cocktail_flip);
275275   state_save_register_global(machine, state->char_palette);
src/mame/drivers/multigam.c
r8581r8582
161161static WRITE8_HANDLER( sprite_dma_w )
162162{
163163   int source = (data & 7);
164   ppu2c0x_spriteram_dma(space, devtag_get_device(space->machine, "ppu"), source);
164   ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source);
165165}
166166
167167static READ8_DEVICE_HANDLER( psg_4015_r )
r8581r8582
341341      if (--multigam3_mmc3_scanline_counter == -1)
342342      {
343343         multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch;
344         generic_pulse_irq_line(devtag_get_device(device->machine, "maincpu"), 0);
344         generic_pulse_irq_line(device->machine->device("maincpu"), 0);
345345      }
346346   }
347347}
348348
349349static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
350350{
351   running_device *ppu = devtag_get_device(space->machine, "ppu");
351   running_device *ppu = space->machine->device("ppu");
352352
353353   /* basically, a MMC3 mapper from the nes */
354354   static int multigam3_mmc3_command;
r8581r8582
620620   multigam_mapper02_prg_base = prg_base;
621621   multigam_mapper02_prg_size = prg_size;
622622
623   ppu2c0x_set_scanline_callback(devtag_get_device(machine, "ppu"), 0);
623   ppu2c0x_set_scanline_callback(machine->device("ppu"), 0);
624624}
625625
626626/******************************************************
r8581r8582
785785   multigam_mmc1_prg_size = prg_size;
786786   multigam_mmc1_chr_bank_base = chr_bank_base;
787787
788   ppu2c0x_set_scanline_callback(devtag_get_device(machine, "ppu"), 0);
788   ppu2c0x_set_scanline_callback(machine->device("ppu"), 0);
789789
790790};
791791
r8581r8582
816816
817817static void supergm3_set_bank(running_machine *machine)
818818{
819   running_device *ppu = devtag_get_device(machine, "ppu");
819   running_device *ppu = machine->device("ppu");
820820   UINT8* mem = memory_region(machine, "maincpu");
821821
822822   // video bank
r8581r8582
10591059static VIDEO_UPDATE( multigam )
10601060{
10611061   /* render the ppu */
1062   ppu2c0x_render(devtag_get_device(screen->machine, "ppu"), bitmap, 0, 0, 0, 0);
1062   ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0);
10631063   return 0;
10641064}
10651065
r8581r8582
10921092   nt_page[2] = nt_ram + 0x800;
10931093   nt_page[3] = nt_ram + 0xc00;
10941094
1095   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w);
1096   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
1095   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w);
1096   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
10971097   memory_set_bankptr(machine, "bank1", memory_region(machine, "gfx1"));
10981098}
10991099
r8581r8582
11051105   nt_page[2] = nt_ram + 0x800;
11061106   nt_page[3] = nt_ram + 0xc00;
11071107
1108   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w);
1108   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w);
11091109
1110   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, "bank2");
1111   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0400, 0x07ff, 0, 0, "bank3");
1112   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0800, 0x0bff, 0, 0, "bank4");
1113   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0c00, 0x0fff, 0, 0, "bank5");
1114   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1000, 0x13ff, 0, 0, "bank6");
1115   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1400, 0x17ff, 0, 0, "bank7");
1116   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1800, 0x1bff, 0, 0, "bank8");
1117   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x1c00, 0x1fff, 0, 0, "bank9");
1110   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, "bank2");
1111   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0400, 0x07ff, 0, 0, "bank3");
1112   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0800, 0x0bff, 0, 0, "bank4");
1113   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0c00, 0x0fff, 0, 0, "bank5");
1114   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1000, 0x13ff, 0, 0, "bank6");
1115   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1400, 0x17ff, 0, 0, "bank7");
1116   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1800, 0x1bff, 0, 0, "bank8");
1117   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x1c00, 0x1fff, 0, 0, "bank9");
11181118
11191119   set_videorom_bank(machine, 0, 8, 0, 8);
11201120};
r8581r8582
11271127   nt_page[2] = nt_ram + 0x800;
11281128   nt_page[3] = nt_ram + 0xc00;
11291129
1130   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w);
1130   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w);
11311131
11321132   vram = auto_alloc_array(machine, UINT8, 0x2000);
11331133   multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000);
src/mame/drivers/fuukifg2.c
r8581r8582
429429
430430   memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x8000);
431431
432   state->maincpu = devtag_get_device(machine, "maincpu");
433   state->audiocpu = devtag_get_device(machine, "audiocpu");
432   state->maincpu = machine->device("maincpu");
433   state->audiocpu = machine->device("audiocpu");
434434
435435   state->raster_interrupt_timer = timer_alloc(machine, raster_interrupt_callback, NULL);
436436}
src/mame/drivers/vcombat.c
r8581r8582
103103{
104104   int y;
105105   const rgb_t *const pens = tlc34076_get_pens();
106   running_device *aux = devtag_get_device(screen->machine, "aux");
106   running_device *aux = screen->machine->device("aux");
107107
108108   UINT16 *m68k_buf = m68k_framebuffer[(*framebuffer_ctrl & 0x20) ? 1 : 0];
109109   UINT16 *i860_buf = i860_framebuffer[(screen == aux) ? 1 : 0][0];
r8581r8582
217217
218218static WRITE16_HANDLER( wiggle_i860p0_pins_w )
219219{
220   wiggle_i860_common(devtag_get_device(space->machine, "vid_0"), data);
220   wiggle_i860_common(space->machine->device("vid_0"), data);
221221}
222222
223223static WRITE16_HANDLER( wiggle_i860p1_pins_w )
224224{
225   wiggle_i860_common(devtag_get_device(space->machine, "vid_1"), data);
225   wiggle_i860_common(space->machine->device("vid_1"), data);
226226}
227227
228228static READ16_HANDLER( main_irqiack_r )
229229{
230230   //fprintf(stderr, "M0: irq iack\n");
231   cpu_set_input_line(devtag_get_device(space->machine, "maincpu"), M68K_IRQ_1, CLEAR_LINE);
232   //cpu_set_input_line(devtag_get_device(space->machine, "maincpu"), INPUT_LINE_RESET, CLEAR_LINE);
231   cpu_set_input_line(space->machine->device("maincpu"), M68K_IRQ_1, CLEAR_LINE);
232   //cpu_set_input_line(space->machine->device("maincpu"), INPUT_LINE_RESET, CLEAR_LINE);
233233   return 0;
234234}
235235
236236static READ16_HANDLER( sound_resetmain_r )
237237{
238238   //fprintf(stderr, "M1: reset line to M0\n");
239   //cpu_set_input_line(devtag_get_device(space->machine, "maincpu"), INPUT_LINE_RESET, PULSE_LINE);
239   //cpu_set_input_line(space->machine->device("maincpu"), INPUT_LINE_RESET, PULSE_LINE);
240240   return 0;
241241}
242242
r8581r8582
286286
287287static WRITE16_HANDLER( crtc_w )
288288{
289   running_device *crtc = devtag_get_device(space->machine, "crtc");
289   running_device *crtc = space->machine->device("crtc");
290290
291291   if (crtc == NULL)
292292      return;
r8581r8582
378378   /* Setup the Bt476 VGA RAMDAC palette chip */
379379   tlc34076_reset(6);
380380
381   i860_set_pin(devtag_get_device(machine, "vid_0"), DEC_PIN_BUS_HOLD, 1);
382   i860_set_pin(devtag_get_device(machine, "vid_1"), DEC_PIN_BUS_HOLD, 1);
381   i860_set_pin(machine->device("vid_0"), DEC_PIN_BUS_HOLD, 1);
382   i860_set_pin(machine->device("vid_1"), DEC_PIN_BUS_HOLD, 1);
383383
384384   crtc_select = 0;
385385}
r8581r8582
389389   /* Setup the Bt476 VGA RAMDAC palette chip */
390390   tlc34076_reset(6);
391391
392   i860_set_pin(devtag_get_device(machine, "vid_0"), DEC_PIN_BUS_HOLD, 1);
392   i860_set_pin(machine->device("vid_0"), DEC_PIN_BUS_HOLD, 1);
393393
394394   crtc_select = 0;
395395}
r8581r8582
530530static WRITE_LINE_DEVICE_HANDLER(sound_update)
531531{
532532   /* Seems reasonable */
533   cpu_set_input_line(devtag_get_device(device->machine, "soundcpu"), M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE);
533   cpu_set_input_line(device->machine->device("soundcpu"), M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE);
534534}
535535
536536static const mc6845_interface mc6845_intf =
src/mame/drivers/guab.c
r8581r8582
623623      }
624624      case 0x30:
625625      {
626         sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data & 0xff);
626         sn76496_w(space->machine->device("snsnd"), 0, data & 0xff);
627627         break;
628628      }
629629      case 0x31:
src/mame/drivers/mcr.c
r8581r8582
413413
414414static WRITE8_HANDLER( journey_op4_w )
415415{
416   running_device *samples = devtag_get_device(space->machine, "samples");
416   running_device *samples = space->machine->device("samples");
417417
418418   /* if we're not playing the sample yet, start it */
419419   if (!sample_playing(samples, 0))
r8581r8582
534534
535535static WRITE8_HANDLER( nflfoot_op4_w )
536536{
537   running_device *sio = devtag_get_device(space->machine, "ipu_sio");
537   running_device *sio = space->machine->device("ipu_sio");
538538
539539   /* bit 7 = J3-7 on IPU board = /RXDA on SIO */
540540   logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(space->cpu), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1);
src/mame/drivers/beaminv.c
r8581r8582
135135   beaminv_state *state = (beaminv_state *)machine->driver_data;
136136   create_interrupt_timer(machine);
137137
138   state->maincpu = devtag_get_device(machine, "maincpu");
138   state->maincpu = machine->device("maincpu");
139139
140140   /* setup for save states */
141141   state_save_register_global(machine, state->controller_select);
src/mame/drivers/matmania.c
r8581r8582
303303{
304304   matmania_state *state = (matmania_state *)machine->driver_data;
305305
306   state->maincpu = devtag_get_device(machine, "maincpu");
307   state->audiocpu = devtag_get_device(machine, "audiocpu");
308   state->mcu = devtag_get_device(machine, "mcu");
306   state->maincpu = machine->device("maincpu");
307   state->audiocpu = machine->device("audiocpu");
308   state->mcu = machine->device("mcu");
309309}
310310
311311static MACHINE_DRIVER_START( matmania )
src/mame/drivers/dcheese.c
r8581r8582
9797{
9898   dcheese_state *state = (dcheese_state *)machine->driver_data;
9999
100   state->maincpu = devtag_get_device(machine, "maincpu");
101   state->audiocpu = devtag_get_device(machine, "audiocpu");
102   state->bsmt = devtag_get_device(machine, "bsmt");
100   state->maincpu = machine->device("maincpu");
101   state->audiocpu = machine->device("audiocpu");
102   state->bsmt = machine->device("bsmt");
103103
104104   cpu_set_irq_callback(state->maincpu, irq_callback);
105105
r8581r8582
131131   if (ACCESSING_BITS_0_7)
132132   {
133133      input_port_write(space->machine, "EEPROMOUT", data, 0xff);
134      ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 1) << 7);
134      ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 1) << 7);
135135   }
136136}
137137
src/mame/drivers/chqflag.c
r8581r8582
359359
360360   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
361361
362   state->maincpu = devtag_get_device(machine, "maincpu");
363   state->audiocpu = devtag_get_device(machine, "audiocpu");
364   state->k051316_1 = devtag_get_device(machine, "k051316_1");
365   state->k051316_2 = devtag_get_device(machine, "k051316_2");
366   state->k051960 = devtag_get_device(machine, "k051960");
367   state->k007232_1 = devtag_get_device(machine, "k007232_1");
368   state->k007232_2 = devtag_get_device(machine, "k007232_2");
362   state->maincpu = machine->device("maincpu");
363   state->audiocpu = machine->device("audiocpu");
364   state->k051316_1 = machine->device("k051316_1");
365   state->k051316_2 = machine->device("k051316_2");
366   state->k051960 = machine->device("k051960");
367   state->k007232_1 = machine->device("k007232_1");
368   state->k007232_2 = machine->device("k007232_2");
369369
370370   state_save_register_global(machine, state->k051316_readroms);
371371   state_save_register_global(machine, state->last_vreg);
src/mame/drivers/lsasquad.c
r8581r8582
571571
572572   memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
573573
574   state->maincpu = devtag_get_device(machine, "maincpu");
575   state->audiocpu = devtag_get_device(machine, "audiocpu");
576   state->mcu = devtag_get_device(machine, "mcu");
574   state->maincpu = machine->device("maincpu");
575   state->audiocpu = machine->device("audiocpu");
576   state->mcu = machine->device("mcu");
577577
578578   state_save_register_global(machine, state->port_a_in);
579579   state_save_register_global(machine, state->port_a_out);
src/mame/drivers/cham24.c
r8581r8582
111111static WRITE8_HANDLER( sprite_dma_w )
112112{
113113   int source = (data & 7);
114   ppu2c0x_spriteram_dma(space, devtag_get_device(space->machine, "ppu"), source);
114   ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source);
115115}
116116
117117static READ8_DEVICE_HANDLER( psg_4015_r )
r8581r8582
272272static VIDEO_UPDATE( cham24 )
273273{
274274   /* render the ppu */
275   ppu2c0x_render(devtag_get_device(screen->machine, "ppu"), bitmap, 0, 0, 0, 0);
275   ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0);
276276   return 0;
277277}
278278
r8581r8582
287287   memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
288288
289289   /* uses 8K swapping, all ROM!*/
290   memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
290   memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
291291   memory_set_bankptr(machine, "bank1", memory_region(machine, "gfx1"));
292292
293293   /* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */
r8581r8582
298298   nt_page[3] = nt_ram + 0xc00;
299299
300300   /* and read/write handlers */
301   memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w);
301   memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w);
302302}
303303
304304static DRIVER_INIT( cham24 )
src/mame/drivers/brkthru.c
r8581r8582
367367{
368368   brkthru_state *state = (brkthru_state *)machine->driver_data;
369369
370   state->maincpu = devtag_get_device(machine, "maincpu");
371   state->audiocpu = devtag_get_device(machine, "audiocpu");
370   state->maincpu = machine->device("maincpu");
371   state->audiocpu = machine->device("audiocpu");
372372
373373   state_save_register_global(machine, state->bgscroll);
374374   state_save_register_global(machine, state->bgbasecolor);
src/mame/drivers/rbmk.c
r8581r8582
122122{
123123   if(mux_data & 8)
124124   {
125      return ym2151_r(devtag_get_device(space->machine, "ymsnd"), offset & 1);
125      return ym2151_r(space->machine->device("ymsnd"), offset & 1);
126126   }
127127   else if(mux_data & 4)
128128   {
r8581r8582
138138
139139static WRITE8_HANDLER( rbmk_mcu_io_w )
140140{
141   if(mux_data & 8) { ym2151_w(devtag_get_device(space->machine, "ymsnd"), offset & 1, data); }
141   if(mux_data & 8) { ym2151_w(space->machine->device("ymsnd"), offset & 1, data); }
142142   else if(mux_data & 4)
143143   {
144144      //printf("%02x %02x W\n",offset,data);
src/mame/drivers/cloud9.c
r8581r8582
170170   rectangle visarea;
171171
172172   /* initialize globals */
173   state->maincpu = devtag_get_device(machine, "maincpu");
173   state->maincpu = machine->device("maincpu");
174174   state->syncprom = memory_region(machine, "proms") + 0x000;
175175
176176   /* find the start of VBLANK in the SYNC PROM */
src/mame/drivers/changela.c
r8581r8582
441441{
442442   changela_state *state = (changela_state *)machine->driver_data;
443443
444   state->mcu = devtag_get_device(machine, "mcu");
444   state->mcu = machine->device("mcu");
445445
446446   /* video */
447447   state_save_register_global(machine, state->slopeROM_bank);
src/mame/drivers/backfire.c
r8581r8582
471471{
472472   backfire_state *state = (backfire_state *)machine->driver_data;
473473
474   state->maincpu = devtag_get_device(machine, "maincpu");
475   state->deco16ic = devtag_get_device(machine, "deco_custom");
476   state->lscreen = devtag_get_device(machine, "lscreen");
477   state->rscreen = devtag_get_device(machine, "rscreen");
478   state->eeprom = devtag_get_device(machine, "eeprom");
474   state->maincpu = machine->device("maincpu");
475   state->deco16ic = machine->device("deco_custom");
476   state->lscreen = machine->device("lscreen");
477   state->rscreen = machine->device("rscreen");
478   state->eeprom = machine->device("eeprom");
479479}
480480
481481static MACHINE_DRIVER_START( backfire )
r8581r8582
691691   deco56_decrypt_gfx(machine, "gfx1"); /* 141 */
692692   deco56_decrypt_gfx(machine, "gfx2"); /* 141 */
693693   deco156_decrypt(machine);
694   cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 4.0f); /* core timings aren't accurate */
694   machine->device("maincpu")->set_clock_scale(4.0f); /* core timings aren't accurate */
695695   descramble_sound(machine);
696696   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
697697}
src/mame/drivers/cubeqst.c
r8581r8582
110110   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
111111   {
112112      int i;
113      int num_entries = cubeqcpu_get_ptr_ram_val(devtag_get_device(screen->machine, "line_cpu"), y);
114      UINT32 *stk_ram = cubeqcpu_get_stack_ram(devtag_get_device(screen->machine, "line_cpu"));
113      int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine->device("line_cpu"), y);
114      UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine->device("line_cpu"));
115115      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
116116      UINT32 pen;
117117
r8581r8582
240240
241241static TIMER_CALLBACK( delayed_bank_swap )
242242{
243   cubeqcpu_swap_line_banks(devtag_get_device(machine, "line_cpu"));
243   cubeqcpu_swap_line_banks(machine->device("line_cpu"));
244244
245245   /* TODO: This is a little dubious */
246   cubeqcpu_clear_stack(devtag_get_device(machine, "line_cpu"));
246   cubeqcpu_clear_stack(machine->device("line_cpu"));
247247}
248248
249249
r8581r8582
375375
376376static READ16_HANDLER( read_rotram )
377377{
378   return cubeqcpu_rotram_r(devtag_get_device(space->machine, "rotate_cpu"), offset, mem_mask);
378   return cubeqcpu_rotram_r(space->machine->device("rotate_cpu"), offset, mem_mask);
379379}
380380
381381static WRITE16_HANDLER( write_rotram )
382382{
383   cubeqcpu_rotram_w(devtag_get_device(space->machine, "rotate_cpu"), offset, data, mem_mask);
383   cubeqcpu_rotram_w(space->machine->device("rotate_cpu"), offset, data, mem_mask);
384384}
385385
386386static READ16_HANDLER( read_sndram )
387387{
388   return cubeqcpu_sndram_r(devtag_get_device(space->machine, "sound_cpu"), offset, mem_mask);
388   return cubeqcpu_sndram_r(space->machine->device("sound_cpu"), offset, mem_mask);
389389}
390390
391391static WRITE16_HANDLER( write_sndram )
392392{
393   cubeqcpu_sndram_w(devtag_get_device(space->machine, "sound_cpu"), offset, data, mem_mask);
393   cubeqcpu_sndram_w(space->machine->device("sound_cpu"), offset, data, mem_mask);
394394}
395395
396396static ADDRESS_MAP_START( m68k_program_map, ADDRESS_SPACE_PROGRAM, 16 )
r8581r8582
427427
428428static MACHINE_START( cubeqst )
429429{
430   laserdisc = devtag_get_device(machine, "laserdisc");
430   laserdisc = machine->device("laserdisc");
431431}
432432
433433static MACHINE_RESET( cubeqst )
r8581r8582
467467      "rdac6", "ldac6",
468468      "rdac7", "ldac7"
469469   };
470   dac_signed_data_16_w(devtag_get_device(device->machine, dacs[data & 15]), (data & 0xfff0) ^ 0x8000);
470   dac_signed_data_16_w(device->machine->device(dacs[data & 15]), (data & 0xfff0) ^ 0x8000);
471471}
472472
473473static const cubeqst_snd_config snd_config =
src/mame/drivers/exerion.c
r8581r8582
386386{
387387   exerion_state *state = (exerion_state *)machine->driver_data;
388388
389   state->maincpu = devtag_get_device(machine, "maincpu");
389   state->maincpu = machine->device("maincpu");
390390
391391   state_save_register_global(machine, state->porta);
392392   state_save_register_global(machine, state->portb);
src/mame/drivers/segas18.c
r8581r8582
166166   workram              = auto_alloc_array(machine, UINT16, 0x04000/2);
167167
168168   /* init the memory mapper */
169   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[state->rom_board], sound_w, sound_r);
169   segaic16_memory_mapper_init(machine->device("maincpu"), region_info_list[state->rom_board], sound_w, sound_r);
170170
171171   /* init the FD1094 */
172172   fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
r8581r8582
175175   state->custom_io_r = NULL;
176176   state->custom_io_w = NULL;
177177
178   state->maincpu = devtag_get_device(machine, "maincpu");
179   state->soundcpu = devtag_get_device(machine, "soundcpu");
180   state->mcu = devtag_get_device(machine, "mcu");
178   state->maincpu = machine->device("maincpu");
179   state->soundcpu = machine->device("soundcpu");
180   state->mcu = machine->device("mcu");
181181
182182   state_save_register_global(machine, state->mcu_data);
183183   state_save_register_global(machine, state->lghost_value);
r8581r8582
212212
213213   segaic16_memory_mapper_reset(machine);
214214   segaic16_tilemap_reset(machine, 0);
215   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
215   fd1094_machine_init(machine->device("maincpu"));
216216
217217   /* if we are running with a real live 8751, we need to boost the interleave at startup */
218218   if (state->mcu != NULL && state->mcu->type() == I8751)
src/mame/drivers/astrocorp.c
r8581r8582
237237      coin_counter_w(space->machine, 0,   (data & 0x0001));   // key in  |
238238      coin_counter_w(space->machine, 0,   (data & 0x0002));   // coin in |- manual shows 1 in- and 1 out- counter
239239      coin_counter_w(space->machine, 1,   (data & 0x0004));   // key out |
240      ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (data & 0x0008)<<4);   // hopper motor?
240      ticket_dispenser_w(space->machine->device("hopper"), 0, (data & 0x0008)<<4);   // hopper motor?
241241      //                                  (data & 0x0010)     // hopper?
242242      set_led_status(space->machine, 0,   (data & 0x0020));   // error lamp (coin/hopper jam: "call attendant")
243      ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, data & 0x0080);   // ticket motor?
243      ticket_dispenser_w(space->machine->device("ticket"), 0, data & 0x0080);   // ticket motor?
244244   }
245245   if (ACCESSING_BITS_8_15)
246246   {
src/mame/drivers/rainbow.c
r8581r8582
668668{
669669   rainbow_state *state = (rainbow_state *)machine->driver_data;
670670
671   state->maincpu = devtag_get_device(machine, "maincpu");
672   state->audiocpu = devtag_get_device(machine, "audiocpu");
673   state->pc080sn = devtag_get_device(machine, "pc080sn");
674   state->pc090oj = devtag_get_device(machine, "pc090oj");
671   state->maincpu = machine->device("maincpu");
672   state->audiocpu = machine->device("audiocpu");
673   state->pc080sn = machine->device("pc080sn");
674   state->pc090oj = machine->device("pc090oj");
675675}
676676
677677static MACHINE_DRIVER_START( rainbow )
src/mame/drivers/galspnbl.c
r8581r8582
204204{
205205   galspnbl_state *state = (galspnbl_state *)machine->driver_data;
206206
207   state->audiocpu = devtag_get_device(machine, "audiocpu");
207   state->audiocpu = machine->device("audiocpu");
208208}
209209
210210static MACHINE_DRIVER_START( galspnbl )
src/mame/drivers/photoply.c
r8581r8582
467467//  bank = -1;
468468//  lastvalue = -1;
469469//  hv_blank = 0;
470   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
471   photoply_devices.pit8253 = devtag_get_device( machine, "pit8254" );
472   photoply_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
473   photoply_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
474   photoply_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
475   photoply_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
470   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
471   photoply_devices.pit8253 = machine->device( "pit8254" );
472   photoply_devices.pic8259_1 = machine->device( "pic8259_1" );
473   photoply_devices.pic8259_2 = machine->device( "pic8259_2" );
474   photoply_devices.dma8237_1 = machine->device( "dma8237_1" );
475   photoply_devices.dma8237_2 = machine->device( "dma8237_2" );
476476
477477   init_pc_common(machine, PCCOMMON_KEYBOARD_AT, photoply_set_keyb_int);
478478   mc146818_init(machine, MC146818_STANDARD);
src/mame/drivers/rungun.c
r8581r8582
366366
367367   memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x10000], 0x4000);
368368
369   state->maincpu = devtag_get_device(machine, "maincpu");
370   state->audiocpu = devtag_get_device(machine, "soundcpu");
371   state->k053936 = devtag_get_device(machine, "k053936");
372   state->k055673 = devtag_get_device(machine, "k055673");
373   state->k053252 = devtag_get_device(machine, "k053252");
374   state->k054539_1 = devtag_get_device(machine, "k054539_1");
375   state->k054539_2 = devtag_get_device(machine, "k054539_2");
369   state->maincpu = machine->device("maincpu");
370   state->audiocpu = machine->device("soundcpu");
371   state->k053936 = machine->device("k053936");
372   state->k055673 = machine->device("k055673");
373   state->k053252 = machine->device("k053252");
374   state->k054539_1 = machine->device("k054539_1");
375   state->k054539_2 = machine->device("k054539_2");
376376
377377   state_save_register_global(machine, state->z80_control);
378378   state_save_register_global(machine, state->sound_status);
r8581r8582
384384{
385385   rungun_state *state = (rungun_state *)machine->driver_data;
386386
387   k054539_init_flags(devtag_get_device(machine, "k054539_1"), K054539_REVERSE_STEREO);
387   k054539_init_flags(machine->device("k054539_1"), K054539_REVERSE_STEREO);
388388
389389   memset(state->sysreg, 0, 0x20);
390390   memset(state->ttl_vram, 0, 0x1000);
src/mame/drivers/sfbonus.c
r8581r8582
4949
5050------------------------------------------------------------
5151
52There is known to be a "Classic Edition Compact Format" PCB
52"Classic Edition Compact Format" PCB:
5353
54ROM1 (program rom) and ROM2 (sound sample) are stadard 32 pin
55style PROMs.  The graphics are stored in ROM3 & ROM4 which
56appear to be surface mounted 8 Mbit roms.
54  +-------+   +-------------+   +------------+
55  | VR1   +---+  Connector  +---+ +---+ +---+|
56+-+386D            +---+          | R | | R ||
57|  ULN2003A        | R |          | O | | O ||
58|                  | O |          | M | | M ||
59|8                 | M |          | 3 | | 4 ||
60|  ULN2003A        | 2 |          +---+ +---+|
61|L          +----+ +---+                     |
62|i          |6295|                    62H256 |
63|n          +----+      +----------+         |
64|e ULN2003A             |          |         |
65|r         +-----+      |  AMCOE   |  25MHz  |
66|          |9536 |      |  SALTIRE |         |
67|C         |     |      |          |         |
68|o         +-----+      +----------+         |
69|n                                        CN1|
70|n             CN3      12MHz   4.9152MHz    |
71|e                                        CN2|
72|c                      +----------+         |
73|t  +---------+         |   ROM1   |         |
74|o  | HM86171 |         +----------+      SW4|
75|r  +---------+                              |
76|                       FM1608-120           |
77|                                         SW5|
78+-+                        H3                |
79  +------------------------------------------+
5780
58------------------------------------------------------------
81     CPU: Amcoe Saltire 208PQFP (Z80 core)
82Graphics: HM86171
83     OSC: 25.000MHz, 12.000MHz & 4.9152MHz
84   Sound: OKI M6295
85   Other: XILINX XC9536XL (used for programable protection, connected to H2)
5986
87HM86171-120 - HMC 28 pin DIP Color Pallete RAMDAC
88 FM1608-120 - RAMTRON 64Kb bytewide Ferroelectric Nonvolatile RAM
89   ULN2003A - 16 pin DIP Seven Darlington Arrays
90       386D - JRC 386D low voltage AMP
91        VR1 - Sound adjust pot
92
93H2 - 6 pin header used to program the XC9536XL (JTAG?)
94H3 - 20 pin dual row connector
95
96CN1 & CN2 are RJ45 LINK connectors
97
98ROMs 1 is a AMIC 290021T
99ROM  2 is a AMIC A29040BV surface mounted
100ROMs 3 & 4 are MX 29LV400TTC surface mounted
101
102--------------------------------------------------------------------
103
60104Model No. S2000-B
61105+---------+   +-------------+   +--------------------+
62106|         +---+  Connector  +---+                    |
r8581r8582
88132+-+      S   S   S   S   S        B     R          +-+
89133  |      W   W   W   W   W        A     S            |
90134+-+      1   2   3   4   5        T     T            |
91+---------------------------------------------------+
135+----------------------------------------------------+
92136
93137     CPU: Amcoe SGC2000 208PQFP (Z80 core)
94138Graphics: HM86171
r8581r8582
49474991   ROM_LOAD_OPTIONAL( "fb617lt.id", 0x00, 0x20, CRC(9903b0a6) SHA1(840873524b1cc33539926655ef94d23f6b219f76) )
49484992ROM_END
49494993
4950ROM_START( fb6s1 )
4994ROM_START( fb6s1 ) /* "Compact" PCB, the surface mounted roms haven't been dumped yet */
49514995   ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */
49524996   ROM_LOAD( "f06s17r.bin", 0x00000, 0x40000, CRC(679747d1) SHA1(ca702324c436d54f4c23350b1af4f0250915883c) )
49534997
4954   // this is a 'compact' board,  the standard roms don't seem correct
4955
49564998   ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */
4957   ROM_LOAD( "fb06rom2.bin", 0x00000, 0x40000, CRC(f1adbcd5) SHA1(90a8830d000eb634c2db8a09431daba6cdcb2d34) )
4999   ROM_LOAD( "a29040bv.rom2", 0x00000, 0x40000, BAD_DUMP CRC(f1adbcd5) SHA1(90a8830d000eb634c2db8a09431daba6cdcb2d34) ) /* dump is from a non compact PCB */
49585000
49595001   ROM_REGION( 0x100000, "gfx1", 0 )
4960   ROM_LOAD16_BYTE( "fb06rom3.bin", 0x00000, 0x40000, CRC(63159a3a) SHA1(77e5801506ea58df73c406c8675dc8c06ba92313) )
5002   ROM_LOAD( "mx29lv400ttc.rom3", 0x00000, 0x080000, NO_DUMP )
5003   ROM_LOAD16_BYTE( "fb06rom3.bin", 0x00000, 0x40000, CRC(63159a3a) SHA1(77e5801506ea58df73c406c8675dc8c06ba92313) ) /* Use these for now so we can see something */
49615004   ROM_LOAD16_BYTE( "fb06rom4.bin", 0x00001, 0x40000, CRC(e4f4f04e) SHA1(412cfec7235455c09cffde5ca05c3e2fe4a040a0) )
49625005
49635006   ROM_REGION( 0x100000, "gfx2", 0 )
4964   /* these should be different */
4965   ROM_LOAD16_BYTE( "fb06rom5_s.bin", 0x00000, 0x80000, NO_DUMP )
4966   ROM_LOAD16_BYTE( "fb06rom6_s.bin", 0x00001, 0x80000, NO_DUMP )
5007   ROM_LOAD( "mx29lv400ttc.rom4", 0x00000, 0x080000, NO_DUMP )
49675008
49685009   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
49695010   ROM_LOAD_OPTIONAL( "fb617re.id", 0x00, 0x20, CRC(132908c4) SHA1(4e4c58327a181c511c8144349432a178936a997f) )
49705011ROM_END
49715012
4972ROM_START( fb6s2 )
5013ROM_START( fb6s2 ) /* "Compact" PCB, the surface mounted roms haven't been dumped yet */
49735014   ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */
49745015   ROM_LOAD( "f06s17lt.bin", 0x00000, 0x40000, CRC(2008a56f) SHA1(1dec4818c49cd63cc29fcb5abdab7a256731ae7b) )
49755016
4976   // this is a 'compact' board,  the standard roms don't seem correct
4977
49785017   ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */
4979   ROM_LOAD( "fb06rom2.bin", 0x00000, 0x40000, CRC(f1adbcd5) SHA1(90a8830d000eb634c2db8a09431daba6cdcb2d34) )
5018   ROM_LOAD( "a29040bv.rom2", 0x00000, 0x40000, BAD_DUMP CRC(f1adbcd5) SHA1(90a8830d000eb634c2db8a09431daba6cdcb2d34) ) /* dump is from a non compact PCB */
49805019
49815020   ROM_REGION( 0x100000, "gfx1", 0 )
4982   ROM_LOAD16_BYTE( "fb06rom3.bin", 0x00000, 0x40000, CRC(63159a3a) SHA1(77e5801506ea58df73c406c8675dc8c06ba92313) )
5021   ROM_LOAD( "mx29lv400ttc.rom3", 0x00000, 0x080000, NO_DUMP )
5022   ROM_LOAD16_BYTE( "fb06rom3.bin", 0x00000, 0x40000, CRC(63159a3a) SHA1(77e5801506ea58df73c406c8675dc8c06ba92313) ) /* Use these for now so we can see something */
49835023   ROM_LOAD16_BYTE( "fb06rom4.bin", 0x00001, 0x40000, CRC(e4f4f04e) SHA1(412cfec7235455c09cffde5ca05c3e2fe4a040a0) )
49845024
49855025   ROM_REGION( 0x100000, "gfx2", 0 )
4986   /* these should be different */
4987   ROM_LOAD16_BYTE( "fb06rom5_s.bin", 0x00000, 0x80000, NO_DUMP )
4988   ROM_LOAD16_BYTE( "fb06rom6_s.bin", 0x00001, 0x80000, NO_DUMP )
5026   ROM_LOAD( "mx29lv400ttc.rom4", 0x00000, 0x080000, NO_DUMP )
49895027
49905028   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
49915029   ROM_LOAD_OPTIONAL( "fb617lt.id", 0x00, 0x20, CRC(9903b0a6) SHA1(840873524b1cc33539926655ef94d23f6b219f76) )
49925030ROM_END
49935031
5032ROM_START( fb6s3 ) /* "Compact" PCB, the surface mounted roms haven't been dumped yet */
5033   ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */
5034   ROM_LOAD( "f06s13r.bin", 0x00000, 0x40000, CRC(93ba8c7c) SHA1(905572e98bd01c4db597ee30afbe5f9cb1b114ed) )
5035
5036   ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */
5037   ROM_LOAD( "a29040bv.rom2", 0x00000, 0x40000, BAD_DUMP CRC(f1adbcd5) SHA1(90a8830d000eb634c2db8a09431daba6cdcb2d34) ) /* dump is from a non compact PCB */
5038
5039   ROM_REGION( 0x100000, "gfx1", 0 )
5040   ROM_LOAD( "mx29lv400ttc.rom3", 0x00000, 0x080000, NO_DUMP )
5041   ROM_LOAD16_BYTE( "fb06rom3.bin", 0x00000, 0x40000, CRC(63159a3a) SHA1(77e5801506ea58df73c406c8675dc8c06ba92313) ) /* Use these for now so we can see something */
5042   ROM_LOAD16_BYTE( "fb06rom4.bin", 0x00001, 0x40000, CRC(e4f4f04e) SHA1(412cfec7235455c09cffde5ca05c3e2fe4a040a0) )
5043
5044   ROM_REGION( 0x100000, "gfx2", 0 )
5045   ROM_LOAD( "mx29lv400ttc.rom4", 0x00000, 0x080000, NO_DUMP )
5046
5047   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
5048   ROM_LOAD_OPTIONAL( "fb6130r.id", 0x00, 0x20, CRC(959969d1) SHA1(885b4708fb459c96ead67ae911e5296adc148ee3) )
5049ROM_END
5050
49945051/* Fruit Bonus 2006 Special Edition */
49955052ROM_START( fb6se )
49965053   ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */
r8581r8582
58275884GAME( 2006, fb6d2,       fb6,      sfbonus,    amcoe1_reels3,    fb6d,            ROT0,  "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT CGA, set 1)", 0)
58285885GAME( 2006, fb6s2,       fb6,      sfbonus,    amcoe1_reels3,    fb6s,            ROT0,  "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT CGA, set 2)", GAME_NOT_WORKING) // no reel gfx
58295886GAME( 2006, fb6v2,       fb6,      sfbonus,    amcoe1_reels3,    fb6v,            ROT0,  "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.7LT Dual)", 0)
5887GAME( 2006, fb6s3,       fb6,      sfbonus,    amcoe1_reels3,    fb6s,            ROT0,  "Amcoe", "Fruit Bonus '06 - 10th anniversary (Version 1.3R CGA)", GAME_NOT_WORKING) // no reel gfx
58305888
58315889GAME( 2006, fb6se,       0,        sfbonus,    amcoe1_reels3,    fb6,             ROT0,  "Amcoe", "Fruit Bonus 2006 Special Edition (Version 1.4E CGA)", 0) /* Released August 2006 according to Amcoe web site */
58325890GAME( 2006, fb6sev,      fb6se,    sfbonus,    amcoe1_reels3,    fb6v3,           ROT0,  "Amcoe", "Fruit Bonus 2006 Special Edition (Version 1.4E Dual)", 0)
r8581r8582
58415899GAME( 2006, bugfeverv2,  bugfever, sfbonus,    amcoe1_reels3,    bugfeverv2,      ROT0,  "Amcoe", "Bugs Fever (Version 1.7E Dual)", 0)
58425900GAME( 2006, bugfevero,   bugfever, sfbonus,    amcoe1_reels3,    bugfever,        ROT0,  "Amcoe", "Bugs Fever (Version 1.6R CGA)", 0)
58435901
5844GAME( 2007, atworld,     0,        sfbonus,    amcoe1_reels3,    atworld,         ROT0,  "Amcoe", "Around The World (Version 1.3E CGA)", 0) /* Year according to Amcoe web site - too new */
5845GAME( 2007, atworldd1,   atworld,  sfbonus,    amcoe1_reels3,    atworldd,        ROT0,  "Amcoe", "Around The World (Version 1.3R CGA)", 0) /* Year according to Amcoe web site - too new */
5902GAME( 2007, atworld,     0,        sfbonus,    amcoe1_reels3,    atworld,         ROT0,  "Amcoe", "Around The World (Version 1.3E CGA)", 0) /* Year according to Amcoe web site */
5903GAME( 2007, atworldd1,   atworld,  sfbonus,    amcoe1_reels3,    atworldd,        ROT0,  "Amcoe", "Around The World (Version 1.3R CGA)", 0) /* Year according to Amcoe web site */
58465904
58475905// no graphic / sound roms dumped for these sets, but functional program roms & descramble are in place
58485906GAME( 2005, funriver,    0,        sfbonus,    amcoe1_reels3,    funriver,        ROT0,  "Amcoe", "Fun River (set 1)", GAME_NOT_WORKING)
src/mame/drivers/crystal.c
r8581r8582
22    CRYSTAL SYSTEM by Brezzasoft (2001)
33    using VRender0 System on a Chip
44
5    The VRender0 (http://www.mesdigital.com/english/Products/product_vrender0.asp) chip contains:
5    The VRender0 (info at archive.org for http://www.mesdigital.com) chip contains:
66        - CPU Core SE3208 (info at www.adc.co.kr) @ 43Mhz
77        - 2 DMA chans
88        - 4 Timers
r8581r8582
563563   crystal_state *state = (crystal_state *)machine->driver_data;
564564   int i;
565565
566   state->maincpu = devtag_get_device(machine, "maincpu");
567   state->ds1302 = devtag_get_device(machine, "rtc");
568   state->vr0video = devtag_get_device(machine, "vr0");
566   state->maincpu = machine->device("maincpu");
567   state->ds1302 = machine->device("rtc");
568   state->vr0video = machine->device("vr0");
569569
570   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback);
570   cpu_set_irq_callback(machine->device("maincpu"), icallback);
571571   for (i = 0; i < 4; i++)
572572      state->Timer[i] = timer_alloc(machine, Timercb, (void*)(FPTR)i);
573573
r8581r8582
597597   memset(state->vidregs, 0, 0x10000);
598598   state->FlipCount = 0;
599599   state->IntHigh = 0;
600   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback);
600   cpu_set_irq_callback(machine->device("maincpu"), icallback);
601601   state->Bank = 0;
602602   memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0);
603603   state->FlashCmd = 0xff;
r8581r8582
612612      timer_adjust_oneshot(state->Timer[i], attotime_never, 0);
613613   }
614614
615   vr0_snd_set_areas(devtag_get_device(machine, "vrender"), state->textureram, state->frameram);
615   vr0_snd_set_areas(machine->device("vrender"), state->textureram, state->frameram);
616616#ifdef IDLE_LOOP_SPEEDUP
617617   state->FlipCntRead = 0;
618618#endif
r8581r8582
902902   ROM_REGION( 0x20000, "maincpu", 0 ) // bios
903903   ROM_LOAD("mx27l1000.u14",  0x000000, 0x020000, CRC(BEFF39A9) SHA1(b6f6dda58d9c82273f9422c1bd623411e58982cb))
904904
905   ROM_REGION( 0x4300, "pic", 0 ) // pic16c727 - we don't have a core for this
906   ROM_LOAD("top_blade_v_pic16c727.bin",  0x000000, 0x4300, CRC(9cdea57b) SHA1(884156085f9e780cdf719aedc2e8a0fd5983613b) )
907
908
905909   ROM_REGION32_LE( 0x1000000, "user1", 0 ) // Flash
906910   ROM_LOAD("flash.u1",  0x0000000, 0x1000000, CRC(bd23f640) SHA1(1d22aa2c828642bb7c1dfea4e13f777f95acc701) )
907911
r8581r8582
913917   ROM_REGION( 0x20000, "maincpu", 0 ) // bios (not the standard one)
914918   ROM_LOAD("bios.u14",  0x000000, 0x020000, CRC(ffc57e90) SHA1(6b6a17fd4798dea9c7b880f3063be8494e7db302) )
915919
920   ROM_REGION( 0x4280, "pic", 0 ) // pic16f84a - we don't have a core for this
921   ROM_LOAD("office_yeo_in_cheon_ha_pic16f84a.bin",  0x000000, 0x4280, CRC(7561cdf5) SHA1(eade592823a110019b4af81a7dc56d01f7d6589f) )
922
923
916924   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Flash
917925   ROM_LOAD("flash.u1",  0x0000000, 0x1000000, CRC(d3f3eec4) SHA1(ea728415bd4906964b7d37f4379a8a3bd42a1c2d) )
918926   ROM_LOAD("flash.u2",  0x1000000, 0x1000000, CRC(e4f85d0a) SHA1(2ddfa6b3a30e69754aa9d96434ff3d37784bfa57) )
src/mame/drivers/madmotor.c
r8581r8582
227227{
228228   madmotor_state *state = (madmotor_state *)machine->driver_data;
229229
230   state->maincpu = devtag_get_device(machine, "maincpu");
231   state->audiocpu = devtag_get_device(machine, "audiocpu");
230   state->maincpu = machine->device("maincpu");
231   state->audiocpu = machine->device("audiocpu");
232232
233233   state_save_register_global(machine, state->flipscreen);
234234}
src/mame/drivers/eprom.c
r8581r8582
4242
4343   cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
4444
45   if (devtag_get_device(machine, "extra") != NULL)
45   if (machine->device("extra") != NULL)
4646      cputag_set_input_line(machine, "extra", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
4747
4848   cputag_set_input_line(machine, "maincpu", 6, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
r8581r8582
108108{
109109   eprom_state *state = (eprom_state *)space->machine->driver_data;
110110
111   if (ACCESSING_BITS_0_7 && (devtag_get_device(space->machine, "extra") != NULL))
111   if (ACCESSING_BITS_0_7 && (space->machine->device("extra") != NULL))
112112   {
113113      /* bit 0: reset extra CPU */
114114      if (data & 1)
src/mame/drivers/cshooter.c
r8581r8582
535535   ROM_REGION( 0x10000, "audiocpu", 0 )   // Sub/Sound CPU?
536536   ROM_LOAD( "r4",  0x00000, 0x08000, CRC(84fed017) SHA1(9a564c9379eb48569cfba48562889277991864d8) )
537537
538   // not hooked up yet (Taito version has this instead of encryption!
538539   ROM_REGION( 0x0800, "cpu2", 0 )   /* 2k for the microcontroller */
539   ROM_LOAD( "68705.bin",    0x0000, 0x0800, NO_DUMP )
540   ROM_LOAD( "crshooter.3j",    0x0000, 0x0800, CRC(aae61ce7) SHA1(bb2b9887ec73a5b82604b9b64c533c2242d20d0f) )
540541
541542   ROM_REGION( 0x02000, "gfx1", 0 )   // TX Layer
542543   ROM_LOAD( "r3",  0x00000, 0x02000, CRC(67b50a47) SHA1(b1f4aefc9437edbeefba5371149cc08c0b55c741) )   // only 1 byte difference with 3.f11, bad dump?
src/mame/drivers/aerofgt.c
r8581r8582
13011301{
13021302   aerofgt_state *state = (aerofgt_state *)machine->driver_data;
13031303
1304   state->audiocpu = devtag_get_device(machine, "audiocpu");
1304   state->audiocpu = machine->device("audiocpu");
13051305   state_save_register_global(machine, state->pending_command);
13061306}
13071307
src/mame/drivers/quakeat.c
r8581r8582
3131
3232
3333 -- Hardware info found in the following press release:
34http://www.quantum3d.com/press/HTMLarchive/4-20-98.html
34http://www.wave-report.com/archives/1998/98170702.htm
3535
3636QUANTUM3D'S HEAVY METAL SYSTEM - HM233G
3737NLX form factor system that is based on the Intel 440LX chipset
r8581r8582
140140
141141static MACHINE_START(quakeat)
142142{
143   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
143   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
144144
145   quakeat_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
146   quakeat_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
145   quakeat_devices.pic8259_1 = machine->device( "pic8259_1" );
146   quakeat_devices.pic8259_2 = machine->device( "pic8259_2" );
147147}
148148/*************************************************************/
149149
src/mame/drivers/ultrsprt.c
r8581r8582
8383static MACHINE_START( ultrsprt )
8484{
8585   /* set conservative DRC options */
86   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
86   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
8787
8888   /* configure fast RAM regions for DRC */
89   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x80000000, 0x8007ffff, FALSE, vram);
90   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0xff000000, 0xff01ffff, FALSE, workram);
89   ppcdrc_add_fastram(machine->device("maincpu"), 0x80000000, 0x8007ffff, FALSE, vram);
90   ppcdrc_add_fastram(machine->device("maincpu"), 0xff000000, 0xff01ffff, FALSE, workram);
9191}
9292
9393
r8581r8582
111111
112112static READ16_HANDLER( K056800_68k_r )
113113{
114   running_device *k056800 = devtag_get_device(space->machine, "k056800");
114   running_device *k056800 = space->machine->device("k056800");
115115   UINT16 r = 0;
116116
117117   if (ACCESSING_BITS_8_15)
r8581r8582
125125
126126static WRITE16_HANDLER( K056800_68k_w )
127127{
128   running_device *k056800 = devtag_get_device(space->machine, "k056800");
128   running_device *k056800 = space->machine->device("k056800");
129129
130130   if (ACCESSING_BITS_8_15)
131131      k056800_sound_w(k056800, (offset*2)+0, (data >> 8) & 0xff, 0x00ff);
r8581r8582
190190static void sound_irq_callback(running_machine *machine, int irq)
191191{
192192   if (irq == 0)
193      /*generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), INPUT_LINE_IRQ5)*/;
193      /*generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ5)*/;
194194   else
195195      cputag_set_input_line(machine, "audiocpu", INPUT_LINE_IRQ6, HOLD_LINE);
196196}
src/mame/drivers/midyunit.c
r8581r8582
2626    Notes:
2727        * Super Hi Impact Proto V4.0: You need to at least reset the high score
2828            table from the UTILITIES menu.  It's best to do a FULL FACTORY RESTORE
29        * Known to exist, but not dumped Terminator 2 LA4 (8/3/92)
3029
3130
3231Super High Impact
r8581r8582
15621561   ROM_REGION( 0x800000, "gfx1", 0 )
15631562   ROM_LOAD ( "trogu111.bin",  0x000000, 0x20000, CRC(9ded08c1) SHA1(bbf069f218e3f3d67e45fa2229a471451b3a8f96) )
15641563   ROM_LOAD ( "trogu112.bin",  0x020000, 0x20000, CRC(42293843) SHA1(cae77eeddd784573beccb79e54573da0e4ccdd8a) )
1565   ROM_LOAD ( "trog_pa6.113",  0x040000, 0x20000, CRC(ae50e5ea) SHA1(915b76f76e7ccbf2c4c28829cea15feaafea498b) )
1564   ROM_LOAD ( "trogu113.pa6",  0x040000, 0x20000, CRC(ae50e5ea) SHA1(915b76f76e7ccbf2c4c28829cea15feaafea498b) )
15661565
1566   ROM_LOAD ( "trogu106.bin",  0x080000, 0x20000, CRC(af2eb0d8) SHA1(3767e6f3853b092b40664c2b6c6a838f0243514b) )
1567   ROM_LOAD ( "trogu107.bin",  0x0a0000, 0x20000, CRC(88a7b3f6) SHA1(ba55f66929841a915d7b96aabf4b11e50ba6cfbd) )
1568
15671569   ROM_LOAD (  "trogu95.bin",  0x200000, 0x20000, CRC(f3ba2838) SHA1(2bee6c783c84a9f3f9309d802f42983857190ece) )
15681570   ROM_LOAD (  "trogu96.bin",  0x220000, 0x20000, CRC(cfed2e77) SHA1(7fc0f52ac844c9efcbcc3004c40f9f4fc7e1c346) )
1569   ROM_LOAD (  "trog_pa6.97",  0x240000, 0x20000, CRC(354b1cb3) SHA1(88400e39f0476d32a0798c50855a8ff9dc0a6617) )
1571   ROM_LOAD (  "trogu97.pa6",  0x240000, 0x20000, CRC(354b1cb3) SHA1(88400e39f0476d32a0798c50855a8ff9dc0a6617) )
15701572
1571   ROM_LOAD ( "trogu106.bin",  0x080000, 0x20000, CRC(af2eb0d8) SHA1(3767e6f3853b092b40664c2b6c6a838f0243514b) )
1572   ROM_LOAD ( "trogu107.bin",  0x0a0000, 0x20000, CRC(88a7b3f6) SHA1(ba55f66929841a915d7b96aabf4b11e50ba6cfbd) )
1573
15741573   ROM_LOAD (  "trogu90.bin",  0x280000, 0x20000, CRC(16e06753) SHA1(62ec2b18e6b965ea0792d655d7878b4225da3aca) )
15751574   ROM_LOAD (  "trogu91.bin",  0x2a0000, 0x20000, CRC(880a02c7) SHA1(ab1b2d24be4571a183b230d267c6c8167d4a42a4) )
15761575ROM_END
15771576
15781577
1579ROM_START( trogp )
1578ROM_START( trogpa4 )
15801579   ROM_REGION( 0x90000, "cvsdcpu", 0 )   /* sound CPU */
15811580   ROM_LOAD (   "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) )
15821581   ROM_RELOAD(                0x20000, 0x10000 )
r8581r8582
15861585   ROM_RELOAD(                0x60000, 0x10000 )
15871586
15881587   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
1589   ROM_LOAD16_BYTE( "trog105.dat",  0xc0000, 0x20000, CRC(526a3f5b) SHA1(8ad8cb15ada527f989f774a4fb81a171697c6dad) )
1590   ROM_LOAD16_BYTE( "trog89.dat",   0xc0001, 0x20000, CRC(38d68685) SHA1(42b73a64641301bf2991929cf365b8f45fc1b5d8) )
1588   ROM_LOAD16_BYTE( "u105-pa4",  0xc0000, 0x20000, CRC(526a3f5b) SHA1(8ad8cb15ada527f989f774a4fb81a171697c6dad) )
1589   ROM_LOAD16_BYTE( "u89-pa4",   0xc0001, 0x20000, CRC(38d68685) SHA1(42b73a64641301bf2991929cf365b8f45fc1b5d8) )
15911590
15921591   ROM_REGION( 0x800000, "gfx1", 0 )
15931592   ROM_LOAD ( "trogu111.bin",  0x000000, 0x20000, CRC(9ded08c1) SHA1(bbf069f218e3f3d67e45fa2229a471451b3a8f96) )
15941593   ROM_LOAD ( "trogu112.bin",  0x020000, 0x20000, CRC(42293843) SHA1(cae77eeddd784573beccb79e54573da0e4ccdd8a) )
1595   ROM_LOAD ( "trog113.dat",   0x040000, 0x20000, CRC(2980a56f) SHA1(1e6ab16be6071d6568149e9ba56e146e3431b5f2) )
1594   ROM_LOAD ( "trogu113.pa4",  0x040000, 0x20000, CRC(2980a56f) SHA1(1e6ab16be6071d6568149e9ba56e146e3431b5f2) )
15961595
15971596   ROM_LOAD ( "trogu106.bin",  0x080000, 0x20000, CRC(af2eb0d8) SHA1(3767e6f3853b092b40664c2b6c6a838f0243514b) )
15981597   ROM_LOAD ( "trogu107.bin",  0x0a0000, 0x20000, CRC(88a7b3f6) SHA1(ba55f66929841a915d7b96aabf4b11e50ba6cfbd) )
15991598
16001599   ROM_LOAD (  "trogu95.bin",  0x200000, 0x20000, CRC(f3ba2838) SHA1(2bee6c783c84a9f3f9309d802f42983857190ece) )
16011600   ROM_LOAD (  "trogu96.bin",  0x220000, 0x20000, CRC(cfed2e77) SHA1(7fc0f52ac844c9efcbcc3004c40f9f4fc7e1c346) )
1602   ROM_LOAD (  "trog97.dat",   0x240000, 0x20000, CRC(f94b77c1) SHA1(d4ca3d7270ea1d86cb5c53e85dc7682b0e5945ef) )
1601   ROM_LOAD (  "trogu97.pa4",  0x240000, 0x20000, CRC(f94b77c1) SHA1(d4ca3d7270ea1d86cb5c53e85dc7682b0e5945ef) )
16031602
16041603   ROM_LOAD (  "trogu90.bin",  0x280000, 0x20000, CRC(16e06753) SHA1(62ec2b18e6b965ea0792d655d7878b4225da3aca) )
16051604   ROM_LOAD (  "trogu91.bin",  0x2a0000, 0x20000, CRC(880a02c7) SHA1(ab1b2d24be4571a183b230d267c6c8167d4a42a4) )
r8581r8582
19911990   ROM_LOAD (  "shiu20.bin", 0x50000, 0x20000, CRC(1b4a71c1) SHA1(74b7b4ae76ebe65f1f46b2117970bfefefbb5344) )
19921991
19931992   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
1994   ROM_LOAD16_BYTE( "pro6.105",  0xc0000, 0x20000, CRC(33e1978d) SHA1(a88af5551d6b4777e0c5f5e3844b2f1d61bbb35d) )
1995   ROM_LOAD16_BYTE( "pro6.89",   0xc0001, 0x20000, CRC(6c070978) SHA1(ca6657c48810d78496c51eb750f45a3e08132ce3) )
1993   ROM_LOAD16_BYTE( "u105-pa6",  0xc0000, 0x20000, CRC(33e1978d) SHA1(a88af5551d6b4777e0c5f5e3844b2f1d61bbb35d) )
1994   ROM_LOAD16_BYTE( "u89-pa6",   0xc0001, 0x20000, CRC(6c070978) SHA1(ca6657c48810d78496c51eb750f45a3e08132ce3) )
19961995
19971996   ROM_REGION( 0x800000, "gfx1", 0 )
19981997   ROM_LOAD ( "shiu111.bin",  0x000000, 0x40000, CRC(80ae2a86) SHA1(1ff76e3064c7636f6877e426f4a88c094d1a6325) )
r8581r8582
21002099ROM_END
21012100
21022101
2103ROM_START( mkprot8 )
2102ROM_START( mkla4 )
21042103   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
21052104   ROM_LOAD (  "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
21062105
r8581r8582
21112110   ROM_RELOAD(               0xc0000, 0x40000 )
21122111
21132112   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2114   ROM_LOAD16_BYTE( "mkprot8.105",  0x00000, 0x80000, CRC(2f3c095d) SHA1(f6e9ac0fc0f997f4b323ba48590b042eae079a16) )
2115   ROM_LOAD16_BYTE(  "mkprot8.89",  0x00001, 0x80000, CRC(edcf217f) SHA1(29e17bd20844a3e666e794c2fc068a011ccff2e8) )
2113   ROM_LOAD16_BYTE( "mkg-u105.la4",  0x00000, 0x80000, CRC(29af348f) SHA1(9f8a57606647c5ea056d61aa4ab1232538539fd8) )
2114   ROM_LOAD16_BYTE(  "mkg-u89.la4",  0x00001, 0x80000, CRC(1ad76662) SHA1(bee4ab5371f58df799365e73ec0cc02e903f240c) )
21162115
21172116   ROM_REGION( 0x800000, "gfx1", 0 )
21182117   ROM_LOAD ( "mkg-u111.rom",  0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) )
r8581r8582
21322131ROM_END
21332132
21342133
2135ROM_START( mkprot9 )
2134ROM_START( mkla3 )
21362135   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
21372136   ROM_LOAD (  "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
21382137
r8581r8582
21432142   ROM_RELOAD(               0xc0000, 0x40000 )
21442143
21452144   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2146   ROM_LOAD16_BYTE( "mkprot9.105",  0x00000, 0x80000, CRC(20772bbd) SHA1(d5b400700b91c7a70bd2441c5254300cf1f743d7) )
2147   ROM_LOAD16_BYTE(  "mkprot9.89",  0x00001, 0x80000, CRC(3238d45b) SHA1(8a4e827994d0d20feda3785a5f8f0f77b737052b) )
2145   ROM_LOAD16_BYTE( "mkg-u105.la3",  0x00000, 0x80000, CRC(2ce843c5) SHA1(d48efcecd6528414249f3884edc32e0dafa9677f) )
2146   ROM_LOAD16_BYTE(  "mkg-u89.la3",  0x00001, 0x80000, CRC(49a46e10) SHA1(c63c00531b29c01ee864acc141b1713507d25c69) )
21482147
21492148   ROM_REGION( 0x800000, "gfx1", 0 )
21502149   ROM_LOAD ( "mkg-u111.rom",  0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) )
r8581r8582
21642163ROM_END
21652164
21662165
2167ROM_START( mkla1 )
2166ROM_START( mkla2 )
21682167   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
21692168   ROM_LOAD (  "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
21702169
r8581r8582
21752174   ROM_RELOAD(               0xc0000, 0x40000 )
21762175
21772176   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2178   ROM_LOAD16_BYTE( "mkg-u105.la1",  0x00000, 0x80000, CRC(e1f7b4c9) SHA1(dc62e67e03b54460494bd94a50347327c19b72ec) )
2179   ROM_LOAD16_BYTE(  "mkg-u89.la1",  0x00001, 0x80000, CRC(9d38ac75) SHA1(86ff581cd3546f6b1be75e1d0744a8d767b22f5a) )
2177   ROM_LOAD16_BYTE( "mkg-u105.la2",  0x00000, 0x80000, CRC(8531d44e) SHA1(652c7946cc725e11815f852af8891511b87de186) )
2178   ROM_LOAD16_BYTE(  "mkg-u89.la2",  0x00001, 0x80000, CRC(b88dc26e) SHA1(bf34a03bdb70b67fd9c0b6d636b038a63827151e) )
21802179
21812180   ROM_REGION( 0x800000, "gfx1", 0 )
21822181   ROM_LOAD ( "mkg-u111.rom",  0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) )
r8581r8582
21962195ROM_END
21972196
21982197
2199ROM_START( mkla2 )
2198ROM_START( mkla1 )
22002199   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
22012200   ROM_LOAD (  "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
22022201
r8581r8582
22072206   ROM_RELOAD(               0xc0000, 0x40000 )
22082207
22092208   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2210   ROM_LOAD16_BYTE( "mkg-u105.la2",  0x00000, 0x80000, CRC(8531d44e) SHA1(652c7946cc725e11815f852af8891511b87de186) )
2211   ROM_LOAD16_BYTE(  "mkg-u89.la2",  0x00001, 0x80000, CRC(b88dc26e) SHA1(bf34a03bdb70b67fd9c0b6d636b038a63827151e) )
2209   ROM_LOAD16_BYTE( "mkg-u105.la1",  0x00000, 0x80000, CRC(e1f7b4c9) SHA1(dc62e67e03b54460494bd94a50347327c19b72ec) )
2210   ROM_LOAD16_BYTE(  "mkg-u89.la1",  0x00001, 0x80000, CRC(9d38ac75) SHA1(86ff581cd3546f6b1be75e1d0744a8d767b22f5a) )
22122211
22132212   ROM_REGION( 0x800000, "gfx1", 0 )
22142213   ROM_LOAD ( "mkg-u111.rom",  0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) )
r8581r8582
22282227ROM_END
22292228
22302229
2231ROM_START( mkla3 )
2230ROM_START( mkprot9 )
22322231   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
22332232   ROM_LOAD (  "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
22342233
r8581r8582
22392238   ROM_RELOAD(               0xc0000, 0x40000 )
22402239
22412240   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2242   ROM_LOAD16_BYTE( "mkg-u105.la3",  0x00000, 0x80000, CRC(2ce843c5) SHA1(d48efcecd6528414249f3884edc32e0dafa9677f) )
2243   ROM_LOAD16_BYTE(  "mkg-u89.la3",  0x00001, 0x80000, CRC(49a46e10) SHA1(c63c00531b29c01ee864acc141b1713507d25c69) )
2241   ROM_LOAD16_BYTE( "mkprot9.105",  0x00000, 0x80000, CRC(20772bbd) SHA1(d5b400700b91c7a70bd2441c5254300cf1f743d7) )
2242   ROM_LOAD16_BYTE(  "mkprot9.89",  0x00001, 0x80000, CRC(3238d45b) SHA1(8a4e827994d0d20feda3785a5f8f0f77b737052b) )
22442243
22452244   ROM_REGION( 0x800000, "gfx1", 0 )
22462245   ROM_LOAD ( "mkg-u111.rom",  0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) )
r8581r8582
22602259ROM_END
22612260
22622261
2263ROM_START( mkla4 )
2262ROM_START( mkprot8 )
22642263   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
22652264   ROM_LOAD (  "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
22662265
r8581r8582
22712270   ROM_RELOAD(               0xc0000, 0x40000 )
22722271
22732272   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2274   ROM_LOAD16_BYTE( "mkg-u105.la4",  0x00000, 0x80000, CRC(29af348f) SHA1(9f8a57606647c5ea056d61aa4ab1232538539fd8) )
2275   ROM_LOAD16_BYTE(  "mkg-u89.la4",  0x00001, 0x80000, CRC(1ad76662) SHA1(bee4ab5371f58df799365e73ec0cc02e903f240c) )
2273   ROM_LOAD16_BYTE( "mkprot8.105",  0x00000, 0x80000, CRC(2f3c095d) SHA1(f6e9ac0fc0f997f4b323ba48590b042eae079a16) )
2274   ROM_LOAD16_BYTE(  "mkprot8.89",  0x00001, 0x80000, CRC(edcf217f) SHA1(29e17bd20844a3e666e794c2fc068a011ccff2e8) )
22762275
22772276   ROM_REGION( 0x800000, "gfx1", 0 )
22782277   ROM_LOAD ( "mkg-u111.rom",  0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) )
r8581r8582
23732372   ROM_RELOAD(             0xc0000, 0x40000 )
23742373
23752374   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
2375   ROM_LOAD16_BYTE( "t2-la4.105",  0x00000, 0x80000, CRC(d4d8d884) SHA1(3209e131b128f12af30b3c6056fd63df497f93eb) )
2376   ROM_LOAD16_BYTE( "t2-la4.89",   0x00001, 0x80000, CRC(25359415) SHA1(ca8b7e1b5a363b78499f92c979a11ace6f1dceab) )
2377
2378   ROM_REGION( 0x800000, "gfx1", 0 )
2379   ROM_LOAD ( "t2.111",  0x000000, 0x80000, CRC(916d0197) SHA1(3b53d3770955b10cc6002e3d3bf0f71429667af0) )
2380   ROM_LOAD ( "t2.112",  0x080000, 0x80000, CRC(39ae1c87) SHA1(a9d332dffc77c1e0dc50549825f5b403cf19c41d) )
2381   ROM_LOAD ( "t2.113",  0x100000, 0x80000, CRC(cb5084e5) SHA1(58cab00d8ebc72792f6c29899013ae6a0d2278b9) )
2382   ROM_LOAD ( "t2.114",  0x180000, 0x80000, CRC(53c516ec) SHA1(2a33639bc5bb4e7f7b3e341ddb59173260461d20) )
2383
2384   ROM_LOAD (  "t2.95",  0x200000, 0x80000, CRC(dd39cf73) SHA1(53bb54e66e4dfbe58385915004b0ad57583a7543) )
2385   ROM_LOAD (  "t2.96",  0x280000, 0x80000, CRC(31f4fd36) SHA1(766fca7d5e5043fc9e68bd3dc15e6a7830279d88) )
2386   ROM_LOAD (  "t2.97",  0x300000, 0x80000, CRC(7f72e775) SHA1(7e2369c6b4ed5d653700b041df58355a0960193a) )
2387   ROM_LOAD (  "t2.98",  0x380000, 0x80000, CRC(1a20ce29) SHA1(9089b7f77da5d67ad46ed249d72de8b8e0e5d807) )
2388
2389   ROM_LOAD ( "t2.106",  0x400000, 0x80000, CRC(f08a9536) SHA1(fbac314bd52f23c7a704acd3c707e75cdf204c07) )
2390   ROM_LOAD ( "t2.107",  0x480000, 0x80000, CRC(268d4035) SHA1(89a310830be9fbc91794fcccc57053d0933c42a3) )
2391   ROM_LOAD ( "t2.108",  0x500000, 0x80000, CRC(379fdaed) SHA1(408df6702c8ea8d3dce0b231955c6a60f3f5f22b) )
2392   ROM_LOAD ( "t2.109",  0x580000, 0x80000, CRC(306a9366) SHA1(b94c23c033221f7f7fddd2911b8cec9549929768) )
2393ROM_END
2394
2395
2396ROM_START( term2la3 )
2397   ROM_REGION( 0x50000, "adpcm", 0 )   /* sound CPU */
2398   ROM_LOAD (  "t2_snd.3", 0x10000, 0x20000, CRC(73c3f5c4) SHA1(978dd974590e77294dbe9a647aebd3d24af6397f) )
2399   ROM_RELOAD (            0x30000, 0x20000 )
2400
2401   ROM_REGION( 0x200000, "oki", 0 )   /* ADPCM */
2402   ROM_LOAD ( "t2_snd.12", 0x00000, 0x40000, CRC(e192a40d) SHA1(1f7a0e282c0c8eb66cbe514128bd104433e53b7a) )
2403   ROM_RELOAD(             0x40000, 0x40000 )
2404   ROM_LOAD ( "t2_snd.13", 0x80000, 0x40000, CRC(956fa80b) SHA1(02ab504627f4b25a394fa4192bb134138cbf6a4f) )
2405   ROM_RELOAD(             0xc0000, 0x40000 )
2406
2407   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
23762408   ROM_LOAD16_BYTE( "t2-la3.105",  0x00000, 0x80000, CRC(34142b28) SHA1(985fd169b3d62c4197fe4c6f11055a6c17872899) )
23772409   ROM_LOAD16_BYTE( "t2-la3.89",   0x00001, 0x80000, CRC(5ffea427) SHA1(c6f65bc57b33ae1a123f610c635e0d65663e54da) )
23782410
r8581r8582
25402572GAME( 1990, trog,     0,        yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (rev LA5 03/29/91)", GAME_SUPPORTS_SAVE )
25412573GAME( 1990, trog4,    trog,     yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (rev LA4 03/11/91)", GAME_SUPPORTS_SAVE )
25422574GAME( 1990, trog3,    trog,     yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (rev LA3 02/14/91)", GAME_SUPPORTS_SAVE )
2543GAME( 1990, trogpa6,  trog,     yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (rev PA6-PAC 09/09/90)", GAME_SUPPORTS_SAVE )
2544GAME( 1990, trogp,    trog,     yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (prototype, rev 4.00 07/27/90)", GAME_SUPPORTS_SAVE )
2545GAME( 1991, strkforc, 0,        yunit_cvsd_4bit_fast,  strkforc, strkforc, ROT0, "Midway",   "Strike Force (rev 1 02/25/91)", GAME_SUPPORTS_SAVE )
2575GAME( 1990, trogpa6,  trog,     yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (prototype, rev PA6-PAC 09/09/90)", GAME_SUPPORTS_SAVE )
2576GAME( 1990, trogpa4,  trog,     yunit_cvsd_4bit_slow,  trog,     trog,     ROT0, "Midway",   "Trog (prototype, rev 4.00 07/27/90)", GAME_SUPPORTS_SAVE )
25462577
25472578GAME( 1990, smashtv,  0,        yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 8.00)", GAME_SUPPORTS_SAVE )
25482579GAME( 1990, smashtv6, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 6.00)", GAME_SUPPORTS_SAVE )
r8581r8582
25622593GAME( 1991, shimpactp5, shimpact, yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 5.0 09/15/91)", GAME_SUPPORTS_SAVE )
25632594GAME( 1991, shimpactp4, shimpact, yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 4.0 09/10/91)", GAME_SUPPORTS_SAVE ) /* See notes about factory restore above */
25642595
2565GAME( 1991, term2,    0,        yunit_adpcm_6bit_faster, term2,    term2,    ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA3 03/27/92)", GAME_SUPPORTS_SAVE )
2596GAME( 1991, strkforc, 0,        yunit_cvsd_4bit_fast,  strkforc, strkforc, ROT0, "Midway",   "Strike Force (rev 1 02/25/91)", GAME_SUPPORTS_SAVE )
2597
2598GAME( 1991, term2,    0,        yunit_adpcm_6bit_faster, term2,    term2,    ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA4 08/03/92)", GAME_SUPPORTS_SAVE )
2599GAME( 1991, term2la3, term2,    yunit_adpcm_6bit_faster, term2,    term2la3, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA3 03/27/92)", GAME_SUPPORTS_SAVE )
25662600GAME( 1991, term2la2, term2,    yunit_adpcm_6bit_faster, term2,    term2la2, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA2 12/09/91)", GAME_SUPPORTS_SAVE )
25672601GAME( 1991, term2la1, term2,    yunit_adpcm_6bit_faster, term2,    term2la1, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA1 11/01/91)", GAME_SUPPORTS_SAVE )
2602
2603GAME( 1992, mkla4,    mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 4.0 09/28/92)", GAME_SUPPORTS_SAVE )
2604GAME( 1992, mkla3,    mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 3.0 08/31/92)", GAME_SUPPORTS_SAVE )
2605GAME( 1992, mkla2,    mk,       yunit_adpcm_6bit_fast,   mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 2.0 08/18/92)", GAME_SUPPORTS_SAVE )
2606GAME( 1992, mkla1,    mk,       yunit_adpcm_6bit_fast,   mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 1.0 08/09/92)", GAME_SUPPORTS_SAVE )
2607GAME( 1992, mkprot9,  mk,       yunit_adpcm_6bit_faster, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (prototype, rev 9.0 07/28/92)", GAME_SUPPORTS_SAVE )
25682608GAME( 1992, mkprot8,  mk,       yunit_adpcm_6bit_faster, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (prototype, rev 8.0 07/21/92)", GAME_SUPPORTS_SAVE )
2569GAME( 1992, mkprot9,  mk,       yunit_adpcm_6bit_faster, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (prototype, rev 9.0 07/28/92)", GAME_SUPPORTS_SAVE )
2570GAME( 1992, mkla1,    mk,       yunit_adpcm_6bit_fast,   mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 1.0 08/09/92)", GAME_SUPPORTS_SAVE )
2571GAME( 1992, mkla2,    mk,       yunit_adpcm_6bit_fast,   mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 2.0 08/18/92)", GAME_SUPPORTS_SAVE )
2572GAME( 1992, mkla3,    mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 3.0 08/31/92)", GAME_SUPPORTS_SAVE )
2573GAME( 1992, mkla4,    mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 4.0 09/28/92)", GAME_SUPPORTS_SAVE )
25742609GAME( 1992, mkyturbo, mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyturbo, ROT0, "hack",     "Mortal Kombat (Turbo 3.1 09/09/93, hack)", GAME_SUPPORTS_SAVE )
25752610GAME( 1992, mkyawdim, mk,       mkyawdim,                mkla4,    mkyawdim, ROT0, "bootleg (Yawdim)", "Mortal Kombat (Yawdim bootleg)", GAME_SUPPORTS_SAVE )
2611
25762612GAME( 1992, totcarn,  0,        yunit_adpcm_6bit_fast,   totcarn,  totcarn,  ROT0, "Midway",   "Total Carnage (rev LA1 03/10/92)", GAME_SUPPORTS_SAVE )
25772613GAME( 1992, totcarnp, totcarn,  yunit_adpcm_6bit_fast,   totcarn,  totcarn,  ROT0, "Midway",   "Total Carnage (prototype, rev 1.0 01/25/92)", GAME_SUPPORTS_SAVE )
src/mame/drivers/maygay1b.c
r8581r8582
33    Maygay M1 A/B driver, (under heavy construction !!!)
44
55    A.G.E Code Copyright J. Wallace and the AGEMAME Development Team.
6    Visit http://www.mameworld.net/agemame/ for more information.
6    Visit http://agemame.mameworld.info for more information.
77
88    M.A.M.E Core Copyright Nicola Salmoria and the MAME Team,
99    used under license from http://mamedev.org
r8581r8582
455455static MACHINE_RESET( m1 )
456456{
457457   ROC10937_reset(0);   // reset display1
458   maygaym1_devices.duart68681 = devtag_get_device( machine, "duart68681" );
458   maygaym1_devices.duart68681 = machine->device( "duart68681" );
459459   m1_stepper_reset();
460460}
461461
src/mame/drivers/mhavoc.c
r8581r8582
205205   int pokey_reg = (offset % 8) | control;
206206
207207   if (pokey_num == 0)
208      return pokey_r(devtag_get_device(space->machine, "pokey1"), pokey_reg);
208      return pokey_r(space->machine->device("pokey1"), pokey_reg);
209209   else
210      return pokey_r(devtag_get_device(space->machine, "pokey2"), pokey_reg);
210      return pokey_r(space->machine->device("pokey2"), pokey_reg);
211211}
212212
213213
r8581r8582
218218   int pokey_reg = (offset % 8) | control;
219219
220220   if (pokey_num == 0)
221      pokey_w(devtag_get_device(space->machine, "pokey1"), pokey_reg, data);
221      pokey_w(space->machine->device("pokey1"), pokey_reg, data);
222222   else
223      pokey_w(devtag_get_device(space->machine, "pokey2"), pokey_reg, data);
223      pokey_w(space->machine->device("pokey2"), pokey_reg, data);
224224}
225225
226226
src/mame/drivers/twinkle.c
r8581r8582
578578*/
579579}
580580
581static WRITE32_HANDLER(security_w)
582{
583   i2cmem_write( space->machine, 0, I2CMEM_SCL, ( data >> 4 ) & 1 );
584   i2cmem_write( space->machine, 0, I2CMEM_SDA, ( data >> 3 ) & 1 );
585}
586
587static READ32_HANDLER(security_r)
588{
589   /* 0x4000 ?? */
590   return i2cmem_read( space->machine, 0, I2CMEM_SDA ) << 12;
591}
592
593581static WRITE32_HANDLER(shared_psx_w)
594582{
595583   if (mem_mask == 0xff)
r8581r8582
636624
637625
638626   AM_RANGE(0x1f260000, 0x1f260003) AM_WRITE(serial_w)
639   AM_RANGE(0x1f270000, 0x1f270003) AM_WRITE(security_w)
640   AM_RANGE(0x1f280000, 0x1f280003) AM_READ(security_r)
627   AM_RANGE(0x1f270000, 0x1f270003) AM_WRITE_PORT("OUTSEC")
628   AM_RANGE(0x1f280000, 0x1f280003) AM_READ_PORT("INSEC")
641629   AM_RANGE(0x1f290000, 0x1f29007f) AM_DEVREADWRITE8("rtc", rtc65271_rtc_r, rtc65271_rtc_w, 0x00ff00ff)
642630   AM_RANGE(0x1f2a0000, 0x1f2a007f) AM_DEVREADWRITE8("rtc", rtc65271_xram_r, rtc65271_xram_w, 0x00ff00ff)
643631   AM_RANGE(0x1f2b0000, 0x1f2b00ff) AM_WRITE(twinkle_output_w)
r8581r8582
875863   psx_dma_install_read_handler(5, scsi_dma_read);
876864   psx_dma_install_write_handler(5, scsi_dma_write);
877865
878   i2cmem_init( machine, 0, I2CMEM_SLAVE_ADDRESS, 0, memory_region_length( machine, "user2" ), memory_region( machine, "user2" ) );
879   i2cmem_write( machine, 0, I2CMEM_E0, 0 );
880   i2cmem_write( machine, 0, I2CMEM_E1, 0 );
881   i2cmem_write( machine, 0, I2CMEM_E2, 0 );
882   i2cmem_write( machine, 0, I2CMEM_WC, 0 );
866   running_device *i2cmem = machine->device("security");
867   i2cmem_e0_write( i2cmem, 0 );
868   i2cmem_e1_write( i2cmem, 0 );
869   i2cmem_e2_write( i2cmem, 0 );
870   i2cmem_wc_write( i2cmem, 0 );
883871}
884872
885873static MACHINE_RESET( twinkle )
r8581r8582
887875   psx_machine_init(machine);
888876
889877   /* also hook up CDDA audio to the CD-ROM drive */
890   cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4));
878   cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4));
891879}
892880
893881static void spu_irq(running_device *device, UINT32 data)
r8581r8582
903891   psx_dma_install_write_handler
904892};
905893
894static const i2cmem_interface i2cmem_interface =
895{
896   I2CMEM_SLAVE_ADDRESS, 0, 0x100
897};
898
906899static MACHINE_DRIVER_START( twinkle )
907900   /* basic machine hardware */
908901   MDRV_CPU_ADD("maincpu",  PSXCPU, XTAL_67_7376MHz )
r8581r8582
915908   MDRV_WATCHDOG_TIME_INIT(MSEC(1200)) /* check TD pin on LTC1232 */
916909
917910   MDRV_MACHINE_RESET( twinkle )
918   MDRV_NVRAM_HANDLER( i2cmem_0 )
911   MDRV_I2CMEM_ADD("security",i2cmem_interface)
919912
920913   MDRV_IDE_CONTROLLER_ADD("ide", ide_interrupt)
921914   MDRV_RTC65271_ADD("rtc", NULL)
r8581r8582
997990   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1)
998991   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN)
999992
993   PORT_START("OUTSEC")
994   PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("security", i2cmem_scl_write)
995   PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("security", i2cmem_sda_write)
996
997   PORT_START("INSEC")
998   PORT_BIT( 0x00001000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("security", i2cmem_sda_read)
1000999INPUT_PORTS_END
10011000
10021001#define TWINKLE_BIOS   \
r8581r8582
10151014ROM_START( bmiidx )
10161015   TWINKLE_BIOS
10171016
1018   ROM_REGION( 0x100, "user2", ROMREGION_ERASE00 )      /* security */
1019
10201017   DISK_REGION( "cdrom0" )   // program
10211018   DISK_IMAGE_READONLY("863jaa01", 0, SHA1(aee12de1dc5dd44e5bf7b62133ed695b80999390) )
10221019
r8581r8582
10281025ROM_END
10291026
10301027ROM_START( bmiidx3 )
1031 TWINKLE_BIOS
1028   TWINKLE_BIOS
10321029
1033 ROM_REGION( 0x100, "user2", 0 )
1034 ROM_LOAD( "992j.pd",      0x000000, 0x000100, BAD_DUMP CRC(51f24913) SHA1(574b555e3d0c234011198d218d7ae5e95091acb1) )
1030   ROM_REGION( 0x100, "security", 0 )
1031   ROM_LOAD( "992j.pd",      0x000000, 0x000100, BAD_DUMP CRC(51f24913) SHA1(574b555e3d0c234011198d218d7ae5e95091acb1) )
10351032
1036 DISK_REGION( "cdrom0" )
1037 DISK_IMAGE_READONLY( "992jaa01", 0, BAD_DUMP SHA1(7e5389735dff379bb286ba3744edf59b7dfcc74b) )
1033   DISK_REGION( "cdrom0" )
1034   DISK_IMAGE_READONLY( "992jaa01", 0, BAD_DUMP SHA1(7e5389735dff379bb286ba3744edf59b7dfcc74b) )
10381035//  DISK_IMAGE_READONLY( "992jaahd", 1, NO_DUMP )
10391036//  DISK_IMAGE_READONLY( "992jaa02", 2, NO_DUMP )
10401037ROM_END
r8581r8582
10421039ROM_START( bmiidx4 )
10431040   TWINKLE_BIOS
10441041
1045   ROM_REGION( 0x100, "user2", 0 )
1042   ROM_REGION( 0x100, "security", 0 )
10461043   ROM_LOAD( "a03j.pd",      0x000000, 0x000100, CRC(8860cfb6) SHA1(85a5b27f24d4baa7960e692b91c0cf3dc5388e72) )
10471044
10481045   DISK_REGION( "cdrom0" )
r8581r8582
10541051ROM_START( bmiidx6 )
10551052   TWINKLE_BIOS
10561053
1057   ROM_REGION( 0x100, "user2", 0 )
1054   ROM_REGION( 0x100, "security", 0 )
10581055   ROM_LOAD( "b4uj.pd",      0x000000, 0x000100, BAD_DUMP CRC(0ab15633) SHA1(df004ff41f35b16089f69808ccf53a5e5cc13ac3) )
10591056
10601057   DISK_REGION( "cdrom0" )
r8581r8582
10661063ROM_START( bmiidx7 )
10671064   TWINKLE_BIOS
10681065
1069   ROM_REGION( 0x100, "user2", 0 )
1066   ROM_REGION( 0x100, "security", 0 )
10701067   ROM_LOAD( "b44j.pd",      0x000000, 0x000100, BAD_DUMP CRC(5baf4761) SHA1(aa7e07eb2cada03b85bdf11ac6a3de65f4253eef) )
10711068
10721069   DISK_REGION( "cdrom0" )
r8581r8582
10781075ROM_START( bmiidx8 )
10791076   TWINKLE_BIOS
10801077
1081   ROM_REGION( 0x100, "user2", 0 )
1078   ROM_REGION( 0x100, "security", 0 )
10821079   ROM_LOAD( "c44j.pd",      0x000000, 0x000100, BAD_DUMP CRC(04c22349) SHA1(d1cb78911cb1ca660d393a81ed3ed07b24c51525) )
10831080
10841081   DISK_REGION( "cdrom0" )
r8581r8582
10901087ROM_START( bmiidxc )
10911088   TWINKLE_BIOS
10921089
1093   ROM_REGION( 0x100, "user2", 0 )
1090   ROM_REGION( 0x100, "security", 0 )
10941091   ROM_LOAD( "896j.pd",      0x000000, 0x000100, BAD_DUMP CRC(1e5caf37) SHA1(75b378662b651cb322e41564d3bae68cc9edadc5) )
10951092
10961093   DISK_REGION( "cdrom0" )
r8581r8582
11021099ROM_START( bmiidxc2 )
11031100   TWINKLE_BIOS
11041101
1105   ROM_REGION( 0x100, "user2", 0 )
1102   ROM_REGION( 0x100, "security", 0 )
11061103   ROM_LOAD( "984j.pd",      0x000000, 0x000100, BAD_DUMP CRC(213843e5) SHA1(5571db155a60fa4087dd996af48e8e27fc1c518c) )
11071104
11081105   DISK_REGION( "cdrom0" )
r8581r8582
11141111ROM_START( bmiidxca )
11151112   TWINKLE_BIOS
11161113
1117   ROM_REGION( 0x100, "user2", 0 )
1114   ROM_REGION( 0x100, "security", 0 )
11181115   ROM_LOAD( "896j.pd",      0x000000, 0x000100, BAD_DUMP CRC(1e5caf37) SHA1(75b378662b651cb322e41564d3bae68cc9edadc5) )
11191116
11201117   DISK_REGION( "cdrom0" )
r8581r8582
11231120//  DISK_IMAGE_READONLY( "abmjaa02", 2, NO_DUMP )
11241121ROM_END
11251122
1126GAME( 1999, gq863,   0,     twinkle, twinkle, twinkle, ROT0, "Konami", "Twinkle System", GAME_IS_BIOS_ROOT )
1123GAME( 1999, gq863,    0,       twinkle, twinkle, twinkle, ROT0, "Konami", "Twinkle System", GAME_IS_BIOS_ROOT )
11271124
11281125/* VCD */
11291126GAME( 1999, bmiidx,   gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX (863 JAA)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
src/mame/drivers/spool99.c
r8581r8582
176176         case 0xafe4: return input_port_read(space->machine,"SERVICE2");//attract mode
177177//          case 0xafe5: return 1;
178178//          case 0xafe6: return 1;
179         case 0xafe7: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom"));
180         case 0xaff8: return okim6295_r(devtag_get_device(space->machine, "oki"),0);
179         case 0xafe7: return eeprom_read_bit(space->machine->device("eeprom"));
180         case 0xaff8: return okim6295_r(space->machine->device("oki"),0);
181181      }
182182   }
183183//  printf("%04x %d\n",offset+0xaf00,io_switch);
r8581r8582
235235         case 0xa725: return input_port_read(space->machine,"HOLD3");
236236         case 0xa726: return input_port_read(space->machine,"HOLD4");
237237         case 0xa727: return input_port_read(space->machine,"HOLD2");
238         case 0xa780: return okim6295_r(devtag_get_device(space->machine, "oki"),0);
238         case 0xa780: return okim6295_r(space->machine->device("oki"),0);
239239         case 0xa7a0: return input_port_read(space->machine,"HOLD1");
240240         case 0xa7a1: return input_port_read(space->machine,"HOLD5");
241241         case 0xa7a2: return input_port_read(space->machine,"START");
242242         case 0xa7a3: return input_port_read(space->machine,"BET");//system 2
243243
244         case 0xa7a7: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom"));
244         case 0xa7a7: return eeprom_read_bit(space->machine->device("eeprom"));
245245
246246      }
247247   }
src/mame/drivers/lgp.c
r8581r8582
333333
334334static MACHINE_START( lgp )
335335{
336   laserdisc = devtag_get_device(machine, "laserdisc");
336   laserdisc = machine->device("laserdisc");
337337}
338338
339339
src/mame/drivers/cliffhgr.c
r8581r8582
215215
216216static MACHINE_START( cliffhgr )
217217{
218   laserdisc = devtag_get_device(machine, "laserdisc");
218   laserdisc = machine->device("laserdisc");
219219   irq_timer = timer_alloc(machine, cliff_irq_callback, NULL);
220220}
221221
src/mame/drivers/artmagic.c
r8581r8582
106106
107107static READ16_HANDLER( tms_host_r )
108108{
109   return tms34010_host_r(devtag_get_device(space->machine, "tms"), offset);
109   return tms34010_host_r(space->machine->device("tms"), offset);
110110}
111111
112112
113113static WRITE16_HANDLER( tms_host_w )
114114{
115   tms34010_host_w(devtag_get_device(space->machine, "tms"), offset, data);
115   tms34010_host_w(space->machine->device("tms"), offset, data);
116116}
117117
118118
src/mame/drivers/battlnts.c
r8581r8582
225225
226226   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
227227
228   state->audiocpu = devtag_get_device(machine, "audiocpu");
229   state->k007342 = devtag_get_device(machine, "k007342");
230   state->k007420 = devtag_get_device(machine, "k007420");
228   state->audiocpu = machine->device("audiocpu");
229   state->k007342 = machine->device("k007342");
230   state->k007420 = machine->device("k007420");
231231
232232   state_save_register_global(machine, state->spritebank);
233233   state_save_register_global_array(machine, state->layer_colorbase);
src/mame/drivers/galpani2.c
r8581r8582
229229
230230static void galpani2_mcu_nmi2(running_machine *machine)
231231{
232      galpani2_write_kaneko(devtag_get_device(machine, "maincpu"));
232      galpani2_write_kaneko(machine->device("maincpu"));
233233      //logerror("%s : MCU executes CHECKs synchro\n", cpuexec_describe_context(machine));
234234}
235235
src/mame/drivers/sprint2.c
r8581r8582
7171
7272static INTERRUPT_GEN( sprint2 )
7373{
74   running_device *discrete = devtag_get_device(device->machine, "discrete");
74   running_device *discrete = device->machine->device("discrete");
7575   static UINT8 dial[2];
7676
7777   /* handle steering wheels */
src/mame/drivers/86lions.c
r8581r8582
7676
7777static READ8_HANDLER(lions_via_r)
7878{
79   running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
79   running_device *via_0 = space->machine->device("via6522_0");
8080   return via_r(via_0, offset);
8181}
8282
8383static WRITE8_HANDLER(lions_via_w)
8484{
85   running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
85   running_device *via_0 = space->machine->device("via6522_0");
8686   via_w(via_0, offset, data);
8787}
8888
src/mame/drivers/exterm.c
r8581r8582
9393
9494static WRITE16_HANDLER( exterm_host_data_w )
9595{
96   tms34010_host_w(devtag_get_device(space->machine, "slave"), offset / TOWORD(0x00100000), data);
96   tms34010_host_w(space->machine->device("slave"), offset / TOWORD(0x00100000), data);
9797}
9898
9999
100100static READ16_HANDLER( exterm_host_data_r )
101101{
102   return tms34010_host_r(devtag_get_device(space->machine, "slave"), offset / TOWORD(0x00100000));
102   return tms34010_host_r(space->machine->device("slave"), offset / TOWORD(0x00100000));
103103}
104104
105105
r8581r8582
393393   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_8C ) )
394394   PORT_DIPNAME( 0x0040, 0x0040, "Memory Test" )
395395   PORT_DIPSETTING(      0x0040, "Once" )
396   PORT_DIPSETTING(      0x0000, "Continous" )
396   PORT_DIPSETTING(      0x0000, "Continuous" )
397397   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) )
398398   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
399399   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
src/mame/drivers/dragrace.c
r8581r8582
318318{
319319   dragrace_state *state = (dragrace_state *)machine->driver_data;
320320
321   state->discrete = devtag_get_device(machine, "discrete");
321   state->discrete = machine->device("discrete");
322322
323323   state_save_register_global(machine, state->misc_flags);
324324   state_save_register_global_array(machine, state->gear);
src/mame/drivers/seibuspi.c
r8581r8582
18371837   UINT8 flash_data = rombase[0x1ffffc];
18381838
18391839   cputag_set_input_line(machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE );
1840   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), spi_irq_callback);
1840   cpu_set_irq_callback(machine->device("maincpu"), spi_irq_callback);
18411841
18421842   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000680, 0x00000683, 0, 0, sound_fifo_r);
18431843   memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000688, 0x0000068b, 0, 0, z80_prg_fifo_w);
r8581r8582
19201920
19211921   memcpy(z80_rom, rom, 0x40000);
19221922
1923   memory_install_write32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), devtag_get_device(machine, "eeprom"), 0x0000068c, 0x0000068f, 0, 0, eeprom_w);
1923   memory_install_write32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), machine->device("eeprom"), 0x0000068c, 0x0000068f, 0, 0, eeprom_w);
19241924   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000680, 0x00000683, 0, 0, sb_coin_r);
19251925
1926   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), spi_irq_callback);
1926   cpu_set_irq_callback(machine->device("maincpu"), spi_irq_callback);
19271927
19281928   sb_coin_latch = 0;
19291929}
r8581r8582
21732173}
21742174
21752175
2176static DRIVER_INIT( rfjet )
2176static void init_rfjet(running_machine *machine)
21772177{
21782178   intelflash_init( machine, 0, FLASH_INTEL_E28F008SA, NULL );
21792179   intelflash_init( machine, 1, FLASH_INTEL_E28F008SA, NULL );
r8581r8582
21862186   memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x560, 0x563, 0, 0, sprite_dma_start_w);
21872187}
21882188
2189static DRIVER_INIT( rfjet )
2190{
2191   init_rfjet(machine);
2192}
2193
21892194/* SYS386 */
21902195
21912196static DRIVER_INIT( rdft22kc )
r8581r8582
21932198   init_rf2(machine);
21942199}
21952200
2201static DRIVER_INIT( rfjet2k )
2202{
2203   init_rfjet(machine);
2204}
2205
21962206static MACHINE_RESET( seibu386 )
21972207{
2198   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), spi_irq_callback);
2208   cpu_set_irq_callback(machine->device("maincpu"), spi_irq_callback);
21992209}
22002210
22012211static MACHINE_DRIVER_START( seibu386 )
r8581r8582
34163426   ROM_LOAD("pcm1.1023", 0x000000, 0x80000, CRC(8b716356) SHA1(42ee1896c02518cd1e9cb0dc130321834665a79e) )
34173427ROM_END
34183428
3429ROM_START( rfjet2kc )
3430   ROM_REGION32_LE(0x200000, "user1", 0)   /* i386 program */
3431   ROM_LOAD32_WORD("prg01.u267", 0x000000, 0x100000, CRC(36019fa8) SHA1(28baf0ed4a53b818c1e6986d5d3491373524eca1) )
3432   ROM_LOAD32_WORD("prg23.u266", 0x000002, 0x100000, CRC(65695dde) SHA1(1b25dde03bc9319414144fc13b34c455112f4076) )
3433
3434   ROM_REGION( 0x30000, "gfx1", 0)   /* text layer roms */
3435   ROM_LOAD24_BYTE("rfj-01.524", 0x000001, 0x10000, CRC(e9d53007) SHA1(29aa7b70d5d5eb5e31426ac84143be44bc0597aa) )
3436   ROM_LOAD24_BYTE("rfj-02.518", 0x000000, 0x10000, CRC(dd3eabd3) SHA1(31c8f7a0cd262096a77673b040326605db542ab8) )
3437   ROM_LOAD24_BYTE("rfj-03.514", 0x000002, 0x10000, CRC(0daa8aac) SHA1(08a98fb3079ea9f78aa5b950bfeb30b0a805bab7) )
3438
3439   ROM_REGION( 0xc00000, "gfx2", 0)   /* background layer roms */
3440   ROM_LOAD24_WORD("bg-1d.u0535", 0x000000, 0x400000, CRC(edfd96da) SHA1(4813267f104619f569e5777e75b75304321abb49) )
3441   ROM_LOAD24_BYTE("bg-1p.u0537", 0x000002, 0x200000, CRC(a4cc4631) SHA1(cc1c4f4de8a078ca774f5a328a9a58291949b1fb) )
3442   ROM_LOAD24_WORD("bg-2d.u0536", 0x600000, 0x200000, CRC(731fbb59) SHA1(13cd29ec4d4c73582c5fb363218e737886826e5f) )
3443   ROM_LOAD24_BYTE("bg-2p.u0547", 0x600002, 0x100000, CRC(03652c25) SHA1(c0d77285111bc84e008362981ac02a246678ed0a) )
3444
3445   ROM_REGION( 0x1800000, "gfx3", 0)   /* sprites */
3446   ROM_LOAD("obj-1.u073",  0x0000000, 0x800000, CRC(58a59896) SHA1(edeaaa69987bd5d08c47ed9bf47a3901e2dcc892) )
3447   ROM_LOAD("obj-2.u074",  0x0800000, 0x800000, CRC(a121d1e3) SHA1(1851ae81f2ae9d3404aadd9fbc0ed7f9230290b9) )
3448   ROM_LOAD("obj-3.u0749", 0x1000000, 0x800000, CRC(bc2c0c63) SHA1(c8d395722f7012c3be366a0fc9b224c537afabae) )
3449
3450   ROM_REGION( 0x80000, "oki1", 0)   /* sound data for MSM6295 */
3451   ROM_LOAD("rfj-05.u1022", 0x000000, 0x80000, CRC(fd599b35) SHA1(00c0307d1b503bd5ce02d7960ce5e1ad600a7290) )
3452
3453   ROM_REGION( 0x80000, "oki2", 0)   /* sound data for MSM6295 */
3454   ROM_LOAD("rfj-04.u1023", 0x000000, 0x80000, CRC(1d10cd08) SHA1(c431d3f1a7b580024b083dafb76c53b771c88726) )
3455ROM_END
3456
34193457/*
34203458
34213459E-Jan Sakurasou
r8581r8582
35073545GAME( 1995, viprp1ot,  viprp1,  spi,      spi_3button, viprp1,  ROT270, "Seibu Kaihatsu (Tuning license)", "Viper Phase 1 (Germany)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35083546GAME( 1995, viprp1hk,  viprp1,  spi,      spi_3button, viprp1,  ROT270, "Seibu Kaihatsu (Metrotainment license)", "Viper Phase 1 (Hong Kong)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) /* "=HONG KONG=" seems part of title */
35093547
3510GAME( 1996, ejanhs,    0,       spi,      spi_ejanhs,  ejanhs,  ROT0,   "Seibu Kaihatsu", "E-Jan High School (Japan)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3548GAME( 1996, ejanhs,    0,       spi,      spi_ejanhs,  ejanhs,  ROT0,   "Seibu Kaihatsu", "E-Jan High School (Japan)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35113549
3512GAME( 1996, rdft,      0,       spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 1)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3513GAME( 1996, rdftu,     rdft,    spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters (US)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3514GAME( 1996, rdftau,    rdft,    spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Australia)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3515GAME( 1996, rdftj,     rdft,    spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 2)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3516GAME( 1996, rdftdi,    rdft,    spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu (Dream Island license)", "Raiden Fighters (Dream Island Co. license)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3517GAME( 1996, rdftit,    rdft,    spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Italy)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3518GAME( 1996, rdfta,     rdft,    spi,      spi_3button, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Austria)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3550GAME( 1996, rdft,      0,       spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 1)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3551GAME( 1996, rdftu,     rdft,    spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters (US)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3552GAME( 1996, rdftau,    rdft,    spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu", "Raiden Fighters (Australia)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3553GAME( 1996, rdftj,     rdft,    spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 2)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3554GAME( 1996, rdftdi,    rdft,    spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu (Dream Island license)", "Raiden Fighters (Dream Island Co. license)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3555GAME( 1996, rdftit,    rdft,    spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu", "Raiden Fighters (Italy)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3556GAME( 1996, rdfta,     rdft,    spi,      spi_3button, rdft,   ROT270, "Seibu Kaihatsu", "Raiden Fighters (Austria)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35193557
35203558GAME( 1997, rdft2,     0,       spi,      spi_2button, rdft2,  ROT270, "Seibu Kaihatsu (Tuning license)", "Raiden Fighters 2",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35213559GAME( 1997, rdft2a2,   rdft2,   spi,      spi_2button, rdft2,  ROT270, "Seibu Kaihatsu (Dream Island license)", "Raiden Fighters 2 (Asia, Dream Island license, SPI)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
r8581r8582
35253563GAME( 1997, rdft2t,    rdft2,   spi,      spi_2button, rdft2,  ROT270, "Seibu Kaihatsu", "Raiden Fighters 2 (Taiwan, SPI)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35263564GAME( 1997, rdft2u,    rdft2,   spi,      spi_2button, rdft2,  ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters 2 (USA, SPI)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35273565
3528GAME( 1998, rfjet,     0,       spi,      spi_2button, rfjet,    ROT270, "Seibu Kaihatsu (Tuning license)", "Raiden Fighters Jet",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3529GAME( 1998, rfjetu,    rfjet,   spi,      spi_2button, rfjet,    ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters Jet (US)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3530GAME( 1998, rfjeta,    rfjet,   spi,      spi_2button, rfjet,    ROT270, "Seibu Kaihatsu (Dream Island license)", "Raiden Fighters Jet (Asia)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3531GAME( 1998, rfjetj,    rfjet,   spi,      spi_2button, rfjet,    ROT270, "Seibu Kaihatsu", "Raiden Fighters Jet (Japan)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3566GAME( 1998, rfjet,     0,       spi,      spi_2button, rfjet,  ROT270, "Seibu Kaihatsu (Tuning license)", "Raiden Fighters Jet",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3567GAME( 1998, rfjetu,    rfjet,   spi,      spi_2button, rfjet,  ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters Jet (US)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3568GAME( 1998, rfjeta,    rfjet,   spi,      spi_2button, rfjet,  ROT270, "Seibu Kaihatsu (Dream Island license)", "Raiden Fighters Jet (Asia)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3569GAME( 1998, rfjetj,    rfjet,   spi,      spi_2button, rfjet,  ROT270, "Seibu Kaihatsu", "Raiden Fighters Jet (Japan)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35323570
35333571/* there is another rf dump rf_spi_asia.zip but it seems strange, 1 program rom, cart pic seems to show others as a different type of rom */
35343572
r8581r8582
35403578
35413579/* SYS386 */
35423580GAME( 2000, rdft22kc,  rdft2,   seibu386, seibu386_2button, rdft22kc, ROT270, "Seibu Kaihatsu", "Raiden Fighters 2 - 2000 (China)", GAME_IMPERFECT_GRAPHICS )
3581GAME( 2000, rfjet2kc,  rfjet,   seibu386, seibu386_2button, rfjet2k,  ROT270, "Seibu Kaihatsu", "Raiden Fighters Jet - 2000 (China)", GAME_IMPERFECT_GRAPHICS )
35433582
35443583/* SYS386F V2.0 */
35453584GAME( 1999, ejsakura,   0,        sys386f2, spi_ejsakura, sys386f2, ROT0, "Seibu Kaihatsu", "E-Jan Sakurasou (v2.0)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/coolpool.c
r8581r8582
77    driver by Nicola Salmoria and Aaron Giles
88
99
10    The main cpu is a 34010; it is encrypted in 9 Ball Shootout.
10    The main cpu is a TMS34010; it is encrypted in 9 Ball Shootout.
1111
12    The second CPU in AmeriDarts is a 32015, whose built-in ROM hasn't
13    been read. A simulation of the I/O behavior is included, but since the
14    second CPU controls sound, there is no sound.
12    The second CPU in AmeriDarts is a TMS32015; it controls sound and
13    the trackball inputs.
1514
16    The second CPU in Cool Pool and 9 Ball Shootout is a 320C26; the code
15    The second CPU in Cool Pool and 9 Ball Shootout is a TMS320C26; the code
1716    is the same in the two games.
1817
1918    Cool Pool:
r8581r8582
3029#include "cpu/tms32025/tms32025.h"
3130#include "video/tlc34076.h"
3231#include "sound/dac.h"
32#include "includes/coolpool.h"
3333
3434
3535
r8581r8582
3939 *
4040 *************************************/
4141
42static UINT16 *vram_base;
4342
44static UINT8 cmd_pending;
45static UINT16 iop_cmd;
46static UINT16 iop_answer;
47static int iop_romaddr;
48static UINT8 amerdart_iop_echo;
4943
5044static const UINT16 nvram_unlock_seq[] =
5145{
r8581r8582
6559
6660static void amerdart_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
6761{
68   UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0xff00];
62   coolpool_state *state = (coolpool_state *)screen.machine->driver_data;
63
64   UINT16 *vram = &state->vram_base[(params->rowaddr << 8) & 0xff00];
6965   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
7066   rgb_t pens[16];
7167   int coladdr = params->coladdr;
r8581r8582
7571   if (scanline < 256)
7672      for (x = 0; x < 16; x++)
7773      {
78         UINT16 pal = vram_base[x];
74         UINT16 pal = state->vram_base[x];
7975         pens[x] = MAKE_RGB(pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
8076      }
8177
r8581r8582
9288
9389static void coolpool_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
9490{
95   UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0x1ff00];
91   coolpool_state *state = (coolpool_state *)screen.machine->driver_data;
92
93   UINT16 *vram = &state->vram_base[(params->rowaddr << 8) & 0x1ff00];
9694   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
9795   const rgb_t *pens = tlc34076_get_pens();
9896   int coladdr = params->coladdr;
r8581r8582
116114
117115static void coolpool_to_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg)
118116{
119   memcpy(shiftreg, &vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
117   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
118
119   memcpy(shiftreg, &state->vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
120120}
121121
122122
123123static void coolpool_from_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg)
124124{
125   memcpy(&vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
125   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
126
127   memcpy(&state->vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
126128}
127129
128130
r8581r8582
196198
197199/*************************************
198200 *
199 *  AmeriDarts fake IOP handling
201 *  AmeriDarts IOP handling
200202 *
201203 *************************************/
202204
203205static WRITE16_HANDLER( amerdart_misc_w )
204206{
205   logerror("%08x:IOP_reset_w %04x\n",cpu_get_pc(space->cpu),data);
207   logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(space->cpu),data);
206208
207209   coin_counter_w(space->machine, 0, ~data & 0x0001);
208210   coin_counter_w(space->machine, 1, ~data & 0x0002);
209211
212   /* bits 10-15 are counted down over time */
213
210214   cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
215}
211216
212   /* bits 10-15 are counted down over time */
213   if (data & 0x0400) amerdart_iop_echo = 1;
217static READ16_HANDLER( amerdart_dsp_bio_line_r )
218{
219   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
220
221   static UINT8 old_cmd;
222   static UINT8 same_cmd_count;
223
224   /* Skip idle checking */
225   if (old_cmd == state->cmd_pending)
226      same_cmd_count += 1;
227   else
228      same_cmd_count = 0;
229
230   if (same_cmd_count >= 5)
231   {
232      same_cmd_count = 5;
233      cpu_spin(space->cpu);
234   }
235   old_cmd = state->cmd_pending;
236
237   return state->cmd_pending ? CLEAR_LINE : ASSERT_LINE;
214238}
215239
240static READ16_HANDLER( amerdart_iop_r )
241{
242   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
216243
217static TIMER_CALLBACK( amerdart_iop_response )
244//  logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),state->iop_answer);
245   cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
246
247   return state->iop_answer;
248}
249
250static WRITE16_HANDLER( amerdart_iop_w )
218251{
219   /* echo values until we get 0x19 */
220   iop_answer = iop_cmd;
221   if (amerdart_iop_echo && iop_cmd != 0x19)
252   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
253
254//  logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data);
255   COMBINE_DATA(&state->iop_cmd);
256   state->cmd_pending = 1;
257}
258
259static READ16_HANDLER( amerdart_dsp_cmd_r )
260{
261   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
262
263//  logerror("%08x:DSP cmd_r %04x\n", cpu_get_pc(space->cpu), state->iop_cmd);
264   state->cmd_pending = 0;
265   return state->iop_cmd;
266}
267
268static WRITE16_HANDLER( amerdart_dsp_answer_w )
269{
270   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
271
272//  logerror("%08x:DSP answer %04x\n", cpu_get_pc(space->cpu), data);
273   state->iop_answer = data;
274   cputag_set_input_line(space->machine, "maincpu", 1, ASSERT_LINE);
275}
276
277
278/*************************************
279 *
280 *  Ameri Darts trackball inputs
281 *
282 *************************************/
283
284static int amerdart_trackball_inc(int data)
285{
286   switch (data & 0x03)   /* Bits of opposite track direction must both change with identical levels */
222287   {
223      cputag_set_input_line(machine, "maincpu", 1, ASSERT_LINE);
224      return;
288      case 0x00:   data ^= 0x03;   break;
289      case 0x01:   data ^= 0x01;   break;
290      case 0x02:   data ^= 0x01;   break;
291      case 0x03:   data ^= 0x03;   break;
225292   }
226   amerdart_iop_echo = 0;
227
228   /* rest is based off the command */
229   switch (iop_cmd)
293   return data;
294}
295static int amerdart_trackball_dec(int data)
296{
297   switch (data & 0x03)   /* Bits of opposite track direction must both change with opposing levels */
230298   {
231      default:
232         logerror("Unknown IOP command %04X\n", iop_cmd);
299      case 0x00:   data ^= 0x01;   break;
300      case 0x01:   data ^= 0x03;   break;
301      case 0x02:   data ^= 0x03;   break;
302      case 0x03:   data ^= 0x01;   break;
303   }
304   return data;
305}
233306
234      case 0x000:
235      case 0x019:
236      case 0x600:
237      case 0x60f:
238      case 0x6f0:
239      case 0x6ff:
240         iop_answer = 0x6c00;
241         break;
307static int amerdart_trackball_direction(const address_space *space, int num, int data)
308{
309   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
242310
243      case 0x100:
244         iop_answer = (INT8)(-input_port_read(machine, "YAXIS2") - input_port_read(machine, "XAXIS2")) << 6;
245         break;
246      case 0x101:
247         iop_answer = (INT8)(-input_port_read(machine, "YAXIS2") + input_port_read(machine, "XAXIS2")) << 6;
248         break;
249      case 0x102:
250         iop_answer = (INT8)(-input_port_read(machine, "YAXIS1") - input_port_read(machine, "XAXIS1")) << 6;
251         break;
252      case 0x103:
253         iop_answer = (INT8)(-input_port_read(machine, "YAXIS1") + input_port_read(machine, "XAXIS1")) << 6;
254         break;
311   UINT16 result_x = (data & 0x0c) >> 2;
312   UINT16 result_y = (data & 0x03) >> 0;
255313
256      case 0x500:
257         iop_answer = input_port_read(machine, "IN1");
258         break;
314
315   if ((state->dx[num] == 0) && (state->dy[num] < 0)) {      /* Up */
316      state->oldy[num]--;
317      result_x = amerdart_trackball_inc(result_x);
318      result_y = amerdart_trackball_inc(result_y);
259319   }
320   if ((state->dx[num] == 0) && (state->dy[num] > 0)) {      /* Down */
321      state->oldy[num]++;
322      result_x = amerdart_trackball_dec(result_x);
323      result_y = amerdart_trackball_dec(result_y);
324   }
325   if ((state->dx[num] < 0) && (state->dy[num] == 0)) {      /* Left */
326      state->oldx[num]--;
327      result_x = amerdart_trackball_inc(result_x);
328      result_y = amerdart_trackball_dec(result_y);
329   }
330   if ((state->dx[num] > 0) && (state->dy[num] == 0)) {      /* Right */
331      state->oldx[num]++;
332      result_x = amerdart_trackball_dec(result_x);
333      result_y = amerdart_trackball_inc(result_y);
334   }
335   if ((state->dx[num] < 0) && (state->dy[num] < 0)) {         /* Left & Up */
336      state->oldx[num]--;
337      state->oldy[num]--;
338      result_x = amerdart_trackball_inc(result_x);
339   }
340   if ((state->dx[num] < 0) && (state->dy[num] > 0)) {         /* Left & Down */
341      state->oldx[num]--;
342      state->oldy[num]++;
343      result_y = amerdart_trackball_dec(result_y);
344   }
345   if ((state->dx[num] > 0) && (state->dy[num] < 0)) {         /* Right & Up */
346      state->oldx[num]++;
347      state->oldy[num]--;
348      result_y = amerdart_trackball_inc(result_y);
349   }
350   if ((state->dx[num] > 0) && (state->dy[num] > 0)) {         /* Right & Down */
351      state->oldx[num]++;
352      state->oldy[num]++;
353      result_x = amerdart_trackball_dec(result_x);
354   }
260355
261   cputag_set_input_line(machine, "maincpu", 1, ASSERT_LINE);
356   data = ((result_x << 2) & 0x0c) | ((result_y << 0) & 0x03);
357
358   return data;
262359}
263360
264361
265static WRITE16_HANDLER( amerdart_iop_w )
362static READ16_HANDLER( amerdart_trackball_r )
266363{
267   logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data);
268   COMBINE_DATA(&iop_cmd);
269   timer_set(space->machine, ATTOTIME_IN_USEC(100), NULL, 0, amerdart_iop_response);
364/*
365    Trackballs seem to be handled as though they're rotated 45 degrees anti-clockwise.
366
367    Sensor data as shown on Input test screen and associated bits read by TMS32015 DSP port:
368    xxyy xxyy ???? ????
369    |||| |||| |||| ||||
370    |||| |||| ++++-++++-- Unused
371    |||| ||||
372    |||| |||+------------ Trackball 1 Up    sensor
373    |||| ||+------------- Trackball 1 Down  sensor
374    |||| |+-------------- Trackball 1 Left  sensor
375    |||| +--------------- Trackball 1 Right sensor
376    ||||
377    |||+----------------- Trackball 2 Up    sensor
378    ||+------------------ Trackball 2 Down  sensor
379    |+------------------- Trackball 2 Left  sensor
380    +-------------------- Trackball 2 Right sensor
381
382    Opposite direction bits toggling the   same   level indicate increment (+) input movement  (00 -> 11 -> 00, etc)
383    Opposite direction bits toggling the opposite level indicate decrement (-) input movement  (01 -> 10 -> 01, etc)
384
385    Input state requirements to indicate trackball direction.
386    Direction      StateX  StateY
387    =============================
388    UP              X +     Y +
389    Down            X -     Y -
390    Left            X +     Y -
391    Right           X -     Y +
392    Up   & Left     X +     Y 0
393    Up   & Right    X 0     Y +
394    Down & Left     X 0     Y -
395    Down & Right    X -     Y 0
396
397*/
398
399   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
400
401
402   state->result = (state->lastresult | 0x00ff);
403
404   state->newx[1] = input_port_read(space->machine, "XAXIS1");   /* Trackball 1  Left - Right */
405   state->newy[1] = input_port_read(space->machine, "YAXIS1");   /* Trackball 1   Up  - Down  */
406   state->newx[2] = input_port_read(space->machine, "XAXIS2");   /* Trackball 2  Left - Right */
407   state->newy[2] = input_port_read(space->machine, "YAXIS2");   /* Trackball 2   Up  - Down  */
408
409   state->dx[1] = (INT8)(state->newx[1] - state->oldx[1]);
410   state->dy[1] = (INT8)(state->newy[1] - state->oldy[1]);
411   state->dx[2] = (INT8)(state->newx[2] - state->oldx[2]);
412   state->dy[2] = (INT8)(state->newy[2] - state->oldy[2]);
413
414   /* Determine Trackball 1 direction state */
415   state->result = (state->result & 0xf0ff) | (amerdart_trackball_direction(space, 1, ((state->result >>  8) & 0xf)) <<  8);
416
417   /* Determine Trackball 2 direction state */
418   state->result = (state->result & 0x0fff) | (amerdart_trackball_direction(space, 2, ((state->result >> 12) & 0xf)) << 12);
419
420
421//  logerror("%08X:read port 6 (X=%02X Y=%02X oldX=%02X oldY=%02X oldRes=%04X Res=%04X)\n", cpu_get_pc(space->cpu), state->newx, state->newy, state->oldx, state->oldy, state->lastresult, state->result);
422
423   state->lastresult = state->result;
424
425   return state->result;
270426}
271427
272428
273
274429/*************************************
275430 *
276431 *  Cool Pool IOP control
r8581r8582
279434
280435static WRITE16_HANDLER( coolpool_misc_w )
281436{
282   logerror("%08x:IOP_reset_w %04x\n",cpu_get_pc(space->cpu),data);
437   logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(space->cpu),data);
283438
284439   coin_counter_w(space->machine, 0, ~data & 0x0001);
285440   coin_counter_w(space->machine, 1, ~data & 0x0002);
r8581r8582
298453
299454static TIMER_CALLBACK( deferred_iop_w )
300455{
301   iop_cmd = param;
302   cmd_pending = 1;
456   coolpool_state *state = (coolpool_state *)machine->driver_data;
457
458   state->iop_cmd = param;
459   state->cmd_pending = 1;
303460   cputag_set_input_line(machine, "dsp", 0, HOLD_LINE);   /* ???  I have no idea who should generate this! */
304461                                             /* the DSP polls the status bit so it isn't strictly */
305462                                             /* necessary to also have an IRQ */
r8581r8582
316473
317474static READ16_HANDLER( coolpool_iop_r )
318475{
319   logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),iop_answer);
476   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
477
478   logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),state->iop_answer);
320479   cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
321480
322   return iop_answer;
481   return state->iop_answer;
323482}
324483
325484
r8581r8582
333492
334493static READ16_HANDLER( dsp_cmd_r )
335494{
336   cmd_pending = 0;
337   logerror("%08x:IOP cmd_r %04x\n", cpu_get_pc(space->cpu), iop_cmd);
338   return iop_cmd;
495   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
496
497   state->cmd_pending = 0;
498   logerror("%08x:IOP cmd_r %04x\n", cpu_get_pc(space->cpu), state->iop_cmd);
499   return state->iop_cmd;
339500}
340501
341502
342503static WRITE16_HANDLER( dsp_answer_w )
343504{
505   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
506
344507   logerror("%08x:IOP answer %04x\n", cpu_get_pc(space->cpu), data);
345   iop_answer = data;
508   state->iop_answer = data;
346509   cputag_set_input_line(space->machine, "maincpu", 1, ASSERT_LINE);
347510}
348511
349512
350513static READ16_HANDLER( dsp_bio_line_r )
351514{
352   return cmd_pending ? CLEAR_LINE : ASSERT_LINE;
515   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
516
517   return state->cmd_pending ? CLEAR_LINE : ASSERT_LINE;
353518}
354519
355520
r8581r8582
368533
369534static READ16_HANDLER( dsp_rom_r )
370535{
536   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
371537   UINT8 *rom = memory_region(space->machine, "user2");
372   return rom[iop_romaddr & (memory_region_length(space->machine, "user2") - 1)];
538
539   return rom[state->iop_romaddr & (memory_region_length(space->machine, "user2") - 1)];
373540}
374541
375542
376543static WRITE16_HANDLER( dsp_romaddr_w )
377544{
545   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
546
378547   switch (offset)
379548   {
380549      case 0:
381         iop_romaddr = (iop_romaddr & 0xffff00) | (data >> 8);
550         state->iop_romaddr = (state->iop_romaddr & 0xffff00) | (data >> 8);
382551         break;
383552
384553      case 1:
385         iop_romaddr = (iop_romaddr & 0x0000ff) | (data << 8);
554         state->iop_romaddr = (state->iop_romaddr & 0x0000ff) | (data << 8);
386555         break;
387556   }
388557}
r8581r8582
403572
404573static READ16_HANDLER( coolpool_input_r )
405574{
406   static UINT8 oldx, oldy;
407   static UINT16 lastresult;
575   coolpool_state *state = (coolpool_state *)space->machine->driver_data;
408576
409   int result = (input_port_read(space->machine, "IN1") & 0x00ff) | (lastresult & 0xff00);
410   UINT8 newx = input_port_read(space->machine, "XAXIS");
411   UINT8 newy = input_port_read(space->machine, "YAXIS");
412   int dx = (INT8)(newx - oldx);
413   int dy = (INT8)(newy - oldy);
577   state->result = (input_port_read(space->machine, "IN1") & 0x00ff) | (state->lastresult & 0xff00);
578   state->newx[1] = input_port_read(space->machine, "XAXIS");
579   state->newy[1] = input_port_read(space->machine, "YAXIS");
580   state->dx[1] = (INT8)(state->newx[1] - state->oldx[1]);
581   state->dy[1] = (INT8)(state->newy[1] - state->oldy[1]);
414582
415   if (dx < 0)
583   if (state->dx[1] < 0)
416584   {
417      oldx--;
418      switch (result & 0x300)
585      state->oldx[1]--;
586      switch (state->result & 0x300)
419587      {
420         case 0x000:   result ^= 0x200;   break;
421         case 0x100:   result ^= 0x100;   break;
422         case 0x200:   result ^= 0x100;   break;
423         case 0x300:   result ^= 0x200;   break;
588         case 0x000:   state->result ^= 0x200;   break;
589         case 0x100:   state->result ^= 0x100;   break;
590         case 0x200:   state->result ^= 0x100;   break;
591         case 0x300:   state->result ^= 0x200;   break;
424592      }
425593   }
426   if (dx > 0)
594   if (state->dx[1] > 0)
427595   {
428      oldx++;
429      switch (result & 0x300)
596      state->oldx[1]++;
597      switch (state->result & 0x300)
430598      {
431         case 0x000:   result ^= 0x100;   break;
432         case 0x100:   result ^= 0x200;   break;
433         case 0x200:   result ^= 0x200;   break;
434         case 0x300:   result ^= 0x100;   break;
599         case 0x000:   state->result ^= 0x100;   break;
600         case 0x100:   state->result ^= 0x200;   break;
601         case 0x200:   state->result ^= 0x200;   break;
602         case 0x300:   state->result ^= 0x100;   break;
435603      }
436604   }
437605
438   if (dy < 0)
606   if (state->dy[1] < 0)
439607   {
440      oldy--;
441      switch (result & 0xc00)
608      state->oldy[1]--;
609      switch (state->result & 0xc00)
442610      {
443         case 0x000:   result ^= 0x800;   break;
444         case 0x400:   result ^= 0x400;   break;
445         case 0x800:   result ^= 0x400;   break;
446         case 0xc00:   result ^= 0x800;   break;
611         case 0x000:   state->result ^= 0x800;   break;
612         case 0x400:   state->result ^= 0x400;   break;
613         case 0x800:   state->result ^= 0x400;   break;
614         case 0xc00:   state->result ^= 0x800;   break;
447615      }
448616   }
449   if (dy > 0)
617   if (state->dy[1] > 0)
450618   {
451      oldy++;
452      switch (result & 0xc00)
619      state->oldy[1]++;
620      switch (state->result & 0xc00)
453621      {
454         case 0x000:   result ^= 0x400;   break;
455         case 0x400:   result ^= 0x800;   break;
456         case 0x800:   result ^= 0x800;   break;
457         case 0xc00:   result ^= 0x400;   break;
622         case 0x000:   state->result ^= 0x400;   break;
623         case 0x400:   state->result ^= 0x800;   break;
624         case 0x800:   state->result ^= 0x800;   break;
625         case 0xc00:   state->result ^= 0x400;   break;
458626      }
459627   }
460628
461629//  logerror("%08X:read port 7 (X=%02X Y=%02X oldX=%02X oldY=%02X res=%04X)\n", cpu_get_pc(space->cpu),
462//      newx, newy, oldx, oldy, result);
463   lastresult = result;
464   return result;
630//      state->newx[1], state->newy[1], state->oldx[1], state->oldy[1], state->result);
631   state->lastresult = state->result;
632   return state->result;
465633}
466634
467635
r8581r8582
473641 *************************************/
474642
475643static ADDRESS_MAP_START( amerdart_map, ADDRESS_SPACE_PROGRAM, 16 )
476   AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_BASE(&vram_base)
644   AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_BASE_MEMBER(coolpool_state,vram_base)
477645   AM_RANGE(0x04000000, 0x0400000f) AM_WRITE(amerdart_misc_w)
478   AM_RANGE(0x05000000, 0x0500000f) AM_READWRITE(coolpool_iop_r, amerdart_iop_w)
646   AM_RANGE(0x05000000, 0x0500000f) AM_READWRITE(amerdart_iop_r, amerdart_iop_w)
479647   AM_RANGE(0x06000000, 0x06007fff) AM_RAM_WRITE(nvram_thrash_data_w) AM_BASE_SIZE_GENERIC(nvram)
480648   AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w)
481649   AM_RANGE(0xffb00000, 0xffffffff) AM_ROM AM_REGION("user1", 0)
r8581r8582
483651
484652
485653static ADDRESS_MAP_START( coolpool_map, ADDRESS_SPACE_PROGRAM, 16 )
486   AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&vram_base)
654   AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE_MEMBER(coolpool_state,vram_base)
487655   AM_RANGE(0x01000000, 0x010000ff) AM_READWRITE(tlc34076_lsb_r, tlc34076_lsb_w)   // IMSG176P-40
488656   AM_RANGE(0x02000000, 0x020000ff) AM_READWRITE(coolpool_iop_r, coolpool_iop_w)
489657   AM_RANGE(0x03000000, 0x0300000f) AM_WRITE(coolpool_misc_w)
r8581r8582
495663
496664
497665static ADDRESS_MAP_START( nballsht_map, ADDRESS_SPACE_PROGRAM, 16 )
498   AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&vram_base)
666   AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE_MEMBER(coolpool_state,vram_base)
499667   AM_RANGE(0x02000000, 0x020000ff) AM_READWRITE(coolpool_iop_r, coolpool_iop_w)
500668   AM_RANGE(0x03000000, 0x0300000f) AM_WRITE(coolpool_misc_w)
501669   AM_RANGE(0x04000000, 0x040000ff) AM_READWRITE(tlc34076_lsb_r, tlc34076_lsb_w)   // IMSG176P-40
r8581r8582
513681 *
514682 *************************************/
515683
516static ADDRESS_MAP_START( amerdart_dsp_map, ADDRESS_SPACE_PROGRAM, 16 )
517   AM_RANGE(0x0000, 0x011f) AM_RAM
518   AM_RANGE(0x8000, 0xffff) AM_ROM
684static ADDRESS_MAP_START( amerdart_dsp_pgm_map, ADDRESS_SPACE_PROGRAM, 16 )
685   AM_RANGE(0x000, 0x0fff) AM_ROM
519686ADDRESS_MAP_END
687   /* 000 - 0FF  TMS32015 Internal Data RAM (256 words) in Data Address Space */
520688
521689
522static ADDRESS_MAP_START( dsp_program_map, ADDRESS_SPACE_PROGRAM, 16 )
690static ADDRESS_MAP_START( amerdart_dsp_io_map, ADDRESS_SPACE_IO, 16 )
691   AM_RANGE(0x00, 0x01) AM_WRITE(dsp_romaddr_w)
692   AM_RANGE(0x02, 0x02) AM_WRITE(amerdart_dsp_answer_w)
693   AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac", dsp_dac_w)
694   AM_RANGE(0x04, 0x04) AM_READ(dsp_rom_r)
695   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN0")
696   AM_RANGE(0x06, 0x06) AM_READ(amerdart_trackball_r)
697   AM_RANGE(0x07, 0x07) AM_READ(amerdart_dsp_cmd_r)
698   AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ(amerdart_dsp_bio_line_r)
699ADDRESS_MAP_END
700
701
702
703static ADDRESS_MAP_START( coolpool_dsp_pgm_map, ADDRESS_SPACE_PROGRAM, 16 )
523704   AM_RANGE(0x0000, 0x7fff) AM_ROM
524705ADDRESS_MAP_END
525706
526707
527static ADDRESS_MAP_START( dsp_io_map, ADDRESS_SPACE_IO, 16 )
708static ADDRESS_MAP_START( coolpool_dsp_io_map, ADDRESS_SPACE_IO, 16 )
528709   AM_RANGE(0x00, 0x01) AM_WRITE(dsp_romaddr_w)
529710   AM_RANGE(0x02, 0x02) AM_READWRITE(dsp_cmd_r, dsp_answer_w)
530711   AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac", dsp_dac_w)
r8581r8582
545726 *************************************/
546727
547728static INPUT_PORTS_START( amerdart )
548   PORT_START("IN1")
549   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 )   PORT_PLAYER(1)
550   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
551   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
552   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 )
553   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_HIGH )
554   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_COIN2 )
555   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
556   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SERVICE1 )
557   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
729   PORT_START("IN0")
730   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
731   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
732   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
733   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN1 )
734   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
735   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
736   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
737   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE1 )
738   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
558739
559740   PORT_START("XAXIS1")
560   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_RESET PORT_PLAYER(1)
741   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(1)
561742
562743   PORT_START("YAXIS1")
563   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_RESET PORT_PLAYER(1)
744   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(1)
564745
565746   PORT_START("XAXIS2")
566   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_RESET PORT_PLAYER(2)
747   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(2)
567748
568749   PORT_START("YAXIS2")
569   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_RESET PORT_PLAYER(2)
750   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(2)
570751INPUT_PORTS_END
571752
572753
573static INPUT_PORTS_START( 9ballsht )
754static INPUT_PORTS_START( coolpool )
574755   PORT_START("IN0")
575756   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
576   PORT_BIT( 0x0300, IP_ACTIVE_LOW, IPT_UNKNOWN )
577   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
578   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
757   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
579758   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
580759   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
581   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
582   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
760   PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNKNOWN )
583761
584762   PORT_START("IN1")
585763   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
r8581r8582
589767   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
590768   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
591769   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
592   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE1 )
593   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
594   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
595   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
596   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
597   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
598   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
599   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
600   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
770   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
771   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_SPECIAL )
772
773   PORT_START("XAXIS")
774   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
775
776   PORT_START("YAXIS")
777   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE
601778INPUT_PORTS_END
602779
603780
604static INPUT_PORTS_START( coolpool )
781static INPUT_PORTS_START( 9ballsht )
605782   PORT_START("IN0")
606783   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
607   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
784   PORT_BIT( 0x0300, IP_ACTIVE_LOW, IPT_UNKNOWN )
785   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
786   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
608787   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
609788   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
610   PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNKNOWN )
789   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
790   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
611791
612792   PORT_START("IN1")
613793   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
r8581r8582
617797   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
618798   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
619799   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
620   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
621   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_SPECIAL )
622
623   PORT_START("XAXIS")
624   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
625
626   PORT_START("YAXIS")
627   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE
800   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE1 )
801   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
802   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
803   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
804   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
805   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
806   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
807   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
808   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
628809INPUT_PORTS_END
629810
630811
r8581r8582
639820{
640821   FALSE,                     /* halt on reset */
641822   "screen",                  /* the screen operated on */
642   40000000/12,               /* pixel clock */
823   XTAL_40MHz/12,               /* pixel clock */
643824   2,                        /* pixels per clock */
644825   amerdart_scanline,            /* scanline callback */
645826   NULL,                     /* generate interrupt */
r8581r8582
652833{
653834   FALSE,                     /* halt on reset */
654835   "screen",                  /* the screen operated on */
655   40000000/6,                  /* pixel clock */
836   XTAL_40MHz/6,               /* pixel clock */
656837   1,                        /* pixels per clock */
657838   coolpool_scanline,            /* scanline callback */
658839   NULL,                     /* generate interrupt */
r8581r8582
670851
671852static MACHINE_DRIVER_START( amerdart )
672853
854   MDRV_DRIVER_DATA( coolpool_state )
855
673856   /* basic machine hardware */
674   MDRV_CPU_ADD("maincpu", TMS34010, 40000000)
857   MDRV_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
675858   MDRV_CPU_CONFIG(tms_config_amerdart)
676859   MDRV_CPU_PROGRAM_MAP(amerdart_map)
677860
678   MDRV_CPU_ADD("dsp", TMS32010, 15000000/2)
679   MDRV_DEVICE_DISABLE()
680   MDRV_CPU_PROGRAM_MAP(amerdart_dsp_map)
861   MDRV_CPU_ADD("dsp", TMS32015, XTAL_40MHz/2)
862   MDRV_CPU_PROGRAM_MAP(amerdart_dsp_pgm_map)
863   /* Data Map is internal to the CPU */
864   MDRV_CPU_IO_MAP(amerdart_dsp_io_map)
865   MDRV_CPU_PERIODIC_INT(irq0_line_pulse, 14400)
681866
682867   MDRV_MACHINE_RESET(amerdart)
683868   MDRV_NVRAM_HANDLER(generic_0fill)
r8581r8582
689874
690875   MDRV_SCREEN_ADD("screen", RASTER)
691876   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
692   MDRV_SCREEN_RAW_PARAMS(40000000/6, 212*2, 0, 161*2, 262, 0, 241)
877   MDRV_SCREEN_RAW_PARAMS(XTAL_40MHz/6, 212*2, 0, 161*2, 262, 0, 241)
693878
694879   /* sound hardware */
695880   MDRV_SPEAKER_STANDARD_MONO("mono")
r8581r8582
701886
702887static MACHINE_DRIVER_START( coolpool )
703888
889   MDRV_DRIVER_DATA( coolpool_state )
890
704891   /* basic machine hardware */
705   MDRV_CPU_ADD("maincpu", TMS34010, 40000000)
892   MDRV_CPU_ADD("maincpu", TMS34010, XTAL_40MHz)
706893   MDRV_CPU_CONFIG(tms_config_coolpool)
707894   MDRV_CPU_PROGRAM_MAP(coolpool_map)
708895
709   MDRV_CPU_ADD("dsp", TMS32026,40000000)
710   MDRV_CPU_PROGRAM_MAP(dsp_program_map)
711   MDRV_CPU_IO_MAP(dsp_io_map)
896   MDRV_CPU_ADD("dsp", TMS32026,XTAL_40MHz)
897   MDRV_CPU_PROGRAM_MAP(coolpool_dsp_pgm_map)
898   MDRV_CPU_IO_MAP(coolpool_dsp_io_map)
712899
713900   MDRV_MACHINE_RESET(coolpool)
714901   MDRV_NVRAM_HANDLER(generic_0fill)
r8581r8582
720907
721908   MDRV_SCREEN_ADD("screen", RASTER)
722909   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
723   MDRV_SCREEN_RAW_PARAMS(40000000/6, 424, 0, 320, 262, 0, 240)
910   MDRV_SCREEN_RAW_PARAMS(XTAL_40MHz/6, 424, 0, 320, 262, 0, 240)
724911
725912   /* sound hardware */
726913   MDRV_SPEAKER_STANDARD_MONO("mono")
r8581r8582
758945   ROM_LOAD16_BYTE( "u57",  0x080001, 0x10000, CRC(f620f935) SHA1(bf891fce1f04f3ad5b8b72d43d041ceacb0b65bc) )
759946   ROM_LOAD16_BYTE( "u58",  0x080000, 0x10000, CRC(f1b3d7c4) SHA1(7b897230d110be7a5eb05eda927d00561ebb9ce3) )
760947
761   ROM_REGION( 0x18000, "dsp", 0 )   /* 32015 code (missing) */
762   ROM_LOAD16_BYTE( "dspl",         0x00000, 0x08000, NO_DUMP )
763   ROM_LOAD16_BYTE( "dsph",         0x00001, 0x08000, NO_DUMP )
948   ROM_REGION( 0x10000, "dsp", 0 )   /* TMS32015 code  */
949   ROM_LOAD16_WORD( "tms320e15.bin", 0x0000, 0x2000, CRC(375DB4EA) SHA1(11689C89CE62F44F43CB8973B4EC6E6B0024ED14) )
764950
765   ROM_REGION( 0x100000, "user2", 0 )            /* 32015 data? (incl. samples?) */
951   ROM_REGION( 0x100000, "user2", 0 )            /* TMS32015 audio sample data */
766952   ROM_LOAD16_WORD( "u1",   0x000000, 0x10000, CRC(3f459482) SHA1(d9d489efd0d9217fceb3bf1a3b37a78d6823b4d9) )
767   ROM_LOAD16_WORD( "u2",   0x010000, 0x10000, CRC(a587fffd) SHA1(f33f511d1bf1d6eb3c42535593a9718571174c4b) )
768   ROM_LOAD16_WORD( "u3",   0x020000, 0x10000, CRC(984d343a) SHA1(ee214830de4cb22d2d8e9d3ca335eff05af4abb6) )
769   ROM_LOAD16_WORD( "u4",   0x030000, 0x10000, CRC(c4765ff6) SHA1(7dca61d32300047ca1c089057e617553d60a0995) )
770   ROM_LOAD16_WORD( "u5",   0x040000, 0x10000, CRC(3b63b890) SHA1(a1223cb8884d5365af7d3f607657efff877f8845) )
771   ROM_LOAD16_WORD( "u6",   0x050000, 0x10000, CRC(5cdb9aa9) SHA1(fae5d2c7f649bcba8068c8bc8266ee411258535e) )
772   ROM_LOAD16_WORD( "u7",   0x060000, 0x10000, CRC(147083a2) SHA1(c04c38145ab159bd519e6325477a3f7d0eebbda1) )
773   ROM_LOAD16_WORD( "u8",   0x070000, 0x10000, CRC(975b368c) SHA1(1d637ce8c5d60833bb25aab2610e1a856720235e) )
774   ROM_LOAD16_WORD( "u16",  0x080000, 0x10000, CRC(7437e8bf) SHA1(754be4822cd586590f09e706d7eb48e5ba8c8817) )
775   ROM_LOAD16_WORD( "u17",  0x090000, 0x10000, CRC(e32bdd0f) SHA1(0662abbe84f0bad2631566b506ef016fcd79b9ee) )
776   ROM_LOAD16_WORD( "u18",  0x0a0000, 0x10000, CRC(de3b4d7c) SHA1(68e7ffe2d84aef7c24d1787c4f9b6950c0107741) )
777   ROM_LOAD16_WORD( "u19",  0x0b0000, 0x10000, CRC(7109247c) SHA1(201809ec6599b30c26823bde6851b6eaa2589710) )
778   ROM_LOAD16_WORD( "u20",  0x0c0000, 0x10000, CRC(038b7d2d) SHA1(80bab18ca36d2bc101da7f3f6e1c82d8a802c14c) )
779   ROM_LOAD16_WORD( "u21",  0x0d0000, 0x10000, CRC(9b0b8978) SHA1(b31d0451ecd7085c191d20b2b41d0e8fe551996c) )
780   ROM_LOAD16_WORD( "u22",  0x0e0000, 0x10000, CRC(4b92588a) SHA1(eea262c1a122015364a0046ff2bc7816f5f6821d) )
953   ROM_LOAD16_WORD( "u16",  0x010000, 0x10000, CRC(7437e8bf) SHA1(754be4822cd586590f09e706d7eb48e5ba8c8817) )
954   ROM_LOAD16_WORD( "u2",   0x020000, 0x10000, CRC(a587fffd) SHA1(f33f511d1bf1d6eb3c42535593a9718571174c4b) )
955   ROM_LOAD16_WORD( "u17",  0x030000, 0x10000, CRC(e32bdd0f) SHA1(0662abbe84f0bad2631566b506ef016fcd79b9ee) )
956   ROM_LOAD16_WORD( "u3",   0x040000, 0x10000, CRC(984d343a) SHA1(ee214830de4cb22d2d8e9d3ca335eff05af4abb6) )
957   ROM_LOAD16_WORD( "u18",  0x050000, 0x10000, CRC(de3b4d7c) SHA1(68e7ffe2d84aef7c24d1787c4f9b6950c0107741) )
958   ROM_LOAD16_WORD( "u4",   0x060000, 0x10000, CRC(c4765ff6) SHA1(7dca61d32300047ca1c089057e617553d60a0995) )
959   ROM_LOAD16_WORD( "u19",  0x070000, 0x10000, CRC(7109247c) SHA1(201809ec6599b30c26823bde6851b6eaa2589710) )
960   ROM_LOAD16_WORD( "u5",   0x080000, 0x10000, CRC(3b63b890) SHA1(a1223cb8884d5365af7d3f607657efff877f8845) )
961   ROM_LOAD16_WORD( "u20",  0x090000, 0x10000, CRC(038b7d2d) SHA1(80bab18ca36d2bc101da7f3f6e1c82d8a802c14c) )
962   ROM_LOAD16_WORD( "u6",   0x0a0000, 0x10000, CRC(5cdb9aa9) SHA1(fae5d2c7f649bcba8068c8bc8266ee411258535e) )
963   ROM_LOAD16_WORD( "u21",  0x0b0000, 0x10000, CRC(9b0b8978) SHA1(b31d0451ecd7085c191d20b2b41d0e8fe551996c) )
964   ROM_LOAD16_WORD( "u7",   0x0c0000, 0x10000, CRC(147083a2) SHA1(c04c38145ab159bd519e6325477a3f7d0eebbda1) )
965   ROM_LOAD16_WORD( "u22",  0x0d0000, 0x10000, CRC(4b92588a) SHA1(eea262c1a122015364a0046ff2bc7816f5f6821d) )
966   ROM_LOAD16_WORD( "u8",   0x0e0000, 0x10000, CRC(975b368c) SHA1(1d637ce8c5d60833bb25aab2610e1a856720235e) )
781967   ROM_LOAD16_WORD( "u23",  0x0f0000, 0x10000, CRC(d7c2b13b) SHA1(3561e08011f649e4d0c47792745b2a014167e816) )
782968ROM_END
783969
r8581r8582
794980   ROM_LOAD16_BYTE( "u57.bin", 0x080001, 0x10000, CRC(8a70f849) SHA1(dfd4cf90de2ab8cbeff458f0fd20110c1ed009e9) )
795981   ROM_LOAD16_BYTE( "u58.bin", 0x080000, 0x10000, CRC(8bb81975) SHA1(b7666572ab543991c7deaa0ebefb8b4526a7e386) )
796982
797   ROM_REGION( 0x18000, "dsp", 0 )   /* 32015 code (missing) */
798   ROM_LOAD16_BYTE( "dspl",         0x00000, 0x08000, NO_DUMP )
799   ROM_LOAD16_BYTE( "dsph",         0x00001, 0x08000, NO_DUMP )
983   ROM_REGION( 0x10000, "dsp", 0 )   /* TMS32015 code  */
984   ROM_LOAD16_WORD( "tms320e15.bin", 0x0000, 0x2000, CRC(375DB4EA) SHA1(11689C89CE62F44F43CB8973B4EC6E6B0024ED14) )
800985
801   ROM_REGION( 0x100000, "user2", 0 )            /* 32015 data? (incl. samples?) */
802   ROM_LOAD16_WORD( "u1.bin",   0x000000, 0x10000, CRC(e2bb7f54) SHA1(39eeb61a852b93331f445cc1c993727e52959660) )
803   ROM_LOAD16_WORD( "u2",      0x010000, 0x10000, CRC(a587fffd) SHA1(f33f511d1bf1d6eb3c42535593a9718571174c4b) )
804   ROM_LOAD16_WORD( "u3",      0x020000, 0x10000, CRC(984d343a) SHA1(ee214830de4cb22d2d8e9d3ca335eff05af4abb6) )
805   ROM_LOAD16_WORD( "u4",      0x030000, 0x10000, CRC(c4765ff6) SHA1(7dca61d32300047ca1c089057e617553d60a0995) )
806   ROM_LOAD16_WORD( "u5",      0x040000, 0x10000, CRC(3b63b890) SHA1(a1223cb8884d5365af7d3f607657efff877f8845) )
807   ROM_LOAD16_WORD( "u6",      0x050000, 0x10000, CRC(5cdb9aa9) SHA1(fae5d2c7f649bcba8068c8bc8266ee411258535e) )
808   ROM_LOAD16_WORD( "u7",      0x060000, 0x10000, CRC(147083a2) SHA1(c04c38145ab159bd519e6325477a3f7d0eebbda1) )
809   ROM_LOAD16_WORD( "u8",      0x070000, 0x10000, CRC(975b368c) SHA1(1d637ce8c5d60833bb25aab2610e1a856720235e) )
810   ROM_LOAD16_WORD( "u16",     0x080000, 0x10000, CRC(7437e8bf) SHA1(754be4822cd586590f09e706d7eb48e5ba8c8817) )
811   ROM_LOAD16_WORD( "u17",     0x090000, 0x10000, CRC(e32bdd0f) SHA1(0662abbe84f0bad2631566b506ef016fcd79b9ee) )
812   ROM_LOAD16_WORD( "u18",     0x0a0000, 0x10000, CRC(de3b4d7c) SHA1(68e7ffe2d84aef7c24d1787c4f9b6950c0107741) )
813   ROM_LOAD16_WORD( "u19",     0x0b0000, 0x10000, CRC(7109247c) SHA1(201809ec6599b30c26823bde6851b6eaa2589710) )
814   ROM_LOAD16_WORD( "u20",     0x0c0000, 0x10000, CRC(038b7d2d) SHA1(80bab18ca36d2bc101da7f3f6e1c82d8a802c14c) )
815   ROM_LOAD16_WORD( "u21",     0x0d0000, 0x10000, CRC(9b0b8978) SHA1(b31d0451ecd7085c191d20b2b41d0e8fe551996c) )
816   ROM_LOAD16_WORD( "u22",     0x0e0000, 0x10000, CRC(4b92588a) SHA1(eea262c1a122015364a0046ff2bc7816f5f6821d) )
986   ROM_REGION( 0x100000, "user2", 0 )            /* TMS32015 audio sample data */
987   ROM_LOAD16_WORD( "u1.bin",  0x000000, 0x10000, CRC(e2bb7f54) SHA1(39eeb61a852b93331f445cc1c993727e52959660) )
988   ROM_LOAD16_WORD( "u16",     0x010000, 0x10000, CRC(7437e8bf) SHA1(754be4822cd586590f09e706d7eb48e5ba8c8817) )
989   ROM_LOAD16_WORD( "u2",      0x020000, 0x10000, CRC(a587fffd) SHA1(f33f511d1bf1d6eb3c42535593a9718571174c4b) )
990   ROM_LOAD16_WORD( "u17",     0x030000, 0x10000, CRC(e32bdd0f) SHA1(0662abbe84f0bad2631566b506ef016fcd79b9ee) )
991   ROM_LOAD16_WORD( "u3",      0x040000, 0x10000, CRC(984d343a) SHA1(ee214830de4cb22d2d8e9d3ca335eff05af4abb6) )
992   ROM_LOAD16_WORD( "u18",     0x050000, 0x10000, CRC(de3b4d7c) SHA1(68e7ffe2d84aef7c24d1787c4f9b6950c0107741) )
993   ROM_LOAD16_WORD( "u4",      0x060000, 0x10000, CRC(c4765ff6) SHA1(7dca61d32300047ca1c089057e617553d60a0995) )
994   ROM_LOAD16_WORD( "u19",     0x070000, 0x10000, CRC(7109247c) SHA1(201809ec6599b30c26823bde6851b6eaa2589710) )
995   ROM_LOAD16_WORD( "u5",      0x080000, 0x10000, CRC(3b63b890) SHA1(a1223cb8884d5365af7d3f607657efff877f8845) )
996   ROM_LOAD16_WORD( "u20",     0x090000, 0x10000, CRC(038b7d2d) SHA1(80bab18ca36d2bc101da7f3f6e1c82d8a802c14c) )
997   ROM_LOAD16_WORD( "u6",      0x0a0000, 0x10000, CRC(5cdb9aa9) SHA1(fae5d2c7f649bcba8068c8bc8266ee411258535e) )
998   ROM_LOAD16_WORD( "u21",     0x0b0000, 0x10000, CRC(9b0b8978) SHA1(b31d0451ecd7085c191d20b2b41d0e8fe551996c) )
999   ROM_LOAD16_WORD( "u7",      0x0c0000, 0x10000, CRC(147083a2) SHA1(c04c38145ab159bd519e6325477a3f7d0eebbda1) )
1000   ROM_LOAD16_WORD( "u22",     0x0d0000, 0x10000, CRC(4b92588a) SHA1(eea262c1a122015364a0046ff2bc7816f5f6821d) )
1001   ROM_LOAD16_WORD( "u8",      0x0e0000, 0x10000, CRC(975b368c) SHA1(1d637ce8c5d60833bb25aab2610e1a856720235e) )
8171002   ROM_LOAD16_WORD( "u23.bin", 0x0f0000, 0x10000, CRC(7c1e6f2e) SHA1(21ae530e4bd7c0c9f1a84f01f136c71952c8adc4) )
8181003ROM_END
8191004
r8581r8582
9441129 *
9451130 *************************************/
9461131
1132static void register_state_save(running_machine *machine)
1133{
1134   coolpool_state *state = (coolpool_state *)machine->driver_data;
1135
1136   state_save_register_global_array(machine, state->oldx);
1137   state_save_register_global_array(machine, state->oldy);
1138   state_save_register_global(machine, state->result);
1139   state_save_register_global(machine, state->lastresult);
1140
1141   state_save_register_global(machine, state->cmd_pending);
1142   state_save_register_global(machine, state->iop_cmd);
1143   state_save_register_global(machine, state->iop_answer);
1144   state_save_register_global(machine, state->iop_romaddr);
1145}
1146
1147
1148
1149static DRIVER_INIT( amerdart )
1150{
1151   coolpool_state *state = (coolpool_state *)machine->driver_data;
1152
1153   state->lastresult = 0xffff;
1154
1155   register_state_save(machine);
1156}
1157
9471158static DRIVER_INIT( coolpool )
9481159{
9491160   memory_install_read16_handler(cputag_get_address_space(machine, "dsp", ADDRESS_SPACE_IO), 0x07, 0x07, 0, 0, coolpool_input_r);
1161
1162   register_state_save(machine);
9501163}
9511164
9521165
r8581r8582
9891202      rom[a] = rom[a+1];
9901203      rom[a+1] = tmp;
9911204   }
1205
1206   register_state_save(machine);
9921207}
9931208
9941209
r8581r8582
9991214 *
10001215 *************************************/
10011216
1002GAME( 1989, amerdart, 0,        amerdart, amerdart, 0,        ROT0, "Ameri",   "AmeriDarts (set 1)", GAME_NO_SOUND )
1003GAME( 1989, amerdart2,amerdart, amerdart, amerdart, 0,        ROT0, "Ameri",   "AmeriDarts (set 2)", GAME_NO_SOUND )
1217GAME( 1989, amerdart, 0,        amerdart, amerdart, amerdart, ROT0, "Ameri",   "AmeriDarts (set 1)", GAME_SUPPORTS_SAVE )
1218GAME( 1989, amerdart2,amerdart, amerdart, amerdart, amerdart, ROT0, "Ameri",   "AmeriDarts (set 2)", GAME_SUPPORTS_SAVE )
10041219GAME( 1992, coolpool, 0,        coolpool, coolpool, coolpool, ROT0, "Catalina", "Cool Pool", 0 )
10051220GAME( 1993, 9ballsht, 0,        9ballsht, 9ballsht, 9ballsht, ROT0, "E-Scape EnterMedia (Bundra license)", "9-Ball Shootout (set 1)", 0 )
10061221GAME( 1993, 9ballsht2,9ballsht, 9ballsht, 9ballsht, 9ballsht, ROT0, "E-Scape EnterMedia (Bundra license)", "9-Ball Shootout (set 2)", 0 )
src/mame/drivers/drmicro.c
r8581r8582
230230{
231231   drmicro_state *state = (drmicro_state *)machine->driver_data;
232232
233   state->msm = devtag_get_device(machine, "msm");
233   state->msm = machine->device("msm");
234234
235235   state_save_register_global(machine, state->nmi_enable);
236236   state_save_register_global(machine, state->pcm_adr);
src/mame/drivers/system1.c
r8581r8582
363363      memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "maincpu") + 0x8000, 0);
364364   memory_set_bank(machine, "bank1", 0);
365365
366   z80_set_cycle_tables(devtag_get_device(machine, "maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
366   z80_set_cycle_tables(machine->device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
367367
368368   mute_xor = 0x00;
369369
r8581r8582
410410
411411static WRITE8_HANDLER( videomode_w )
412412{
413   running_device *i8751 = devtag_get_device(space->machine, "mcu");
413   running_device *i8751 = space->machine->device("mcu");
414414
415415   /* bit 6 is connected to the 8751 IRQ */
416416   if (i8751 != NULL)
r8581r8582
608608       enough, the MCU will fail; on shtngmst this happens after 3
609609       VBLANKs without a tick */
610610
611   running_device *mcu = devtag_get_device(timer.machine, "mcu");
611   running_device *mcu = timer.machine->device("mcu");
612612   cpu_set_input_line(mcu, MCS51_T0_LINE, ASSERT_LINE);
613613   cpu_set_input_line(mcu, MCS51_T0_LINE, CLEAR_LINE);
614614}
src/mame/drivers/niyanpai.c
r8581r8582
122122         niyanpai_soundbank_w(space->machine, data & 0x03);
123123         break;
124124      case 1:         /* PB_0 */
125         DAC_WRITE(devtag_get_device(space->machine, "dac2"), 0, data);
125         DAC_WRITE(space->machine->device("dac2"), 0, data);
126126         break;
127127      case 2:         /* PC_0 */
128         DAC_WRITE(devtag_get_device(space->machine, "dac1"), 0, data);
128         DAC_WRITE(space->machine->device("dac1"), 0, data);
129129         break;
130130      case 3:         /* PD_0 */
131131         break;
src/mame/drivers/bfm_sc2.c
r8581r8582
698698
699699   if ( old != volume_override )
700700   {
701      running_device *ym = devtag_get_device(space->machine, "ymsnd");
702      running_device *upd = devtag_get_device(space->machine, "upd");
701      running_device *ym = space->machine->device("ymsnd");
702      running_device *upd = space->machine->device("upd");
703703      float percent = volume_override? 1.0f : (32-global_volume)/32.0f;
704704
705705      sound_set_output_gain(ym, 0, percent);
r8581r8582
776776      }
777777   }
778778
779   if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80;           // update sound busy input
779   if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;           // update sound busy input
780780
781781   return result;
782782}
r8581r8582
812812         }
813813
814814         {
815            running_device *ym = devtag_get_device(space->machine, "ymsnd");
816            running_device *upd = devtag_get_device(space->machine, "upd");
815            running_device *ym = space->machine->device("ymsnd");
816            running_device *upd = space->machine->device("upd");
817817            float percent = volume_override ? 1.0f : (32-global_volume)/32.0f;
818818
819819            sound_set_output_gain(ym, 0, percent);
r8581r8582
26662666
26672667   int result = optic_pattern;
26682668
2669   if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80;
2669   if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
26702670
26712671   return result;
26722672}
r8581r8582
26802680
26812681   int result = optic_pattern;
26822682
2683   if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80;
2683   if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
26842684
26852685   if ( BFM_dm01_busy() ) result |= 0x40;
26862686
src/mame/drivers/suprnova.c
r8581r8582
6363R,G,B Brightness:
6464   The Electro Design games have this set darker than 0xff for sprites and bg's anyway.
6565   Galpanis uses it to dim the bg's in attract on the stats screens for the characters (bg's hidden by white pen atm).
66Lots of games use them to fade, haven't seen r,g,b used independantly yet but you never know.
66Lots of games use them to fade, haven't seen r,g,b used independently yet but you never know.
6767
6868etc.etc.
6969
r8581r8582
995995static void init_skns(running_machine *machine)
996996{
997997   // init DRC to fastest options
998   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
998   sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
999999
1000   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x6f8);
1000   sh2drc_add_pcflush(machine->device("maincpu"), 0x6f8);
10011001   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000028, 0x600002b, 0, 0, bios_skip_r );
10021002}
10031003
10041004static void set_drc_pcflush(running_machine *machine, UINT32 addr)
10051005{
1006   sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), addr);
1006   sh2drc_add_pcflush(machine->device("maincpu"), addr);
10071007}
10081008
10091009static DRIVER_INIT( galpani4 ) { skns_sprite_kludge(-5,-1); init_skns(machine);  }
src/mame/drivers/tmmjprd.c
r8581r8582
265265static VIDEO_UPDATE( tmmjprd )
266266{
267267   UINT8* gfxroms = memory_region(screen->machine,"gfx2");
268   running_device *left_screen  = devtag_get_device(screen->machine, "lscreen");
269   running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
268   running_device *left_screen  = screen->machine->device("lscreen");
269   running_device *right_screen = screen->machine->device("rscreen");
270270
271271   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
272272
src/mame/drivers/dynax.c
r8581r8582
456456   dynax_state *state = (dynax_state *)machine->driver_data;
457457   /* start with the MSM5205 reset */
458458   state->resetkludge = 0;
459   msm5205_reset_w(devtag_get_device(machine, "msm"), 1);
459   msm5205_reset_w(machine->device("msm"), 1);
460460}
461461
462462static WRITE8_HANDLER( yarunara_layer_half_w )
r8581r8582
42044204{
42054205   dynax_state *state = (dynax_state *)machine->driver_data;
42064206
4207   state->maincpu = devtag_get_device(machine, "maincpu");
4208   state->soundcpu = devtag_get_device(machine, "soundcpu");
4209   state->rtc = devtag_get_device(machine, "rtc");
4210   state->ymsnd = devtag_get_device(machine, "ymsnd");
4207   state->maincpu = machine->device("maincpu");
4208   state->soundcpu = machine->device("soundcpu");
4209   state->rtc = machine->device("rtc");
4210   state->ymsnd = machine->device("ymsnd");
42114211
42124212   state_save_register_global(machine, state->sound_irq);
42134213   state_save_register_global(machine, state->vblank_irq);
r8581r8582
42444244{
42454245   dynax_state *state = (dynax_state *)machine->driver_data;
42464246
4247   if (devtag_get_device(machine, "msm") != NULL)
4247   if (machine->device("msm") != NULL)
42484248      MACHINE_RESET_CALL(adpcm);
42494249
42504250   state->sound_irq = 0;
r8581r8582
47014701   memory_configure_bank(machine, "bank1", 0, 0x10, &MAIN[0x8000],  0x8000);
47024702   memory_configure_bank(machine, "bank2", 0, 12,   &SOUND[0x8000], 0x8000);
47034703
4704   state->top_scr = devtag_get_device(machine, "top");
4705   state->bot_scr = devtag_get_device(machine, "bottom");
4704   state->top_scr = machine->device("top");
4705   state->bot_scr = machine->device("bottom");
47064706
47074707   MACHINE_START_CALL(dynax);
47084708}
src/mame/drivers/sigmab98.c
r8581r8582
313313// 02 hopper motor on (active low)?
314314static WRITE8_HANDLER( c8_w )
315315{
316   ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80);
316   ticket_dispenser_w(space->machine->device("hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80);
317317
318318   c8 = data;
319319   show_outputs();
src/mame/drivers/volfied.c
r8581r8582
237237
238238   volfied_cchip_init(machine);
239239
240   state->maincpu = devtag_get_device(machine, "maincpu");
241   state->audiocpu = devtag_get_device(machine, "audiocpu");
242   state->pc090oj = devtag_get_device(machine, "pc090oj");
240   state->maincpu = machine->device("maincpu");
241   state->audiocpu = machine->device("audiocpu");
242   state->pc090oj = machine->device("pc090oj");
243243}
244244
245245static MACHINE_RESET( volfied )
src/mame/drivers/dribling.c
r8581r8582
287287{
288288   dribling_state *state = (dribling_state *)machine->driver_data;
289289
290   state->maincpu = devtag_get_device(machine, "maincpu");
291   state->ppi_0 = devtag_get_device(machine, "ppi8255_0");
292   state->ppi_1 = devtag_get_device(machine, "ppi8255_1");
290   state->maincpu = machine->device("maincpu");
291   state->ppi_0 = machine->device("ppi8255_0");
292   state->ppi_1 = machine->device("ppi8255_1");
293293
294294   state_save_register_global(machine, state->abca);
295295   state_save_register_global(machine, state->di);
src/mame/drivers/megadriv.c
r8581r8582
698698   if (length==0x00) length = 0xffff;
699699
700700   /* This is a hack until real DMA timings are implemented */
701   cpu_spinuntil_time(devtag_get_device(machine, "maincpu"), ATTOTIME_IN_NSEC(length * 1000 / 3500));
701   cpu_spinuntil_time(machine->device("maincpu"), ATTOTIME_IN_NSEC(length * 1000 / 3500));
702702
703703   for (count = 0;count<(length>>1);count++)
704704   {
r8581r8582
983983      case 0x12:
984984      case 0x14:
985985      case 0x16:
986         if (ACCESSING_BITS_0_7) sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data & 0xff);
987         //if (ACCESSING_BITS_8_15) sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, (data >>8) & 0xff);
986         if (ACCESSING_BITS_0_7) sn76496_w(space->machine->device("snsnd"), 0, data & 0xff);
987         //if (ACCESSING_BITS_8_15) sn76496_w(space->machine->device("snsnd"), 0, (data >>8) & 0xff);
988988         break;
989989
990990      default:
r8581r8582
23742374      case 0x13:
23752375      case 0x15:
23762376      case 0x17:
2377         sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data);
2377         sn76496_w(space->machine->device("snsnd"), 0, data);
23782378         break;
23792379
23802380      default:
r8581r8582
24052405   else if (fulladdress == 0xc00011)
24062406   {
24072407      /* quite a few early games write here, most of the later ones don't */
2408      sn76496_w(devtag_get_device(space->machine, "snsnd"), 0, data);
2408      sn76496_w(space->machine->device("snsnd"), 0, data);
24092409   }
24102410   else
24112411   {
r8581r8582
58845884
58855885
58865886
5887      if (devtag_get_device(timer.machine, "genesis_snd_z80") != NULL)
5887      if (timer.machine->device("genesis_snd_z80") != NULL)
58885888      {
58895889         if (genesis_scanline_counter == megadrive_z80irq_scanline)
58905890         {
r8581r8582
59725972      break;
59735973   }
59745974
5975   if (devtag_get_device(machine, "genesis_snd_z80") != NULL)
5975   if (machine->device("genesis_snd_z80") != NULL)
59765976   {
59775977      genz80.z80_is_reset = 1;
59785978      genz80.z80_has_bus = 1;
r8581r8582
59985998   if (genesis_other_hacks)
59995999   {
60006000   //  set_refresh_rate(megadriv_framerate);
6001      cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.9950f); /* Fatal Rewind is very fussy... */
6002   //  cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.3800f); /* Fatal Rewind is very fussy... */
6001      machine->device("maincpu")->set_clock_scale(0.9950f); /* Fatal Rewind is very fussy... */
6002   //  machine->device("maincpu")->set_clock_scale(0.3800f); /* Fatal Rewind is very fussy... */
60036003
60046004      memset(megadrive_ram,0x00,0x10000);
60056005   }
r8581r8582
64106410   }
64116411
64126412
6413   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), genesis_int_callback);
6413   cpu_set_irq_callback(machine->device("maincpu"), genesis_int_callback);
64146414   megadriv_backupram = NULL;
64156415   megadriv_backupram_length = 0;
64166416
64176417   vdp_get_word_from_68k_mem = vdp_get_word_from_68k_mem_default;
64186418
6419   m68k_set_tas_callback(devtag_get_device(machine, "maincpu"), megadriv_tas_callback);
6419   m68k_set_tas_callback(machine->device("maincpu"), megadriv_tas_callback);
64206420
64216421   if ((ipt == INPUT_PORTS_NAME(megadri6)) || (ipt == INPUT_PORTS_NAME(ssf2ghw)) || (ipt == INPUT_PORTS_NAME(mk3ghw)))
64226422   {
r8581r8582
65436543/* sets the megadrive z80 to it's normal ports / map */
65446544void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag)
65456545{
6546   running_device *ym = devtag_get_device(machine, "ymsnd");
6546   running_device *ym = machine->device("ymsnd");
65476547
65486548   /* INIT THE PORTS *********************************************************************************************/
65496549   memory_install_readwrite8_handler(cputag_get_address_space(machine, tag, ADDRESS_SPACE_IO), 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w);
r8581r8582
66346634   _32x_240mode = 0;
66356635
66366636// checking if these help brutal, they don't.
6637   sh2drc_set_options(devtag_get_device(machine, "32x_master_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
6638   sh2drc_set_options(devtag_get_device(machine, "32x_slave_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
6637   sh2drc_set_options(machine->device("32x_master_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
6638   sh2drc_set_options(machine->device("32x_slave_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
66396639
66406640   DRIVER_INIT_CALL(megadriv);
66416641}
src/mame/drivers/itech32.c
r8581r8582
738738   set_led_status(space->machine, 1, data & 0x01);
739739   set_led_status(space->machine, 2, data & 0x02);
740740   set_led_status(space->machine, 3, data & 0x04);
741   ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, (data & 0x10) << 3);
741   ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3);
742742   coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
743743}
744744
r8581r8582
757757   /* bit 4 controls the ticket dispenser */
758758   /* bit 5 controls the coin counter */
759759   /* bit 6 controls the diagnostic sound LED */
760   ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, (data & 0x10) << 3);
760   ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3);
761761   coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
762762}
763763
r8581r8582
40454045
40464046static void install_timekeeper(running_machine *machine)
40474047{
4048   running_device *device = devtag_get_device(machine, "m48t02");
4048   running_device *device = machine->device("m48t02");
40494049   memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x681000, 0x6817ff, 0, 0, timekeeper_32be_r, timekeeper_32be_w);
40504050}
40514051
src/mame/drivers/mexico86.c
r8581r8582
426426
427427   memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
428428
429   state->maincpu = devtag_get_device(machine, "maincpu");
430   state->audiocpu = devtag_get_device(machine, "audiocpu");
431   state->subcpu = devtag_get_device(machine, "sub");
432   state->mcu = devtag_get_device(machine, "mcu");
429   state->maincpu = machine->device("maincpu");
430   state->audiocpu = machine->device("audiocpu");
431   state->subcpu = machine->device("sub");
432   state->mcu = machine->device("mcu");
433433
434434   state_save_register_global(machine, state->port_a_in);
435435   state_save_register_global(machine, state->port_a_out);
r8581r8582
452452   mexico86_state *state = (mexico86_state *)machine->driver_data;
453453
454454   /*TODO: check the PCB and see how the halt / reset lines are connected. */
455   if (devtag_get_device(machine, "sub") != NULL)
455   if (machine->device("sub") != NULL)
456456      cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE);
457457
458458   state->port_a_in = 0;
src/mame/drivers/calchase.c
r8581r8582
558558
559559static MACHINE_START(calchase)
560560{
561   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
561   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
562562
563   calchase_devices.pit8254 = devtag_get_device( machine, "pit8254" );
564   calchase_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
565   calchase_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
566   calchase_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
567   calchase_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
563   calchase_devices.pit8254 = machine->device( "pit8254" );
564   calchase_devices.pic8259_1 = machine->device( "pic8259_1" );
565   calchase_devices.pic8259_2 = machine->device( "pic8259_2" );
566   calchase_devices.dma8237_1 = machine->device( "dma8237_1" );
567   calchase_devices.dma8237_2 = machine->device( "dma8237_2" );
568568}
569569
570570/*************************************************************
src/mame/drivers/ashnojoe.c
r8581r8582
334334{
335335   ashnojoe_state *state = (ashnojoe_state *)machine->driver_data;
336336
337   state->audiocpu = devtag_get_device(machine, "audiocpu");
337   state->audiocpu = machine->device("audiocpu");
338338
339339   state_save_register_global(machine, state->adpcm_byte);
340340   state_save_register_global(machine, state->soundlatch_status);
src/mame/drivers/mouser.c
r8581r8582
175175{
176176   mouser_state *state = (mouser_state *)machine->driver_data;
177177
178   state->maincpu = devtag_get_device(machine, "maincpu");
179   state->audiocpu = devtag_get_device(machine, "audiocpu");
178   state->maincpu = machine->device("maincpu");
179   state->audiocpu = machine->device("audiocpu");
180180
181181   state_save_register_global(machine, state->sound_byte);
182182   state_save_register_global(machine, state->nmi_enable);
src/mame/drivers/undrfire.c
r8581r8582
297297
298298         if (ACCESSING_BITS_0_7)
299299         {
300            running_device *device = devtag_get_device(space->machine, "eeprom");
300            running_device *device = space->machine->device("eeprom");
301301            eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
302302            eeprom_write_bit(device, data & 0x40);
303303            eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/grchamp.c
r8581r8582
244244
245245static WRITE8_HANDLER( cpu1_outputs_w )
246246{
247   running_device *discrete = devtag_get_device(space->machine, "discrete");
247   running_device *discrete = space->machine->device("discrete");
248248   grchamp_state *state = (grchamp_state *)space->machine->driver_data;
249249   UINT8 diff = data ^ state->cpu1_out[offset];
250250   state->cpu1_out[offset] = data;
src/mame/drivers/lkage.c
r8581r8582
360360{
361361   lkage_state *state = (lkage_state *)machine->driver_data;
362362
363   state->maincpu = devtag_get_device(machine, "maincpu");
364   state->audiocpu = devtag_get_device(machine, "audiocpu");
365   state->mcu = devtag_get_device(machine, "mcu");
363   state->maincpu = machine->device("maincpu");
364   state->audiocpu = machine->device("audiocpu");
365   state->mcu = machine->device("mcu");
366366
367367   state_save_register_global(machine, state->bg_tile_bank);
368368   state_save_register_global(machine, state->fg_tile_bank);
src/mame/drivers/gaiden.c
r8581r8582
99076000-077fff Sprite RAM
1010078000-079fff Palette RAM
1111
1207a100-07a1ff Unknown
13
1412memory mapped ports:
1513
1614read:
r8581r8582
2220see the input_ports definition below for details on the input bits
2321
2422write:
2507a104-07a105 text  layer Y scroll
2607a10c-07a10d text  layer X scroll
2707a204-07a205 front layer Y scroll
2807a20c-07a20d front layer X scroll
2907a304-07a305 back  layer Y scroll
3007a30c-07a30d back  layer X scroll
2307a002-07a003 sprite layer Y offset
2407a104-07a105 text   layer Y scroll
2507a108-07a109 text   layer Y scroll offset
2607a10c-07a10d text   layer X scroll
2707a204-07a205 front  layer Y scroll
2807a208-07a209 front  layer Y scroll offset
2907a20c-07a20d front  layer X scroll
3007a304-07a305 back   layer Y scroll
3107a308-07a309 back   layer Y scroll offset
3207a30c-07a30d back   layer X scroll
3133
34unknown writes during boot sequence and/or game start:
3507a000, 07a004, 07a006, 07a100, 07a110, 07a200, 07a210, 07a300, 07a310
36
3237Notes:
3338- The sprite Y size control is slightly different from gaiden/wildfang to
3439  raiga. In the first two, size X and Y change together, while in the latter
r8581r8582
301306   state->bg_scroll_y = 0;
302307   state->fg_scroll_x = 0;
303308   state->fg_scroll_y = 0;
309
310   state->tx_offset_y = 0;
311   state->fg_offset_y = 0;
312   state->bg_offset_y = 0;
313   state->spr_offset_y = 0;
304314}
305315
306316static MACHINE_START( raiga )
307317{
308318   gaiden_state *state = (gaiden_state *)machine->driver_data;
309   state->audiocpu = devtag_get_device(machine, "audiocpu");
319   state->audiocpu = machine->device("audiocpu");
310320
311321   state_save_register_global(machine, state->prot);
312322   state_save_register_global(machine, state->jumpcode);
r8581r8582
317327   state_save_register_global(machine, state->bg_scroll_y);
318328   state_save_register_global(machine, state->fg_scroll_x);
319329   state_save_register_global(machine, state->fg_scroll_y);
330
331   state_save_register_global(machine, state->tx_offset_y);
332   state_save_register_global(machine, state->fg_offset_y);
333   state_save_register_global(machine, state->bg_offset_y);
334   state_save_register_global(machine, state->spr_offset_y);
320335}
321336
322337static WRITE16_HANDLER( raiga_protection_w )
r8581r8582
387402   AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE_SIZE_MEMBER(gaiden_state, spriteram, spriteram_size)
388403   AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
389404   AM_RANGE(0x07a000, 0x07a001) AM_READ_PORT("SYSTEM")
390   AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2")
405   AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2") AM_WRITE(gaiden_sproffsety_w)
391406   AM_RANGE(0x07a004, 0x07a005) AM_READ_PORT("DSW")
392407   AM_RANGE(0x07a104, 0x07a105) AM_WRITE(gaiden_txscrolly_w)
408   AM_RANGE(0x07a108, 0x07a109) AM_WRITE(gaiden_txoffsety_w)
393409   AM_RANGE(0x07a10c, 0x07a10d) AM_WRITE(gaiden_txscrollx_w)
394410   AM_RANGE(0x07a204, 0x07a205) AM_WRITE(gaiden_fgscrolly_w)
411   AM_RANGE(0x07a208, 0x07a209) AM_WRITE(gaiden_fgoffsety_w)
395412   AM_RANGE(0x07a20c, 0x07a20d) AM_WRITE(gaiden_fgscrollx_w)
396413   AM_RANGE(0x07a304, 0x07a305) AM_WRITE(gaiden_bgscrolly_w)
414   AM_RANGE(0x07a308, 0x07a309) AM_WRITE(gaiden_bgoffsety_w)
397415   AM_RANGE(0x07a30c, 0x07a30d) AM_WRITE(gaiden_bgscrollx_w)
398416   AM_RANGE(0x07a800, 0x07a801) AM_WRITE(watchdog_reset16_w)
399417   AM_RANGE(0x07a802, 0x07a803) AM_WRITE(gaiden_sound_command_w)
r8581r8582
472490   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
473491   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
474492
475INPUT_PORTS_END
476
477static INPUT_PORTS_START( shadoww )
478   PORT_INCLUDE(  common )
479
480   /* Dip Switches order fits the first screen */
481493   PORT_START("DSW")
482494   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
483495   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
r8581r8582
519531   PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SWB:8" )
520532INPUT_PORTS_END
521533
534static INPUT_PORTS_START( drgnbowl )
535   PORT_INCLUDE(  common )
536
537   PORT_MODIFY("DSW")
538   PORT_DIPUNKNOWN_DIPLOC( 0x0002, 0x0002, "SWA:7" ) /* No Flip Screen */
539INPUT_PORTS_END
540
522541static INPUT_PORTS_START( wildfang )
523542   PORT_INCLUDE(  common )
524543
525   /* Dip Switches order fits the first screen */
526   PORT_START("DSW")
527   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
528   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
529   PORT_DIPSETTING(      0x0080, DEF_STR( 4C_1C ) )
530   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_1C ) )
531   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
532   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
533   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
534   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
535   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )
536   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:6,5,4")
537   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
538   PORT_DIPSETTING(      0x0010, DEF_STR( 4C_1C ) )
539   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
540   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
541   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
542   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
543   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
544   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_4C ) )
545   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWA:7")
546   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
547   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
548   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8")
549   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
550   PORT_DIPSETTING(      0x0001, DEF_STR( On ) )
544   PORT_MODIFY("DSW")
551545   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1")
552546   PORT_DIPSETTING(      0x8000, "1" )
553547   PORT_DIPSETTING(      0xc000, "2" )
r8581r8582
565559   PORT_DIPSETTING(      0x0400, DEF_STR( Normal ) )
566560   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
567561   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
568   PORT_DIPUNKNOWN_DIPLOC( 0x0200, 0x0200, "SWB:7" )
569562   PORT_DIPNAME( 0x0100, 0x0100, "Title" ) PORT_DIPLOCATION("SWB:8")   // also affects Difficulty Table (see above)
570563   PORT_DIPSETTING(      0x0100, "Wild Fang" )
571564   PORT_DIPSETTING(      0x0000, "Tecmo Knight" )
572565INPUT_PORTS_END
573566
574567static INPUT_PORTS_START( tknight )
575   PORT_INCLUDE(  common )
568   PORT_INCLUDE(  wildfang )
576569
577   /* Dip Switches order fits the first screen */
578   PORT_START("DSW")
579   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
580   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
581   PORT_DIPSETTING(      0x0080, DEF_STR( 4C_1C ) )
582   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_1C ) )
583   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
584   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
585   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
586   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
587   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )
588   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:6,5,4")
589   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
590   PORT_DIPSETTING(      0x0010, DEF_STR( 4C_1C ) )
591   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
592   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
593   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
594   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
595   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
596   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_4C ) )
597   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWA:7")
598   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
599   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
600   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8")
601   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
602   PORT_DIPSETTING(      0x0001, DEF_STR( On ) )
603   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1")
604   PORT_DIPSETTING(      0x8000, "1" )
605   PORT_DIPSETTING(      0xc000, "2" )
606   PORT_DIPSETTING(      0x4000, "3" )
607/*  PORT_DIPSETTING(      0x0000, "2" ) */
608   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SWB:3" )
609   PORT_DIPUNKNOWN_DIPLOC( 0x1000, 0x1000, "SWB:4" )
610   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6,5")
611   PORT_DIPSETTING(      0x0c00, DEF_STR( Easy ) )
612   PORT_DIPSETTING(      0x0400, DEF_STR( Normal ) )
613   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
614   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
615   PORT_DIPUNKNOWN_DIPLOC( 0x0200, 0x0200, "SWB:7" )
616   PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SWB:8" )
570   PORT_MODIFY("DSW")
571   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SWB:3" ) /* No seperate difficulty option like parent set */
572   PORT_DIPUNKNOWN_DIPLOC( 0x1000, 0x1000, "SWB:4" ) /* No seperate difficulty option like parent set */
573   PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SWB:8" ) /* No title change option */
617574INPUT_PORTS_END
618575
619576static INPUT_PORTS_START( raiga )
r8581r8582
624581   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
625582
626583   /* Dip Switches order fits the first screen */
627   PORT_START("DSW")
584   PORT_MODIFY("DSW")
628585   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:4,3,2,1")
629586   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
630587   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )
r8581r8582
680637   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
681638INPUT_PORTS_END
682639
683static INPUT_PORTS_START( drgnbowl )
684   PORT_INCLUDE(  common )
685640
686   /* Dip Switches order fits the first screen */
687   PORT_START("DSW")
688   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
689   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
690   PORT_DIPSETTING(      0x0080, DEF_STR( 4C_1C ) )
691   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_1C ) )
692   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
693   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
694   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
695   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
696   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )
697   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:6,5,4")
698   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
699   PORT_DIPSETTING(      0x0010, DEF_STR( 4C_1C ) )
700   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
701   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
702   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
703   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
704   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
705   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_4C ) )
706   PORT_DIPUNKNOWN_DIPLOC( 0x0002, 0x0002, "SWA:7" )
707   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8")
708   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
709   PORT_DIPSETTING(      0x0001, DEF_STR( On ) )
710   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1")
711   PORT_DIPSETTING(      0x0000, "1" )
712   PORT_DIPSETTING(      0xc000, "2" )
713   PORT_DIPSETTING(      0x4000, "3" )
714   PORT_DIPSETTING(      0x8000, "4" )
715   PORT_DIPNAME( 0x3000, 0x3000, "Energy" ) PORT_DIPLOCATION("SWB:4,3")
716   PORT_DIPSETTING(      0x0000, "2" )
717   PORT_DIPSETTING(      0x3000, "3" )
718   PORT_DIPSETTING(      0x1000, "4" )
719   PORT_DIPSETTING(      0x2000, "5" )
720   PORT_DIPUNKNOWN_DIPLOC( 0x0800, 0x0800, "SWB:5" )
721   PORT_DIPUNKNOWN_DIPLOC( 0x0400, 0x0400, "SWB:6" )
722   PORT_DIPUNKNOWN_DIPLOC( 0x0200, 0x0200, "SWB:7" )
723   PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SWB:8" )
724INPUT_PORTS_END
725641
726
727
728642static const gfx_layout tilelayout =
729643{
730644   8,8,   /* tile size */
r8581r8582
873787   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
874788   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
875789   MDRV_SCREEN_SIZE(32*8, 32*8)
876   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
790   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 32*8-1)
877791
878792   MDRV_GFXDECODE(gaiden)
879793   MDRV_PALETTE_LENGTH(4096)
r8581r8582
13561270ROM_END
13571271
13581272
1359ROM_START( tknight )
1273ROM_START( wildfang ) /* Dipswitch selectable title of Wild Fang or Temco Knight */
13601274   ROM_REGION( 0x40000, "maincpu", 0 )   /* 2*128k for 68000 code */
1361   ROM_LOAD16_BYTE( "tkni1.bin",    0x00000, 0x20000, CRC(9121daa8) SHA1(06ba7779602df8fae32e859371d27c0dbb8d3430) )
1362   ROM_LOAD16_BYTE( "tkni2.bin",    0x00001, 0x20000, CRC(6669cd87) SHA1(8888522a3aef76a979ffc80ba457dd49f279abf1) )
1275   ROM_LOAD16_BYTE( "1.3st",    0x00000, 0x20000, CRC(ab876c9b) SHA1(b02c822f107df4c9c4f0024998f225c1ddbbd496) )
1276   ROM_LOAD16_BYTE( "2.5st",    0x00001, 0x20000, CRC(1dc74b3b) SHA1(c99051ebefd6ce666b13ab56c0a10b188f15ec28) )
13631277
13641278   ROM_REGION( 0x10000, "audiocpu", 0 )
13651279   ROM_LOAD( "tkni3.bin",    0x0000, 0x10000, CRC(15623ec7) SHA1(db43fe6c417117d7cd90a26e12a52efb0e1a5ca6) )   /* Audio CPU is a Z80  */
r8581r8582
13711285   ROM_LOAD( "tkni5.bin",    0x000000, 0x10000, CRC(5ed15896) SHA1(87bdddb26934af0b2c4e704e6d85c69a7531aeb1) )   /* 8x8 tiles */
13721286
13731287   ROM_REGION( 0x080000, "gfx2", 0 )
1374   ROM_LOAD( "tkni7.bin",    0x000000, 0x80000, CRC(4b4d4286) SHA1(d386aa223eb288ea829c98d3f39279a75dc66b71) )
1288   ROM_LOAD( "14.3a",        0x000000, 0x20000, CRC(0d20c10c) SHA1(209ca4e166d0b91ff99a338e135e5388af2c51f5) )
1289   ROM_LOAD( "15.3b",        0x020000, 0x20000, CRC(3f40a6b4) SHA1(7486ddfe4b0ac4198512548b74402f4194c804f1) )
1290   ROM_LOAD( "16.1a",        0x040000, 0x20000, CRC(0f31639e) SHA1(e150db4f617c5fcf505e5ca95d94073c1f6b7d0d) )
1291   ROM_LOAD( "17.1b",        0x060000, 0x20000, CRC(f32c158e) SHA1(2861754bda37e30799151b5ca73771937edf38a9) )
13751292
13761293   ROM_REGION( 0x080000, "gfx3", 0 )
13771294   ROM_LOAD( "tkni6.bin",    0x000000, 0x80000, CRC(f68fafb1) SHA1(aeca38eaea2f6dfc484e48ac1114c0c4abaafb9c) )
r8581r8582
13841301   ROM_LOAD( "tkni4.bin",    0x0000, 0x20000, CRC(a7a1dbcf) SHA1(2fee1d9745ce2ab54b0b9cbb6ab2e66ba9677245) ) /* samples */
13851302ROM_END
13861303
1387ROM_START( wildfang )
1304ROM_START( wildfangs ) /* Wild Fang - No title change option */
13881305   ROM_REGION( 0x40000, "maincpu", 0 )   /* 2*128k for 68000 code */
1389   ROM_LOAD16_BYTE( "1.3st",    0x00000, 0x20000, CRC(ab876c9b) SHA1(b02c822f107df4c9c4f0024998f225c1ddbbd496) )
1390   ROM_LOAD16_BYTE( "2.5st",    0x00001, 0x20000, CRC(1dc74b3b) SHA1(c99051ebefd6ce666b13ab56c0a10b188f15ec28) )
1306   ROM_LOAD16_BYTE( "1.3s",    0x00000, 0x20000, CRC(3421f691) SHA1(7829729e2007a53fc598db3ae3524b971cbf49e9) )
1307   ROM_LOAD16_BYTE( "2.5s",    0x00001, 0x20000, CRC(d3547708) SHA1(91cc0575b25fe15d668eec26dd74945c51ed67eb) )
13911308
13921309   ROM_REGION( 0x10000, "audiocpu", 0 )
13931310   ROM_LOAD( "tkni3.bin",    0x0000, 0x10000, CRC(15623ec7) SHA1(db43fe6c417117d7cd90a26e12a52efb0e1a5ca6) )   /* Audio CPU is a Z80  */
r8581r8582
14151332   ROM_LOAD( "tkni4.bin",    0x0000, 0x20000, CRC(a7a1dbcf) SHA1(2fee1d9745ce2ab54b0b9cbb6ab2e66ba9677245) ) /* samples */
14161333ROM_END
14171334
1335ROM_START( tknight ) /* Temco Knight - No title change option */
1336   ROM_REGION( 0x40000, "maincpu", 0 )   /* 2*128k for 68000 code */
1337   ROM_LOAD16_BYTE( "tkni1.bin",    0x00000, 0x20000, CRC(9121daa8) SHA1(06ba7779602df8fae32e859371d27c0dbb8d3430) )
1338   ROM_LOAD16_BYTE( "tkni2.bin",    0x00001, 0x20000, CRC(6669cd87) SHA1(8888522a3aef76a979ffc80ba457dd49f279abf1) )
1339
1340   ROM_REGION( 0x10000, "audiocpu", 0 )
1341   ROM_LOAD( "tkni3.bin",    0x0000, 0x10000, CRC(15623ec7) SHA1(db43fe6c417117d7cd90a26e12a52efb0e1a5ca6) )   /* Audio CPU is a Z80  */
1342
1343   ROM_REGION( 0x1000, "mcu", 0 )   /* protection NEC D8749 */
1344   ROM_LOAD( "a-6v.mcu",         0x00000, 0x1000, NO_DUMP )
1345
1346   ROM_REGION( 0x010000, "gfx1", 0 )
1347   ROM_LOAD( "tkni5.bin",    0x000000, 0x10000, CRC(5ed15896) SHA1(87bdddb26934af0b2c4e704e6d85c69a7531aeb1) )   /* 8x8 tiles */
1348
1349   ROM_REGION( 0x080000, "gfx2", 0 )
1350   ROM_LOAD( "tkni7.bin",    0x000000, 0x80000, CRC(4b4d4286) SHA1(d386aa223eb288ea829c98d3f39279a75dc66b71) )
1351
1352   ROM_REGION( 0x080000, "gfx3", 0 )
1353   ROM_LOAD( "tkni6.bin",    0x000000, 0x80000, CRC(f68fafb1) SHA1(aeca38eaea2f6dfc484e48ac1114c0c4abaafb9c) )
1354
1355   ROM_REGION( 0x100000, "gfx4", 0 )
1356   ROM_LOAD( "tkni9.bin",    0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) )   /* sprites */
1357   ROM_LOAD( "tkni8.bin",    0x080000, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) )   /* sprites */
1358
1359   ROM_REGION( 0x40000, "oki", 0 )   /* 128k for ADPCM samples - sound chip is OKIM6295 */
1360   ROM_LOAD( "tkni4.bin",    0x0000, 0x20000, CRC(a7a1dbcf) SHA1(2fee1d9745ce2ab54b0b9cbb6ab2e66ba9677245) ) /* samples */
1361ROM_END
1362
14181363ROM_START( stratof )
14191364   ROM_REGION( 0x40000, "maincpu", 0 )
14201365   ROM_LOAD16_BYTE( "1.3s",        0x00000, 0x20000, CRC(060822a4) SHA1(82abf6ea64695d2f7b5934ad2487e857648aeecf) )
r8581r8582
16841629   DRIVER_INIT_CALL(shadoww);
16851630}
16861631
1687GAME( 1988, shadoww,  0,        shadoww, shadoww,  shadoww,  ROT0, "Tecmo", "Shadow Warriors (World, set 1)", GAME_SUPPORTS_SAVE )
1688GAME( 1988, shadowwa, shadoww,  shadoww, shadoww,  shadoww,  ROT0, "Tecmo", "Shadow Warriors (World, set 2)", GAME_SUPPORTS_SAVE )
1689GAME( 1988, gaiden,   shadoww,  shadoww, shadoww,  shadoww,  ROT0, "Tecmo", "Ninja Gaiden (US)", GAME_SUPPORTS_SAVE )
1690GAME( 1989, ryukendn, shadoww,  shadoww, shadoww,  shadoww,  ROT0, "Tecmo", "Ninja Ryukenden (Japan, set 1)", GAME_SUPPORTS_SAVE )
1691GAME( 1989, ryukendna,shadoww,  shadoww, shadoww,  shadoww,  ROT0, "Tecmo", "Ninja Ryukenden (Japan, set 2)", GAME_SUPPORTS_SAVE )
1692GAME( 1989, mastninj, shadoww,  mastninj,shadoww,  mastninj, ROT0, "bootleg", "Master Ninja (bootleg of Shadow Warriors / Ninja Gaiden)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // sprites need fixing, sound and yscroll too.
1632GAME( 1988, shadoww,  0,        shadoww, common,   shadoww,  ROT0, "Tecmo", "Shadow Warriors (World, set 1)", GAME_SUPPORTS_SAVE )
1633GAME( 1988, shadowwa, shadoww,  shadoww, common,   shadoww,  ROT0, "Tecmo", "Shadow Warriors (World, set 2)", GAME_SUPPORTS_SAVE )
1634GAME( 1988, gaiden,   shadoww,  shadoww, common,   shadoww,  ROT0, "Tecmo", "Ninja Gaiden (US)", GAME_SUPPORTS_SAVE )
1635GAME( 1989, ryukendn, shadoww,  shadoww, common,   shadoww,  ROT0, "Tecmo", "Ninja Ryukenden (Japan, set 1)", GAME_SUPPORTS_SAVE )
1636GAME( 1989, ryukendna,shadoww,  shadoww, common,   shadoww,  ROT0, "Tecmo", "Ninja Ryukenden (Japan, set 2)", GAME_SUPPORTS_SAVE )
1637GAME( 1989, mastninj, shadoww,  mastninj,common,   mastninj, ROT0, "bootleg", "Master Ninja (bootleg of Shadow Warriors / Ninja Gaiden)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // sprites need fixing, sound and yscroll too.
16931638GAME( 1989, wildfang, 0,        shadoww, wildfang, wildfang, ROT0, "Tecmo", "Wild Fang / Tecmo Knight", GAME_SUPPORTS_SAVE )
1639GAME( 1989, wildfangs,wildfang, shadoww, tknight,  wildfang, ROT0, "Tecmo", "Wild Fang", GAME_SUPPORTS_SAVE )
16941640GAME( 1989, tknight,  wildfang, shadoww, tknight,  wildfang, ROT0, "Tecmo", "Tecmo Knight", GAME_SUPPORTS_SAVE )
16951641GAME( 1991, stratof,  0,        raiga,   raiga,    raiga,    ROT0, "Tecmo", "Raiga - Strato Fighter (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
16961642GAME( 1991, raiga,    stratof,  raiga,   raiga,    raiga,    ROT0, "Tecmo", "Raiga - Strato Fighter (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
src/mame/drivers/trackfld.c
r8581r8582
858858   trackfld_state *state = (trackfld_state *)machine->driver_data;
859859
860860   state->audiocpu = machine->device<cpu_device>("audiocpu");
861   state->vlm = devtag_get_device(machine, "vlm");
861   state->vlm = machine->device("vlm");
862862
863863   /* video */
864864   state_save_register_global(machine, state->bg_bank);
src/mame/drivers/astrof.c
r8581r8582
500500   /* the 74175 outputs all HI's if not otherwise set */
501501   astrof_set_video_control_2(machine, 0xff);
502502
503   state->maincpu = devtag_get_device(machine, "maincpu");
504   state->samples = devtag_get_device(machine, "samples");
503   state->maincpu = machine->device("maincpu");
504   state->samples = machine->device("samples");
505505
506506   /* register for state saving */
507507   state_save_register_global(machine, state->red_on);
r8581r8582
534534   /* the 74175 outputs all HI's if not otherwise set */
535535   spfghmk2_set_video_control_2(machine, 0xff);
536536
537   state->maincpu = devtag_get_device(machine, "maincpu");
537   state->maincpu = machine->device("maincpu");
538538
539539   /* the red background circuit is disabled */
540540   state->red_on = FALSE;
r8581r8582
553553   /* the 74175 outputs all HI's if not otherwise set */
554554   tomahawk_set_video_control_2(machine, 0xff);
555555
556   state->maincpu = devtag_get_device(machine, "maincpu");
557   state->sn = devtag_get_device(machine, "snsnd");
556   state->maincpu = machine->device("maincpu");
557   state->sn = machine->device("snsnd");
558558
559559   /* register for state saving */
560560   state_save_register_global(machine, state->red_on);
src/mame/drivers/vegas.c
r8581r8582
528528
529529static MACHINE_START( vegas )
530530{
531   voodoo = devtag_get_device(machine, "voodoo");
531   voodoo = machine->device("voodoo");
532532
533533   /* allocate timers for the NILE */
534534   timer[0] = timer_alloc(machine, NULL, NULL);
r8581r8582
537537   timer[3] = timer_alloc(machine, nile_timer_callback, NULL);
538538
539539   /* identify our sound board */
540   if (devtag_get_device(machine, "dsio") != NULL)
540   if (machine->device("dsio") != NULL)
541541      dcs_idma_cs = 6;
542   else if (devtag_get_device(machine, "denver") != NULL)
542   else if (machine->device("denver") != NULL)
543543      dcs_idma_cs = 7;
544544   else
545545      dcs_idma_cs = 0;
546546
547547   /* set the fastest DRC options, but strict verification */
548   mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC);
548   mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC);
549549
550550   /* configure fast RAM regions for DRC */
551   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, ramsize - 1, FALSE, rambase);
552   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase);
551   mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, ramsize - 1, FALSE, rambase);
552   mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase);
553553
554554   /* register for save states */
555555   state_save_register_global(machine, nile_irq_state);
r8581r8582
577577   memset(pci_3dfx_regs, 0, sizeof(pci_3dfx_regs));
578578
579579   /* reset the DCS system if we have one */
580   if (devtag_get_device(machine, "dcs2") != NULL || devtag_get_device(machine, "dsio") != NULL || devtag_get_device(machine, "denver") != NULL)
580   if (machine->device("dcs2") != NULL || machine->device("dsio") != NULL || machine->device("denver") != NULL)
581581   {
582582      dcs_reset_w(1);
583583      dcs_reset_w(0);
r8581r8582
767767
768768      case 0x14:      /* interrupt pending */
769769         if (data & 4)
770            ide_interrupt(devtag_get_device(space->machine, "ide"), 0);
770            ide_interrupt(space->machine->device("ide"), 0);
771771         break;
772772   }
773773   if (LOG_PCI)
r8581r8582
15511551
15521552static void remap_dynamic_addresses(running_machine *machine)
15531553{
1554   running_device *ethernet = devtag_get_device(machine, "ethernet");
1555   running_device *ide = devtag_get_device(machine, "ide");
1554   running_device *ethernet = machine->device("ethernet");
1555   running_device *ide = machine->device("ide");
15561556   int voodoo_type = voodoo_get_type(voodoo);
15571557   offs_t base;
15581558   int addr;
r8581r8582
24912491   init_common(machine, MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */);
24922492
24932493   /* speedups */
2494   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80015430, 0x8CC38060, 250);      /* confirmed */
2495   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80015464, 0x3C09801E, 250);      /* confirmed */
2496   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800C8918, 0x8FA2004C, 250);      /* confirmed */
2497   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800C8890, 0x8FA20024, 250);      /* confirmed */
2494   mips3drc_add_hotspot(machine->device("maincpu"), 0x80015430, 0x8CC38060, 250);      /* confirmed */
2495   mips3drc_add_hotspot(machine->device("maincpu"), 0x80015464, 0x3C09801E, 250);      /* confirmed */
2496   mips3drc_add_hotspot(machine->device("maincpu"), 0x800C8918, 0x8FA2004C, 250);      /* confirmed */
2497   mips3drc_add_hotspot(machine->device("maincpu"), 0x800C8890, 0x8FA20024, 250);      /* confirmed */
24982498}
24992499
25002500
r8581r8582
25042504   init_common(machine, MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */);
25052505
25062506   /* speedups */
2507   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800158B8, 0x8CC3CC40, 250);      /* confirmed */
2508   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800158EC, 0x3C0C8022, 250);      /* confirmed */
2509   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800D40C0, 0x8FA2004C, 250);      /* confirmed */
2510   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800D4038, 0x8FA20024, 250);      /* confirmed */
2507   mips3drc_add_hotspot(machine->device("maincpu"), 0x800158B8, 0x8CC3CC40, 250);      /* confirmed */
2508   mips3drc_add_hotspot(machine->device("maincpu"), 0x800158EC, 0x3C0C8022, 250);      /* confirmed */
2509   mips3drc_add_hotspot(machine->device("maincpu"), 0x800D40C0, 0x8FA2004C, 250);      /* confirmed */
2510   mips3drc_add_hotspot(machine->device("maincpu"), 0x800D4038, 0x8FA20024, 250);      /* confirmed */
25112511}
25122512
25132513
r8581r8582
25172517   init_common(machine, MIDWAY_IOASIC_MACE, 337/* others? */);
25182518
25192519   /* speedups */
2520   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8009436C, 0x0C031663, 250);      /* confirmed */
2520   mips3drc_add_hotspot(machine->device("maincpu"), 0x8009436C, 0x0C031663, 250);      /* confirmed */
25212521}
25222522
25232523
r8581r8582
25272527   init_common(machine, MIDWAY_IOASIC_GAUNTDL, 330/* others? */);
25282528
25292529   /* speedups */
2530   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80051CD8, 0x0C023C15, 250);      /* confirmed */
2531   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8005E674, 0x3C028017, 250);      /* confirmed */
2532   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8002DBCC, 0x8FA2002C, 250);      /* confirmed */
2533   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80015930, 0x8FC20244, 250);      /* confirmed */
2530   mips3drc_add_hotspot(machine->device("maincpu"), 0x80051CD8, 0x0C023C15, 250);      /* confirmed */
2531   mips3drc_add_hotspot(machine->device("maincpu"), 0x8005E674, 0x3C028017, 250);      /* confirmed */
2532   mips3drc_add_hotspot(machine->device("maincpu"), 0x8002DBCC, 0x8FA2002C, 250);      /* confirmed */
2533   mips3drc_add_hotspot(machine->device("maincpu"), 0x80015930, 0x8FC20244, 250);      /* confirmed */
25342534}
25352535
25362536
src/mame/drivers/galpanic.c
r8581r8582
137137
138138static VIDEO_EOF( galpanic )
139139{
140   running_device *pandora = devtag_get_device(machine, "pandora");
140   running_device *pandora = machine->device("pandora");
141141   pandora_eof(pandora);
142142}
143143
r8581r8582
163163
164164static WRITE16_HANDLER( galpanic_6295_bankswitch_w )
165165{
166   running_device *pandora = devtag_get_device(space->machine, "pandora");
166   running_device *pandora = space->machine->device("pandora");
167167
168168   if (ACCESSING_BITS_8_15)
169169   {
r8581r8582
189189#ifdef UNUSED_FUNCTION
190190static WRITE16_HANDLER( galpanica_misc_w )
191191{
192   running_device *pandora = devtag_get_device(machine, "pandora");
192   running_device *pandora = machine->device("pandora");
193193
194194   if (ACCESSING_BITS_0_7)
195195   {
src/mame/drivers/finalizr.c
r8581r8582
247247{
248248   finalizr_state *state = (finalizr_state *)machine->driver_data;
249249
250   state->audio_cpu = devtag_get_device(machine, "audiocpu");
250   state->audio_cpu = machine->device("audiocpu");
251251
252252   state_save_register_global(machine, state->spriterambank);
253253   state_save_register_global(machine, state->charbank);
src/mame/drivers/enigma2.c
r8581r8582
155155   enigma2_state *state = (enigma2_state *)machine->driver_data;
156156   create_interrupt_timers(machine);
157157
158   state->maincpu = devtag_get_device(machine, "maincpu");
159   state->audiocpu = devtag_get_device(machine, "audiocpu");
158   state->maincpu = machine->device("maincpu");
159   state->audiocpu = machine->device("audiocpu");
160160
161161   state_save_register_global(machine, state->blink_count);
162162   state_save_register_global(machine, state->sound_latch);
src/mame/drivers/segaorun.c
r8581r8582
400400   workram              = auto_alloc_array(machine, UINT16, 0x08000/2);
401401
402402   /* init the memory mapper */
403   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), outrun_info, sound_data_w, NULL);
403   segaic16_memory_mapper_init(machine->device("maincpu"), outrun_info, sound_data_w, NULL);
404404
405405   /* init the FD1094 */
406406   fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
r8581r8582
410410   state->custom_io_w = NULL;
411411   state->custom_map = NULL;
412412
413   state->maincpu = devtag_get_device(machine, "maincpu");
414   state->soundcpu = devtag_get_device(machine, "soundcpu");
415   state->subcpu = devtag_get_device(machine, "sub");
416   state->ppi8255 = devtag_get_device(machine, "ppi8255");
413   state->maincpu = machine->device("maincpu");
414   state->soundcpu = machine->device("soundcpu");
415   state->subcpu = machine->device("sub");
416   state->ppi8255 = machine->device("ppi8255");
417417
418418   state_save_register_global(machine, state->adc_select);
419419   state_save_register_global(machine, state->vblank_irq_state);
r8581r8582
521521static MACHINE_RESET( outrun )
522522{
523523   segas1x_state *state = (segas1x_state *)machine->driver_data;
524   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
524   fd1094_machine_init(machine->device("maincpu"));
525525
526526   /* reset misc components */
527527   segaic16_memory_mapper_reset(machine);
r8581r8582
530530   segaic16_tilemap_reset(machine, 0);
531531
532532   /* hook the RESET line, which resets CPU #1 */
533   m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), outrun_reset);
533   m68k_set_reset_callback(machine->device("maincpu"), outrun_reset);
534534
535535   /* start timers to track interrupts */
536536   timer_set(machine, machine->primary_screen->time_until_pos(223), NULL, 223, scanline_callback);
src/mame/drivers/gticlub.c
r8581r8582
264264
265265   if (strcmp(screen->tag(), "lscreen") == 0)
266266   {
267      running_device *k001604 = devtag_get_device(screen->machine, "k001604_1");
268      running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
267      running_device *k001604 = screen->machine->device("k001604_1");
268      running_device *voodoo = screen->machine->device("voodoo0");
269269
270270   //  k001604_draw_back_layer(k001604, bitmap, cliprect);
271271
r8581r8582
275275   }
276276   else if (strcmp(screen->tag(), "rscreen") == 0)
277277   {
278      running_device *k001604 = devtag_get_device(screen->machine, "k001604_2");
279      running_device *voodoo = devtag_get_device(screen->machine, "voodoo1");
278      running_device *k001604 = screen->machine->device("k001604_2");
279      running_device *voodoo = screen->machine->device("voodoo1");
280280
281281   //  k001604_draw_back_layer(k001604, bitmap, cliprect);
282282
r8581r8582
293293
294294static READ32_HANDLER( gticlub_k001604_tile_r )
295295{
296   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
296   running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
297297   return k001604_tile_r(k001604, offset, mem_mask);
298298}
299299
300300static WRITE32_HANDLER( gticlub_k001604_tile_w )
301301{
302   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
302   running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
303303   k001604_tile_w(k001604, offset, data, mem_mask);
304304}
305305
306306
307307static READ32_HANDLER( gticlub_k001604_char_r )
308308{
309   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
309   running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
310310   return k001604_char_r(k001604, offset, mem_mask);
311311}
312312
313313static WRITE32_HANDLER( gticlub_k001604_char_w )
314314{
315   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
315   running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
316316   k001604_char_w(k001604, offset, data, mem_mask);
317317}
318318
319319static READ32_HANDLER( gticlub_k001604_reg_r )
320320{
321   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
321   running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
322322   return k001604_reg_r(k001604, offset, mem_mask);
323323}
324324
325325static WRITE32_HANDLER( gticlub_k001604_reg_w )
326326{
327   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
327   running_device *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
328328   k001604_reg_w(k001604, offset, data, mem_mask);
329329}
330330
r8581r8582
348348static READ8_HANDLER( sysreg_r )
349349{
350350   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
351   running_device *adc1038 = devtag_get_device(space->machine, "adc1038");
352   running_device *eeprom = devtag_get_device(space->machine, "eeprom");
351   running_device *adc1038 = space->machine->device("adc1038");
352   running_device *eeprom = space->machine->device("eeprom");
353353
354354   switch (offset)
355355   {
r8581r8582
383383
384384static WRITE8_HANDLER( sysreg_w )
385385{
386   running_device *adc1038 = devtag_get_device(space->machine, "adc1038");
387   running_device *eeprom = devtag_get_device(space->machine, "eeprom");
386   running_device *adc1038 = space->machine->device("adc1038");
387   running_device *eeprom = space->machine->device("eeprom");
388388
389389   switch (offset)
390390   {
r8581r8582
422422static MACHINE_START( gticlub )
423423{
424424   /* set conservative DRC options */
425   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
425   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
426426
427427   /* configure fast RAM regions for DRC */
428   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram);
428   ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram);
429429}
430430
431431static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 )
src/mame/drivers/mazerbla.c
r8581r8582
14031403{
14041404   mazerbla_state *state = (mazerbla_state *)machine->driver_data;
14051405
1406   state->maincpu = devtag_get_device(machine, "maincpu");
1407   state->subcpu = devtag_get_device(machine, "sub");
1406   state->maincpu = machine->device("maincpu");
1407   state->subcpu = machine->device("sub");
14081408
14091409   state_save_register_global_array(machine, state->vcu_video_reg);
14101410   state_save_register_global(machine, state->vcu_gfx_addr);
r8581r8582
14701470
14711471   memset(state->lookup_ram, 0, ARRAY_LENGTH(state->lookup_ram));
14721472
1473   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
1473   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
14741474}
14751475
14761476
src/mame/drivers/namcona1.c
r8581r8582
919919
920920static MACHINE_START( namcona1 )
921921{
922   c140_set_base(devtag_get_device(machine, "c140"), namcona1_workram);
922   c140_set_base(machine->device("c140"), namcona1_workram);
923923}
924924
925925// for games with the MCU emulated, the MCU boots the 68000.  don't allow it before that.
src/mame/drivers/cdi.c
r8581r8582
4949        va_start( v, s_fmt );
5050        vsprintf( buf, s_fmt, v );
5151        va_end( v );
52        logerror( "%08x: %s", cpu_get_pc(devtag_get_device(machine, "maincpu")), buf );
52        logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
5353    }
5454}
5555#else
r8581r8582
607607    {
608608        UINT8 interrupt = scc68070->picr1 & 7;
609609        scc68070->timers.timer_status_register |= TSR_OV0;
610        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
610        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
611611        cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
612612    }
613613    scc68070_set_timer_callback(&state->scc68070_regs, 0);
r8581r8582
17041704
17051705        // Set the CDIC interrupt line
17061706        verboselog(machine, 0, "Setting CDIC interrupt line for soundmap decode\n" );
1707        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128);
1707        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128);
17081708        cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
17091709    }
17101710    else
r8581r8582
19301930
19311931                            //printf( "Setting CDIC interrupt line\n" );
19321932                            verboselog(machine, 0, "Setting CDIC interrupt line for audio sector\n" );
1933                            cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128);
1933                            cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128);
19341934                            cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
19351935                        }
19361936                    }
r8581r8582
19501950                        {
19511951                            //printf( "Setting CDIC interrupt line\n" );
19521952                            verboselog(machine, 0, "Setting CDIC interrupt line for message sector\n" );
1953                            cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128);
1953                            cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128);
19541954                            cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
19551955                        }
19561956                        else
r8581r8582
19701970
19711971                        //printf( "Setting CDIC interrupt line\n" );
19721972                        verboselog(machine, 0, "Setting CDIC interrupt line for data sector\n" );
1973                        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128);
1973                        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128);
19741974                        cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
19751975                    }
19761976                }
r8581r8582
20332033
20342034                verboselog(machine, 0, "Playing CDDA sector from MSF location %06x\n", cdic->time | 2 );
20352035
2036                cdda_start_audio(devtag_get_device(machine, "cdda"), lba, rounded_next_msf);
2036                cdda_start_audio(machine->device("cdda"), lba, rounded_next_msf);
20372037
20382038            }
20392039
r8581r8582
20632063            }
20642064
20652065            verboselog(machine, 0, "Setting CDIC interrupt line for CDDA sector\n" );
2066            cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128);
2066            cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128);
20672067            cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
20682068            break;
20692069        }
r8581r8582
21142114            cdic->time = next_msf << 8;
21152115
21162116            verboselog(machine, 0, "Setting CDIC interrupt line for Seek sector\n" );
2117            cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 128);
2117            cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 128);
21182118            cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
21192119            break;
21202120        }
r8581r8582
23382338                        break;
23392339                    }
23402340                    case 0x2b: // Stop CDDA
2341                        cdda_stop_audio(devtag_get_device(space->machine, "cdda"));
2341                        cdda_stop_audio(space->machine->device("cdda"));
23422342                        timer_adjust_oneshot(cdic->interrupt_timer, attotime_never, 0);
23432343                        break;
23442344                    case 0x23: // Reset Mode 1
r8581r8582
24202420    slave_regs_t *slave = &state->slave_regs;
24212421
24222422    verboselog(machine, 0, "Asserting IRQ2\n" );
2423    cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_2, 26);
2423    cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_2, 26);
24242424    cputag_set_input_line(machine, "maincpu", M68K_IRQ_2, ASSERT_LINE);
24252425    timer_adjust_oneshot(slave->interrupt_timer, attotime_never, 0);
24262426}
r8581r8582
32793279                    UINT8 interrupt = (state->scc68070_regs.lir >> 4) & 7;
32803280                    if(interrupt)
32813281                    {
3282                        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
3282                        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
32833283                        cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
32843284                    }
32853285                }
r8581r8582
32893289                    UINT8 interrupt = state->scc68070_regs.lir & 7;
32903290                    if(interrupt)
32913291                    {
3292                        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
3292                        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
32933293                        cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
32943294                    }
32953295                }
r8581r8582
33703370                    UINT8 interrupt = (state->scc68070_regs.lir >> 4) & 7;
33713371                    if(interrupt)
33723372                    {
3373                        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
3373                        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
33743374                        cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
33753375                    }
33763376                }
r8581r8582
33803380                    UINT8 interrupt = state->scc68070_regs.lir & 7;
33813381                    if(interrupt)
33823382                    {
3383                        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
3383                        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
33843384                        cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
33853385                    }
33863386                }
r8581r8582
44654465static VIDEO_UPDATE(cdi)
44664466{
44674467    cdi_state *state = (cdi_state *)screen->machine->driver_data;
4468    running_device *main_screen = devtag_get_device(screen->machine, "screen");
4469    running_device *lcd_screen = devtag_get_device(screen->machine, "lcd");
4468    running_device *main_screen = screen->machine->device("screen");
4469    running_device *lcd_screen = screen->machine->device("lcd");
44704470
44714471    if (screen == main_screen)
44724472    {
r8581r8582
44884488    if(state->timer_set == 0)
44894489    {
44904490        state->timer_set = 1;
4491        cpu_set_input_line_vector(devtag_get_device(machine, "maincpu"), M68K_IRQ_4, 60);
4491        cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_4, 60);
44924492        cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
44934493        timer_adjust_oneshot(state->test_timer, ATTOTIME_IN_HZ(10000), 0);
44944494    }
r8581r8582
46164616    cdi_state *state = (cdi_state *)machine->driver_data;
46174617    UINT16 *src   = (UINT16*)memory_region(machine, "maincpu");
46184618    UINT16 *dst   = state->planea;
4619    //running_device *cdrom_dev = devtag_get_device(machine, "cdrom");
4619    //running_device *cdrom_dev = machine->device("cdrom");
46204620    memcpy(dst, src, 0x8);
46214621
46224622    scc68070_init(machine, &state->scc68070_regs);
r8581r8582
46244624    slave_init(machine, &state->slave_regs);
46254625
46264626    state->cdic_regs.cd = cdrom_open(get_disk_handle(machine, "cdrom"));
4627    cdda_set_cdrom(devtag_get_device(machine, "cdda"), state->cdic_regs.cd);
4627    cdda_set_cdrom(machine->device("cdda"), state->cdic_regs.cd);
46284628
4629    devtag_get_device(machine, "maincpu")->reset();
4629    machine->device("maincpu")->reset();
46304630
46314631    state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
46324632    state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
src/mame/drivers/pcat_dyn.c
r8581r8582
483483//  bank = -1;
484484//  lastvalue = -1;
485485//  hv_blank = 0;
486   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
487   pcat_dyn_devices.pit8253 = devtag_get_device( machine, "pit8254" );
488   pcat_dyn_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
489   pcat_dyn_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
490   pcat_dyn_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
491   pcat_dyn_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
486   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
487   pcat_dyn_devices.pit8253 = machine->device( "pit8254" );
488   pcat_dyn_devices.pic8259_1 = machine->device( "pic8259_1" );
489   pcat_dyn_devices.pic8259_2 = machine->device( "pic8259_2" );
490   pcat_dyn_devices.dma8237_1 = machine->device( "dma8237_1" );
491   pcat_dyn_devices.dma8237_2 = machine->device( "dma8237_2" );
492492
493493   init_pc_common(machine, PCCOMMON_KEYBOARD_AT, pcat_dyn_set_keyb_int);
494494   mc146818_init(machine, MC146818_STANDARD);
src/mame/drivers/dkong.c
r8581r8582
389389{
390390   dkong_state *state = (dkong_state *)machine->driver_data;
391391
392   state->dev_n2a03a = devtag_get_device(machine, "n2a03a");
393   state->dev_n2a03b = devtag_get_device(machine, "n2a03b");
394   state->dev_6h = devtag_get_device(machine, "ls259.6h");
395   state->dev_vp2 = devtag_get_device(machine, "virtual_p2");
392   state->dev_n2a03a = machine->device("n2a03a");
393   state->dev_n2a03b = machine->device("n2a03b");
394   state->dev_6h = machine->device("ls259.6h");
395   state->dev_vp2 = machine->device("virtual_p2");
396396}
397397
398398static MACHINE_START( dkong2b )
src/mame/drivers/appoooh.c
r8581r8582
404404{
405405   appoooh_state *state = (appoooh_state *)machine->driver_data;
406406
407   state->adpcm = devtag_get_device(machine, "msm");
407   state->adpcm = machine->device("msm");
408408
409409   state_save_register_global(machine, state->adpcm_data);
410410   state_save_register_global(machine, state->adpcm_address);
src/mame/drivers/metlclsh.c
r8581r8582
277277{
278278   metlclsh_state *state = (metlclsh_state *)machine->driver_data;
279279
280   state->maincpu = devtag_get_device(machine, "maincpu");
281   state->subcpu = devtag_get_device(machine, "sub");
280   state->maincpu = machine->device("maincpu");
281   state->subcpu = machine->device("sub");
282282
283283   state_save_register_global(machine, state->write_mask);
284284   state_save_register_global(machine, state->gfxbank);
src/mame/drivers/goldstar.c
r8581r8582
51535153   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128, 4 )
51545154GFXDECODE_END
51555155
5156static GFXDECODE_START( magical )
5157   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 32 )
5158   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 0, 16 )
5159GFXDECODE_END
5160
51565161static GFXDECODE_START( cm )
51575162   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 16 )
51585163   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128+64, 4 ) // or is there a register for the +64?
r8581r8582
59755980
59765981MACHINE_DRIVER_END
59775982
5983static PALETTE_INIT(magical)
5984{
5985   int i;
5986   for (i = 0; i < 0x100; i++)
5987   {
5988      int r,g,b;
5989
5990      UINT8*proms = memory_region(machine, "proms");
5991
5992      b = proms[0x000 + i] << 4;
5993      g = proms[0x100 + i] << 4;
5994      r = proms[0x200 + i] << 4;
5995
5996      palette_set_color(machine, i, MAKE_RGB(r, g, b));
5997   }
5998}
5999
59786000static MACHINE_DRIVER_START( magical )
59796001
59806002   MDRV_DRIVER_DATA(goldstar_state)
r8581r8582
59976019   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
59986020   MDRV_SCREEN_SIZE(64*8, 32*8)
59996021   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
6000   MDRV_PALETTE_INIT(lucky8)
6022   MDRV_PALETTE_INIT(magical)
60016023
6002   MDRV_GFXDECODE(ncb3)
6024   MDRV_GFXDECODE(magical)
60036025   MDRV_PALETTE_LENGTH(256)
60046026   MDRV_NVRAM_HANDLER(goldstar)
60056027
r8581r8582
74637485   ROM_LOAD( "g13", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
74647486ROM_END
74657487
7488
7489/*
7490
7491Magical Tonic
7492
7493unknown, 40 pin cpu (plastic box, with "Tonic" sticker on it)
74948255 x3
7495YM2203
749612 MHz
7497
74984x DSW
7499
7500*/
7501
7502/* is this the original magical odds? */
7503static DRIVER_INIT(mtonic)
7504{
7505   int A;
7506   UINT8 *ROM = memory_region(machine, "maincpu");
7507
7508   for (A = 0;A < 0x8000;A++)
7509   {
7510      if ((A & 4) == 4)
7511         ROM[A] ^= 0x01;
7512
7513      ROM[A] = BITSWAP8(ROM[A], 3,6,5,4,7,2,1,0);
7514   }
7515}
7516
7517
7518ROM_START( mtonic )
7519   ROM_REGION( 0x10000, "maincpu", 0 )
7520   ROM_LOAD( "8.e6",   0x0000, 0x8000, CRC(01daf2af) SHA1(cb9b12c79dce3c9123510a49dffc9f3cee056cf6) )
7521   ROM_LOAD( "9.e6",   0x8000, 0x8000, CRC(1770ac79) SHA1(cadfd00ae75b90b1d202d741828e0afbd5ba0bec) )
7522
7523   ROM_REGION( 0x30000, "gfx1", 0 )
7524   ROM_LOAD( "5.j10",   0x00000, 0x10000, CRC(b8032ea3) SHA1(15e5335a583d8e7a5422cd4d1d7342874a4962ab) )
7525   ROM_LOAD( "6.j11",   0x10000, 0x10000, CRC(ff38ff30) SHA1(8fef6e1fe7c307c69c9dcafa69ecf66467b9cb41) )
7526   ROM_LOAD( "7.j12",   0x20000, 0x10000, CRC(8f1d2db9) SHA1(200de01334905079dca542541e442d4194ecd913) )
7527
7528   ROM_REGION( 0x10000, "gfx2", 0 )
7529   ROM_LOAD( "1.l10",   0x0000, 0x4000, CRC(746588db) SHA1(2a0af552011246d4cc0cd0b670907cf8685ce8ef) )
7530   ROM_LOAD( "2.l11",   0x4000, 0x4000, CRC(8b7dd248) SHA1(a3ebde9fd0b6b1e42aa9b6d8e30c225abf2f80ce) )
7531   ROM_LOAD( "3.l12",   0x8000, 0x4000, CRC(de05e678) SHA1(8b9fcb9f912075a20a9ae38100006b57d508e0e7) )
7532   ROM_LOAD( "4.l13",   0xc000, 0x4000, CRC(8c542eee) SHA1(cb424e2a67c6d39302beca7cd5244bcad4a91189) )
7533
7534   ROM_REGION( 0x200, "proms", 0 )
7535   ROM_LOAD( "prom1",   0x0000, 0x0100, NO_DUMP )
7536   ROM_LOAD( "prom2",   0x0100, 0x0100, NO_DUMP )
7537
7538   ROM_REGION( 0x40, "proms2", 0 )
7539   ROM_LOAD( "prom3",   0x0000, 0x0020, NO_DUMP )
7540ROM_END
7541
7542
7543// is this a bootleg board?
74667544ROM_START( magical )
74677545   ROM_REGION( 0x20000, "maincpu", 0 )
74687546   ROM_LOAD( "8_p6_d12.512", 0x00000, 0x08000, CRC(6978c662) SHA1(cfdbcdcd4085c264e1d0ad4f18160b40d2d4e406) )
r8581r8582
74717549   ROM_IGNORE(0xc000) // BADADDR        --xxxxxxxxxxxxxx
74727550
74737551   ROM_REGION( 0x30000, "gfx1", 0 )
7474   ROM_LOAD( "5_l5_g2.512", 0x00000, 0x10000, CRC(f0ffb199) SHA1(383406e6ab74e8cecaf5574a879bf24aa606ac37) )
7552   ROM_LOAD( "5_l5_g2.512", 0x20000, 0x10000, CRC(f0ffb199) SHA1(383406e6ab74e8cecaf5574a879bf24aa606ac37) )
74757553   ROM_LOAD( "6_l6_g3.512", 0x10000, 0x10000, CRC(3e44d92b) SHA1(4e00e26a4dbf326c0c919c40382505189e82c85b) )
7476   ROM_LOAD( "7_l7_g5.512", 0x20000, 0x10000, CRC(654bb754) SHA1(346bfbf85fc38797cf422da47d474e2ef2ef459c) )
7554   ROM_LOAD( "7_l7_g5.512", 0x00000, 0x10000, CRC(654bb754) SHA1(346bfbf85fc38797cf422da47d474e2ef2ef459c) )
74777555
74787556   ROM_REGION( 0x8000, "gfx2", 0 )
7479   ROM_LOAD( "1_m1_h2.764", 0x00000, 0x2000, CRC(d7d657e4) SHA1(53e2717edb4cdeac83cd519b08225784600afa61) )
7557   ROM_LOAD( "1_m1_h2.764", 0x06000, 0x2000, CRC(d7d657e4) SHA1(53e2717edb4cdeac83cd519b08225784600afa61) )
74807558   ROM_LOAD( "2_m2_h3.764", 0x02000, 0x2000, CRC(fb7541d5) SHA1(62a36c186b32bd98dff5c3f0fa5f2ad13992835c) )
74817559   ROM_LOAD( "3_m3_h5.764", 0x04000, 0x2000, CRC(49572d8b) SHA1(ceaaf911f58cceec82f429ca9114bffa1a67ec12) )
7482   ROM_LOAD( "4_m4_h6.764", 0x06000, 0x2000, CRC(cccfaa5d) SHA1(69d9b8a26c769fd69093610e92918c9a086a2077) )
7560   ROM_LOAD( "4_m4_h6.764", 0x00000, 0x2000, CRC(cccfaa5d) SHA1(69d9b8a26c769fd69093610e92918c9a086a2077) )
74837561
7484   ROM_REGION( 0x200, "proms", 0 )
7485   ROM_LOAD( "proms", 0x0000, 0x0200, NO_DUMP )
7562   ROM_REGION( 0x300, "proms", 0 )
7563   ROM_LOAD( "82s129a.3c", 0x000, 0x100, CRC(8c4c0dc8) SHA1(1b3ddbd253555efd1f48d469b42b272b9d96bacf) )
7564   ROM_LOAD( "82s129a.1c", 0x100, 0x100, CRC(55e3c65f) SHA1(f51d08e0b2e4d97d2eacb1f6d52777065bbe1ae5) )
7565   ROM_LOAD( "82s129a.2c", 0x200, 0x100, CRC(4d46f40a) SHA1(c141e94ae5705773605b7a094e65625b4a21db73) )
74867566
7487   ROM_REGION( 0x20, "proms2", ROMREGION_ERASE00 )
7488   ROM_COPY( "proms", 0x00000, 0x00000, 0x20 ) // copy some fake colours from the no dump region
7567   ROM_REGION( 0x100, "proms2", 0 )
7568   ROM_LOAD( "82s129a.6j", 0x000, 0x100, CRC(1200815e) SHA1(8c9a856274246644af25961a2e731dbcb73f12b9) )
74897569
7490   ROM_REGION( 0x100, "unkprom", ROMREGION_ERASE00 )
7491   //ROM_LOAD( "g14", 0x0000, 0x0100, CRC(bd48de71) SHA1(e4fa1e774af1499bc568be5b2deabb859d8c8172) )
7570   ROM_REGION( 0x100, "proms3", 0 )
7571   ROM_LOAD( "dm74s288.1a", 0x00, 0x20, CRC(6a13320b) SHA1(6d7c663477f3fbc22fb716e15bfdd9c452eb686a) )
7572   ROM_LOAD( "dm74s288.1b", 0x20, 0x20, CRC(e04abac8) SHA1(4f2adf9f1482470b6de6d0e547623f62e95eaf24) )
7573   ROM_LOAD( "dm74s288.12k",0x40, 0x20, CRC(03231e84) SHA1(92abdf6f8ef705b260378e90e6d591da056c2cee) )
7574ROM_END
74927575
7493   ROM_REGION( 0x20, "unkprom2", ROMREGION_ERASE00 )
7494   //ROM_LOAD( "g13", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
7576// is this a bootleg board?
7577// program is the same as above set (but without the oversized rom 9), only gfx1 differs
7578// the proms came from this board
7579ROM_START( magicala )
7580   ROM_REGION( 0x20000, "maincpu", 0 )
7581   ROM_LOAD( "8.12e", 0x00000, 0x08000, CRC(6978c662) SHA1(cfdbcdcd4085c264e1d0ad4f18160b40d2d4e406) )
7582   ROM_IGNORE(0x8000) // 1ST AND 2ND HALF IDENTICAL
7583   ROM_LOAD( "9.14e", 0x0c000, 0x04000, CRC(b3661c55) SHA1(f576d434ccec6f342455c18ada156d29634627cb) )
7584
7585   ROM_REGION( 0x30000, "gfx1", 0 )
7586   ROM_LOAD( "5.2f", 0x20000, 0x10000, CRC(39e6ad6f) SHA1(0075015b3e794d82fb62984a41be48d17833c9f0) )
7587   ROM_LOAD( "6.3f", 0x10000, 0x10000, CRC(42e03002) SHA1(5c4f2a1aa91d3c0906665bec7423f8579f434dc1) )
7588   ROM_LOAD( "7.5f", 0x00000, 0x10000, CRC(5301a9a4) SHA1(f592bfc5f0d835cab6029aed7d6dcdd9d2ee1a2c) )
7589
7590   ROM_REGION( 0x8000, "gfx2", 0 )
7591   ROM_LOAD( "1_m1_h2.764", 0x06000, 0x2000, CRC(d7d657e4) SHA1(53e2717edb4cdeac83cd519b08225784600afa61) )
7592   ROM_LOAD( "2_m2_h3.764", 0x02000, 0x2000, CRC(fb7541d5) SHA1(62a36c186b32bd98dff5c3f0fa5f2ad13992835c) )
7593   ROM_LOAD( "3_m3_h5.764", 0x04000, 0x2000, CRC(49572d8b) SHA1(ceaaf911f58cceec82f429ca9114bffa1a67ec12) )
7594   ROM_LOAD( "4_m4_h6.764", 0x00000, 0x2000, CRC(cccfaa5d) SHA1(69d9b8a26c769fd69093610e92918c9a086a2077) )
7595
7596   ROM_REGION( 0x300, "proms", 0 )
7597   ROM_LOAD( "82s129a.3c", 0x000, 0x100, CRC(8c4c0dc8) SHA1(1b3ddbd253555efd1f48d469b42b272b9d96bacf) )
7598   ROM_LOAD( "82s129a.1c", 0x100, 0x100, CRC(55e3c65f) SHA1(f51d08e0b2e4d97d2eacb1f6d52777065bbe1ae5) )
7599   ROM_LOAD( "82s129a.2c", 0x200, 0x100, CRC(4d46f40a) SHA1(c141e94ae5705773605b7a094e65625b4a21db73) )
7600
7601   ROM_REGION( 0x100, "proms2", 0 )
7602   ROM_LOAD( "82s129a.6j", 0x000, 0x100, CRC(1200815e) SHA1(8c9a856274246644af25961a2e731dbcb73f12b9) )
7603
7604   ROM_REGION( 0x100, "proms3", 0 )
7605   ROM_LOAD( "dm74s288.1a", 0x00, 0x20, CRC(6a13320b) SHA1(6d7c663477f3fbc22fb716e15bfdd9c452eb686a) )
7606   ROM_LOAD( "dm74s288.1b", 0x20, 0x20, CRC(e04abac8) SHA1(4f2adf9f1482470b6de6d0e547623f62e95eaf24) )
7607   ROM_LOAD( "dm74s288.12k",0x40, 0x20, CRC(03231e84) SHA1(92abdf6f8ef705b260378e90e6d591da056c2cee) )
74957608ROM_END
74967609
74977610/*
74987611
7499unknown koren or chinese bootleg of something?
7612unknown korean or chinese bootleg of something?
75007613
75017614XTAL 12MHz
75027615Z80 @ 3MHz
r8581r8582
79998112   ROM_LOAD( "wcat3.d13",   0x0000, 0x0020, CRC(eab832ed) SHA1(0fbc8914ba1805cfc6698fe7f137a934e63a4f89) )
80008113ROM_END
80018114
8002/*
80038115
8004Magical Tonic
8005
8006unknown, 40 pin cpu (plastic box, with "Tonic" sticker on it)
80078255 x3
8008YM2203
800912 MHz
8010
80114x DSW
8012
8013*/
8014
8015static DRIVER_INIT(mtonic)
8016{
8017   int A;
8018   UINT8 *ROM = memory_region(machine, "maincpu");
8019
8020   for (A = 0;A < 0x8000;A++)
8021   {
8022      if ((A & 4) == 4)
8023         ROM[A] ^= 0x01;
8024
8025      ROM[A] = BITSWAP8(ROM[A], 3,6,5,4,7,2,1,0);
8026   }
8027}
8028
8029
8030ROM_START( mtonic )
8031   ROM_REGION( 0x10000, "maincpu", 0 )
8032   ROM_LOAD( "8.e6",   0x0000, 0x8000, CRC(01daf2af) SHA1(cb9b12c79dce3c9123510a49dffc9f3cee056cf6) )
8033   ROM_LOAD( "9.e6",   0x8000, 0x8000, CRC(1770ac79) SHA1(cadfd00ae75b90b1d202d741828e0afbd5ba0bec) )
8034
8035   ROM_REGION( 0x30000, "gfx1", 0 )
8036   ROM_LOAD( "5.j10",   0x00000, 0x10000, CRC(b8032ea3) SHA1(15e5335a583d8e7a5422cd4d1d7342874a4962ab) )
8037   ROM_LOAD( "6.j11",   0x10000, 0x10000, CRC(ff38ff30) SHA1(8fef6e1fe7c307c69c9dcafa69ecf66467b9cb41) )
8038   ROM_LOAD( "7.j12",   0x20000, 0x10000, CRC(8f1d2db9) SHA1(200de01334905079dca542541e442d4194ecd913) )
8039
8040   ROM_REGION( 0x10000, "gfx2", 0 )
8041   ROM_LOAD( "1.l10",   0x0000, 0x4000, CRC(746588db) SHA1(2a0af552011246d4cc0cd0b670907cf8685ce8ef) )
8042   ROM_LOAD( "2.l11",   0x4000, 0x4000, CRC(8b7dd248) SHA1(a3ebde9fd0b6b1e42aa9b6d8e30c225abf2f80ce) )
8043   ROM_LOAD( "3.l12",   0x8000, 0x4000, CRC(de05e678) SHA1(8b9fcb9f912075a20a9ae38100006b57d508e0e7) )
8044   ROM_LOAD( "4.l13",   0xc000, 0x4000, CRC(8c542eee) SHA1(cb424e2a67c6d39302beca7cd5244bcad4a91189) )
8045
8046   ROM_REGION( 0x200, "proms", 0 )
8047   ROM_LOAD( "prom1",   0x0000, 0x0100, NO_DUMP )
8048   ROM_LOAD( "prom2",   0x0100, 0x0100, NO_DUMP )
8049
8050   ROM_REGION( 0x40, "proms2", 0 )
8051   ROM_LOAD( "prom3",   0x0000, 0x0020, NO_DUMP )
8052ROM_END
8053
8054
80558116/* these 'Amcoe' games look like bootlegs of cherry master
80568117  the z80 roms are encrypted */
80578118ROM_START( skill98 )
r8581r8582
99179978GAME(  198?, wcat3,     0,        wcat3,    lucky8,   0,         ROT0, "E.A.I.",               "Wild Cat 3",                                               GAME_NOT_WORKING )
99189979
99199980GAME(  1992, magical,   0,        magical,  magical,  0,         ROT0, "Pal Company / Micro Manufacturing Inc.", "Magical Odds (set 1)",               GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
9920GAME(  1991, mtonic,    magical,  magical,  mtonic,   mtonic,    ROT0, "Pal Company",                            "Magical Odds (set 2, alt hardware)", GAME_WRONG_COLORS | GAME_NOT_WORKING |GAME_NO_SOUND) // Magical Odds logo / company in GFX
9981GAME(  1992, magicala,  magical,  magical,  magical,  0,         ROT0, "Pal Company / Micro Manufacturing Inc.", "Magical Odds (set 2)",               GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
9982GAME(  1991, mtonic,    magical,  magical,  mtonic,   mtonic,    ROT0, "Pal Company",                            "Magical Odds (set 3, alt hardware)", GAME_WRONG_COLORS | GAME_NOT_WORKING |GAME_NO_SOUND) // Magical Odds logo / company in GFX
99219983
99229984
99239985/* --- Amcoe games --- */
src/mame/drivers/dbz.c
r8581r8582
340340{
341341   dbz_state *state = (dbz_state *)machine->driver_data;
342342
343   state->maincpu = devtag_get_device(machine, "maincpu");
344   state->audiocpu = devtag_get_device(machine, "audiocpu");
345   state->k053936_1 = devtag_get_device(machine, "k053936_1");
346   state->k053936_2 = devtag_get_device(machine, "k053936_2");
347   state->k056832 = devtag_get_device(machine, "k056832");
348   state->k053246 = devtag_get_device(machine, "k053246");
349   state->k053251 = devtag_get_device(machine, "k053251");
343   state->maincpu = machine->device("maincpu");
344   state->audiocpu = machine->device("audiocpu");
345   state->k053936_1 = machine->device("k053936_1");
346   state->k053936_2 = machine->device("k053936_2");
347   state->k056832 = machine->device("k056832");
348   state->k053246 = machine->device("k053246");
349   state->k053251 = machine->device("k053251");
350350
351351   state_save_register_global(machine, state->control);
352352   state_save_register_global(machine, state->sprite_colorbase);
src/mame/drivers/20pacgal.c
r8581r8582
280280{
281281   _20pacgal_state *state = (_20pacgal_state *)machine->driver_data;
282282
283   state->maincpu = devtag_get_device(machine, "maincpu");
284   state->eeprom = devtag_get_device(machine, "eeprom");
283   state->maincpu = machine->device("maincpu");
284   state->eeprom = machine->device("eeprom");
285285
286286   state_save_register_global(machine, state->game_selected);
287287   state_save_register_global_pointer(machine, state->ram_48000, 0x2000);
src/mame/drivers/seicross.c
r8581r8582
102102{
103103//logerror("PC %04x: 8910 port B = %02x\n",cpu_get_pc(space->cpu),data);
104104   /* bit 0 is IRQ enable */
105   cpu_interrupt_enable(devtag_get_device(device->machine, "maincpu"), data & 1);
105   cpu_interrupt_enable(device->machine->device("maincpu"), data & 1);
106106
107107   /* bit 1 flips screen */
108108
src/mame/drivers/spbactn.c
r8581r8582
5555 U112: TECMO-5
5656
5757 --- Team Japump!!! ---
58 http://www.rainemu.com/japump/
59 http://japump.i.am/
6058 Dumped by Noel Miruru
6159 17/Oct/2000
6260
src/mame/drivers/system16.c
r8581r8582
33123312
33133313   state->beautyb_unkx = 0;
33143314
3315   state->maincpu = devtag_get_device(machine, "maincpu");
3316   state->soundcpu = devtag_get_device(machine, "soundcpu");
3315   state->maincpu = machine->device("maincpu");
3316   state->soundcpu = machine->device("soundcpu");
33173317}
33183318
33193319/* Sys16A */
src/mame/drivers/nyny.c
r8581r8582
157157   /* update the different PIA pins from the input ports */
158158
159159   /* CA1 - copy of PA0 (COIN1) */
160   pia6821_ca1_w(state->pia1, 0, input_port_read(device->machine, "IN0") & 0x01);
160   pia6821_ca1_w(state->pia1, input_port_read(device->machine, "IN0") & 0x01);
161161
162162   /* CA2 - copy of PA1 (SERVICE1) */
163   pia6821_ca2_w(state->pia1, 0, input_port_read(device->machine, "IN0") & 0x02);
163   pia6821_ca2_w(state->pia1, input_port_read(device->machine, "IN0") & 0x02);
164164
165165   /* CB1 - (crosshatch) */
166   pia6821_cb1_w(state->pia1, 0, input_port_read(device->machine, "CROSS"));
166   pia6821_cb1_w(state->pia1, input_port_read(device->machine, "CROSS"));
167167
168168   /* CB2 - NOT CONNECTED */
169169}
r8581r8582
248248static WRITE8_DEVICE_HANDLER( ic48_1_74123_output_changed )
249249{
250250   nyny_state *state = (nyny_state *)device->machine->driver_data;
251   pia6821_ca1_w(state->pia2, 0, data);
251   pia6821_ca1_w(state->pia2, data);
252252}
253253
254254
r8581r8582
681681{
682682   nyny_state *state = (nyny_state *)machine->driver_data;
683683
684   state->maincpu = devtag_get_device(machine, "maincpu");
685   state->audiocpu = devtag_get_device(machine, "audiocpu");
686   state->audiocpu2 = devtag_get_device(machine, "audio2");
687   state->ic48_1 = devtag_get_device(machine, "ic48_1");
688   state->mc6845 = devtag_get_device(machine, "crtc");
689   state->pia1 = devtag_get_device(machine, "pia1");
690   state->pia2 = devtag_get_device(machine, "pia2");
684   state->maincpu = machine->device("maincpu");
685   state->audiocpu = machine->device("audiocpu");
686   state->audiocpu2 = machine->device("audio2");
687   state->ic48_1 = machine->device("ic48_1");
688   state->mc6845 = machine->device("crtc");
689   state->pia1 = machine->device("pia1");
690   state->pia2 = machine->device("pia2");
691691
692692   /* setup for save states */
693693   state_save_register_global(machine, state->flipscreen);
src/mame/drivers/limenko.c
r8581r8582
199199   if(spotty_sound_cmd == 0xf7)
200200      return soundlatch_r(space,0);
201201   else
202      return okim6295_r(devtag_get_device(space->machine, "oki"),0);
202      return okim6295_r(space->machine->device("oki"),0);
203203}
204204
205205static ADDRESS_MAP_START( spotty_sound_io_map, ADDRESS_SPACE_IO, 8 )
src/mame/drivers/actfancr.c
r8581r8582
280280{
281281   actfancr_state *state = (actfancr_state *)machine->driver_data;
282282
283   state->maincpu = devtag_get_device(machine, "maincpu");
284   state->audiocpu = devtag_get_device(machine, "audiocpu");
283   state->maincpu = machine->device("maincpu");
284   state->audiocpu = machine->device("audiocpu");
285285}
286286
287287static MACHINE_START( triothep )
src/mame/drivers/model1.c
r8581r8582
713713static void irq_init(running_machine *machine)
714714{
715715   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
716   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
716   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
717717}
718718
719719static INTERRUPT_GEN(model1_interrupt)
r8581r8582
838838
839839static READ16_HANDLER( snd_68k_ready_r )
840840{
841   int sr = cpu_get_reg(devtag_get_device(space->machine, "audiocpu"), M68K_SR);
841   int sr = cpu_get_reg(space->machine->device("audiocpu"), M68K_SR);
842842
843843   if ((sr & 0x0700) > 0x0100)
844844   {
src/mame/drivers/polepos.c
r8581r8582
133133CPU 8L    PP1-2       PP4-2       CPU 4L    136014-102                136014-177
134134   ?      PP1-3*      PP4-3*      CPU 3K    136014-112*               *
135135   ?      PP1-4*      PP4-4*      CPU 4K    136014-113*               *
136CPU 4M    PP1-5       PP4-5       CPU 3E    136014-103                136014-178
137CPU 4L    PP1-6       PP4-6       CPU 4E    136014-104                136014-179
136CPU 4M    PP1-5       PP4-5       CPU 3E    136014-103 or 136014-203  136014-178
137CPU 4L    PP1-6       PP4-6       CPU 4E    136014-104 or 136014-204  136014-179
138138CPU 3M    PP1-7*      PP4-7       CPU 3D    136014-114*               136014-184
139139CPU 3L    PP1-8*      PP4-8       CPU 4D    136014-115*               136014-185
140140CPU 6H    PP1-9       PP4-9       CPU 7H    136014-105 or 136014-160  136014-180
r8581r8582
149149   ?      PP1-2[pal]  <--         CPU 2N    PAL-1                     <--
150150   ?      PP1-3[pal]  <--         CPU 7C    PAL-3                     <--
151151CPU 9H    PP1-4[bpr]  <--         CPU 7L    136014-117                <--
152   ?      PP1-5[bpr]  <--         CPU 11D   136014-118                <--
152CPU 3B    PP1-5[bpr]  <--         CPU 11D   136014-118                <--
153153
154154VID 5N    PP1-17      <--         VID 13J   136014-119 == 136014-150  <--
155155VID 5M    PP1-18      <--         VID 12J   136014-120 == 136014-151  <--
r8581r8582
161161VID 2M    PP1-24*     PP4-24      VID 12M   136014-130*               136014-174
162162VID 1N    PP1-25      PP4-25      VID 13N   136014-125 or 136014-156  136014-170
163163VID 1M    PP1-26      PP4-26      VID 12N   136014-126 or 136014-157  136014-171
164   ?      PP1-27      <--         VID 11N   136014-131               <--
164VID 1L    PP1-27      <--         VID 11N   136014-131 or 136014-231  <--
165165VID 1F    PP1-28      PP4-28      VID 7N    136014-132 or 137205-001? 136014-172
166166VID 1E    PP1-29      PP4-29      VID 6N    136014-133 or 137205-001? 136014-173
167167VID 3A    PP1-30      <--         VID 2L    136014-127 == 136014-158  <--
r8581r8582
176176VID 3C    PP1-12[bpr] PP4-12[bpr] VID 4L    136014-145                136014-191
177177VID 8E    PP1-13[bpr] <--         VID 6E    136014-135                <--
178178VID 9E    PP1-14[bpr] <--         VID 6D    136014-136                <--
179   ?      PP1-15[bpr] <--         VID 2D    136014-142                <--
180   ?      PP1-16[bpr] <--         VID 2C    136014-143                <--
179VID 9A    PP1-15[bpr] <--         VID 2D    136014-142                <--
180VID 10A   PP1-16[bpr] <--         VID 2C    136014-143                <--
181181VID 11A   PP1-17[bpr] <--         VID 2B    136014-144                <--
182182
183183
r8581r8582
210210
211211Todo:
212212
213- the bootlegs without Namco devices (topracern, polepos2bi) still still require
213- the bootlegs without Namco devices (topracern, polepos2bi) still require
214214  our 06xx and 51xx emulation to boot, this is incorrect.
215- these sets also don't update the ingame gear artwork
216215
217216***************************************************************************/
218217
r8581r8582
225224#include "machine/namco51.h"
226225#include "machine/namco53.h"
227226#include "sound/namco.h"
228#include "sound/samples.h"
229227#include "audio/namco52.h"
230228#include "audio/namco54.h"
231229#include "includes/polepos.h"
232230#include "sound/tms5220.h"
233231
234232#include "polepos.lh"
233#include "topracer.lh"
235234
235
236#define MASTER_CLOCK   XTAL_24_576MHz
236237#define POLEPOS_TOGGLE   PORT_TOGGLE
237238
238239
r8581r8582
241242static INT16 steer_accum;
242243
243244
244
245245/*************************************************************************************/
246246/* Pole Position II protection                                                       */
247247/*************************************************************************************/
r8581r8582
304304   switch (offset)
305305   {
306306      case 0x00:   /* IRQON */
307         cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
307         cpu_interrupt_enable(space->machine->device("maincpu"), bit);
308308         if (!bit)
309309            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
310310         break;
r8581r8582
314314         break;
315315
316316      case 0x02:   /* CLSON */
317         polepos_sound_enable(devtag_get_device(space->machine, "namco"),bit);
317         polepos_sound_enable(space->machine->device("namco"),bit);
318318         if (!bit)
319319         {
320320            polepos_engine_sound_lsb_w(space, 0, 0);
r8581r8582
420420{
421421   /* read the current steering value and update our delta */
422422   UINT8 steer_new = input_port_read(device->machine, "STEER");
423   steer_accum += (INT8)(steer_new - steer_last);
423   steer_accum += (INT8)(steer_new - steer_last) * 2;
424424   steer_last = steer_new;
425425
426426   /* if we have delta, clock things */
427427   if (steer_accum < 0)
428428   {
429      steer_delta = 1;
429      steer_delta = 0;
430430      steer_accum++;
431431   }
432432   else if (steer_accum > 0)
433433   {
434      steer_delta = 0;
434      steer_delta = 1;
435435      steer_accum--;
436436   }
437   else
438      steer_delta ^= 1;
439437
440438   return steer_accum & 1;
441439}
r8581r8582
468466      polepos_latch_w(space, i, 0);
469467
470468   /* set the interrupt vectors (this shouldn't be needed) */
471   cpu_set_input_line_vector(devtag_get_device(machine, "sub"), 0, Z8000_NVI);
472   cpu_set_input_line_vector(devtag_get_device(machine, "sub2"), 0, Z8000_NVI);
469   cpu_set_input_line_vector(machine->device("sub"), 0, Z8000_NVI);
470   cpu_set_input_line_vector(machine->device("sub2"), 0, Z8000_NVI);
473471}
474472
475473
r8581r8582
604602
605603
606604static INPUT_PORTS_START( poleposa )
607   PORT_START("IN0L")
608   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
609   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
610   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(auto_start_r, NULL) // start 1, program controlled
611   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
605   PORT_INCLUDE( polepos )
612606
613   PORT_START("IN0H")
614   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
615   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
616   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
617   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
618
619   PORT_START("DSWA")
607   PORT_MODIFY("DSWA")
620608   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
621609   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
622610   PORT_DIPSETTING(   0x20, DEF_STR( 2C_1C ) )
r8581r8582
640628   PORT_DIPSETTING(   0x01, "3" )
641629   PORT_DIPSETTING(   0x00, "4" )
642630
643   PORT_START("DSWA_HI")
644   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(high_port_r, "DSWA")
645
646   PORT_START("DSWB")
631   PORT_MODIFY("DSWB")
647632   PORT_DIPNAME( 0xe0, 0xe0, "Practice Rank" )
648633   PORT_DIPSETTING(   0xe0, "A" )
649634   PORT_DIPSETTING(   0x60, "B" )
r8581r8582
668653   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
669654   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
670655   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
671
672   PORT_START("DSWB_HI")
673   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(high_port_r, "DSWB")
674
675   PORT_START("BRAKE")
676   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
677
678   PORT_START("ACCEL")
679   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
680
681   PORT_START("STEER")
682   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(4)
683656INPUT_PORTS_END
684657
685658
r8581r8582
726699   PORT_START("DSWA_HI")
727700   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(high_port_r, "DSWA")
728701
702   /* FIXME: these dips don't work and may not even exist on this bootleg */
729703   PORT_START("DSWB")
730704   PORT_DIPNAME( 0x07, 0x07, "Extended Rank" )
731705   PORT_DIPSETTING(   0x07, "A" )
r8581r8582
767741
768742
769743static INPUT_PORTS_START( polepos2 )
770   PORT_START("IN0L")
771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
772   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
773   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(auto_start_r, NULL)   // start 1, program controlled
774   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
744   PORT_INCLUDE( polepos )
775745
776   PORT_START("IN0H")
777   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
778   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
779   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
780   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
781
782   PORT_START("DSWA")
746   PORT_MODIFY("DSWA")
783747   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
784748   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
785749   PORT_DIPSETTING(   0x20, DEF_STR( 2C_1C ) )
r8581r8582
804768   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
805769   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
806770
807   PORT_START("DSWA_HI")
808   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(high_port_r, "DSWA")
809
810   PORT_START("DSWB")
771   PORT_MODIFY("DSWB")
811772   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Game_Time ) )
812773   PORT_DIPSETTING(   0x80, "90 secs." )
813774   PORT_DIPSETTING(   0x00, "120 secs." )
r8581r8582
829790   PORT_DIPNAME( 0x01, 0x01, "Speed" )
830791   PORT_DIPSETTING(   0x01, "Average" )
831792   PORT_DIPSETTING(   0x00, DEF_STR( High ) )
832
833   PORT_START("DSWB_HI")
834   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(high_port_r, "DSWB")
835
836   PORT_START("BRAKE")
837   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
838
839   PORT_START("ACCEL")
840   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
841
842   PORT_START("STEER")
843   PORT_BIT ( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(4)
844793INPUT_PORTS_END
845794
846795
r8581r8582
917866static MACHINE_DRIVER_START( polepos )
918867
919868   /* basic machine hardware */
920   MDRV_CPU_ADD("maincpu", Z80, 24576000/8)   /* 3.072 MHz */
869   MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/8)   /* 3.072 MHz */
921870   MDRV_CPU_PROGRAM_MAP(z80_map)
922871   MDRV_CPU_IO_MAP(z80_io)
923872   MDRV_CPU_VBLANK_INT_HACK(irq0_line_assert,2)   /* 64V */
924873
925   MDRV_CPU_ADD("sub", Z8002, 24576000/8)   /* 3.072 MHz */
874   MDRV_CPU_ADD("sub", Z8002, MASTER_CLOCK/8)   /* 3.072 MHz */
926875   MDRV_CPU_PROGRAM_MAP(z8002_map)
927876   MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)
928877
929   MDRV_CPU_ADD("sub2", Z8002, 24576000/8)   /* 3.072 MHz */
878   MDRV_CPU_ADD("sub2", Z8002, MASTER_CLOCK/8)   /* 3.072 MHz */
930879   MDRV_CPU_PROGRAM_MAP(z8002_map)
931880   MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)
932881
933   MDRV_NAMCO_51XX_ADD("51xx", 18432000/6/2, namco_51xx_intf)      /* 1.536 MHz */
934   MDRV_NAMCO_52XX_ADD("52xx", 18432000/6/2, namco_52xx_intf)      /* 1.536 MHz */
935   MDRV_NAMCO_53XX_ADD("53xx", 18432000/6/2, namco_53xx_intf)      /* 1.536 MHz */
936   MDRV_NAMCO_54XX_ADD("54xx", 18432000/6/2, "discrete", NODE_01)   /* 1.536 MHz */
882   MDRV_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2, namco_51xx_intf)      /* 1.536 MHz */
883   MDRV_NAMCO_52XX_ADD("52xx", MASTER_CLOCK/8/2, namco_52xx_intf)      /* 1.536 MHz */
884   MDRV_NAMCO_53XX_ADD("53xx", MASTER_CLOCK/8/2, namco_53xx_intf)      /* 1.536 MHz */
885   MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/8/2, "discrete", NODE_01)   /* 1.536 MHz */
937886
938   MDRV_NAMCO_06XX_ADD("06xx", 18432000/6/64, "maincpu", "51xx", "53xx", "52xx", "54xx")
887   MDRV_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/8/64, "maincpu", "51xx", "53xx", "52xx", "54xx")
939888
940889   MDRV_WATCHDOG_VBLANK_INIT(16)   // 128V clocks the same as VBLANK
941890
r8581r8582
946895
947896   /* video hardware */
948897   MDRV_SCREEN_ADD("screen", RASTER)
949   MDRV_SCREEN_REFRESH_RATE(60.606060)
898   MDRV_SCREEN_REFRESH_RATE((double)MASTER_CLOCK/4/384/264)
950899   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
951900   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
952901   MDRV_SCREEN_SIZE(32*8, 32*8)
953902   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
954903
904   /* should be correct, but makes polepos2 and clones fail to boot */
905//  MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 384, 0, 256, 264, 16, 224+16)
906
955907   MDRV_GFXDECODE(polepos)
956908   MDRV_PALETTE_LENGTH(0x0f00)
957909   MDRV_DEFAULT_LAYOUT(layout_polepos)
r8581r8582
963915   /* sound hardware */
964916   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
965917
966   MDRV_SOUND_ADD("namco", NAMCO, 24576000/512)
918   MDRV_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/512)
967919   MDRV_SOUND_CONFIG(namco_config)
968920   MDRV_SOUND_ROUTE(0, "lspeaker", 0.80)
969921   MDRV_SOUND_ROUTE(1, "rspeaker", 0.80)
r8581r8582
1000952static MACHINE_DRIVER_START( topracern )
1001953
1002954   /* basic machine hardware */
1003   MDRV_CPU_ADD("maincpu", Z80, 24576000/8)   /* 3.072 MHz */
955   MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/8)   /* 3.072 MHz */
1004956   MDRV_CPU_PROGRAM_MAP(z80_map)
1005957   MDRV_CPU_IO_MAP(z80_io)
1006958   MDRV_CPU_VBLANK_INT_HACK(irq0_line_assert,2)   /* 64V */
1007959
1008   MDRV_CPU_ADD("sub", Z8002, 24576000/8)   /* 3.072 MHz */
960   MDRV_CPU_ADD("sub", Z8002, MASTER_CLOCK/8)   /* 3.072 MHz */
1009961   MDRV_CPU_PROGRAM_MAP(z8002_map)
1010962   MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)
1011963
1012   MDRV_CPU_ADD("sub2", Z8002, 24576000/8)   /* 3.072 MHz */
964   MDRV_CPU_ADD("sub2", Z8002, MASTER_CLOCK/8)   /* 3.072 MHz */
1013965   MDRV_CPU_PROGRAM_MAP(z8002_map)
1014966   MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)
1015967
1016968   /* todo, remove these devices too, this bootleg doesn't have them, but the emulation doesn't boot without them.. */
1017   MDRV_NAMCO_51XX_ADD("51xx", 18432000/6/2, namco_51xx_bl_intf)      /* 1.536 MHz */
1018   MDRV_NAMCO_06XX_ADD("06xx", 18432000/6/64, "maincpu", "51xx", NULL, NULL, NULL)
969   MDRV_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2, namco_51xx_bl_intf)      /* 1.536 MHz */
970   MDRV_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/8/64, "maincpu", "51xx", NULL, NULL, NULL)
1019971
1020972   MDRV_WATCHDOG_VBLANK_INIT(16)   // 128V clocks the same as VBLANK
1021973
r8581r8582
1026978
1027979   /* video hardware */
1028980   MDRV_SCREEN_ADD("screen", RASTER)
1029   MDRV_SCREEN_REFRESH_RATE(60.606060)
981   MDRV_SCREEN_REFRESH_RATE((double)MASTER_CLOCK/4/384/264)
1030982   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
1031983   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1032984   MDRV_SCREEN_SIZE(32*8, 32*8)
r8581r8582
1034986
1035987   MDRV_GFXDECODE(polepos)
1036988   MDRV_PALETTE_LENGTH(0x0f00)
1037   MDRV_DEFAULT_LAYOUT(layout_polepos)
989   MDRV_DEFAULT_LAYOUT(layout_topracer)
1038990
1039991   MDRV_PALETTE_INIT(polepos)
1040992   MDRV_VIDEO_START(polepos)
r8581r8582
1043995   /* sound hardware */
1044996   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1045997
1046   MDRV_SOUND_ADD("namco", NAMCO, 24576000/512)
998   MDRV_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/512)
1047999   MDRV_SOUND_CONFIG(namco_config)
10481000   MDRV_SOUND_ROUTE(0, "lspeaker", 0.80)
10491001   MDRV_SOUND_ROUTE(1, "rspeaker", 0.80)
r8581r8582
10671019static MACHINE_DRIVER_START( polepos2bi )
10681020   MDRV_IMPORT_FROM(topracern)
10691021
1070   MDRV_CPU_ADD("soundz80bl", Z80, 24576000/8)   /*? MHz */
1022   MDRV_CPU_ADD("soundz80bl", Z80, MASTER_CLOCK/8)   /*? MHz */
10711023   MDRV_CPU_PROGRAM_MAP(sound_z80_bootleg_map)
10721024   MDRV_CPU_IO_MAP(sound_z80_bootleg_iomap)
10731025
r8581r8582
10901042   /* Z80 memory/ROM data */
10911043   ROM_REGION( 0x10000, "maincpu", 0 )
10921044   ROM_LOAD( "pp1_9b.6h",    0x0000, 0x2000, CRC(94436b70) SHA1(7495c2a8c3928c59146760d19e672afee01c5b17) )
1093   ROM_LOAD( "136014.116",   0x2000, 0x1000, CRC(7174bcb7) SHA1(460326a6cea201db2df813013c95562a222ea95d) )
1045   ROM_LOAD( "pp1_10b.5h",   0x2000, 0x1000, CRC(7174bcb7) SHA1(460326a6cea201db2df813013c95562a222ea95d) )
10941046
10951047   /* Z8002 #1 memory/ROM data */
10961048   ROM_REGION( 0x10000, "sub", 0 )
1097   ROM_LOAD16_BYTE( "pp1_1b.8m",     0x0001, 0x2000, CRC(361c56dd) SHA1(6e4abf98b10077c6980e8aa3861f0233135ea68f) )
1098   ROM_LOAD16_BYTE( "pp1_2b.8l",     0x0000, 0x2000, CRC(582b530a) SHA1(4fc38aa8b70816e14b321ec778090f6c7e7f1640) )
1049   ROM_LOAD16_BYTE( "pp1_1b.8m",    0x0001, 0x2000, CRC(361c56dd) SHA1(6e4abf98b10077c6980e8aa3861f0233135ea68f) )
1050   ROM_LOAD16_BYTE( "pp1_2b.8l",    0x0000, 0x2000, CRC(582b530a) SHA1(4fc38aa8b70816e14b321ec778090f6c7e7f1640) )
10991051
11001052   /* Z8002 #2 memory/ROM data */
11011053   ROM_REGION( 0x10000, "sub2", 0 )
1102   ROM_LOAD16_BYTE( "pp1_5b.4m",     0x0001, 0x2000, CRC(5cdf5294) SHA1(dbdf327a541fd71aadafda9c925fa4cf7f7c4a24) )
1103   ROM_LOAD16_BYTE( "pp1_6b.4l",     0x0000, 0x2000, CRC(81696272) SHA1(27041a7c24297a6f317537c44922b51d2b2278a6) )
1054   ROM_LOAD16_BYTE( "pp1_5b.4m",    0x0001, 0x2000, CRC(5cdf5294) SHA1(dbdf327a541fd71aadafda9c925fa4cf7f7c4a24) )
1055   ROM_LOAD16_BYTE( "pp1_6b.4l",    0x0000, 0x2000, CRC(81696272) SHA1(27041a7c24297a6f317537c44922b51d2b2278a6) )
11041056
11051057   /* graphics data */
11061058   ROM_REGION( 0x01000, "gfx1", 0 )   /* 2bpp alpha layer */
1107   ROM_LOAD( "pp1_28.1f",    0x0000, 0x1000, CRC(5b277daf) SHA1(0b1feeb2c0c63a5db5ba9b0115aa1b2388636a70) )
1059   ROM_LOAD( "pp1_28.1f",    0x0000, 0x1000, CRC(5b277daf) SHA1(0b1feeb2c0c63a5db5ba9b0115aa1b2388636a70) )
11081060
11091061   ROM_REGION( 0x01000, "gfx2", 0 )   /* 2bpp view layer */
1110   ROM_LOAD( "pp1_29.1e",    0x0000, 0x1000, CRC(706e888a) SHA1(af1aa2199fcf73a3afbe760857ff117865350954) )
1062   ROM_LOAD( "pp1_29.1e",    0x0000, 0x1000, CRC(706e888a) SHA1(af1aa2199fcf73a3afbe760857ff117865350954) )
11111063
11121064   ROM_REGION( 0x04000, "gfx3", 0 )   /* 4bpp 16x16 sprites */
1113   ROM_LOAD( "pp1_25.1n",     0x0000, 0x2000, CRC(ac8e28c1) SHA1(13bc2bf4be28d9ae987f79034f9532272b3a2543) )    /* 4bpp sm sprites, planes 0+1 */
1114   ROM_LOAD( "pp1_26.1m",     0x2000, 0x2000, CRC(94443079) SHA1(413d7b762c8dff541675e96874be6ee0251d3581) )    /* 4bpp sm sprites, planes 2+3 */
1065   ROM_LOAD( "pp1_25.1n",    0x0000, 0x2000, CRC(ac8e28c1) SHA1(13bc2bf4be28d9ae987f79034f9532272b3a2543) )    /* 4bpp sm sprites, planes 0+1 */
1066   ROM_LOAD( "pp1_26.1m",    0x2000, 0x2000, CRC(94443079) SHA1(413d7b762c8dff541675e96874be6ee0251d3581) )    /* 4bpp sm sprites, planes 2+3 */
11151067
11161068   ROM_REGION( 0x10000, "gfx4", 0 )   /* 4bpp 32x32 sprites */
1117   ROM_LOAD( "136014.150",   0x0000, 0x2000, CRC(2e134b46) SHA1(0938f5f9f5cc6d7c1096c569449db78dbc42da01) )    /* 4bpp lg sprites, planes 0+1 */
1069   ROM_LOAD( "pp1_17.5n",    0x0000, 0x2000, CRC(2e134b46) SHA1(0938f5f9f5cc6d7c1096c569449db78dbc42da01) )    /* 4bpp lg sprites, planes 0+1 */
11181070   ROM_LOAD( "pp1_19.4n",    0x2000, 0x2000, CRC(43ff83e1) SHA1(8f830549a629b019125e59801e5027e4e4b3c0f2) )
11191071   ROM_LOAD( "pp1_21.3n",    0x4000, 0x2000, CRC(5f958eb4) SHA1(b56d84e5e5e0ddeb0e71851ba66e5fa1b1409551) )
1120   ROM_LOAD( "136014.151",   0x8000, 0x2000, CRC(6f9997d2) SHA1(b26d505266ccf23bfd867f881756c3251c80f57b) )    /* 4bpp lg sprites, planes 2+3 */
1072   ROM_LOAD( "pp1_18.5m",    0x8000, 0x2000, CRC(6f9997d2) SHA1(b26d505266ccf23bfd867f881756c3251c80f57b) )    /* 4bpp lg sprites, planes 2+3 */
11211073   ROM_LOAD( "pp1_20.4m",    0xa000, 0x2000, CRC(ec18075b) SHA1(af7be549c5fa47551a8dca4c0a531552147fa50f) )
11221074   ROM_LOAD( "pp1_22.3m",    0xc000, 0x2000, CRC(1d2f30b1) SHA1(1d88a3069e9b15febd2835dd63e5511b3b2a6b45) )
11231075
11241076   ROM_REGION( 0x5000, "gfx5", 0 )    /* road generation ROMs needed at runtime */
1125   ROM_LOAD( "136014.158",   0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) )    /* road control */
1126   ROM_LOAD( "136014.159",   0x2000, 0x2000, CRC(6d1e7042) SHA1(90113ff0c93ed86d95067290088705bb5e6608d1) )    /* road bits 1 */
1127   ROM_LOAD( "136014.134",   0x4000, 0x1000, CRC(4e97f101) SHA1(f377d053821c74aee93ebcd30a4d43e6156f3cfe) )    /* road bits 2 */
1077   ROM_LOAD( "pp1_30.3a",    0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) )    /* road control */
1078   ROM_LOAD( "pp1_31.2a",    0x2000, 0x2000, CRC(6d1e7042) SHA1(90113ff0c93ed86d95067290088705bb5e6608d1) )    /* road bits 1 */
1079   ROM_LOAD( "pp1_32.1a",    0x4000, 0x1000, CRC(4e97f101) SHA1(f377d053821c74aee93ebcd30a4d43e6156f3cfe) )    /* road bits 2 */
11281080
11291081   ROM_REGION( 0x1000, "gfx6", 0 )    /* sprite scaling */
1130   ROM_LOAD( "136014.231",   0x0000, 0x1000, CRC(a61bff15) SHA1(f7a59970831cdaaa7bf59c2221a38e4746c54244) )    /* vertical scaling */
1082   ROM_LOAD( "pp1_27.1l",    0x0000, 0x1000, CRC(a61bff15) SHA1(f7a59970831cdaaa7bf59c2221a38e4746c54244) )    /* vertical scaling */
11311083
11321084   /* graphics (P)ROM data */
11331085   ROM_REGION( 0x1040, "proms", 0 )
1134   ROM_LOAD( "136014.137",   0x0000, 0x0100, CRC(f07ff2ad) SHA1(e1f3cb10a03d23f8c1d422acf271dba4e7b98cb1) )    /* red palette */
1135   ROM_LOAD( "136014.138",   0x0100, 0x0100, CRC(adbde7d7) SHA1(956ac5117c1e310f554ac705aa2dc24a796c36a5) )    /* green palette */
1136   ROM_LOAD( "136014.139",   0x0200, 0x0100, CRC(ddac786a) SHA1(d1860105bf91297533ccc4aa6775987df198d0fa) )    /* blue palette */
1137   ROM_LOAD( "136014.140",   0x0300, 0x0100, CRC(1e8d0491) SHA1(e8bf1db5c1fb04a35763099965cf5c588240bde5) )    /* alpha color */
1138   ROM_LOAD( "136014.141",   0x0400, 0x0100, CRC(0e4fe8a0) SHA1(d330b1e5ebccf5bbefcf71486fd80d816de38196) )    /* background color */
1139   ROM_LOAD( "136014.142",   0x0500, 0x0100, CRC(2d502464) SHA1(682b7dd22e51d5db52c0804b7e27e47641dfa6bd) )    /* vertical position low */
1140   ROM_LOAD( "136014.143",   0x0600, 0x0100, CRC(027aa62c) SHA1(c7030d8b64b80e107c446f6fbdd63f560c0a91c0) )    /* vertical position med */
1141   ROM_LOAD( "136014.144",   0x0700, 0x0100, CRC(1f8d0df3) SHA1(b8f17758f114f5e247b65b3f2922ca2660757e66) )    /* vertical position hi */
1142   ROM_LOAD( "136014.145",   0x0800, 0x0400, CRC(7afc7cfc) SHA1(ba2407f6eff124e881b354f13205a4c058b7cf60) )    /* road color */
1086   ROM_LOAD( "pp1_7.bpr",    0x0000, 0x0100, CRC(f07ff2ad) SHA1(e1f3cb10a03d23f8c1d422acf271dba4e7b98cb1) )    /* red palette */
1087   ROM_LOAD( "pp1_8.bpr",    0x0100, 0x0100, CRC(adbde7d7) SHA1(956ac5117c1e310f554ac705aa2dc24a796c36a5) )    /* green palette */
1088   ROM_LOAD( "pp1_9.bpr",    0x0200, 0x0100, CRC(ddac786a) SHA1(d1860105bf91297533ccc4aa6775987df198d0fa) )    /* blue palette */
1089   ROM_LOAD( "pp1_10.bpr",   0x0300, 0x0100, CRC(1e8d0491) SHA1(e8bf1db5c1fb04a35763099965cf5c588240bde5) )    /* alpha color */
1090   ROM_LOAD( "pp1_11.bpr",   0x0400, 0x0100, CRC(0e4fe8a0) SHA1(d330b1e5ebccf5bbefcf71486fd80d816de38196) )    /* background color */
1091   ROM_LOAD( "pp1_15.bpr",   0x0500, 0x0100, CRC(2d502464) SHA1(682b7dd22e51d5db52c0804b7e27e47641dfa6bd) )    /* vertical position low */
1092   ROM_LOAD( "pp1_16.bpr",   0x0600, 0x0100, CRC(027aa62c) SHA1(c7030d8b64b80e107c446f6fbdd63f560c0a91c0) )    /* vertical position med */
1093   ROM_LOAD( "pp1_17.bpr",   0x0700, 0x0100, CRC(1f8d0df3) SHA1(b8f17758f114f5e247b65b3f2922ca2660757e66) )    /* vertical position hi */
1094   ROM_LOAD( "pp1_12.bpr",   0x0800, 0x0400, CRC(7afc7cfc) SHA1(ba2407f6eff124e881b354f13205a4c058b7cf60) )    /* road color */
11431095   ROM_LOAD( "pp1_6.bpr",    0x0c00, 0x0400, CRC(2f1079ee) SHA1(18a27998a78deff13dd198f3668a7e92f084f467) )    /* sprite color */
1144   ROM_LOAD( "136014.135",   0x1000, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
1145   ROM_LOAD( "136014.136",   0x1020, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
1096   ROM_LOAD( "pp1_13.bpr",   0x1000, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
1097   ROM_LOAD( "pp1_14.bpr",   0x1020, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
11461098
11471099   /* sound (P)ROM data */
11481100   ROM_REGION( 0x0100, "namco", 0 )
1149   ROM_LOAD( "136014.118",   0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) )    /* Namco sound */
1101   ROM_LOAD( "pp1_5.bpr",    0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) )    /* Namco sound */
11501102
11511103   ROM_REGION( 0x4000, "engine", 0 )
1152   ROM_LOAD( "136014.110",   0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
1153   ROM_LOAD( "136014.111",   0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
1104   ROM_LOAD( "pp1_15.6a",    0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
1105   ROM_LOAD( "pp1_16.5a",    0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
11541106
11551107   ROM_REGION( 0x8000, "52xx", 0 )
11561108   ROM_LOAD( "pp1_11.2e",    0x0000, 0x2000, CRC(45b9bfeb) SHA1(ff8c690471944d414931fb88666594ef608997f8) )    /* voice */
r8581r8582
11601112
11611113   /* unknown or unused (P)ROM data */
11621114   ROM_REGION( 0x0100, "user1", 0 )
1163   ROM_LOAD( "136014.117",   0x0000, 0x0100, CRC(2401c817) SHA1(8991b7994513a469e64392fa8f233af5e5f06d54) )    /* sync chain */
1115   ROM_LOAD( "pp1_4.bpr",    0x0000, 0x0100, CRC(2401c817) SHA1(8991b7994513a469e64392fa8f233af5e5f06d54) )    /* sync chain */
11641116ROM_END
11651117
11661118/*
r8581r8582
14581410   ROM_LOAD( "tr21.bin",     0x4000, 0x2000, CRC(17c798b0) SHA1(ae2047bc0e4e8c85e1de09c39c200ea8f7c6a72e) )
14591411   ROM_LOAD( "pp18.bin",     0x8000, 0x2000, CRC(5fd933e3) SHA1(5b27a8519234c935308f943cd58abc1efc463726) )    /* 4bpp lg sprites, planes 2+3 */
14601412   ROM_LOAD( "tr20.bin",     0xa000, 0x2000, CRC(7053e219) SHA1(97700fbe887e2d11c9f9a0937147725f6787f081) )
1461   ROM_LOAD( "tr22.bin",     0xc000, 0x2000, CRC(f48917b2) SHA1(2823cfc33ae97ef979d92e2eeeb94c95f1f3d9f3) )
1413//  ROM_LOAD( "tr22.bin",     0xc000, 0x2000, CRC(f48917b2) SHA1(2823cfc33ae97ef979d92e2eeeb94c95f1f3d9f3) )    /* differs by one bit, almost certainly bitrot */
1414   ROM_LOAD( "tr22.bin",     0xc000, 0x2000, CRC(5fe9b365) SHA1(1a3ac099a6bb506a5f71c12c6fb14d014172371c) )
14621415
14631416   ROM_REGION( 0x5000, "gfx5", 0 )    /* road generation ROMs needed at runtime */
14641417   ROM_LOAD( "136014.158",   0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) )    /* road control */
r8581r8582
16871640ROM_START( polepos2 )
16881641   /* Z80 memory/ROM data */
16891642   ROM_REGION( 0x10000, "maincpu", 0 )
1690   ROM_LOAD( "pp4_9.6h",      0x0000, 0x2000, CRC(bcf87004) SHA1(0c60cbb777fe72dfd11c6f3e9da806a515cd0f8a) )
1691   ROM_LOAD( "136014.183",    0x2000, 0x1000, CRC(a9d4c380) SHA1(6048a8e858824936901e8e3e6b65d7505ccd82b4) )
1643   ROM_LOAD( "pp4_9.6h",     0x0000, 0x2000, CRC(bcf87004) SHA1(0c60cbb777fe72dfd11c6f3e9da806a515cd0f8a) )
1644   ROM_LOAD( "pp4_10.5h",    0x2000, 0x1000, CRC(a9d4c380) SHA1(6048a8e858824936901e8e3e6b65d7505ccd82b4) )
16921645
16931646   /* Z8002 #1 memory/ROM data */
16941647   ROM_REGION( 0x10000, "sub", 0 )
1695   ROM_LOAD16_BYTE( "pp4_1.8m",      0x0001, 0x2000, CRC(3f6ac294) SHA1(414ea7e43e62a573ad8971a7045f61eb997cf94e) )
1696   ROM_LOAD16_BYTE( "pp4_2.8l",      0x0000, 0x2000, CRC(51b9a669) SHA1(563ba42098d330801a992cd9c008c4cbbb993530) )
1648   ROM_LOAD16_BYTE( "pp4_1.8m",     0x0001, 0x2000, CRC(3f6ac294) SHA1(414ea7e43e62a573ad8971a7045f61eb997cf94e) )
1649   ROM_LOAD16_BYTE( "pp4_2.8l",     0x0000, 0x2000, CRC(51b9a669) SHA1(563ba42098d330801a992cd9c008c4cbbb993530) )
16971650
16981651   /* Z8002 #2 memory/ROM data */
16991652   ROM_REGION( 0x10000, "sub2", 0 )
1700   ROM_LOAD16_BYTE( "pp4_5.4m",      0x0001, 0x2000, CRC(c3053cae) SHA1(f42cf61fe696dd7e282b29e2234ea7f487ec2372) )
1701   ROM_LOAD16_BYTE( "pp4_6.4l",      0x0000, 0x2000, CRC(38d04e0f) SHA1(5527cb1864248208b10d219a50ad742f286a119f) )
1702   ROM_LOAD16_BYTE( "pp4_7.3m",      0x4001, 0x1000, CRC(ad1c8994) SHA1(2877de9641516767170c0109900955cc7d1ff402) )
1703   ROM_LOAD16_BYTE( "pp4_8.3l",      0x4000, 0x1000, CRC(ef25a2ee) SHA1(45959355cad1a48f19ae14193374e03d4f9965c7) )
1653   ROM_LOAD16_BYTE( "pp4_5.4m",     0x0001, 0x2000, CRC(c3053cae) SHA1(f42cf61fe696dd7e282b29e2234ea7f487ec2372) )
1654   ROM_LOAD16_BYTE( "pp4_6.4l",     0x0000, 0x2000, CRC(38d04e0f) SHA1(5527cb1864248208b10d219a50ad742f286a119f) )
1655   ROM_LOAD16_BYTE( "pp4_7.3m",     0x4001, 0x1000, CRC(ad1c8994) SHA1(2877de9641516767170c0109900955cc7d1ff402) )
1656   ROM_LOAD16_BYTE( "pp4_8.3l",     0x4000, 0x1000, CRC(ef25a2ee) SHA1(45959355cad1a48f19ae14193374e03d4f9965c7) )
17041657
17051658   /* graphics data */
17061659   ROM_REGION( 0x02000, "gfx1", 0 )   /* 2bpp alpha layer */
1707   ROM_LOAD( "pp4_28.1f",    0x0000, 0x2000, CRC(280dde7d) SHA1(b7c7fb3a5076aa4d0e0cf3256ece9a6194315626) )
1660   ROM_LOAD( "pp4_28.1f",    0x0000, 0x2000, CRC(280dde7d) SHA1(b7c7fb3a5076aa4d0e0cf3256ece9a6194315626) )
17081661
17091662   ROM_REGION( 0x02000, "gfx2", 0 )   /* 2bpp view layer */
1710   ROM_LOAD( "136014.173",   0x0000, 0x2000, CRC(ec3ec6e6) SHA1(ae905d0ae802d1010b2c1f1a13e88a1f0dbe57da) )
1663   ROM_LOAD( "pp4_29.1e",    0x0000, 0x2000, CRC(ec3ec6e6) SHA1(ae905d0ae802d1010b2c1f1a13e88a1f0dbe57da) )
17111664
17121665   ROM_REGION( 0x04000, "gfx3", 0 )   /* 4bpp 16x16 sprites */
1713   ROM_LOAD( "pp4_25.1n",     0x0000, 0x2000, CRC(fd098e65) SHA1(2c497f1d278ba6730752706a0d1b5a5a0fec3d5b) )    /* 4bpp sm sprites, planes 0+1 */
1714   ROM_LOAD( "pp4_26.1m",     0x2000, 0x2000, CRC(35ac62b3) SHA1(21038a78eb73d520e3e1ae8e1c0047d06b94cdab) )    /* 4bpp sm sprites, planes 2+3 */
1666   ROM_LOAD( "pp4_25.1n",    0x0000, 0x2000, CRC(fd098e65) SHA1(2c497f1d278ba6730752706a0d1b5a5a0fec3d5b) )    /* 4bpp sm sprites, planes 0+1 */
1667   ROM_LOAD( "pp4_26.1m",    0x2000, 0x2000, CRC(35ac62b3) SHA1(21038a78eb73d520e3e1ae8e1c0047d06b94cdab) )    /* 4bpp sm sprites, planes 2+3 */
17151668
17161669   ROM_REGION( 0x10000, "gfx4", 0 )   /* 4bpp 32x32 sprites */
1717   ROM_LOAD( "136014.119",  0x0000, 0x2000, CRC(2e134b46) SHA1(0938f5f9f5cc6d7c1096c569449db78dbc42da01) )    /* 4bpp lg sprites, planes 0+1 */
1718   ROM_LOAD( "pp1_19.4n",     0x2000, 0x2000, CRC(43ff83e1) SHA1(8f830549a629b019125e59801e5027e4e4b3c0f2) )
1719   ROM_LOAD( "pp1_21.3n",     0x4000, 0x2000, CRC(5f958eb4) SHA1(b56d84e5e5e0ddeb0e71851ba66e5fa1b1409551) )
1720   ROM_LOAD( "pp4_23.2n",     0x6000, 0x2000, CRC(9e056fcd) SHA1(8545e0a9b6ebf8c2903321ceb9c4d693db10d750) )
1721   ROM_LOAD( "136014.120",  0x8000, 0x2000, CRC(6f9997d2) SHA1(b26d505266ccf23bfd867f881756c3251c80f57b) )    /* 4bpp lg sprites, planes 2+3 */
1722   ROM_LOAD( "pp1_20.4m",     0xa000, 0x2000, CRC(ec18075b) SHA1(af7be549c5fa47551a8dca4c0a531552147fa50f) )
1723   ROM_LOAD( "pp1_22.3m",     0xc000, 0x2000, CRC(1d2f30b1) SHA1(1d88a3069e9b15febd2835dd63e5511b3b2a6b45) )
1724   ROM_LOAD( "pp4_24.2m",     0xe000, 0x2000, CRC(795268cf) SHA1(84136142ef4bdcd97ede2209ecb16745960ac393) )
1670   ROM_LOAD( "pp1_17.5n",    0x0000, 0x2000, CRC(2e134b46) SHA1(0938f5f9f5cc6d7c1096c569449db78dbc42da01) )    /* 4bpp lg sprites, planes 0+1 */
1671   ROM_LOAD( "pp1_19.4n",    0x2000, 0x2000, CRC(43ff83e1) SHA1(8f830549a629b019125e59801e5027e4e4b3c0f2) )
1672   ROM_LOAD( "pp1_21.3n",    0x4000, 0x2000, CRC(5f958eb4) SHA1(b56d84e5e5e0ddeb0e71851ba66e5fa1b1409551) )
1673   ROM_LOAD( "pp4_23.2n",    0x6000, 0x2000, CRC(9e056fcd) SHA1(8545e0a9b6ebf8c2903321ceb9c4d693db10d750) )
1674   ROM_LOAD( "pp1_18.5m",    0x8000, 0x2000, CRC(6f9997d2) SHA1(b26d505266ccf23bfd867f881756c3251c80f57b) )    /* 4bpp lg sprites, planes 2+3 */
1675   ROM_LOAD( "pp1_20.4m",    0xa000, 0x2000, CRC(ec18075b) SHA1(af7be549c5fa47551a8dca4c0a531552147fa50f) )
1676   ROM_LOAD( "pp1_22.3m",    0xc000, 0x2000, CRC(1d2f30b1) SHA1(1d88a3069e9b15febd2835dd63e5511b3b2a6b45) )
1677   ROM_LOAD( "pp4_24.2m",    0xe000, 0x2000, CRC(795268cf) SHA1(84136142ef4bdcd97ede2209ecb16745960ac393) )
17251678
17261679   ROM_REGION( 0x5000, "gfx5", 0 )    /* road generation ROMs needed at runtime */
1727   ROM_LOAD( "136014.127",   0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) )    /* road control */
1728   ROM_LOAD( "136014.128",   0x2000, 0x2000, CRC(6d1e7042) SHA1(90113ff0c93ed86d95067290088705bb5e6608d1) )    /* road bits 1 */
1729   ROM_LOAD( "136014.134",   0x4000, 0x1000, CRC(4e97f101) SHA1(f377d053821c74aee93ebcd30a4d43e6156f3cfe) )    /* road bits 2 */
1680   ROM_LOAD( "pp1_30.3a",    0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) )    /* road control */
1681   ROM_LOAD( "pp1_31.2a",    0x2000, 0x2000, CRC(6d1e7042) SHA1(90113ff0c93ed86d95067290088705bb5e6608d1) )    /* road bits 1 */
1682   ROM_LOAD( "pp1_32.1a",    0x4000, 0x1000, CRC(4e97f101) SHA1(f377d053821c74aee93ebcd30a4d43e6156f3cfe) )    /* road bits 2 */
17301683
17311684   ROM_REGION( 0x1000, "gfx6", 0 )    /* sprite scaling */
1732   ROM_LOAD( "136014.231",   0x0000, 0x1000, CRC(a61bff15) SHA1(f7a59970831cdaaa7bf59c2221a38e4746c54244) )    /* vertical scaling */
1685   ROM_LOAD( "pp1_27.1l",    0x0000, 0x1000, CRC(a61bff15) SHA1(f7a59970831cdaaa7bf59c2221a38e4746c54244) )    /* vertical scaling */
17331686
17341687   /* graphics (P)ROM data */
17351688   ROM_REGION( 0x1040, "proms", 0 )
1736   ROM_LOAD( "136014.186",   0x0000, 0x0100, CRC(16d69c31) SHA1(f24b345448e4f4ef4e2f3b057b81d399cf427f88) )    /* red palette */
1737   ROM_LOAD( "136014.187",   0x0100, 0x0100, CRC(07340311) SHA1(3820d1fa99013ed18de5d9400ad376cc446d1217) )    /* green palette */
1738   ROM_LOAD( "136014.188",   0x0200, 0x0100, CRC(1efc84d7) SHA1(6946e1c209eec0a4b75778ae88111e6cb63c63fb) )    /* blue palette */
1739   ROM_LOAD( "136014.189",   0x0300, 0x0100, CRC(064d51a0) SHA1(d5baa29930530a8930b44a374e285de849c2a6ce) )    /* alpha color */
1740   ROM_LOAD( "136014.190",   0x0400, 0x0100, CRC(7880c5af) SHA1(e4388e354420be3f99594a10c091e3d2f745cc04) )    /* background color */
1741   ROM_LOAD( "136014.142",   0x0500, 0x0100, CRC(2d502464) SHA1(682b7dd22e51d5db52c0804b7e27e47641dfa6bd) )    /* vertical position low */
1742   ROM_LOAD( "136014.143",   0x0600, 0x0100, CRC(027aa62c) SHA1(c7030d8b64b80e107c446f6fbdd63f560c0a91c0) )    /* vertical position med */
1743   ROM_LOAD( "136014.144",   0x0700, 0x0100, CRC(1f8d0df3) SHA1(b8f17758f114f5e247b65b3f2922ca2660757e66) )    /* vertical position hi */
1744   ROM_LOAD( "136014.191",   0x0800, 0x0400, CRC(8b270902) SHA1(27b3ebc92d3a2a5c0432bde018a0e43669041d50) )    /* road color */
1745   ROM_LOAD( "pp4-6.6m",     0x0c00, 0x0400, CRC(647212b5) SHA1(ad58dfebd0ce8226285c2671c3b7797852c26d07) )    /* sprite color */
1746   ROM_LOAD( "136014.135",   0x1000, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
1747   ROM_LOAD( "136014.136",   0x1020, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
1689   ROM_LOAD( "pp4_7.bpr",    0x0000, 0x0100, CRC(16d69c31) SHA1(f24b345448e4f4ef4e2f3b057b81d399cf427f88) )    /* red palette */
1690   ROM_LOAD( "pp4_8.bpr",    0x0100, 0x0100, CRC(07340311) SHA1(3820d1fa99013ed18de5d9400ad376cc446d1217) )    /* green palette */
1691   ROM_LOAD( "pp4_9.bpr",    0x0200, 0x0100, CRC(1efc84d7) SHA1(6946e1c209eec0a4b75778ae88111e6cb63c63fb) )    /* blue palette */
1692   ROM_LOAD( "pp4_10.bpr",   0x0300, 0x0100, CRC(064d51a0) SHA1(d5baa29930530a8930b44a374e285de849c2a6ce) )    /* alpha color */
1693   ROM_LOAD( "pp4_11.bpr",   0x0400, 0x0100, CRC(7880c5af) SHA1(e4388e354420be3f99594a10c091e3d2f745cc04) )    /* background color */
1694   ROM_LOAD( "pp1_15.bpr",   0x0500, 0x0100, CRC(2d502464) SHA1(682b7dd22e51d5db52c0804b7e27e47641dfa6bd) )    /* vertical position low */
1695   ROM_LOAD( "pp1_16.bpr",   0x0600, 0x0100, CRC(027aa62c) SHA1(c7030d8b64b80e107c446f6fbdd63f560c0a91c0) )    /* vertical position med */
1696   ROM_LOAD( "pp1_17.bpr",   0x0700, 0x0100, CRC(1f8d0df3) SHA1(b8f17758f114f5e247b65b3f2922ca2660757e66) )    /* vertical position hi */
1697   ROM_LOAD( "pp4_12.bpr",   0x0800, 0x0400, CRC(8b270902) SHA1(27b3ebc92d3a2a5c0432bde018a0e43669041d50) )    /* road color */
1698   ROM_LOAD( "pp4_6.bpr",    0x0c00, 0x0400, CRC(647212b5) SHA1(ad58dfebd0ce8226285c2671c3b7797852c26d07) )    /* sprite color */
1699   ROM_LOAD( "pp1_13.bpr",   0x1000, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
1700   ROM_LOAD( "pp1_14.bpr",   0x1020, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) )    /* video RAM address decoder (not used) */
17481701
17491702   /* sound (P)ROM data */
17501703   ROM_REGION( 0x0100, "namco", 0 )
1751   ROM_LOAD( "136014.118",   0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) )    /* Namco sound */
1704   ROM_LOAD( "pp1_5.bpr",    0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) )    /* Namco sound */
17521705
17531706   ROM_REGION( 0x4000, "engine", 0 )
1754   ROM_LOAD( "136014.181",   0x0000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
1755   ROM_LOAD( "136014.182",   0x2000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
1707   ROM_LOAD( "pp4_15.6a",    0x0000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
1708   ROM_LOAD( "pp4_16.5a",    0x2000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
17561709
17571710   ROM_REGION( 0x8000, "52xx", 0 )
1758   ROM_LOAD( "pp1_11.2e",     0x0000, 0x2000, CRC(45b9bfeb) SHA1(ff8c690471944d414931fb88666594ef608997f8) )    /* voice */
1759   ROM_LOAD( "pp1_12.2f",     0x2000, 0x2000, CRC(a31b4be5) SHA1(38298093bb97ea8647fe187359cae05b65e1c616) )    /* voice */
1760   ROM_LOAD( "pp1_13.1e",     0x4000, 0x2000, CRC(a4237466) SHA1(88a397276038cc2fc05f2c18472e6b7cef167f2e) )    /* voice */
1761   ROM_LOAD( "pp1_14.1f",     0x6000, 0x2000, CRC(944580f9) SHA1(c76f529cae718674ce97a1a599a3c6eaf6bf561a) )    /* voice */
1711   ROM_LOAD( "pp1_11.2e",    0x0000, 0x2000, CRC(45b9bfeb) SHA1(ff8c690471944d414931fb88666594ef608997f8) )    /* voice */
1712   ROM_LOAD( "pp1_12.2f",    0x2000, 0x2000, CRC(a31b4be5) SHA1(38298093bb97ea8647fe187359cae05b65e1c616) )    /* voice */
1713   ROM_LOAD( "pp1_13.1e",    0x4000, 0x2000, CRC(a4237466) SHA1(88a397276038cc2fc05f2c18472e6b7cef167f2e) )    /* voice */
1714   ROM_LOAD( "pp1_14.1f",    0x6000, 0x2000, CRC(944580f9) SHA1(c76f529cae718674ce97a1a599a3c6eaf6bf561a) )    /* voice */
17621715
17631716   /* unknown or unused (P)ROM data */
17641717   ROM_REGION( 0x0100, "user1", 0 )
1765   ROM_LOAD( "136014.117",   0x0000, 0x0100, CRC(2401c817) SHA1(8991b7994513a469e64392fa8f233af5e5f06d54) )    /* sync chain */
1718   ROM_LOAD( "pp1_4.bpr",    0x0000, 0x0100, CRC(2401c817) SHA1(8991b7994513a469e64392fa8f233af5e5f06d54) )    /* sync chain */
17661719ROM_END
17671720
17681721
r8581r8582
20031956   ROM_REGION( 0x0100, "namco", 0 )
20041957   ROM_LOAD( "74s287-b.bin",   0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) )    /* Namco sound */
20051958
2006   ROM_REGION( 0x4000, "engine", 0 ) /* these roms are both the same on the original sets, but here they differ */
2007   ROM_LOAD( "pp4-15.bin",   0x0000, 0x2000, CRC(5d79e1ad) SHA1(0323bdf3b9aca298b788bb07020653a43114c952) )
1959   ROM_REGION( 0x4000, "engine", 0 )
1960//  ROM_LOAD( "pp4-15.bin",   0x0000, 0x2000, CRC(5d79e1ad) SHA1(0323bdf3b9aca298b788bb07020653a43114c952) )    /* differs by one bit, almost certainly bitrot */
1961   ROM_LOAD( "pp4-15.bin",   0x0000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
20081962   ROM_LOAD( "pp4-16.bin",   0x2000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
20091963
20101964   ROM_REGION( 0x6000, "52xx", ROMREGION_ERASEFF )
r8581r8582
20301984 * Initialization routines
20311985 *********************************************************************/
20321986
2033static DRIVER_INIT( polepos )
2034{
2035   polepos_gear_bit = 2;
2036}
2037
20381987static DRIVER_INIT( topracern )
20391988{
2040   polepos_gear_bit = 0x20;
2041
20421989   /* extra direct mapped inputs read */
20431990   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, "STEER");
20441991   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x03, 0x03, 0, 0, "IN0");
20451992   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, "DSWA");
2046
20471993}
20481994
20491995static DRIVER_INIT( polepos2 )
20501996{
20511997   /* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */
20521998   memory_install_read16_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0, polepos2_ic25_r);
2053
2054   DRIVER_INIT_CALL(polepos);
20551999}
20562000
20572001
r8581r8582
20592003 * Game drivers
20602004 *********************************************************************/
20612005
2062GAME( 1982, polepos,    0,        polepos,    polepos,  polepos,  ROT0, "Namco", "Pole Position", 0 )
2063GAME( 1982, poleposa,   polepos,  polepos,    poleposa, polepos,  ROT0, "Namco (Atari license)", "Pole Position (Atari version 2)", 0 )
2064GAME( 1982, polepos1,   polepos,  polepos,    poleposa, polepos,  ROT0, "Namco (Atari license)", "Pole Position (Atari version 1)", 0 )
2065GAME( 1982, topracer,   polepos,  polepos,    polepos,  polepos,  ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, set 1)", 0 ) // the NAMCO customs have been cloned on these bootlegs
2066GAME( 1983, topracera,  polepos,  polepos,    polepos,  polepos,  ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, set 2)", 0 ) // ^
2006GAME( 1982, polepos,    0,        polepos,    polepos,  0,        ROT0, "Namco", "Pole Position", 0 )
2007GAME( 1982, poleposa,   polepos,  polepos,    poleposa, 0,        ROT0, "Namco (Atari license)", "Pole Position (Atari version 2)", 0 )
2008GAME( 1982, polepos1,   polepos,  polepos,    poleposa, 0,        ROT0, "Namco (Atari license)", "Pole Position (Atari version 1)", 0 )
2009GAME( 1984, topracer,   polepos,  polepos,    polepos,  0,        ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, 1984)", 0 ) // the NAMCO customs have been cloned on these bootlegs
2010GAME( 1983, topracera,  polepos,  polepos,    polepos,  0,        ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, 1983)", 0 ) // the only difference between them is the year displayed on the title screen
20672011GAME( 1982, topracern,  polepos,  topracern,  topracern,topracern,ROT0, "bootleg", "Top Racer (no MB8841 + MB8842)", 0 )
20682012
20692013GAME( 1983, polepos2,   0,        polepos,    polepos2, polepos2, ROT0, "Namco", "Pole Position II", 0 )
20702014GAME( 1983, polepos2a,  polepos2, polepos,    polepos2, polepos2, ROT0, "Namco (Atari license)", "Pole Position II (Atari)", 0 )
2071GAME( 1983, polepos2b,  polepos2, polepos,    polepos2, polepos,  ROT0, "bootleg", "Pole Position II (bootleg)", 0 )
2072GAME( 1983, polepos2bi, polepos2, polepos2bi, topracern, topracern, ROT0, "bootleg", "Gran Premio F1 (Italian bootleg of Pole Position II)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) // should have italian voices
2015GAME( 1983, polepos2b,  polepos2, polepos,    polepos2, 0,        ROT0, "bootleg", "Pole Position II (bootleg)", 0 )
2016GAME( 1984, polepos2bi, polepos2, polepos2bi, topracern,topracern,ROT0, "bootleg", "Gran Premio F1 (Italian bootleg of Pole Position II)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) // should have italian voices
src/mame/drivers/qdrmfgp.c
r8581r8582
8787      int vol = space->machine->generic.nvram.u16[0x10] & 0xff;
8888      if (vol)
8989      {
90         running_device *k054539 = devtag_get_device(space->machine, "konami");
90         running_device *k054539 = space->machine->device("konami");
9191         int i;
9292         double gain = vol / 90.0;
9393
r8581r8582
117117      int vol = space->machine->generic.nvram.u16[0x8] & 0xff;
118118      if (vol)
119119      {
120         running_device *k054539 = devtag_get_device(space->machine, "konami");
120         running_device *k054539 = space->machine->device("konami");
121121         int i;
122122         double gain = vol / 90.0;
123123
r8581r8582
130130
131131static READ16_HANDLER( v_rom_r )
132132{
133   running_device *k056832 = devtag_get_device(space->machine, "k056832");
133   running_device *k056832 = space->machine->device("k056832");
134134   UINT8 *mem8 = memory_region(space->machine, "gfx1");
135135   int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
136136
r8581r8582
145145
146146static READ16_HANDLER( gp2_vram_r )
147147{
148   running_device *k056832 = devtag_get_device(space->machine, "k056832");
148   running_device *k056832 = space->machine->device("k056832");
149149
150150   if (offset < 0x1000 / 2)
151151      return k056832_ram_word_r(k056832, offset * 2 + 1, mem_mask);
r8581r8582
155155
156156static READ16_HANDLER( gp2_vram_mirror_r )
157157{
158   running_device *k056832 = devtag_get_device(space->machine, "k056832");
158   running_device *k056832 = space->machine->device("k056832");
159159
160160   if (offset < 0x1000 / 2)
161161      return k056832_ram_word_r(k056832, offset * 2, mem_mask);
r8581r8582
165165
166166static WRITE16_HANDLER( gp2_vram_w )
167167{
168   running_device *k056832 = devtag_get_device(space->machine, "k056832");
168   running_device *k056832 = space->machine->device("k056832");
169169
170170   if (offset < 0x1000 / 2)
171171      k056832_ram_word_w(k056832, offset * 2 + 1, data, mem_mask);
r8581r8582
175175
176176static WRITE16_HANDLER( gp2_vram_mirror_w )
177177{
178   running_device *k056832 = devtag_get_device(space->machine, "k056832");
178   running_device *k056832 = space->machine->device("k056832");
179179
180180   if (offset < 0x1000 / 2)
181181      k056832_ram_word_w(k056832, offset * 2, data, mem_mask);
r8581r8582
242242
243243static READ16_HANDLER( gp2_ide_std_r )
244244{
245   running_device *device = devtag_get_device(space->machine, "ide");
245   running_device *device = space->machine->device("ide");
246246   if (offset & 0x01)
247247   {
248248      if (offset == 0x07)
src/mame/drivers/cps1.c
r8581r8582
29452945{
29462946   cps_state *state = (cps_state *)machine->driver_data;
29472947
2948   state->maincpu = devtag_get_device(machine, "maincpu");
2949   state->audiocpu = devtag_get_device(machine, "audiocpu");
2948   state->maincpu = machine->device("maincpu");
2949   state->audiocpu = machine->device("audiocpu");
29502950}
29512951
29522952static MACHINE_START( cps1 )
r8581r8582
62666266
62676267
62686268
6269/* B-Board 91635B */
6269/* B-Board 91634B-2 */
62706270ROM_START( captcomm )
62716271   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
6272   ROM_LOAD16_WORD_SWAP( "cce_23d.rom",  0x000000, 0x80000, CRC(19c58ece) SHA1(6e23e87db29b2c5698b7cead99d1106a2e190648) )
6273   ROM_LOAD16_WORD_SWAP( "cc_22d.rom",   0x080000, 0x80000, CRC(a91949b7) SHA1(c027af89cd8f6bd3aaed61114582322c42e0c74f) )
6274   ROM_LOAD16_BYTE( "cc_24d.rom",        0x100000, 0x20000, CRC(680e543f) SHA1(cfa963ab6329f615807db213bf53841860ed3149) )
6275   ROM_LOAD16_BYTE( "cc_28d.rom",        0x100001, 0x20000, CRC(8820039f) SHA1(d68ce0b34ade75b8c5214168b2b1e0cdff45cd52) )
6272   ROM_LOAD16_WORD_SWAP( "cce_23f.8f",  0x000000, 0x80000, CRC(42c814c5) SHA1(60e6ae6b8a89cdaa1abf1749c60a5e3b3972e1ab) )
6273   ROM_LOAD16_WORD_SWAP( "cc_22f.7f",   0x080000, 0x80000, CRC(0fd34195) SHA1(fb2b9a53af43507f13c4f94eaebbf0b538b2e754) )
6274   ROM_LOAD16_BYTE( "cc_24f.9e",        0x100000, 0x20000, CRC(3a794f25) SHA1(7f3722a4ef0c1d7acb73e6bac9dd6ae7b35e6374) )
6275   ROM_LOAD16_BYTE( "cc_28f.9f",        0x100001, 0x20000, CRC(fc3c2906) SHA1(621c3b79b6fdea1665bb316eb539e5916e890656) )
62766276
62776277   ROM_REGION( 0x400000, "gfx", 0 )
6278   ROMX_LOAD( "gfx_01.rom",   0x000000, 0x80000, CRC(7261d8ba) SHA1(4b66292e42d20d0b79a756f0e445492ddb9c6bbc) , ROM_GROUPWORD | ROM_SKIP(6) )
6279   ROMX_LOAD( "gfx_03.rom",   0x000002, 0x80000, CRC(6a60f949) SHA1(87391ff92abaf3e451f70d789a938cffbd1fd222) , ROM_GROUPWORD | ROM_SKIP(6) )
6280   ROMX_LOAD( "gfx_02.rom",   0x000004, 0x80000, CRC(00637302) SHA1(2c554b59cceec2de67a9a4bc6281fe846d3c8cd2) , ROM_GROUPWORD | ROM_SKIP(6) )
6281   ROMX_LOAD( "gfx_04.rom",   0x000006, 0x80000, CRC(cc87cf61) SHA1(7fb1f49494cc1a08aded20754bb0cefb1c323198) , ROM_GROUPWORD | ROM_SKIP(6) )
6282   ROMX_LOAD( "gfx_05.rom",   0x200000, 0x80000, CRC(28718bed) SHA1(dfdc4dd14dc609783bad94d608a9e9b137dea944) , ROM_GROUPWORD | ROM_SKIP(6) )
6283   ROMX_LOAD( "gfx_07.rom",   0x200002, 0x80000, CRC(d4acc53a) SHA1(d03282ebbde362e679cc97f772aa9baf163d7606) , ROM_GROUPWORD | ROM_SKIP(6) )
6284   ROMX_LOAD( "gfx_06.rom",   0x200004, 0x80000, CRC(0c69f151) SHA1(a170b8e568439e4a26d84376d53560e4248e4e2f) , ROM_GROUPWORD | ROM_SKIP(6) )
6285   ROMX_LOAD( "gfx_08.rom",   0x200006, 0x80000, CRC(1f9ebb97) SHA1(023d00cb7b6a52d1b29e2052abe08ef34cb0c55c) , ROM_GROUPWORD | ROM_SKIP(6) )
6278   ROMX_LOAD( "cc_01.3a",     0x000000, 0x80000, CRC(7261d8ba) SHA1(4b66292e42d20d0b79a756f0e445492ddb9c6bbc) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-5m.3a
6279   ROMX_LOAD( "cc_02.4a",     0x000002, 0x80000, CRC(6a60f949) SHA1(87391ff92abaf3e451f70d789a938cffbd1fd222) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-7m.5a
6280   ROMX_LOAD( "cc_03.5a",     0x000004, 0x80000, CRC(00637302) SHA1(2c554b59cceec2de67a9a4bc6281fe846d3c8cd2) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-1m.4a
6281   ROMX_LOAD( "cc_04.6a",     0x000006, 0x80000, CRC(cc87cf61) SHA1(7fb1f49494cc1a08aded20754bb0cefb1c323198) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-3m.6a
6282   ROMX_LOAD( "cc_05.7a",     0x200000, 0x80000, CRC(28718bed) SHA1(dfdc4dd14dc609783bad94d608a9e9b137dea944) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-6m.7a
6283   ROMX_LOAD( "cc_06.8a",     0x200002, 0x80000, CRC(d4acc53a) SHA1(d03282ebbde362e679cc97f772aa9baf163d7606) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-8m.9a
6284   ROMX_LOAD( "cc_07.9a",     0x200004, 0x80000, CRC(0c69f151) SHA1(a170b8e568439e4a26d84376d53560e4248e4e2f) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-2m.8a
6285   ROMX_LOAD( "cc_08.10a",    0x200006, 0x80000, CRC(1f9ebb97) SHA1(023d00cb7b6a52d1b29e2052abe08ef34cb0c55c) , ROM_GROUPWORD | ROM_SKIP(6) )   // == cc-4m.10a
62866286
62876287   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
6288   ROM_LOAD( "cc_09.rom",     0x00000, 0x08000, CRC(698e8b58) SHA1(b7a3d905a7ed2c430426ca2e185e3d7e75e752a1) )
6288   ROM_LOAD( "cc_09.12a",     0x00000, 0x08000, CRC(698e8b58) SHA1(b7a3d905a7ed2c430426ca2e185e3d7e75e752a1) ) // == cc_09.11a
62896289   ROM_CONTINUE(              0x10000, 0x08000 )
62906290
62916291   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
6292   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
6293   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
6292   ROM_LOAD( "cc_18.11c",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
6293   ROM_LOAD( "cc_19.12c",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
62946294
62956295   ROM_REGION( 0x0200, "aboardplds", 0 )
62966296   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
r8581r8582
63096309   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
63106310ROM_END
63116311
6312/* B-Board 91635B-2 */
6313ROM_START( captcommr1 )
6314   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
6315   ROM_LOAD16_WORD_SWAP( "cce_23d.8f",   0x000000, 0x80000, CRC(19c58ece) SHA1(6e23e87db29b2c5698b7cead99d1106a2e190648) )
6316   ROM_LOAD16_WORD_SWAP( "cc_22d.7f",    0x080000, 0x80000, CRC(a91949b7) SHA1(c027af89cd8f6bd3aaed61114582322c42e0c74f) )
6317   ROM_LOAD16_BYTE( "cc_24d.9e",         0x100000, 0x20000, CRC(680e543f) SHA1(cfa963ab6329f615807db213bf53841860ed3149) )
6318   ROM_LOAD16_BYTE( "cc_28d.9f",         0x100001, 0x20000, CRC(8820039f) SHA1(d68ce0b34ade75b8c5214168b2b1e0cdff45cd52) )
6319
6320   ROM_REGION( 0x400000, "gfx", 0 )
6321   ROMX_LOAD( "cc-5m.3a",     0x000000, 0x80000, CRC(7261d8ba) SHA1(4b66292e42d20d0b79a756f0e445492ddb9c6bbc) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "1" socket
6322   ROMX_LOAD( "cc-7m.5a",     0x000002, 0x80000, CRC(6a60f949) SHA1(87391ff92abaf3e451f70d789a938cffbd1fd222) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "3" socket
6323   ROMX_LOAD( "cc-1m.4a",     0x000004, 0x80000, CRC(00637302) SHA1(2c554b59cceec2de67a9a4bc6281fe846d3c8cd2) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "2" socket
6324   ROMX_LOAD( "cc-3m.6a",     0x000006, 0x80000, CRC(cc87cf61) SHA1(7fb1f49494cc1a08aded20754bb0cefb1c323198) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "4" socket
6325   ROMX_LOAD( "cc-6m.7a",     0x200000, 0x80000, CRC(28718bed) SHA1(dfdc4dd14dc609783bad94d608a9e9b137dea944) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "5" socket
6326   ROMX_LOAD( "cc-8m.9a",     0x200002, 0x80000, CRC(d4acc53a) SHA1(d03282ebbde362e679cc97f772aa9baf163d7606) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "7" socket
6327   ROMX_LOAD( "cc-2m.8a",     0x200004, 0x80000, CRC(0c69f151) SHA1(a170b8e568439e4a26d84376d53560e4248e4e2f) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "6" socket
6328   ROMX_LOAD( "cc-4m.10a",    0x200006, 0x80000, CRC(1f9ebb97) SHA1(023d00cb7b6a52d1b29e2052abe08ef34cb0c55c) , ROM_GROUPWORD | ROM_SKIP(6) )   // in "8" socket
6329
6330   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
6331   ROM_LOAD( "cc_09.11a",     0x00000, 0x08000, CRC(698e8b58) SHA1(b7a3d905a7ed2c430426ca2e185e3d7e75e752a1) )
6332   ROM_CONTINUE(              0x10000, 0x08000 )
6333
6334   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
6335   ROM_LOAD( "cc_18.11c",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
6336   ROM_LOAD( "cc_19.12c",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
6337
6338   ROM_REGION( 0x0200, "aboardplds", 0 )
6339   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
6340   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
6341   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
6342   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
6343   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
6344
6345   ROM_REGION( 0x0200, "bboardplds", 0 )
6346   ROM_LOAD( "cc63b.1a",     0x0000, 0x0117, CRC(cae8f0f9) SHA1(eadbd45e184195b2d170cd71a68e5caed64b69f7) )
6347   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
6348   ROM_LOAD( "ccprg.11d",    0x0000, 0x0117, CRC(e1c225c4) SHA1(97146451ca9aa3cecd443cc6881151ed8df47fbf) )
6349
6350   ROM_REGION( 0x0200, "cboardplds", 0 )
6351   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
6352   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
6353ROM_END
6354
63126355/* B-Board 91635B */
63136356ROM_START( captcommu )
63146357   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
r8581r8582
91729215GAME( 1991, kod,      0,        cps1_10MHz, kod,      cps1,     ROT0,   "Capcom", "The King of Dragons (World 910711)", GAME_SUPPORTS_SAVE )   // "ETC"
91739216GAME( 1991, kodu,     kod,      cps1_10MHz, kodj,     cps1,     ROT0,   "Capcom", "The King of Dragons (US 910910)", GAME_SUPPORTS_SAVE )
91749217GAME( 1991, kodj,     kod,      cps1_10MHz, kodj,     cps1,     ROT0,   "Capcom", "The King of Dragons (Japan 910805)", GAME_SUPPORTS_SAVE )
9175GAME( 1991, captcomm, 0,        cps1_10MHz, captcomm, cps1,     ROT0,   "Capcom", "Captain Commando (World 911014)", GAME_SUPPORTS_SAVE )   // "OTHER COUNTRY"
9218GAME( 1991, captcomm, 0,        cps1_10MHz, captcomm, cps1,     ROT0,   "Capcom", "Captain Commando (World 911202)", GAME_SUPPORTS_SAVE )   // "OTHER COUNTRY"
9219GAME( 1991, captcommr1, captcomm, cps1_10MHz, captcomm, cps1,     ROT0,   "Capcom", "Captain Commando (World 911014)", GAME_SUPPORTS_SAVE )   // "OTHER COUNTRY"
91769220GAME( 1991, captcommu,captcomm, cps1_10MHz, captcomm, cps1,     ROT0,   "Capcom", "Captain Commando (US 910928)", GAME_SUPPORTS_SAVE )
91779221GAME( 1991, captcommj,captcomm, cps1_10MHz, captcomm, cps1,     ROT0,   "Capcom", "Captain Commando (Japan 911202)", GAME_SUPPORTS_SAVE )
91789222GAME( 1991, captcommb,captcomm, cps1_10MHz, captcomm, cps1,     ROT0,   "bootleg","Captain Commando (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
src/mame/drivers/yunsun16.c
r8581r8582
559559{
560560   yunsun16_state *state = (yunsun16_state *)machine->driver_data;
561561
562   state->audiocpu = devtag_get_device(machine, "audiocpu");
562   state->audiocpu = machine->device("audiocpu");
563563
564564   state_save_register_global(machine, state->sprites_scrolldx);
565565   state_save_register_global(machine, state->sprites_scrolldy);
src/mame/drivers/wiz.c
r8581r8582
189189
190190static WRITE8_HANDLER( sound_command_w )
191191{
192   running_device *discrete = devtag_get_device(space->machine, "discrete");
192   running_device *discrete = space->machine->device("discrete");
193193
194194   switch (offset)
195195   {
src/mame/drivers/namcos11.c
r8581r8582
4646Tekken Ver.C            (C) Namco, 1995
4747Tekken II Ver.C         (C) Namco, 1995
4848
49If you can help with the remaining undumped S11 games, please contact http://www.mameworld.net/gurudumps/comments.html
49If you can help with the remaining undumped S11 games, please contact http://guru.mameworld.info/
5050
5151
5252The Namco System 11 system comprises 3 PCB's....
src/mame/drivers/lethalj.c
r8581r8582
176176static WRITE16_HANDLER( ripribit_control_w )
177177{
178178   coin_counter_w(space->machine, 0, data & 1);
179   ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, ((data >> 1) & 1) << 7);
179   ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 1) & 1) << 7);
180180   output_set_lamp_value(0, (data >> 2) & 1);
181181}
182182
183183
184184static WRITE16_HANDLER( cfarm_control_w )
185185{
186   ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, ((data >> 0) & 1) << 7);
186   ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7);
187187   output_set_lamp_value(0, (data >> 2) & 1);
188188   output_set_lamp_value(1, (data >> 3) & 1);
189189   output_set_lamp_value(2, (data >> 4) & 1);
r8581r8582
193193
194194static WRITE16_HANDLER( cclownz_control_w )
195195{
196   ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, ((data >> 0) & 1) << 7);
196   ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7);
197197   output_set_lamp_value(0, (data >> 2) & 1);
198198   output_set_lamp_value(1, (data >> 4) & 1);
199199   output_set_lamp_value(2, (data >> 5) & 1);
src/mame/drivers/itech8.c
r8581r8582
776776   /* bit 5 controls the coin counter */
777777   /* bit 6 controls the diagnostic sound LED */
778778   pia_portb_data = data;
779   ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 0x10) << 3);
779   ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x10) << 3);
780780   coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
781781}
782782
r8581r8582
790790   /* bit 6 controls the diagnostic sound LED */
791791   /* bit 7 controls the ticket dispenser */
792792   pia_portb_data = data;
793   ticket_dispenser_w(devtag_get_device(device->machine, "ticket"), 0, data & 0x80);
793   ticket_dispenser_w(device->machine->device("ticket"), 0, data & 0x80);
794794   coin_counter_w(device->machine, 0, (data & 0x20) >> 5);
795795}
796796
src/mame/drivers/galaxian.c
r8581r8582
537537{
538538   /* the decoding here is very simplistic, and you can address both simultaneously */
539539   UINT8 result = 0xff;
540   if (offset & 0x20) result &= ay8910_r(devtag_get_device(space->machine, "8910.1"), 0);
541   if (offset & 0x80) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0);
540   if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0);
541   if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0);
542542   return result;
543543}
544544
r8581r8582
548548   /* AV 4,5 ==> AY8910 #2 */
549549   /* the decoding here is very simplistic, and you can address two simultaneously */
550550   if (offset & 0x10)
551      ay8910_address_w(devtag_get_device(space->machine, "8910.1"), 0, data);
551      ay8910_address_w(space->machine->device("8910.1"), 0, data);
552552   else if (offset & 0x20)
553      ay8910_data_w(devtag_get_device(space->machine, "8910.1"), 0, data);
553      ay8910_data_w(space->machine->device("8910.1"), 0, data);
554554   /* AV6,7 ==> AY8910 #1 */
555555   if (offset & 0x40)
556      ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data);
556      ay8910_address_w(space->machine->device("8910.0"), 0, data);
557557   else if (offset & 0x80)
558      ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data);
558      ay8910_data_w(space->machine->device("8910.0"), 0, data);
559559}
560560
561561
r8581r8582
611611
612612static WRITE8_HANDLER( konami_sound_filter_w )
613613{
614   running_device *discrete = devtag_get_device(space->machine, "konami");
614   running_device *discrete = space->machine->device("konami");
615615   static const char *const ayname[2] = { "8910.0", "8910.1" };
616616   int which, chan;
617617
r8581r8582
619619   /* AV0 .. AV5 ==> AY8910 #2 */
620620   /* AV6 .. AV11 ==> AY8910 #1 */
621621   for (which = 0; which < 2; which++)
622      if (devtag_get_device(space->machine, ayname[which]) != NULL)
622      if (space->machine->device(ayname[which]) != NULL)
623623         for (chan = 0; chan < 3; chan++)
624624         {
625625            UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3;
r8581r8582
676676{
677677   /* the decoding here is very simplistic, and you can address both simultaneously */
678678   UINT8 result = 0xff;
679   if (offset & 0x0100) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset & 3);
680   if (offset & 0x0200) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 3);
679   if (offset & 0x0100) result &= ppi8255_r(space->machine->device("ppi8255_0"), offset & 3);
680   if (offset & 0x0200) result &= ppi8255_r(space->machine->device("ppi8255_1"), offset & 3);
681681   return result;
682682}
683683
r8581r8582
685685static WRITE8_HANDLER( theend_ppi8255_w )
686686{
687687   /* the decoding here is very simplistic, and you can address both simultaneously */
688   if (offset & 0x0100) ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), offset & 3, data);
689   if (offset & 0x0200) ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data);
688   if (offset & 0x0100) ppi8255_w(space->machine->device("ppi8255_0"), offset & 3, data);
689   if (offset & 0x0200) ppi8255_w(space->machine->device("ppi8255_1"), offset & 3, data);
690690}
691691
692692
r8581r8582
797797{
798798   /* the decoding here is very simplistic, and you can address both simultaneously */
799799   UINT8 result = 0xff;
800   if (offset & 0x04) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_2"), offset & 3);
800   if (offset & 0x04) result &= ppi8255_r(space->machine->device("ppi8255_2"), offset & 3);
801801   return result;
802802}
803803
r8581r8582
805805static WRITE8_HANDLER( sfx_sample_io_w )
806806{
807807   /* the decoding here is very simplistic, and you can address both simultaneously */
808   if (offset & 0x04) ppi8255_w(devtag_get_device(space->machine, "ppi8255_2"), offset & 3, data);
809   if (offset & 0x10) dac_signed_data_w(devtag_get_device(space->machine, "dac"), data);
808   if (offset & 0x04) ppi8255_w(space->machine->device("ppi8255_2"), offset & 3, data);
809   if (offset & 0x10) dac_signed_data_w(space->machine->device("dac"), data);
810810}
811811
812812
r8581r8582
844844{
845845   /* the decoding here is very simplistic, and you can address both simultaneously */
846846   UINT8 result = 0xff;
847   if (offset & 0x1000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 1) & 3);
848   if (offset & 0x2000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 1) & 3);
847   if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 1) & 3);
848   if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 1) & 3);
849849   return result;
850850}
851851
r8581r8582
853853static WRITE8_HANDLER( frogger_ppi8255_w )
854854{
855855   /* the decoding here is very simplistic, and you can address both simultaneously */
856   if (offset & 0x1000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 1) & 3, data);
857   if (offset & 0x2000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 1) & 3, data);
856   if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 1) & 3, data);
857   if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 1) & 3, data);
858858}
859859
860860
r8581r8582
862862{
863863   /* the decoding here is very simplistic */
864864   UINT8 result = 0xff;
865   if (offset & 0x40) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0);
865   if (offset & 0x40) result &= ay8910_r(space->machine->device("8910.0"), 0);
866866   return result;
867867}
868868
r8581r8582
872872   /* the decoding here is very simplistic */
873873   /* AV6,7 ==> AY8910 #1 */
874874   if (offset & 0x40)
875      ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data);
875      ay8910_data_w(space->machine->device("8910.0"), 0, data);
876876   else if (offset & 0x80)
877      ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data);
877      ay8910_address_w(space->machine->device("8910.0"), 0, data);
878878}
879879
880880
r8581r8582
903903{
904904   /* the decoding here is very simplistic, and you can address both simultaneously */
905905   UINT8 result = 0xff;
906   if (offset & 0x1000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 3) & 3);
907   if (offset & 0x2000) result &= ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 3) & 3);
906   if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 3) & 3);
907   if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 3) & 3);
908908   return result;
909909}
910910
r8581r8582
912912static WRITE8_HANDLER( frogf_ppi8255_w )
913913{
914914   /* the decoding here is very simplistic, and you can address both simultaneously */
915   if (offset & 0x1000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 3) & 3, data);
916   if (offset & 0x2000) ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 3) & 3, data);
915   if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 3) & 3, data);
916   if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 3) & 3, data);
917917}
918918
919919
r8581r8582
924924 *
925925 *************************************/
926926
927static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 4) & 3); }
928static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 4) & 3); }
929static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset >> 4) & 3, data); }
930static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset >> 4) & 3, data); }
927static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 4) & 3); }
928static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 4) & 3); }
929static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 4) & 3, data); }
930static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 4) & 3, data); }
931931
932932
933933
r8581r8582
941941{
942942   /* the decoding here is very simplistic, and you can address both simultaneously */
943943   UINT8 result = 0xff;
944   if (offset & 0x08) result &= ay8910_r(devtag_get_device(space->machine, "8910.2"), 0);
945   if (offset & 0x20) result &= ay8910_r(devtag_get_device(space->machine, "8910.1"), 0);
946   if (offset & 0x80) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0);
944   if (offset & 0x08) result &= ay8910_r(space->machine->device("8910.2"), 0);
945   if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0);
946   if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0);
947947   return result;
948948}
949949
r8581r8582
951951static WRITE8_HANDLER( scorpion_ay8910_w )
952952{
953953   /* the decoding here is very simplistic, and you can address all six simultaneously */
954   if (offset & 0x04) ay8910_address_w(devtag_get_device(space->machine, "8910.2"), 0, data);
955   if (offset & 0x08) ay8910_data_w(devtag_get_device(space->machine, "8910.2"), 0, data);
956   if (offset & 0x10) ay8910_address_w(devtag_get_device(space->machine, "8910.1"), 0, data);
957   if (offset & 0x20) ay8910_data_w(devtag_get_device(space->machine, "8910.1"), 0, data);
958   if (offset & 0x40) ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data);
959   if (offset & 0x80) ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data);
954   if (offset & 0x04) ay8910_address_w(space->machine->device("8910.2"), 0, data);
955   if (offset & 0x08) ay8910_data_w(space->machine->device("8910.2"), 0, data);
956   if (offset & 0x10) ay8910_address_w(space->machine->device("8910.1"), 0, data);
957   if (offset & 0x20) ay8910_data_w(space->machine->device("8910.1"), 0, data);
958   if (offset & 0x40) ay8910_address_w(space->machine->device("8910.0"), 0, data);
959   if (offset & 0x80) ay8910_data_w(space->machine->device("8910.0"), 0, data);
960960}
961961
962962
r8581r8582
991991
992992static READ8_HANDLER( scorpion_digitalker_intr_r )
993993{
994   running_device *digitalker = devtag_get_device(space->machine, "digitalker");
994   running_device *digitalker = space->machine->device("digitalker");
995995   return digitalker_0_intr_r(digitalker);
996996}
997997
r8581r8582
10711071         /* bit 0 = WRITE */
10721072         /* bit 1 = C/D */
10731073         if ((offset & 1) != 0)
1074            ay8910_data_address_w(devtag_get_device(space->machine, "aysnd"), offset >> 1, zigzag_ay8910_latch);
1074            ay8910_data_address_w(space->machine->device("aysnd"), offset >> 1, zigzag_ay8910_latch);
10751075         break;
10761076
10771077      case 0x100:
r8581r8582
11631163static WRITE8_HANDLER( mshuttle_ay8910_control_w )
11641164{
11651165   if (!mshuttle_ay8910_cs)
1166      ay8910_address_w(devtag_get_device(space->machine, "aysnd"), offset, data);
1166      ay8910_address_w(space->machine->device("aysnd"), offset, data);
11671167}
11681168
11691169
11701170static WRITE8_HANDLER( mshuttle_ay8910_data_w )
11711171{
11721172   if (!mshuttle_ay8910_cs)
1173      ay8910_data_w(devtag_get_device(space->machine, "aysnd"), offset, data);
1173      ay8910_data_w(space->machine->device("aysnd"), offset, data);
11741174}
11751175
11761176
11771177static READ8_HANDLER( mshuttle_ay8910_data_r )
11781178{
11791179   if (!mshuttle_ay8910_cs)
1180      return ay8910_r(devtag_get_device(space->machine, "aysnd"), offset);
1180      return ay8910_r(space->machine->device("aysnd"), offset);
11811181   return 0xff;
11821182}
11831183
src/mame/drivers/hyprduel.c
r8581r8582
654654{
655655   hyprduel_state *state = (hyprduel_state *)machine->driver_data;
656656
657   state->maincpu = devtag_get_device(machine, "maincpu");
658   state->subcpu = devtag_get_device(machine, "sub");
657   state->maincpu = machine->device("maincpu");
658   state->subcpu = machine->device("sub");
659659
660660   state_save_register_global(machine, state->blitter_bit);
661661   state_save_register_global(machine, state->requested_int);
src/mame/drivers/arcadecl.c
r8581r8582
9292{
9393   /* generate 32V signals */
9494   if ((scanline & 32) == 0)
95      atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
95      atarigen_scanline_int_gen(screen.machine->device("maincpu"));
9696}
9797
9898
src/mame/drivers/flstory.c
r8581r8582
658658{
659659   flstory_state *state = (flstory_state *)machine->driver_data;
660660
661   state->maincpu = devtag_get_device(machine, "maincpu");
662   state->audiocpu = devtag_get_device(machine, "audiocpu");
663   state->mcu = devtag_get_device(machine, "mcu");
661   state->maincpu = machine->device("maincpu");
662   state->audiocpu = machine->device("audiocpu");
663   state->mcu = machine->device("mcu");
664664
665665   /* video */
666666   state_save_register_global(machine, state->char_bank);
src/mame/drivers/suprslam.c
r8581r8582
300300{
301301   suprslam_state *state = (suprslam_state *)machine->driver_data;
302302
303   state->audiocpu = devtag_get_device(machine, "audiocpu");
304   state->k053936 = devtag_get_device(machine, "k053936");
303   state->audiocpu = machine->device("audiocpu");
304   state->k053936 = machine->device("k053936");
305305
306306   state_save_register_global(machine, state->screen_bank);
307307   state_save_register_global(machine, state->bg_bank);
src/mame/drivers/bmcbowl.c
r8581r8582
7777
7878BrianT
7979
80* There is a MESS driver for this chip (gm68b45s CTR controller):
81http://cvs.mess.org:6502/cgi-bin/viewcvs.cgi/mess/video/m6845.c?rev=1.10
82
8380Top board:
8481          --- Edge Connection ---
8582GS9403      7EX    8EX   Part #      Misc HD74LS374p
r8581r8582
216213
217214static READ16_HANDLER(bmcbowl_via_r)
218215{
219   running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
216   running_device *via_0 = space->machine->device("via6522_0");
220217   return via_r(via_0, offset);
221218}
222219
223220static WRITE16_HANDLER(bmcbowl_via_w)
224221{
225   running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
222   running_device *via_0 = space->machine->device("via6522_0");
226223   via_w(via_0, offset, data);
227224}
228225
src/mame/drivers/kyugo.c
r8581r8582
451451{
452452   kyugo_state *state = (kyugo_state *)machine->driver_data;
453453
454   state->maincpu = devtag_get_device(machine, "maincpu");
455   state->subcpu = devtag_get_device(machine, "sub");
454   state->maincpu = machine->device("maincpu");
455   state->subcpu = machine->device("sub");
456456
457457   state_save_register_global(machine, state->scroll_x_lo);
458458   state_save_register_global(machine, state->scroll_x_hi);
r8581r8582
467467   kyugo_state *state = (kyugo_state *)machine->driver_data;
468468   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
469469   // must start with interrupts and sub CPU disabled
470   cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0);
470   cpu_interrupt_enable(machine->device("maincpu"), 0);
471471   kyugo_sub_cpu_control_w(space, 0, 0);
472472
473473   state->scroll_x_lo = 0;
src/mame/drivers/lazercmd.c
r8581r8582
603603{
604604   lazercmd_state *state = (lazercmd_state *)machine->driver_data;
605605
606   state->dac = devtag_get_device(machine, "dac");
606   state->dac = machine->device("dac");
607607
608608   state_save_register_global(machine, state->marker_x);
609609   state_save_register_global(machine, state->marker_y);
src/mame/drivers/pcat_nit.c
r8581r8582
213213
214214static MACHINE_START( streetg2 )
215215{
216   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), pcat_irq_callback);
216   cpu_set_irq_callback(machine->device("maincpu"), pcat_irq_callback);
217217
218218   init_pc_common(machine, PCCOMMON_KEYBOARD_AT, streetg2_set_keyb_int);
219219   mc146818_init(machine, MC146818_STANDARD);
src/mame/drivers/lordgun.c
r8581r8582
144144
145145static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w )
146146{
147   running_device *eeprom = devtag_get_device(device->machine, "eeprom");
147   running_device *eeprom = device->machine->device("eeprom");
148148   static UINT8 old;
149149   int i;
150150
r8581r8582
177177
178178static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w )
179179{
180   running_device *eeprom = devtag_get_device(device->machine, "eeprom");
180   running_device *eeprom = device->machine->device("eeprom");
181181
182182   if (~data & ~0xf8)
183183   {
r8581r8582
985985   ROM_REGION( 0x40000, "oki2", 0 ) // Samples
986986   ROM_LOAD( "hfh_g.u66", 0x00000, 0x40000, CRC(7cfcd98e) SHA1(3b03123160adfd3404a9e0c4c68420930e80ae48) )
987987
988   ROM_REGION( 0x200000, "ymf", 0 ) // Samples
989   ROM_LOAD( "yrw801-m", 0x000000, 0x200000, NO_DUMP CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca) ) // not present in this set: Yamaha YRW801 2MB ROM with samples for the OPL4
988   ROM_REGION( 0x200000, "ymf", 0 ) // Samples (Standard Yamaha YRW801 2MB samples ROM)
989   ROM_LOAD( "yrw801-m", 0x000000, 0x200000, CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca) ) /* Not dumped from PCB, but is a standard samples rom */
990990ROM_END
991991
992992/***************************************************************************
r8581r8582
10081008   ROM_LOAD( "hfh_s.u86", 0x00000, 0x10000, CRC(5728a9ed) SHA1(e5a9e4a1a2cc6c848b08608bc8727bc739270873) )
10091009
10101010   ROM_REGION( 0x300000, "tiles0", 0 )   // Tilemaps 0 & 3
1011   ROM_LOAD( "igst0101.u9",  0x000000, 0x100000, NO_DUMP CRC(2ce12d7b) SHA1(aa93a82e5f4015c46bb705efb2051b62cd5d7e04) )
1012   ROM_LOAD( "igst0102.u10", 0x100000, 0x100000, NO_DUMP CRC(542a76a0) SHA1(6947b50a024d0053c1eaf9da8c90652bab875142) )
1013   ROM_LOAD( "igst0103.u11", 0x200000, 0x100000, NO_DUMP CRC(adf5698a) SHA1(4b798f8acc5d7581c7e0989260863ae0ca654acd) )
1011   ROM_LOAD( "igst0101.u9",  0x000000, 0x100000, BAD_DUMP CRC(2ce12d7b) SHA1(aa93a82e5f4015c46bb705efb2051b62cd5d7e04) ) /* Graphics ROMs not confirmed to be the same */
1012   ROM_LOAD( "igst0102.u10", 0x100000, 0x100000, BAD_DUMP CRC(542a76a0) SHA1(6947b50a024d0053c1eaf9da8c90652bab875142) ) /* Use these until roms are dumped / verified */
1013   ROM_LOAD( "igst0103.u11", 0x200000, 0x100000, BAD_DUMP CRC(adf5698a) SHA1(4b798f8acc5d7581c7e0989260863ae0ca654acd) )
10141014
10151015   ROM_REGION( 0x600000, "tiles1", 0 )   // Tilemaps 1 & 2
1016   ROM_LOAD( "igsb0101.u8", 0x000000, 0x200000, NO_DUMP CRC(5c995f7e) SHA1(4f08cf13e313c6802c924b914c73cab4b450da61) )
1017   ROM_LOAD( "igsb0102.u7", 0x200000, 0x200000, NO_DUMP CRC(a2ae9baf) SHA1(338ee260c33448568f138ca00e1d4edda4da018f) )
1018   ROM_LOAD( "igsb0103.u6", 0x400000, 0x200000, NO_DUMP CRC(11b927af) SHA1(2f15e5cea1b86cde3b679bdd0f3d79672d0ddd3e) )
1016   ROM_LOAD( "igsb0101.u8", 0x000000, 0x200000, BAD_DUMP CRC(5c995f7e) SHA1(4f08cf13e313c6802c924b914c73cab4b450da61) ) /* Graphics ROMs not confirmed to be the same */
1017   ROM_LOAD( "igsb0102.u7", 0x200000, 0x200000, BAD_DUMP CRC(a2ae9baf) SHA1(338ee260c33448568f138ca00e1d4edda4da018f) ) /* Use these until roms are dumped / verified */
1018   ROM_LOAD( "igsb0103.u6", 0x400000, 0x200000, BAD_DUMP CRC(11b927af) SHA1(2f15e5cea1b86cde3b679bdd0f3d79672d0ddd3e) )
10191019
10201020   ROM_REGION( 0xc00000, "sprites", 0 ) // Sprites
1021   ROM_LOAD( "igsa0101.u3", 0x000000, 0x400000, NO_DUMP CRC(374d07c4) SHA1(87e9bfe32cbfe9964ba7253847fbd14aa3c8ed20) )
1022   ROM_LOAD( "igsa0102.u2", 0x400000, 0x400000, NO_DUMP CRC(dbeee7ac) SHA1(e0eb0d73d9230aa6f69f5ac25d44fa19affebe88) )
1023   ROM_LOAD( "igsa0103.u1", 0x800000, 0x400000, NO_DUMP CRC(e5f19041) SHA1(c92a29bbbcb9a1f63364c665e3e0f9679add4389) )
1021   ROM_LOAD( "igsa0101.u3", 0x000000, 0x400000, BAD_DUMP CRC(374d07c4) SHA1(87e9bfe32cbfe9964ba7253847fbd14aa3c8ed20) ) /* Graphics ROMs not confirmed to be the same */
1022   ROM_LOAD( "igsa0102.u2", 0x400000, 0x400000, BAD_DUMP CRC(dbeee7ac) SHA1(e0eb0d73d9230aa6f69f5ac25d44fa19affebe88) ) /* Use these until roms are dumped / verified */
1023   ROM_LOAD( "igsa0103.u1", 0x800000, 0x400000, BAD_DUMP CRC(e5f19041) SHA1(c92a29bbbcb9a1f63364c665e3e0f9679add4389) )
10241024
10251025   ROM_REGION( 0x40000, "oki", 0 ) // Samples
10261026   ROM_LOAD( "hfh_g.u65", 0x00000, 0x40000, CRC(ec469b57) SHA1(ba1668078987ad51f47bcd3e61c51a0cf2545350) )
r8581r8582
10281028   ROM_REGION( 0x40000, "oki2", 0 ) // Samples
10291029   ROM_LOAD( "hfh_g.u66", 0x00000, 0x40000, CRC(7cfcd98e) SHA1(3b03123160adfd3404a9e0c4c68420930e80ae48) )
10301030
1031   ROM_REGION( 0x200000, "ymf", 0 ) // Samples
1032   ROM_LOAD( "yrw801-m", 0x000000, 0x200000, NO_DUMP CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca) ) // not present in this set: Yamaha YRW801 2MB ROM with samples for the OPL4
1031   ROM_REGION( 0x200000, "ymf", 0 ) // Samples (Standard Yamaha YRW801 2MB samples ROM)
1032   ROM_LOAD( "yrw801-m", 0x000000, 0x200000, CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca) ) /* Not dumped from PCB, but is a standard samples rom */
10331033ROM_END
10341034
10351035
src/mame/drivers/zerozone.c
r8581r8582
173173{
174174   zerozone_state *state = (zerozone_state *)machine->driver_data;
175175
176   state->audiocpu = devtag_get_device(machine, "audiocpu");
176   state->audiocpu = machine->device("audiocpu");
177177
178178   state_save_register_global(machine, state->tilebank);
179179}
src/mame/drivers/lemmings.c
r8581r8582
259259{
260260   lemmings_state *state = (lemmings_state *)machine->driver_data;
261261
262   state->audiocpu = devtag_get_device(machine, "audiocpu");
262   state->audiocpu = machine->device("audiocpu");
263263}
264264
265265static MACHINE_DRIVER_START( lemmings )
src/mame/drivers/espial.c
r8581r8582
6363{
6464   espial_state *state = (espial_state *)machine->driver_data;
6565
66   state->maincpu = devtag_get_device(machine, "maincpu");
67   state->audiocpu = devtag_get_device(machine, "audiocpu");
66   state->maincpu = machine->device("maincpu");
67   state->audiocpu = machine->device("audiocpu");
6868
6969   //state_save_register_global_array(machine, mcu_out[1]);
7070   state_save_register_global(machine, state->sound_nmi_enabled);
src/mame/drivers/tmnt.c
r8581r8582
22372237{
22382238   tmnt_state *state = (tmnt_state *)machine->driver_data;
22392239
2240   state->maincpu = devtag_get_device(machine, "maincpu");
2241   state->audiocpu = devtag_get_device(machine, "audiocpu");
2242   state->k007232 = devtag_get_device(machine, "k007232");
2243   state->k053260 = devtag_get_device(machine, "k053260");
2244   state->k054539 = devtag_get_device(machine, "k054539");
2245   state->upd = devtag_get_device(machine, "upd");
2246   state->samples = devtag_get_device(machine, "samples");
2247   state->k052109 = devtag_get_device(machine, "k052109");
2248   state->k051960 = devtag_get_device(machine, "k051960");
2249   state->k053245 = devtag_get_device(machine, "k053245");
2250   state->k053251 = devtag_get_device(machine, "k053251");
2251   state->k053936 = devtag_get_device(machine, "k053936");
2252   state->k054000 = devtag_get_device(machine, "k054000");
2240   state->maincpu = machine->device("maincpu");
2241   state->audiocpu = machine->device("audiocpu");
2242   state->k007232 = machine->device("k007232");
2243   state->k053260 = machine->device("k053260");
2244   state->k054539 = machine->device("k054539");
2245   state->upd = machine->device("upd");
2246   state->samples = machine->device("samples");
2247   state->k052109 = machine->device("k052109");
2248   state->k051960 = machine->device("k051960");
2249   state->k053245 = machine->device("k053245");
2250   state->k053251 = machine->device("k053251");
2251   state->k053936 = machine->device("k053936");
2252   state->k054000 = machine->device("k054000");
22532253
22542254   state_save_register_global(machine, state->toggle);
22552255   state_save_register_global(machine, state->last);
src/mame/drivers/kongambl.c
r8581r8582
2020
2121static VIDEO_START(kongambl)
2222{
23   running_device *k056832 = devtag_get_device(machine, "k056832");
23   running_device *k056832 = machine->device("k056832");
2424
2525   k056832_set_layer_association(k056832, 0);
2626   k056832_set_layer_offs(k056832, 0, -2, 0);
r8581r8582
3131
3232static VIDEO_UPDATE(kongambl)
3333{
34   running_device *k056832 = devtag_get_device(screen->machine, "k056832");
34   running_device *k056832 = screen->machine->device("k056832");
3535
3636   bitmap_fill(bitmap, cliprect, 0);
3737   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
src/mame/drivers/mogura.c
r8581r8582
195195{
196196   mogura_state *state = (mogura_state *)machine->driver_data;
197197
198   state->maincpu = devtag_get_device(machine, "maincpu");
199   state->dac1 = devtag_get_device(machine, "dac1");
200   state->dac2 = devtag_get_device(machine, "dac2");
198   state->maincpu = machine->device("maincpu");
199   state->dac1 = machine->device("dac1");
200   state->dac2 = machine->device("dac2");
201201}
202202
203203static MACHINE_DRIVER_START( mogura )
src/mame/drivers/berzerk.c
r8581r8582
474474   {
475475   /* offset 4 writes to the S14001A */
476476   case 4:
477      device = devtag_get_device(space->machine, "speech");
477      device = space->machine->device("speech");
478478      switch (data >> 6)
479479      {
480480      /* write data to the S14001 */
r8581r8582
492492         break;
493493
494494      case 1:
495         device = devtag_get_device(space->machine, "speech");
495         device = space->machine->device("speech");
496496         /* volume */
497497         s14001a_set_volume(device, ((data & 0x38) >> 3) + 1);
498498
r8581r8582
524524
525525static READ8_HANDLER( berzerk_audio_r )
526526{
527   running_device *device = devtag_get_device(space->machine, "speech");
527   running_device *device = space->machine->device("speech");
528528   switch (offset)
529529   {
530530   /* offset 4 reads from the S14001A */
src/mame/drivers/spy.c
r8581r8582
516516   machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
517517   state->pmcram = auto_alloc_array_clear(machine, UINT8, 0x800);
518518
519   state->maincpu = devtag_get_device(machine, "maincpu");
520   state->audiocpu = devtag_get_device(machine, "audiocpu");
521   state->k052109 = devtag_get_device(machine, "k052109");
522   state->k051960 = devtag_get_device(machine, "k051960");
523   state->k007232_1 = devtag_get_device(machine, "k007232_1");
524   state->k007232_2 = devtag_get_device(machine, "k007232_2");
519   state->maincpu = machine->device("maincpu");
520   state->audiocpu = machine->device("audiocpu");
521   state->k052109 = machine->device("k052109");
522   state->k051960 = machine->device("k051960");
523   state->k007232_1 = machine->device("k007232_1");
524   state->k007232_2 = machine->device("k007232_2");
525525
526526   state_save_register_global(machine, state->rambank);
527527   state_save_register_global(machine, state->pmcbank);
src/mame/drivers/psikyo.c
r8581r8582
10281028{
10291029   psikyo_state *state = (psikyo_state *)machine->driver_data;
10301030
1031   state->audiocpu = devtag_get_device(machine, "audiocpu");
1031   state->audiocpu = machine->device("audiocpu");
10321032
10331033   state_save_register_global(machine, state->soundlatch);
10341034   state_save_register_global(machine, state->z80_nmi);
src/mame/drivers/dacholer.c
r8581r8582
438438{
439439   dacholer_state *state = (dacholer_state *)machine->driver_data;
440440
441   state->audiocpu = devtag_get_device(machine, "audiocpu");
441   state->audiocpu = machine->device("audiocpu");
442442
443443   state_save_register_global(machine, state->bg_bank);
444444   state_save_register_global(machine, state->msm_data);
src/mame/drivers/esd16.c
r8581r8582
523523
524524   memory_configure_bank(machine, "bank1", 0, 17, &AUDIO[0x0000], 0x4000);
525525
526   state->audio_cpu = devtag_get_device(machine, "audiocpu");
527   state->eeprom = devtag_get_device(machine, "eeprom");
526   state->audio_cpu = machine->device("audiocpu");
527   state->eeprom = machine->device("eeprom");
528528
529529   state_save_register_global(machine, state->tilemap0_color);
530530}
src/mame/drivers/model3.c
r8581r8582
11431143      case 0x9c:      /* Unknown */
11441144         break;
11451145      default:
1146         logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(devtag_get_device(machine, "maincpu")));
1146         logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine->device("maincpu")));
11471147         break;
11481148   }
11491149}
r8581r8582
12031203static void configure_fast_ram(running_machine *machine)
12041204{
12051205   /* set conservative DRC options */
1206   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES);
1206   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES);
12071207
12081208   /* configure fast RAM regions for DRC */
1209   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x007fffff, FALSE, work_ram);
1209   ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, work_ram);
12101210}
12111211
12121212static MACHINE_START(model3_10)
r8581r8582
13691369      case 0:
13701370         if (ACCESSING_BITS_56_63)
13711371         {
1372            running_device *device = devtag_get_device(space->machine, "eeprom");
1372            running_device *device = space->machine->device("eeprom");
13731373            int reg = (data >> 56) & 0xff;
13741374            eeprom_write_bit(device, (reg & 0x20) ? 1 : 0);
13751375            eeprom_set_clock_line(device, (reg & 0x80) ? ASSERT_LINE : CLEAR_LINE);
r8581r8582
16201620   // serial configuration writes
16211621   if ((mem_mask == U64(0xff00000000000000)) && (offset == 0))
16221622   {
1623      scsp_midi_in(devtag_get_device(space->machine, "scsp1"), 0, (data>>56)&0xff, 0);
1623      scsp_midi_in(space->machine->device("scsp1"), 0, (data>>56)&0xff, 0);
16241624
16251625      // give the 68k time to notice
16261626      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(40));
src/mame/drivers/cb2001.c
r8581r8582
3636
3737------------------------------
3838
39this seems more like 8-bit hardware, maybe it should be v25, not v35...
40
3941*************************************************************************************************/
4042
4143#include "emu.h"
r8581r8582
4648#define xxxx 0x90 /* Unknown */
4749
4850static const UINT8 cb2001_decryption_table[256] = {
49   0xe8,xxxx,xxxx,xxxx,0x80,0xe4,0x12,0x27, 0x3c,xxxx,xxxx,0x23,xxxx,xxxx,xxxx,0x5f, /* 00 */
50//    pppp                pppp ???? pppp p?p?  pppp           pppp                pppp
51   xxxx,xxxx,xxxx,0x27,0x1c,xxxx,xxxx,xxxx, 0x32,xxxx,0xa0,0xd3,0x3a,0x14,0x89,0x1f, /* 10 */
52//                   p?p? pppp                 pppp      pppp pppp pppp pppp pppp pppp
53   xxxx,0x8e,xxxx,0x0f,xxxx,0x49,0xb5,xxxx, 0x56,xxxx,xxxx,0x75,0x33,0xb6,xxxx,xxxx, /* 20 */
54//         !!!!      pppp      pppp pppp       pppp           pppp pppp pppp
55   xxxx,xxxx,xxxx,xxxx,xxxx,0x22,0x5b,xxxx, xxxx,xxxx,0x74,xxxx,xxxx,0xa6,xxxx,0x74, /* 30 */
56//                             ???? pppp                 ????           pppp      pppp
51   0xe8,xxxx,xxxx,xxxx,0x80,0xe4,0x12,0x2f, 0x3c,xxxx,xxxx,0x23,xxxx,xxxx,xxxx,0x5f, /* 00 */
52//    ----                ---- **** pppp pppp  pppp           pppp                pppp
53   0x86,xxxx,xxxx,0x27,0x1c,xxxx,xxxx,xxxx, 0x32,xxxx,0xa0,0xd3,0x3a,0x14,0x89,0x1f, /* 10 */
54//    wwww           **** pppp                 pppp      pppp pppp pppp pppp pppp pppp
55   xxxx,0x8e,xxxx,0x0f,xxxx,0x49,0xb5,xxxx, 0x56,xxxx,xxxx,0x75,0x33,0xb6,xxxx,0x39, /* 20 */
56//         !!!!      pppp      pppp pppp       pppp           pppp pppp pppp      ****
57   0x89,xxxx,xxxx,xxxx,xxxx,0x22,0x5b,xxxx, xxxx,xxxx,0x74,xxxx,xxxx,0xa6,xxxx,0x74, /* 30 */
58//    wwww                     **** pppp                 debu           pppp      pppp
5759   xxxx,0xea,xxxx,xxxx,0xd0,0xb0,0x5e,xxxx, xxxx,0xa2,xxxx,xxxx,0xa3,xxxx,xxxx,0xb3, /* 40 */
58//         !!!!           ???? gggg pppp            pppp           pppp           pppp
59   0x2b,xxxx,0x2c,xxxx,0x9d,xxxx,0x42,0xc0, xxxx,xxxx,xxxx,xxxx,0xeb,0xab,xxxx,xxxx, /* 50 */
60//    ????      pppp      ????      pppp pppp                      pppp pppp
60//         !!!!           **** pppp pppp            pppp           pppp           pppp
61   xxxx,xxxx,0x2c,xxxx,0x9d,xxxx,0x42,0xc0, 0x04,xxxx,0xb7,xxxx,0xeb,0xab,xxxx,xxxx, /* 50 */
62//              pppp      ****      pppp pppp  ****      ****      pppp pppp
6163   xxxx,xxxx,xxxx,xxxx,0x0a,xxxx,xxxx,xxxx, 0xa1,0xa5,xxxx,xxxx,xxxx,0xbb,0xba,xxxx, /* 60 */
62//                        pppp                 pppp pppp                pppp gggg
63   0xc3,0x53,0x02,0x58,xxxx,xxxx,0x24,xxxx, 0x72,xxxx,0xf3,xxxx,xxxx,0x43,xxxx,xxxx, /* 70 */
64//    pppp pppp pppp pppp           pppp       pppp      pppp           pppp
65   0x26,xxxx,xxxx,xxxx,xxxx,0x3d,0xfb,0xf6, xxxx,xxxx,0x59,xxxx,0x73,xxxx,0x2a,xxxx, /* 80 */
66//    pppp                     pppp ???? pppp            pppp      pppp      ????
67   xxxx,xxxx,0xe9,xxxx,xxxx,0xbe,xxxx,xxxx, xxxx,xxxx,0x57,xxxx,0xb9,xxxx,0xbf,xxxx, /* 90 */
68//              pppp           pppp                      pppp      pppp      pppp
64//                        pppp                 pppp pppp                pppp pppp
65   0xc3,0x53,0x02,0x58,xxxx,xxxx,0x24,xxxx, 0x72,xxxx,0xf3,xxxx,xxxx,0x43,xxxx,0x34, /* 70 */
66//    pppp pppp pppp pppp           pppp       pppp      pppp           pppp      ****
67   0x26,xxxx,0x81,xxxx,xxxx,0x3d,0xfb,0xf6, xxxx,xxxx,0x59,xxxx,0x73,xxxx,0x2a,xxxx, /* 80 */
68//    pppp      wwww           pppp **** pppp            pppp      pppp      pppp
69   xxxx,0x3d,0xe9,xxxx,xxxx,0xbe,0xf9,xxxx, xxxx,xxxx,0x57,xxxx,0xb9,xxxx,0xbf,xxxx, /* 90 */
70//         wwww pppp           pppp ****                 pppp      pppp      pppp
6971   0xc1,xxxx,0xe6,0x06,0xaa,0x9c,0xad,0xb8, 0x4e,xxxx,0x8d,0x50,0x51,0xa4,xxxx,0x1a, /* A0 */
70//    ????      pppp pppp pppp ???? pppp !!!!  pppp      pppp pppp pppp pppp      pppp
71   0xac,xxxx,0xb4,xxxx,xxxx,0x83,xxxx,xxxx, xxxx,0x13,0x03,xxxx,0x1e,xxxx,0x07,0xcf, /* B0 */
72//    pppp      pppp           pppp                 ???? pppp      pppp      pppp pppp
73   0xcb,0xec,0xee,xxxx,xxxx,0xe2,0x87,xxxx, xxxx,xxxx,0x76,0x61,xxxx,xxxx,0x2e,xxxx, /* C0 */
74//    pppp pppp pppp           pppp pppp                 pppp ????           pppp
75   xxxx,0xf3,0x46,xxxx,0x60,xxxx,0x4f,0x47, 0x88,xxxx,xxxx,xxxx,xxxx,0xfa,0xc7,0x8b, /* D0 */
76//         ???? pppp      ????      pppp pppp  pppp                     ???? !!!! pppp
77   0x8a,0xb1,xxxx,0xc6,xxxx,0x5a,xxxx,xxxx, 0x9a,0x52,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* E0 */
78//    pppp gggg      !!!!      ????            pppp ????
79   xxxx,0xae,0xfe,xxxx,xxxx,xxxx,xxxx,0x2a, xxxx,xxxx,0x1c,xxxx,0x81,xxxx,xxxx,xxxx, /* F0 */
80//         ???? pppp                     ????            ????      ????
72//    ****      pppp pppp pppp **** pppp !!!!  pppp      pppp pppp pppp pppp      pppp
73   0xac,xxxx,0xb4,xxxx,xxxx,0x83,xxxx,xxxx, xxxx,0x05,0x03,xxxx,0x1e,0x43,0x07,0xcf, /* B0 */
74//    pppp      pppp           pppp                 pppp pppp      pppp **** pppp pppp
75   0xcb,0xec,0xee,xxxx,xxxx,0xe2,0x87,xxxx, xxxx,xxxx,0x76,0x61,0x48,xxxx,0x2e,xxxx, /* C0 */
76//    pppp pppp pppp           pppp pppp                 pppp **** ****      pppp
77   xxxx,0xf2,0x46,xxxx,0x60,xxxx,0x4f,0x47, 0x88,xxxx,xxxx,0x04,xxxx,0xfa,0xc7,0x8b, /* D0 */
78//         ???? pppp      ****      pppp pppp  pppp           wwww      **** !!!! pppp
79   0x8a,0xb1,xxxx,0xc6,xxxx,0x5a,xxxx,0xb2, 0x9a,0x52,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* E0 */
80//    pppp gggg      !!!!      ****      pppp  pppp ****
81   xxxx,0xae,0xfe,xxxx,xxxx,xxxx,xxxx,0x2a, xxxx,xxxx,0x04,xxxx,0x81,xxxx,xxxx,xxxx, /* F0 */
82//         ???? pppp                     ****            wwww      pppp
8183};
8284
8385/* robiza's notes:
8486
85sure:
86e8 -> 9a call_far
87c0 -> cb ret_f
88
89aa -> 8d
90aa 1e ## ## -> bb mov bw,####
91aa 26 ## ## -> bc mov sp,####
92aa 36 ## ## -> be mov ix,####
93aa 3e ## ## -> bf mov iy,####
94
95e01f7-e0204 (b0 -> ac) (ce -> 2e) (a4 -> aa) : this routine write the "dyna..." string in nvram
96e33ac / 2bbc : c6 -> 87, 9a -> 57, 28 -> 56, 46 -> 5e, 0f -> 5f, a8 -> 4e, ab -> 50, 73 -> 58
97
98
9987e0022 a5         push psw ?
10088e0023 d4         push r ?
101e0024 bc         push ds0                                                          (bc -> 1e)
102e0025 a3         push ds1                                                          (a3 -> 06)
89e0024 bc         push ds0                 (bc -> 1e)
90e0025 a3         push ds1                 (a3 -> 06)
10391e0026 dd         di ?
10492e0027 a7 00 00   mov aw,0
10593e002a 21 d8      mov ds0,aw
r8581r8582
10896e0030 49 67 07   mov [767],al
10997e0033 45 01      mov al,1
11098e0035 49 d3 06   mov [6d3],al
99...
100e00a6 be         pop ds1                  (be -> 07)
101e00a7 1f         pop ds0                  (1f -> 1f)
102e00a8 05 30      in al, 30 ?
103e00aa cb         pop r ?
104e00ab 54         pop psw ?
105e00ac 23 92      fint                     (23 -> 0f)
106e00ae bf         reti
111107
108cmast91 and cmv4 seems similar to this cb2001:
109
110cmast91:                                  cb2001:
111
1121120089 call 2a9d                            e0038 call e30a2
113  2a9d ld hl,d0b3                           e30a2 lea bw,[04a6]          (1e -> bb)
113  2a9d ld hl,d0b3                           e30a2 lea bw,[04a6]
114114  2aa0 inc (hl)                             e30a5 inc b ptr[bw]
115115  2aa1 inc hl                               e30a8 inc bw
116116  2aa2 inc (hl)                             e30a9 inc b ptr[bw]
r8581r8582
149149.                                           e0066 mov aw,1
150150.                                           e0069 br e006e
151151
152
153
154e00a6 be         pop ds1                                                             (be -> 07)
155e00a7 1f         pop ds0                                                             (1f -> 1f)
156e00a8 05         pop r ?
157e0030 30         pop psw ?
158e00aa cb         ?
159e00ab 54         ?
160e00ac 23 92      fint                                                                (23 -> 0f)
161e00ae bf         reti
162
163
164cmast91 and cmv4 seems similar to this cb2001:
165
166cmast91:                      cb2001:
1671520067 ld a,$07                 e0130 mov al,7h
1681530069 out ($23),a              e0132 mov dw,23h
169154                              e0135 out dw,al
r8581r8582
1761610071 out ($13),a              e0126 mov dw,13h
177162                              e0129 out dw,al
178163
179-------------------------------------------------
164-----------------
180165
181166cmv4                          cb2001                     (en -> de)
182167
r8581r8582
243228  4aae ld e,(hl)                .
244229  4aaf inc hl                   .
245230  4abo ld d,(hl)                .
246  4ab1 ex de,hl                 e66f2 mov bw,w ptr ss[bw](df -> 8b)prefix not sure about prefix
231  4ab1 ex de,hl                 e66f2 mov bw,w ptr ss[bw](df -> 8b)
247232  4ab2 xor a                    .
248233  4ab3 ld ($d618),a             e66f5 mov b ptr[72dh],ah (d8 -> 88)
249234  4ab6 ld ($d619),a             e66f9 mov b ptr[72eh],ah
r8581r8582
262247  .                             e6716 or bw,bw                      ??? (0b -> 23) ???
263248  .                             e6718 bne 0e671bh
264249  .                             e671a ret
265  4acc ld a,(hl)                e671b mov al,b ptr ps[bw](ce -> 2e) (e0 -> 8a) not sure about the prefix
250  4acc ld a,(hl)                e671b mov al,b ptr ps[bw](ce -> 2e) (e0 -> 8a)
266251  4acd inc hl                   e671e inc bw             (7d -> 43)
267252  4ace cp $f0                   e671f cmp al,0f0h
268253  4ad0 jr nc,$4b14              e6721 bnc 0e676fh        (8c -> 73)
r8581r8582
297282  .                             e6755 mov dw,23h
298283  4b06 out ($03),a              e6758 out dw,al
299284
300
301
302
303285-------------------------------------------------
304286
305
30628756 -> 42 (inc dw or dec dw)
307288
308aa -> ????
30928992 -> e9 (probably)
3101c ????
311dd -> fa (di)
290dd -> fa (di) (probably)
312291
313292checked against gussun (from 10000) and quizf1 (start up code):
31429341 -> ea (jmp_far)
r8581r8582
317296de -> c7
318297e3 -> c6
319298
320opcodes: 18,c5 probably:
321e1af1 36 62 06 mov ix,0662
322      9c 04 00 mov cw,0004
323      00 94 17 call e328e
324
325e328e 18 c0 xor al,al
326      d8 04 mov byte ptr [ix],al
327      d2    inc ix
328      c5 fb dbnz e3290
329      70    ret
330299*/
331300
332301static UINT16 *cb2001_vram_fg;
333302static UINT16* cb2001_vram_bg;
334303static int cb2001_videobank;
304static int cb2001_videomode;
335305
336static VIDEO_START(cb2001)
337{
306static tilemap_t *reel1_tilemap, *reel2_tilemap, *reel3_tilemap;
338307
339}
340308
309// these areas are wrong
310static const rectangle visible1 = { 0*8, (14+48)*8-1,  3*8,  (3+7)*8-1 };
311static const rectangle visible2 = { 0*8, (14+48)*8-1, 10*8, (10+7)*8-1 };
312static const rectangle visible3 = { 0*8, (14+48)*8-1, 17*8, (17+7)*8-1 };
313
341314static VIDEO_UPDATE(cb2001)
342315{
343316   int count,x,y;
317   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
344318
345319   count = 0x0000;
346320
347   for (y=0;y<32;y++)
321   // render bg as 8x8 tilemaps
322   if (!(cb2001_videomode & 0x03))
348323   {
349      for (x=0;x<64;x++)
324      for (y=0;y<32;y++)
350325      {
351         int tile;
352         int colour;
326         for (x=0;x<64;x++)
327         {
328            int tile;
329            int colour;
353330
354         tile = (cb2001_vram_bg[count] & 0x0fff);
355         colour = (cb2001_vram_bg[count] & 0xf000)>>12;
356         tile += cb2001_videobank*0x2000;
331            tile = (cb2001_vram_bg[count] & 0x0fff);
332            colour = (cb2001_vram_bg[count] & 0xf000)>>12;
333            tile += cb2001_videobank*0x2000;
357334
358         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8);
335            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8);
359336
360         count++;
337            count++;
338         }
361339      }
362340   }
341   else
342   {
343      int i;
363344
345      for (i= 0;i < 64;i++)
346      {
347         UINT16 scroll;
364348
349         scroll = cb2001_vram_bg[0xa00/2 + i/2];
350         if (i&1)
351            scroll >>=8;
352         scroll &=0xff;
353
354         tilemap_set_scrolly(reel2_tilemap, i, scroll);
355
356         scroll = cb2001_vram_bg[0x800/2 + i/2];
357         if (i&1)
358            scroll >>=8;
359         scroll &=0xff;
360
361         tilemap_set_scrolly(reel1_tilemap, i, scroll);
362
363         scroll = cb2001_vram_bg[0xc00/2 + i/2];
364         if (i&1)
365            scroll >>=8;
366         scroll &=0xff;
367
368         tilemap_set_scrolly(reel3_tilemap, i, scroll);
369
370      }
371
372
373      tilemap_draw(bitmap, &visible1, reel1_tilemap, 0, 0);
374      tilemap_draw(bitmap, &visible2, reel2_tilemap, 0, 0);
375      tilemap_draw(bitmap, &visible3, reel3_tilemap, 0, 0);
376   }
377
365378   count = 0x0000;
366379
367380   for (y=0;y<32;y++)
r8581r8582
375388         colour = (cb2001_vram_fg[count] & 0xf000)>>12;
376389         tile += cb2001_videobank*0x2000;
377390
378         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8, 0);
391         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8,0);
379392         count++;
380393      }
381394   }
r8581r8582
394407      cb2001_videobank = (data & 0x0800)>>11;
395408   }
396409   else // something else
397      logerror("cb2001_vidctrl_w %04x %04x\n", data, mem_mask);
410      printf("cb2001_vidctrl_w %04x %04x\n", data, mem_mask);
398411}
399412
400413WRITE16_HANDLER( cb2001_vidctrl2_w )
401414{
402415   if (mem_mask&0xff00) // video control?
403416   {
404      logerror("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask);
417      printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // i think this switches to 'reels' mode
418      cb2001_videomode = (data>>8) & 0x03; // which bit??
405419   }
406420   else // something else
407      logerror("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // bank could be here instead
421      printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // bank could be here instead
408422}
409423
424
425static TILE_GET_INFO( get_cb2001_reel1_tile_info )
426{
427   int code = cb2001_vram_bg[(0x0000/2) + tile_index/2];
428
429   if (tile_index&1)
430      code >>=8;
431
432   code &=0xff;
433
434   int colour = 0;//= (cb2001_out_c&0x7) + 8;
435
436   SET_TILE_INFO(
437         1,
438         code+0x800,
439         colour,
440         0);
441}
442
443static TILE_GET_INFO( get_cb2001_reel2_tile_info )
444{
445   int code = cb2001_vram_bg[(0x0200/2) + tile_index/2];
446
447   if (tile_index&1)
448      code >>=8;
449
450   code &=0xff;
451
452   int colour = 0;//(cb2001_out_c&0x7) + 8;
453
454   SET_TILE_INFO(
455         1,
456         code+0x800,
457         colour,
458         0);
459}
460
461
462static TILE_GET_INFO( get_cb2001_reel3_tile_info )
463{
464   int code = cb2001_vram_bg[(0x0400/2) + tile_index/2];
465   int colour = 0;//(cb2001_out_c&0x7) + 8;
466
467   if (tile_index&1)
468      code >>=8;
469
470   code &=0xff;
471
472   SET_TILE_INFO(
473         1,
474         code+0x800,
475         colour,
476         0);
477}
478
479
480static VIDEO_START(cb2001)
481{
482   reel1_tilemap = tilemap_create(machine,get_cb2001_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
483   reel2_tilemap = tilemap_create(machine,get_cb2001_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
484   reel3_tilemap = tilemap_create(machine,get_cb2001_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
485
486   tilemap_set_scroll_cols(reel1_tilemap, 64);
487   tilemap_set_scroll_cols(reel2_tilemap, 64);
488   tilemap_set_scroll_cols(reel3_tilemap, 64);
489}
490
491WRITE16_HANDLER( cb2001_bg_w )
492{
493   COMBINE_DATA(&cb2001_vram_bg[offset]);
494
495   // also used for the reel tilemaps in a different mode
496/*
497    if (offset<0x200/2)
498    {
499        tilemap_mark_tile_dirty(reel1_tilemap,(offset&0xff)/2);
500    }
501    else if (offset<0x400/2)
502    {
503        tilemap_mark_tile_dirty(reel2_tilemap,(offset&0xff)/2);
504    }
505    else if (offset<0x600/2)
506    {
507        tilemap_mark_tile_dirty(reel3_tilemap,(offset&0xff)/2);
508    }
509    else if (offset<0x800/2)
510    {
511    //  tilemap_mark_tile_dirty(reel4_tilemap,(offset&0xff)/2);
512    }
513*/
514   tilemap_mark_all_tiles_dirty (reel1_tilemap);
515   tilemap_mark_all_tiles_dirty (reel2_tilemap);
516   tilemap_mark_all_tiles_dirty (reel3_tilemap);
517
518
519}
520
410521static ADDRESS_MAP_START( cb2001_map, ADDRESS_SPACE_PROGRAM, 16 )
411522   AM_RANGE(0x00000, 0x1ffff) AM_RAM
412523   AM_RANGE(0x20000, 0x20fff) AM_RAM AM_BASE(&cb2001_vram_fg)
413   AM_RANGE(0x21000, 0x21fff) AM_RAM AM_BASE(&cb2001_vram_bg)
524   AM_RANGE(0x21000, 0x21fff) AM_RAM_WRITE(&cb2001_bg_w) AM_BASE(&cb2001_vram_bg)
414525   AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0)
415526ADDRESS_MAP_END
416527
417528static ADDRESS_MAP_START( cb2001_io, ADDRESS_SPACE_IO, 16 )
418//  ADDRESS_MAP_GLOBAL_MASK(0x00ff)
419529   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE8("ppi8255_0", ppi8255_r, ppi8255_w, 0xffff)   /* Input Ports */
420530   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE8("ppi8255_1", ppi8255_r, ppi8255_w, 0xffff)   /* DIP switches */
421   AM_RANGE(0x20, 0x21) AM_DEVREAD8("aysnd", ay8910_r, 0x00ff)
531   AM_RANGE(0x20, 0x21) AM_DEVREAD8("aysnd", ay8910_r, 0xff00)
422532   AM_RANGE(0x22, 0x23) AM_DEVWRITE8("aysnd", ay8910_data_address_w, 0xffff)
423533
424534   AM_RANGE(0x30, 0x31) AM_WRITE(cb2001_vidctrl_w)
r8581r8582
427537
428538static INPUT_PORTS_START( cb2001 )
429539   PORT_START("IN0")
430   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
431   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
540   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
541   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE )
432542   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 / Big")
433543   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop 1 / D-UP")
434544   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All / Take")
r8581r8582
604714   8*32
605715};
606716
717
607718static const gfx_layout cb2001_layout32 =
608719   {
609720   8,32,
r8581r8582
616727};
617728
618729static GFXDECODE_START( cb2001 )
619   GFXDECODE_ENTRY( "gfx", 0, cb2001_layout,   0x0, 32 )
730   GFXDECODE_ENTRY( "gfx", 0, cb2001_layout,   0x0, 32 )
620731   GFXDECODE_ENTRY( "gfx", 0, cb2001_layout32, 0x0, 32 )
621732GFXDECODE_END
622733
r8581r8582
741852GAME( 2001, cb2001,    0,      cb2001,      cb2001,   0, ROT0,  "Dyna", "Cherry Bonus 2001", GAME_NOT_WORKING|GAME_NO_SOUND )
742853GAME( 2001, scherrym,  0,      cb2001,      cb2001,   0, ROT0,  "Dyna", "Super Cherry Master", GAME_NOT_WORKING|GAME_NO_SOUND ) // 2001 version? (we have bootlegs running on z80 hw of a 1996 version)
743854
855
src/mame/drivers/funkyjet.c
r8581r8582
300300{
301301   funkyjet_state *state = (funkyjet_state *)machine->driver_data;
302302
303   state->maincpu = devtag_get_device(machine, "maincpu");
304   state->audiocpu = devtag_get_device(machine, "audiocpu");
305   state->deco16ic = devtag_get_device(machine, "deco_custom");
303   state->maincpu = machine->device("maincpu");
304   state->audiocpu = machine->device("audiocpu");
305   state->deco16ic = machine->device("deco_custom");
306306}
307307
308308static MACHINE_DRIVER_START( funkyjet )
src/mame/drivers/xexex.c
r8581r8582
469469   memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x10000], 0x4000);
470470   memory_set_bank(machine, "bank2", 0);
471471
472   state->maincpu = devtag_get_device(machine, "maincpu");
473   state->audiocpu = devtag_get_device(machine, "audiocpu");
474   state->k053246 = devtag_get_device(machine, "k053246");
475   state->k053250 = devtag_get_device(machine, "k053250");
476   state->k053251 = devtag_get_device(machine, "k053251");
477   state->k053252 = devtag_get_device(machine, "k053252");
478   state->k056832 = devtag_get_device(machine, "k056832");
479   state->k054338 = devtag_get_device(machine, "k054338");
480   state->k054539 = devtag_get_device(machine, "k054539");
481   state->filter1l = devtag_get_device(machine, "filter1l");
482   state->filter1r = devtag_get_device(machine, "filter1r");
483   state->filter2l = devtag_get_device(machine, "filter2l");
484   state->filter2r = devtag_get_device(machine, "filter2r");
472   state->maincpu = machine->device("maincpu");
473   state->audiocpu = machine->device("audiocpu");
474   state->k053246 = machine->device("k053246");
475   state->k053250 = machine->device("k053250");
476   state->k053251 = machine->device("k053251");
477   state->k053252 = machine->device("k053252");
478   state->k056832 = machine->device("k056832");
479   state->k054338 = machine->device("k054338");
480   state->k054539 = machine->device("k054539");
481   state->filter1l = machine->device("filter1l");
482   state->filter1r = machine->device("filter1r");
483   state->filter2l = machine->device("filter2l");
484   state->filter2r = machine->device("filter2r");
485485
486486   state_save_register_global(machine, state->cur_alpha);
487487   state_save_register_global(machine, state->sprite_colorbase);
r8581r8582
516516   state->suspension_active = 0;
517517   state->resume_trigger = 1000;
518518   state->frame = -1;
519   k054539_init_flags(devtag_get_device(machine, "k054539"), K054539_REVERSE_STEREO);
519   k054539_init_flags(machine->device("k054539"), K054539_REVERSE_STEREO);
520520}
521521
522522static MACHINE_DRIVER_START( xexex )
src/mame/drivers/ironhors.c
r8581r8582
360360{
361361   ironhors_state *state = (ironhors_state *)machine->driver_data;
362362
363   state->soundcpu = devtag_get_device(machine, "soundcpu");
363   state->soundcpu = machine->device("soundcpu");
364364
365365   state_save_register_global(machine, state->palettebank);
366366   state_save_register_global(machine, state->charbank);
src/mame/drivers/skullxbo.c
r8581r8582
4141
4242static TIMER_CALLBACK( irq_gen )
4343{
44   atarigen_scanline_int_gen(devtag_get_device(machine, "maincpu"));
44   atarigen_scanline_int_gen(machine->device("maincpu"));
4545}
4646
4747
src/mame/drivers/mrflea.c
r8581r8582
329329{
330330   mrflea_state *state = (mrflea_state *)machine->driver_data;
331331
332   state->maincpu = devtag_get_device(machine, "maincpu");
333   state->subcpu = devtag_get_device(machine, "sub");
332   state->maincpu = machine->device("maincpu");
333   state->subcpu = machine->device("sub");
334334
335335   state_save_register_global(machine, state->gfx_bank);
336336   state_save_register_global(machine, state->io);
src/mame/drivers/cps3.c
r8581r8582
7575** NOT DUMPED but known to exist
7676
7777The Game Region / No CD Flags / Development flags etc. are controlled by a byte in the bios roms.  The CDs
78contain revisions of the game code and are independant of the region.
78contain revisions of the game code and are independent of the region.
7979
8080The CP SYSTEM III comprises a main board with several custom ASICs, custom 72-pin SIMMs for program
8181and graphics storage (the same SIMMs are also used in some CPS2 titles), SCSI CDROM and CDROM disc,
r8581r8582
694694   if (!cps3_user5region) cps3_user5region = auto_alloc_array(machine, UINT8, USER5REGION_LENGTH);
695695
696696   // set strict verify
697   sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_STRICT_VERIFY);
697   sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY);
698698
699699   cps3_decrypt_bios(machine);
700700   decrypted_gamerom = auto_alloc_array(machine, UINT32, 0x1000000/4);
src/mame/drivers/spiders.c
r8581r8582
231231
232232static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
233233{
234   running_device *pia1 = devtag_get_device(device->machine, "pia1");
235   running_device *pia2 = devtag_get_device(device->machine, "pia2");
236   running_device *pia3 = devtag_get_device(device->machine, "pia3");
234   running_device *pia1 = device->machine->device("pia1");
235   running_device *pia2 = device->machine->device("pia2");
236   running_device *pia3 = device->machine->device("pia3");
237237   int combined_state = pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1) |
238238                                       pia6821_get_irq_b(pia2) |
239239                   pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3);
r8581r8582
279279
280280static INTERRUPT_GEN( update_pia_1 )
281281{
282   running_device *pia1 = devtag_get_device(device->machine, "pia1");
282   running_device *pia1 = device->machine->device("pia1");
283283   /* update the different PIA pins from the input ports */
284284
285285   /* CA1 - copy of PA1 (COIN1) */
286   pia6821_ca1_w(pia1, 0, input_port_read(device->machine, "IN0") & 0x02);
286   pia6821_ca1_w(pia1, input_port_read(device->machine, "IN0") & 0x02);
287287
288288   /* CA2 - copy of PA0 (SERVICE1) */
289   pia6821_ca2_w(pia1, 0, input_port_read(device->machine, "IN0") & 0x01);
289   pia6821_ca2_w(pia1, input_port_read(device->machine, "IN0") & 0x01);
290290
291291   /* CB1 - (crosshatch) */
292   pia6821_cb1_w(pia1, 0, input_port_read(device->machine, "XHATCH"));
292   pia6821_cb1_w(pia1, input_port_read(device->machine, "XHATCH"));
293293
294294   /* CB2 - NOT CONNECTED */
295295}
r8581r8582
382382
383383static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed)
384384{
385   running_device *pia2 = devtag_get_device(device->machine, "pia2");
386   pia6821_ca1_w(pia2, 0, data);
385   running_device *pia2 = device->machine->device("pia2");
386   pia6821_ca1_w(pia2, data);
387387}
388388
389389
r8581r8582
509509
510510static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
511511{
512   ttl74123_a_w(devtag_get_device(device->machine, "ic60"), 0, state);
512   ttl74123_a_w(device->machine->device("ic60"), 0, state);
513513}
514514
515515
r8581r8582
530530
531531static VIDEO_UPDATE( spiders )
532532{
533   running_device *mc6845 = devtag_get_device(screen->machine, "crtc");
533   running_device *mc6845 = screen->machine->device("crtc");
534534   mc6845_update(mc6845, bitmap, cliprect);
535535
536536   return 0;
src/mame/drivers/mlanding.c
r8581r8582
301301
302302static WRITE16_HANDLER( ml_to_sound_w )
303303{
304   running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt");
304   running_device *tc0140syt = space->machine->device("tc0140syt");
305305   if (offset == 0)
306306      tc0140syt_port_w(tc0140syt, 0, data & 0xff);
307307   else if (offset == 1)
r8581r8582
313313
314314static WRITE8_HANDLER( ml_sound_to_main_w )
315315{
316   running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt");
316   running_device *tc0140syt = space->machine->device("tc0140syt");
317317   if (offset == 0)
318318      tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff);
319319   else if (offset == 1)
src/mame/drivers/seattle.c
r8581r8582
500500{
501501   int index;
502502
503   voodoo = devtag_get_device(machine, "voodoo");
503   voodoo = machine->device("voodoo");
504504
505505   /* allocate timers for the galileo */
506506   galileo.timer[0].timer = timer_alloc(machine, galileo_timer_callback, NULL);
r8581r8582
509509   galileo.timer[3].timer = timer_alloc(machine, galileo_timer_callback, NULL);
510510
511511   /* set the fastest DRC options, but strict verification */
512   mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
512   mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
513513
514514   /* configure fast RAM regions for DRC */
515   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x007fffff, FALSE, rambase);
516   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  rombase);
515   mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, rambase);
516   mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  rombase);
517517
518518   /* register for save states */
519519   state_save_register_global_array(machine, galileo.reg);
r8581r8582
556556   cpu_stalled_on_voodoo = FALSE;
557557
558558   /* reset either the DCS2 board or the CAGE board */
559   if (devtag_get_device(machine, "dcs2") != NULL)
559   if (machine->device("dcs2") != NULL)
560560   {
561561      dcs_reset_w(1);
562562      dcs_reset_w(0);
563563   }
564   else if (devtag_get_device(machine, "cage") != NULL)
564   else if (machine->device("cage") != NULL)
565565   {
566566      cage_control_w(machine, 0);
567567      cage_control_w(machine, 3);
r8581r8582
13331333      }
13341334      else
13351335      {
1336         if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(devtag_get_device(device->machine, "maincpu")));
1337         cpu_spinuntil_trigger(devtag_get_device(device->machine, "maincpu"), 45678);
1336         if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(device->machine->device("maincpu")));
1337         cpu_spinuntil_trigger(device->machine->device("maincpu"), 45678);
13381338      }
13391339   }
13401340
r8581r8582
17201720{
17211721   /* note that blitz times out if we don't have this cycle stealing */
17221722   if (offset == 0x3f6/4)
1723      cpu_eat_cycles(devtag_get_device(device->machine, "maincpu"), 100);
1723      cpu_eat_cycles(device->machine->device("maincpu"), 100);
17241724   return ide_controller32_r(device, offset, mem_mask);
17251725}
17261726
r8581r8582
27952795
27962796      case SEATTLE_WIDGET_CONFIG:
27972797         /* set up the widget board */
2798         device = devtag_get_device(machine, "ethernet");
2798         device = machine->device("ethernet");
27992799         memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x16c00000, 0x16c0001f, 0, 0, widget_r, widget_w);
28002800         break;
28012801
r8581r8582
28042804         memory_install_readwrite32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x14000000, 0x14000003, 0, 0, analog_port_r, analog_port_w);
28052805
28062806         /* set up the ethernet controller */
2807         device = devtag_get_device(machine, "ethernet");
2807         device = machine->device("ethernet");
28082808         memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x16c00000, 0x16c0003f, 0, 0, ethernet_r, ethernet_w);
28092809         break;
28102810   }
r8581r8582
28172817   init_common(machine, MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG);
28182818
28192819   /* speedups */
2820   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8004413C, 0x0C0054B4, 250);      /* confirmed */
2821   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80094930, 0x00A2102B, 250);      /* confirmed */
2822   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80092984, 0x3C028011, 250);      /* confirmed */
2820   mips3drc_add_hotspot(machine->device("maincpu"), 0x8004413C, 0x0C0054B4, 250);      /* confirmed */
2821   mips3drc_add_hotspot(machine->device("maincpu"), 0x80094930, 0x00A2102B, 250);      /* confirmed */
2822   mips3drc_add_hotspot(machine->device("maincpu"), 0x80092984, 0x3C028011, 250);      /* confirmed */
28232823}
28242824
28252825
r8581r8582
28292829   init_common(machine, MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG);
28302830
28312831   /* speedups */
2832   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800108F8, 0x8C420000, 250);      /* confirmed */
2832   mips3drc_add_hotspot(machine->device("maincpu"), 0x800108F8, 0x8C420000, 250);      /* confirmed */
28332833}
28342834
28352835
r8581r8582
28392839   init_common(machine, MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG);
28402840
28412841   /* speedups */
2842   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80059F34, 0x3C028012, 250);      /* confirmed */
2843   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800A5AF4, 0x8E300010, 250);      /* confirmed */
2844   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8004C260, 0x3C028012, 250);      /* confirmed */
2842   mips3drc_add_hotspot(machine->device("maincpu"), 0x80059F34, 0x3C028012, 250);      /* confirmed */
2843   mips3drc_add_hotspot(machine->device("maincpu"), 0x800A5AF4, 0x8E300010, 250);      /* confirmed */
2844   mips3drc_add_hotspot(machine->device("maincpu"), 0x8004C260, 0x3C028012, 250);      /* confirmed */
28452845}
28462846
28472847
r8581r8582
28512851   init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG);
28522852
28532853   /* speedups */
2854   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800343E8, 0x3C028012, 250);      /* confirmed */
2855   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8008F4F0, 0x3C028012, 250);      /* confirmed */
2856   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800A365C, 0x8E300014, 250);      /* confirmed */
2857   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80051DAC, 0x3C028012, 250);      /* confirmed */
2854   mips3drc_add_hotspot(machine->device("maincpu"), 0x800343E8, 0x3C028012, 250);      /* confirmed */
2855   mips3drc_add_hotspot(machine->device("maincpu"), 0x8008F4F0, 0x3C028012, 250);      /* confirmed */
2856   mips3drc_add_hotspot(machine->device("maincpu"), 0x800A365C, 0x8E300014, 250);      /* confirmed */
2857   mips3drc_add_hotspot(machine->device("maincpu"), 0x80051DAC, 0x3C028012, 250);      /* confirmed */
28582858}
28592859
28602860
r8581r8582
28652865   midway_ioasic_set_auto_ack(1);
28662866
28672867   /* speedups */
2868   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80032534, 0x02221024, 250);      /* confirmed */
2869   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800B1BE4, 0x8E110014, 250);      /* confirmed */
2868   mips3drc_add_hotspot(machine->device("maincpu"), 0x80032534, 0x02221024, 250);      /* confirmed */
2869   mips3drc_add_hotspot(machine->device("maincpu"), 0x800B1BE4, 0x8E110014, 250);      /* confirmed */
28702870}
28712871
28722872
r8581r8582
28762876   init_common(machine, MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG);
28772877
28782878   /* speedups */
2879   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80049F14, 0x3C028020, 250);      /* confirmed */
2880   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8004859C, 0x3C028020, 250);      /* confirmed */
2881   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8005922C, 0x8E020014, 250);      /* confirmed */
2879   mips3drc_add_hotspot(machine->device("maincpu"), 0x80049F14, 0x3C028020, 250);      /* confirmed */
2880   mips3drc_add_hotspot(machine->device("maincpu"), 0x8004859C, 0x3C028020, 250);      /* confirmed */
2881   mips3drc_add_hotspot(machine->device("maincpu"), 0x8005922C, 0x8E020014, 250);      /* confirmed */
28822882}
28832883
28842884
r8581r8582
29002900   rombase[0x934/4] += 4;
29012901
29022902   /* main CPU speedups */
2903   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80135510, 0x3C028024, 250);      /* confirmed */
2904   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x800087DC, 0x8E820010, 250);      /* confirmed */
2903   mips3drc_add_hotspot(machine->device("maincpu"), 0x80135510, 0x3C028024, 250);      /* confirmed */
2904   mips3drc_add_hotspot(machine->device("maincpu"), 0x800087DC, 0x8E820010, 250);      /* confirmed */
29052905}
29062906
29072907
r8581r8582
29112911   init_common(machine, MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG);
29122912
29132913   /* speedups */
2914   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8014E41C, 0x3C038025, 250);      /* confirmed */
2915   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80011F10, 0x8E020018, 250);      /* confirmed */
2914   mips3drc_add_hotspot(machine->device("maincpu"), 0x8014E41C, 0x3C038025, 250);      /* confirmed */
2915   mips3drc_add_hotspot(machine->device("maincpu"), 0x80011F10, 0x8E020018, 250);      /* confirmed */
29162916}
29172917
29182918
r8581r8582
29222922   init_common(machine, MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG);
29232923
29242924   /* speedups */
2925   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8015773C, 0x3C038025, 250);      /* confirmed */
2926   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80012CA8, 0x8E020018, 250);      /* confirmed */
2925   mips3drc_add_hotspot(machine->device("maincpu"), 0x8015773C, 0x3C038025, 250);      /* confirmed */
2926   mips3drc_add_hotspot(machine->device("maincpu"), 0x80012CA8, 0x8E020018, 250);      /* confirmed */
29272927}
29282928
29292929
r8581r8582
29362936   memory_install_readwrite32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r, carnevil_gun_w);
29372937
29382938   /* speedups */
2939   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x8015176C, 0x3C03801A, 250);      /* confirmed */
2940   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80011FBC, 0x8E020018, 250);      /* confirmed */
2939   mips3drc_add_hotspot(machine->device("maincpu"), 0x8015176C, 0x3C03801A, 250);      /* confirmed */
2940   mips3drc_add_hotspot(machine->device("maincpu"), 0x80011FBC, 0x8E020018, 250);      /* confirmed */
29412941}
29422942
29432943
r8581r8582
29472947   init_common(machine, MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG);
29482948
29492949   /* speedups */
2950   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x801643BC, 0x3C03801B, 250);      /* confirmed */
2951   mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80011FB8, 0x8E020018, 250);      /* confirmed */
2952   //mips3drc_add_hotspot(devtag_get_device(machine, "maincpu"), 0x80136A80, 0x3C02801D, 250);      /* potential */
2950   mips3drc_add_hotspot(machine->device("maincpu"), 0x801643BC, 0x3C03801B, 250);      /* confirmed */
2951   mips3drc_add_hotspot(machine->device("maincpu"), 0x80011FB8, 0x8E020018, 250);      /* confirmed */
2952   //mips3drc_add_hotspot(machine->device("maincpu"), 0x80136A80, 0x3C02801D, 250);      /* potential */
29532953}
29542954
29552955
src/mame/drivers/galastrm.c
r8581r8582
131131
132132         if (ACCESSING_BITS_0_7)
133133         {
134            running_device *device = devtag_get_device(space->machine, "eeprom");
134            running_device *device = space->machine->device("eeprom");
135135            eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
136136            eeprom_write_bit(device, data & 0x40);
137137            eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/alpha68k.c
r8581r8582
18541854{
18551855   alpha68k_state *state = (alpha68k_state *)machine->driver_data;
18561856
1857   state->audiocpu = devtag_get_device(machine, "audiocpu");
1857   state->audiocpu = machine->device("audiocpu");
18581858
18591859   state_save_register_global(machine, state->trigstate);
18601860   state_save_register_global(machine, state->deposits1);
r8581r8582
23892389   ROM_LOAD( "2s.1f",      0x00000, 0x4000, CRC(800ceb27) SHA1(4daa1b8adcad7a90cfd5d20704a7c431673c4995) )
23902390   ROM_LOAD( "1s.1d",      0x04000, 0x8000, CRC(87d3e719) SHA1(4b8b1b600c7c1de3a77030001e7e6f0ff118f294) )
23912391
2392   // not hooked up yet
2393   ROM_REGION( 0x1000, "mcu", 0 )
2394   ROM_LOAD( "kyros_68705u3.bin",    0x0000, 0x1000, CRC(c20880b7) SHA1(b041c36cbc4f348d74e0548df5cb14727f2d353b) ) // this one is from a bootleg PCB, program code *might* be compatible.
2395   ROM_LOAD( "kyros_mcu.bin",    0x0000, 0x0800,  CRC(3a902a19) SHA1(af1be8894c899b27b1106663ffaf2ab43fa1cdaa) ) // original MCU? (HD6805U1)
2396
2397
23922398   ROM_REGION( 0x60000, "gfx1", 0 )
23932399   ROM_LOAD( "8.9pr",  0x00000, 0x8000, CRC(c5290944) SHA1(ec97482dc59220002780ae4d02be4cd172cf65ac) )
23942400   ROM_LOAD( "11.11m", 0x08000, 0x8000, CRC(fbd44f1e) SHA1(d095544ea76674a7ad17c1b8c88614e65890281c) )
src/mame/drivers/tmaster.c
r8581r8582
545545
546546static READ16_HANDLER( galgames_eeprom_r )
547547{
548   running_device *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]);
548   running_device *eeprom = space->machine->device(galgames_eeprom_names[galgames_cart]);
549549
550550   return eeprom_read_bit(eeprom) ? 0x80 : 0x00;
551551}
r8581r8582
557557
558558   if ( ACCESSING_BITS_0_7 )
559559   {
560      running_device *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]);
560      running_device *eeprom = space->machine->device(galgames_eeprom_names[galgames_cart]);
561561
562562      // latch the bit
563563      eeprom_write_bit(eeprom, data & 0x0001);
r8581r8582
633633      {
634634         case 0x07:      // 7 resets the eeprom
635635            for (i = 0; i < 5; i++)
636               eeprom_set_cs_line(devtag_get_device(space->machine, galgames_eeprom_names[i]), ASSERT_LINE);
636               eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[i]), ASSERT_LINE);
637637            break;
638638
639639         case 0x00:
r8581r8582
641641         case 0x02:
642642         case 0x03:
643643         case 0x04:
644            eeprom_set_cs_line(devtag_get_device(space->machine, galgames_eeprom_names[data & 0xff]), CLEAR_LINE);
644            eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[data & 0xff]), CLEAR_LINE);
645645            galgames_update_rombank(space->machine, data & 0xff);
646646            break;
647647
648648         default:
649            eeprom_set_cs_line(devtag_get_device(space->machine, galgames_eeprom_names[0]), CLEAR_LINE);
649            eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[0]), CLEAR_LINE);
650650            galgames_update_rombank(space->machine, 0);
651651            logerror("%06x: unknown cart sel = %04x\n", cpu_get_pc(space->cpu), data);
652652            break;
r8581r8582
848848   tmaster_gfx_offs = 0;
849849   tmaster_gfx_size = memory_region_length(machine, "blitter");
850850
851   tmaster_devices.duart68681 = devtag_get_device( machine, "duart68681" );
851   tmaster_devices.duart68681 = machine->device( "duart68681" );
852852}
853853
854854static INTERRUPT_GEN( tm3k_interrupt )
src/mame/drivers/namcos22.c
r8581r8582
26442644            int i;
26452645            for (i = 0; i < 16; i++)
26462646            {
2647               generic_pulse_irq_line(devtag_get_device(space->machine, "mcu"), M37710_LINE_TIMERA3TICK);
2647               generic_pulse_irq_line(space->machine->device("mcu"), M37710_LINE_TIMERA3TICK);
26482648            }
26492649         }
26502650
src/mame/drivers/flyball.c
r8581r8582
364364{
365365   flyball_state *state = (flyball_state *)machine->driver_data;
366366
367   state->maincpu = devtag_get_device(machine, "maincpu");
367   state->maincpu = machine->device("maincpu");
368368
369369   state_save_register_global(machine, state->pitcher_vert);
370370   state_save_register_global(machine, state->pitcher_horz);
src/mame/drivers/atarisy1.c
r8581r8582
215215   atarigen_eeprom_reset(&state->atarigen);
216216   atarigen_slapstic_reset(&state->atarigen);
217217   atarigen_interrupt_reset(&state->atarigen, update_interrupts);
218   atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
218   atarigen_sound_io_reset(machine->device("audiocpu"));
219219
220220   /* reset the joystick parameters */
221221   state->joystick_value = 0;
r8581r8582
388388
389389static WRITE8_DEVICE_HANDLER( via_pa_w )
390390{
391   tms5220_data_w(devtag_get_device(device->machine, "tms"), 0, data);
391   tms5220_data_w(device->machine->device("tms"), 0, data);
392392}
393393
394394
395395static READ8_DEVICE_HANDLER( via_pa_r )
396396{
397   return tms5220_status_r(devtag_get_device(device->machine, "tms"), 0);
397   return tms5220_status_r(device->machine->device("tms"), 0);
398398}
399399
400400
401401static WRITE8_DEVICE_HANDLER( via_pb_w )
402402{
403403   /* write strobe */
404   tms5220_wsq_w(devtag_get_device(device->machine, "tms"), data & 1);
404   tms5220_wsq_w(device->machine->device("tms"), data & 1);
405405
406406   /* read strobe */
407   tms5220_rsq_w(devtag_get_device(device->machine, "tms"), (data & 2)>>1);
407   tms5220_rsq_w(device->machine->device("tms"), (data & 2)>>1);
408408
409409   /* bit 4 is connected to an up-counter, clocked by SYCLKB */
410410   data = 5 | ((data >> 3) & 2);
411   tms5220_set_frequency(devtag_get_device(device->machine, "tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
411   tms5220_set_frequency(device->machine->device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
412412}
413413
414414
415415static READ8_DEVICE_HANDLER( via_pb_r )
416416{
417   return (tms5220_readyq_r(devtag_get_device(device->machine, "tms")) << 2) | (tms5220_intq_r(devtag_get_device(device->machine, "tms")) << 3);
417   return (tms5220_readyq_r(device->machine->device("tms")) << 2) | (tms5220_intq_r(device->machine->device("tms")) << 3);
418418}
419419
420420
r8581r8582
23272327{
23282328   atarisy1_state *state = (atarisy1_state *)machine->driver_data;
23292329
2330   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 103);
2330   atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 103);
23312331
23322332   state->joystick_type = 0;   /* none */
23332333   state->trackball_type = 1;   /* rotated */
r8581r8582
23382338{
23392339   atarisy1_state *state = (atarisy1_state *)machine->driver_data;
23402340
2341   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 107);
2341   atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 107);
23422342
23432343   state->joystick_type = 1;   /* digital */
23442344   state->trackball_type = 0;   /* none */
r8581r8582
23492349{
23502350   atarisy1_state *state = (atarisy1_state *)machine->driver_data;
23512351
2352   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 105);
2352   atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 105);
23532353
23542354   state->joystick_type = 1;   /* digital */
23552355   state->trackball_type = 0;   /* none */
r8581r8582
23602360{
23612361   atarisy1_state *state = (atarisy1_state *)machine->driver_data;
23622362
2363   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 108);
2363   atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 108);
23642364
23652365   state->joystick_type = 2;   /* analog */
23662366   state->trackball_type = 0;   /* none */
r8581r8582
23712371{
23722372   atarisy1_state *state = (atarisy1_state *)machine->driver_data;
23732373
2374   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 109);
2374   atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 109);
23752375
23762376   state->joystick_type = 3;   /* pedal */
23772377   state->trackball_type = 2;   /* steering wheel */
r8581r8582
23822382{
23832383   atarisy1_state *state = (atarisy1_state *)machine->driver_data;
23842384
2385   atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 110);
2385   atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 110);
23862386
23872387   state->joystick_type = 3;   /* pedal */
23882388   state->trackball_type = 2;   /* steering wheel */
src/mame/drivers/ssv.c
r8581r8582
339339static MACHINE_RESET( ssv )
340340{
341341   requested_int = 0;
342   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), ssv_irq_callback);
342   cpu_set_irq_callback(machine->device("maincpu"), ssv_irq_callback);
343343   memory_set_bankptr(machine, "bank1", memory_region(machine, "user1"));
344344}
345345
r8581r8582
766766{
767767   if (ACCESSING_BITS_0_7)
768768   {
769      running_device *device = devtag_get_device(space->machine, "ensoniq");
769      running_device *device = space->machine->device("ensoniq");
770770      int bank = 0x400000/2 * (data & 1);   // UINT16 address
771771      int voice;
772772      for (voice = 0; voice < 32; voice++)
src/mame/drivers/mpu4drvr.c
r8581r8582
357357
358358   if (data)
359359   {
360      running_device *acia_0 = devtag_get_device(device->machine, "acia6850_0");
361      running_device *acia_1 = devtag_get_device(device->machine, "acia6850_1");
360      running_device *acia_0 = device->machine->device("acia6850_0");
361      running_device *acia_1 = device->machine->device("acia6850_1");
362362      acia6850_tx_clock_in(acia_0);
363363      acia6850_rx_clock_in(acia_0);
364364      acia6850_tx_clock_in(acia_1);
r8581r8582
18941894
18951895static void video_reset(running_device *device)
18961896{
1897   devtag_get_device(device->machine, "6840ptm_68k")->reset();
1898   devtag_get_device(device->machine, "acia6850_1")->reset();
1897   device->machine->device("6840ptm_68k")->reset();
1898   device->machine->device("acia6850_1")->reset();
18991899}
19001900
19011901/* machine start (called only once) */
r8581r8582
19191919   ROC10937_init(0, MSC1937, 0);
19201920
19211921   /* Hook the reset line */
1922   m68k_set_reset_callback(devtag_get_device(machine, "video"), video_reset);
1922   m68k_set_reset_callback(machine->device("video"), video_reset);
19231923}
19241924
19251925static MACHINE_RESET( mpu4_vid )
r8581r8582
25022502static DRIVER_INIT (mating)
25032503{
25042504   const address_space *space = cputag_get_address_space(machine, "video", ADDRESS_SPACE_PROGRAM);
2505   running_device *device = devtag_get_device(machine, "oki");
2505   running_device *device = machine->device("oki");
25062506
25072507   /* The Mating Game has an extra 256kB RAM on the program card */
25082508   memory_install_ram(space, 0x600000, 0x63ffff, 0, 0, NULL);
src/mame/drivers/circusc.c
r8581r8582
6262   circusc_state *state = (circusc_state *)machine->driver_data;
6363
6464   state->audiocpu = machine->device<cpu_device>("audiocpu");
65   state->sn1 = devtag_get_device(machine, "sn1");
66   state->sn2 = devtag_get_device(machine, "sn2");
67   state->dac = devtag_get_device(machine, "dac");
68   state->discrete = devtag_get_device(machine, "fltdisc");
65   state->sn1 = machine->device("sn1");
66   state->sn2 = machine->device("sn2");
67   state->dac = machine->device("dac");
68   state->discrete = machine->device("fltdisc");
6969
7070   state_save_register_global(machine, state->sn_latch);
7171}
src/mame/drivers/opwolf.c
r8581r8582
435435
436436   state->maincpu = machine->device<cpu_device>("maincpu");
437437   state->audiocpu = machine->device<cpu_device>("audiocpu");
438   state->pc080sn = devtag_get_device(machine, "pc080sn");
439   state->pc090oj = devtag_get_device(machine, "pc090oj");
440   state->msm1 = devtag_get_device(machine, "msm1");
441   state->msm2 = devtag_get_device(machine, "msm2");
438   state->pc080sn = machine->device("pc080sn");
439   state->pc090oj = machine->device("pc090oj");
440   state->msm1 = machine->device("msm1");
441   state->msm2 = machine->device("msm2");
442442
443443   state_save_register_global(machine, state->sprite_ctrl);
444444   state_save_register_global(machine, state->sprites_flipscreen);
r8581r8582
462462   state->sprite_ctrl = 0;
463463   state->sprites_flipscreen = 0;
464464
465   msm5205_reset_w(devtag_get_device(machine, "msm1"), 1);
466   msm5205_reset_w(devtag_get_device(machine, "msm2"), 1);
465   msm5205_reset_w(machine->device("msm1"), 1);
466   msm5205_reset_w(machine->device("msm2"), 1);
467467}
468468
469469static void opwolf_msm5205_vck( running_device *device )
src/mame/drivers/firebeat.c
r8581r8582
16831683static MACHINE_START( firebeat )
16841684{
16851685   /* set conservative DRC options */
1686   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
1686   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
16871687
16881688   /* configure fast RAM regions for DRC */
1689   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x01ffffff, FALSE, work_ram);
1689   ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x01ffffff, FALSE, work_ram);
16901690}
16911691
16921692static ADDRESS_MAP_START( firebeat_map, ADDRESS_SPACE_PROGRAM, 32 )
r8581r8582
19091909   }
19101910
19111911   SCSIGetDevice( atapi_device_data[1], &cd );
1912   cdda_set_cdrom(devtag_get_device(machine, "cdda"), cd);
1912   cdda_set_cdrom(machine->device("cdda"), cd);
19131913}
19141914
19151915static MACHINE_DRIVER_START(firebeat)
r8581r8582
21572157{
21582158   int r = ibutton_w(data);
21592159   if (r >= 0)
2160      ppc4xx_spu_receive_byte(devtag_get_device(device->machine, "maincpu"), r);
2160      ppc4xx_spu_receive_byte(device->machine->device("maincpu"), r);
21612161}
21622162
21632163/*****************************************************************************/
r8581r8582
21902190
21912191   cur_cab_data = cab_data;
21922192
2193   ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), security_w);
2193   ppc4xx_spu_set_tx_handler(machine->device("maincpu"), security_w);
21942194
21952195   set_ibutton(rom);
21962196
src/mame/drivers/bigevglf.c
r8581r8582
434434{
435435   bigevglf_state *state = (bigevglf_state *)machine->driver_data;
436436
437   state->audiocpu = devtag_get_device(machine, "audiocpu");
438   state->mcu = devtag_get_device(machine, "mcu");
437   state->audiocpu = machine->device("audiocpu");
438   state->mcu = machine->device("mcu");
439439
440440   state_save_register_global(machine, state->vidram_bank);
441441   state_save_register_global(machine, state->plane_selected);
src/mame/drivers/inufuku.c
r8581r8582
322322   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000);
323323   memory_set_bank(machine, "bank1", 0);
324324
325   state->audiocpu = devtag_get_device(machine, "audiocpu");
325   state->audiocpu = machine->device("audiocpu");
326326
327327   state_save_register_global(machine, state->pending_command);
328328   state_save_register_global(machine, state->bg_scrollx);
src/mame/drivers/cubocd32.c
r8581r8582
330330#include "includes/amiga.h"
331331#include "includes/cubocd32.h"
332332#include "machine/6526cia.h"
333#include "machine/i2cmem.h"
333334
334335
335336/* set to 0 to use control panel with only buttons (as in quiz games) - joy is default in dispenser setup */
r8581r8582
376377static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
377378{
378379   /* bit 1 = cd audio mute */
379   sound_set_output_gain(devtag_get_device(device->machine, "cdda"), 0, ( data & 1 ) ? 0.0 : 1.0 );
380   sound_set_output_gain(device->machine->device("cdda"), 0, ( data & 1 ) ? 0.0 : 1.0 );
380381
381382   /* bit 2 = Power Led on Amiga */
382383   set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
r8581r8582
10421043   DEVCB_NULL
10431044};
10441045
1046#define   NVRAM_SIZE 1024
1047#define   NVRAM_PAGE_SIZE   16   /* max size of one write request */
1048
1049static const i2cmem_interface i2cmem_interface =
1050{
1051   I2CMEM_SLAVE_ADDRESS, NVRAM_PAGE_SIZE, NVRAM_SIZE
1052};
1053
10451054static MACHINE_DRIVER_START( cd32 )
10461055
10471056   /* basic machine hardware */
r8581r8582
10491058   MDRV_CPU_PROGRAM_MAP(cd32_map)
10501059
10511060   MDRV_MACHINE_RESET(amiga)
1052   MDRV_NVRAM_HANDLER(cd32)
10531061
1062   MDRV_I2CMEM_ADD("i2cmem",i2cmem_interface)
1063
10541064   /* video hardware */
10551065   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
10561066
r8581r8582
11801190
11811191static void cndypuzl_input_hack(running_machine *machine)
11821192{
1183   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1193   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
11841194   {
11851195//      amiga_chip_ram_w(0x051c02, 0x0000);
11861196
1187      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1197      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
11881198      amiga_chip_ram_w(r_A5 - 0x7ebe, 0x0000);
11891199   }
11901200}
r8581r8582
11971207
11981208static void haremchl_input_hack(running_machine *machine)
11991209{
1200   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1210   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
12011211   {
12021212//      amiga_chip_ram_w8(0x002907, 0x00);
12031213
1204      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1214      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
12051215      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7f00 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7f00 + 2));
12061216      amiga_chip_ram_w8(r_A2 + 0x1f, 0x00);
12071217   }
r8581r8582
12151225
12161226static void lsrquiz_input_hack(running_machine *machine)
12171227{
1218   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1228   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
12191229   {
12201230//      amiga_chip_ram_w8(0x001e1b, 0x00);
12211231
1222      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1232      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
12231233      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fe0 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fe0 + 2));
12241234      amiga_chip_ram_w8(r_A2 + 0x13, 0x00);
12251235   }
r8581r8582
12341244/* The hack isn't working if you exit the test mode with P1 button 2 ! */
12351245static void lsrquiz2_input_hack(running_machine *machine)
12361246{
1237   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1247   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
12381248   {
12391249//      amiga_chip_ram_w8(0x046107, 0x00);
12401250
1241      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1251      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
12421252      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fdc + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fdc + 2));
12431253      amiga_chip_ram_w8(r_A2 + 0x17, 0x00);
12441254   }
r8581r8582
12521262
12531263static void lasstixx_input_hack(running_machine *machine)
12541264{
1255   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1265   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
12561266   {
12571267//      amiga_chip_ram_w8(0x00281c, 0x00);
12581268
1259      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1269      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
12601270      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fa2 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fa2 + 2));
12611271      amiga_chip_ram_w8(r_A2 + 0x24, 0x00);
12621272   }
r8581r8582
12701280
12711281static void mgnumber_input_hack(running_machine *machine)
12721282{
1273   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1283   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
12741284   {
12751285//      amiga_chip_ram_w(0x04bfa0, 0x0000);
12761286
1277      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1287      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
12781288      amiga_chip_ram_w(r_A5 - 0x7ed8, 0x0000);
12791289   }
12801290}
r8581r8582
12871297
12881298static void mgprem11_input_hack(running_machine *machine)
12891299{
1290   if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
1300   if(cpu_get_pc(machine->device("maincpu")) < amiga_chip_ram_size)
12911301   {
12921302//      amiga_chip_ram_w8(0x044f7e, 0x00);
12931303
1294      UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
1304      UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
12951305      amiga_chip_ram_w8(r_A5 - 0x7eca, 0x00);
12961306   }
12971307}
src/mame/drivers/cbuster.c
r8581r8582
297297{
298298   cbuster_state *state = (cbuster_state *)machine->driver_data;
299299
300   state->maincpu = devtag_get_device(machine, "maincpu");
301   state->audiocpu = devtag_get_device(machine, "audiocpu");
302   state->deco16ic = devtag_get_device(machine, "deco_custom");
300   state->maincpu = machine->device("maincpu");
301   state->audiocpu = machine->device("audiocpu");
302   state->deco16ic = machine->device("deco_custom");
303303
304304   state_save_register_global(machine, state->prot);
305305   state_save_register_global(machine, state->pri);
src/mame/drivers/ghosteo.c
r8581r8582
550550      IC42S16800 - ISSI IC42S16800 4(2)M x 8(16) Bits x 4 Banks (128MBit) SDRAM
551551
552552      QS1000     - QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
553                   see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
554553      QS1001A    - QDSP QS1001A 512k x8 MaskROM (SOP32)
555554
556555      qs1001a.u17 was not dumped from this PCB, but is a standard sample rom found on many Eolith games
src/mame/drivers/ojankohs.c
r8581r8582
796796{
797797   ojankohs_state *state = (ojankohs_state *)machine->driver_data;
798798
799   state->maincpu = devtag_get_device(machine, "maincpu");
800   state->msm = devtag_get_device(machine, "msm");
799   state->maincpu = machine->device("maincpu");
800   state->msm = machine->device("msm");
801801
802802   state_save_register_global(machine, state->gfxreg);
803803   state_save_register_global(machine, state->flipscreen);
src/mame/drivers/n8080.c
r8581r8582
436436{
437437   n8080_state *state = (n8080_state *)machine->driver_data;
438438
439   state->maincpu = devtag_get_device(machine, "maincpu");
439   state->maincpu = machine->device("maincpu");
440440
441441   state_save_register_global(machine, state->shift_data);
442442   state_save_register_global(machine, state->shift_bits);
src/mame/drivers/kncljoe.c
r8581r8582
252252{
253253   kncljoe_state *state = (kncljoe_state *)machine->driver_data;
254254
255   state->soundcpu = devtag_get_device(machine, "soundcpu");
255   state->soundcpu = machine->device("soundcpu");
256256
257257   state_save_register_global(machine, state->port1);
258258   state_save_register_global(machine, state->port2);
src/mame/drivers/spdodgeb.c
r8581r8582
6161static WRITE8_HANDLER( spd_adpcm_w )
6262{
6363   int chip = offset & 1;
64   running_device *adpcm = devtag_get_device(space->machine, (chip == 0) ? "msm1" : "msm2");
64   running_device *adpcm = space->machine->device((chip == 0) ? "msm1" : "msm2");
6565
6666   switch (offset/2)
6767   {
src/mame/drivers/deco_ld.c
r8581r8582
484484
485485static MACHINE_START( rblaster )
486486{
487   laserdisc = devtag_get_device(machine, "laserdisc");
487   laserdisc = machine->device("laserdisc");
488488}
489489
490490static MACHINE_DRIVER_START( rblaster )
src/mame/drivers/cvs.c
r8581r8582
10191019   start_393hz_timer(machine);
10201020
10211021   /* set devices */
1022   state->maincpu = devtag_get_device(machine, "maincpu");
1023   state->audiocpu = devtag_get_device(machine, "audiocpu");
1024   state->speech = devtag_get_device(machine, "speech");
1025   state->dac3 = devtag_get_device(machine, "dac3");
1026   state->tms = devtag_get_device(machine, "tms");
1027   state->s2636_0 = devtag_get_device(machine, "s2636_0");
1028   state->s2636_1 = devtag_get_device(machine, "s2636_1");
1029   state->s2636_2 = devtag_get_device(machine, "s2636_2");
1022   state->maincpu = machine->device("maincpu");
1023   state->audiocpu = machine->device("audiocpu");
1024   state->speech = machine->device("speech");
1025   state->dac3 = machine->device("dac3");
1026   state->tms = machine->device("tms");
1027   state->s2636_0 = machine->device("s2636_0");
1028   state->s2636_1 = machine->device("s2636_1");
1029   state->s2636_2 = machine->device("s2636_2");
10301030
10311031   /* register state save */
10321032   state_save_register_global_pointer(machine, state->color_ram, 0x400);
src/mame/drivers/turbo.c
r8581r8582
680680{
681681   /* assert ACK */
682682   turbo_state *state = (turbo_state *)space->machine->driver_data;
683   ppi8255_set_port_c(devtag_get_device(space->machine, "ppi8255_0"), 0x00);
683   ppi8255_set_port_c(space->machine->device("ppi8255_0"), 0x00);
684684   return state->buckrog_command;
685685}
686686
r8581r8582
719719
720720static TIMER_CALLBACK( delayed_ppi8255_w )
721721{
722    ppi8255_w(devtag_get_device(machine, "ppi8255_0"), param >> 8, param & 0xff);
722    ppi8255_w(machine->device("ppi8255_0"), param >> 8, param & 0xff);
723723}
724724
725725
src/mame/drivers/trvquest.c
r8581r8582
186186{
187187   gameplan_state *state = (gameplan_state *)machine->driver_data;
188188
189   state->maincpu = devtag_get_device(machine, "maincpu");
190   state->via_0 = devtag_get_device(machine, "via6522_0");
191   state->via_1 = devtag_get_device(machine, "via6522_1");
192   state->via_2 = devtag_get_device(machine, "via6522_2");
189   state->maincpu = machine->device("maincpu");
190   state->via_0 = machine->device("via6522_0");
191   state->via_1 = machine->device("via6522_1");
192   state->via_2 = machine->device("via6522_2");
193193
194194   /* register for save states */
195195   state_save_register_global(machine, state->video_x);
src/mame/drivers/plygonet.c
r8581r8582
211211   if (mem_mask == 0x0000ff00)   { hi_addr++; }   /* Low byte */
212212   if (mem_mask == 0xff000000) {}            /* High byte */
213213
214   value = dsp56k_host_interface_read(devtag_get_device(space->machine, "dsp"), hi_addr);
214   value = dsp56k_host_interface_read(space->machine->device("dsp"), hi_addr);
215215
216216   if (mem_mask == 0x0000ff00)   { value <<= 8;  }
217217   if (mem_mask == 0xff000000) { value <<= 24; }
r8581r8582
295295   if (mem_mask == 0xff000000) { hi_data = (data & 0xff000000) >> 24; }
296296
297297   logerror("write (host-side) %08x %08x %08x (HI %04x)\n", offset, mem_mask, data, hi_addr);
298   dsp56k_host_interface_write(devtag_get_device(space->machine, "dsp"), hi_addr, hi_data);
298   dsp56k_host_interface_write(space->machine->device("dsp"), hi_addr, hi_data);
299299}
300300
301301
src/mame/drivers/nemesis.c
r8581r8582
16501650
16511651   state->maincpu = machine->device<cpu_device>("maincpu");
16521652   state->audiocpu = machine->device<cpu_device>("audiocpu");
1653   state->vlm = devtag_get_device(machine, "vlm");
1653   state->vlm = machine->device("vlm");
16541654
16551655   state_save_register_global(machine, state->irq_on);
16561656   state_save_register_global(machine, state->irq1_on);
src/mame/drivers/magmax.c
r8581r8582
116116
117117static WRITE8_DEVICE_HANDLER( ay8910_portA_0_w )
118118{
119running_device *ay1 = devtag_get_device(device->machine, "ay1");
120running_device *ay2 = devtag_get_device(device->machine, "ay2");
121running_device *ay3 = devtag_get_device(device->machine, "ay3");
119running_device *ay1 = device->machine->device("ay1");
120running_device *ay2 = device->machine->device("ay2");
121running_device *ay3 = device->machine->device("ay3");
122122float percent;
123123
124124/*There are three AY8910 chips and four(!) separate amplifiers on the board
src/mame/drivers/warriorb.c
r8581r8582
542542
543543   memory_configure_bank(machine, "bank10", 0, 8, memory_region(machine, "audiocpu") + 0xc000, 0x4000);
544544
545   state->maincpu = devtag_get_device(machine, "maincpu");
546   state->audiocpu = devtag_get_device(machine, "audiocpu");
547   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
548   state->tc0100scn_1 = devtag_get_device(machine, "tc0100scn_1");
549   state->tc0100scn_2 = devtag_get_device(machine, "tc0100scn_2");
545   state->maincpu = machine->device("maincpu");
546   state->audiocpu = machine->device("audiocpu");
547   state->tc0140syt = machine->device("tc0140syt");
548   state->tc0100scn_1 = machine->device("tc0100scn_1");
549   state->tc0100scn_2 = machine->device("tc0100scn_2");
550550
551   state->lscreen = devtag_get_device(machine, "lscreen");
552   state->rscreen = devtag_get_device(machine, "rscreen");
551   state->lscreen = machine->device("lscreen");
552   state->rscreen = machine->device("rscreen");
553553
554   state->_2610_1l = devtag_get_device(machine, "2610.1.l");
555   state->_2610_1r = devtag_get_device(machine, "2610.1.r");
556   state->_2610_2l = devtag_get_device(machine, "2610.2.l");
557   state->_2610_2r = devtag_get_device(machine, "2610.2.r");
554   state->_2610_1l = machine->device("2610.1.l");
555   state->_2610_1r = machine->device("2610.1.r");
556   state->_2610_2l = machine->device("2610.2.l");
557   state->_2610_2r = machine->device("2610.2.r");
558558
559559   state_save_register_global(machine, state->banknum);
560560   state_save_register_global_array(machine, state->pandata);
src/mame/drivers/goal92.c
r8581r8582
297297
298298   memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
299299
300   state->audiocpu = devtag_get_device(machine, "audiocpu");
300   state->audiocpu = machine->device("audiocpu");
301301
302302   state_save_register_global(machine, state->fg_bank);
303303   state_save_register_global(machine, state->msm5205next);
src/mame/drivers/alg.c
r8581r8582
8686
8787static MACHINE_START( alg )
8888{
89   laserdisc = devtag_get_device(machine, "laserdisc");
89   laserdisc = machine->device("laserdisc");
9090
9191   serial_timer = timer_alloc(machine, response_timer, NULL);
9292   serial_timer_active = FALSE;
src/mame/drivers/trucocl.c
r8581r8582
2323  - 01 x lm324n
2424
2525  To not overload the driver, I put the rest of technical info in
26  http://www.mameworld.net/robbie/trucocl.htm
26  http://robbie.mameworld.info/trucocl.htm
2727
2828- Added 2 "hidden" color proms (am27s19)
2929- One GAL is connected to the color proms inputs.
src/mame/drivers/blockhl.c
r8581r8582
198198
199199   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
200200
201   state->maincpu = devtag_get_device(machine, "maincpu");
202   state->audiocpu = devtag_get_device(machine, "audiocpu");
203   state->k052109 = devtag_get_device(machine, "k052109");
204   state->k051960 = devtag_get_device(machine, "k051960");
201   state->maincpu = machine->device("maincpu");
202   state->audiocpu = machine->device("audiocpu");
203   state->k052109 = machine->device("k052109");
204   state->k051960 = machine->device("k051960");
205205
206206   state_save_register_global(machine, state->palette_selected);
207207   state_save_register_global(machine, state->rombank);
r8581r8582
211211{
212212   blockhl_state *state = (blockhl_state *)machine->driver_data;
213213
214   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), blockhl_banking);
214   konami_configure_set_lines(machine->device("maincpu"), blockhl_banking);
215215
216216   state->palette_selected = 0;
217217   state->rombank = 0;
src/mame/drivers/blackt96.c
r8581r8582
153153static WRITE16_HANDLER( blackt96_80000_w )
154154{
155155   // TO sound MCU?
156   //printf("blackt96_80000_w %04x %04x\n",data,mem_mask);
156   printf("blackt96_80000_w %04x %04x\n",data,mem_mask);
157157}
158158
159159
r8581r8582
342342
343343    /* Dipswitch Port A */
344344   PORT_START("DSW1")
345   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!7,!8")
345   PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!7,!8")
346346   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
347347   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_2C ) )
348348   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_3C ) )
349349   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_4C ) )
350   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!5,!6")
350   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!5,!6")
351351   PORT_DIPSETTING(      0x0c00, DEF_STR( 4C_1C ) )
352352   PORT_DIPSETTING(      0x0400, DEF_STR( 3C_1C ) )
353353   PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )
r8581r8582
414414};
415415
416416
417/* wrong layout, but we can see some tiles */
418417static const gfx_layout blackt963_layout =
419418{
420419   8,8,
r8581r8582
432431   GFXDECODE_ENTRY( "gfx3", 0, blackt963_layout,   0x0, 0x80  )
433432GFXDECODE_END
434433
434
435static READ8_HANDLER( PIC16C5X_T0_clk_r )
436{
437   return 0;
438}
439
440static WRITE8_HANDLER( blackt96_soundio_port00_w )
441{
442
443}
444
445static READ8_HANDLER( blackt96_soundio_port01_r )
446{
447   return mame_rand(space->machine);
448}
449
450static WRITE8_HANDLER( blackt96_soundio_port01_w )
451{
452
453}
454
455static READ8_HANDLER( blackt96_soundio_port02_r )
456{
457   return mame_rand(space->machine);
458}
459
460static WRITE8_HANDLER( blackt96_soundio_port02_w )
461{
462
463}
464
435465static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
466   AM_RANGE(0x00, 0x00) AM_WRITE( blackt96_soundio_port00_w )
467   AM_RANGE(0x01, 0x01) AM_READWRITE( blackt96_soundio_port01_r, blackt96_soundio_port01_w )
468   AM_RANGE(0x02, 0x02) AM_READWRITE( blackt96_soundio_port02_r, blackt96_soundio_port02_w )
469   AM_RANGE(PIC16C5x_T0, PIC16C5x_T0) AM_READ(PIC16C5X_T0_clk_r)
436470ADDRESS_MAP_END
437471
472
473
438474static MACHINE_DRIVER_START( blackt96 )
439475   MDRV_CPU_ADD("maincpu", M68000, 18000000 /2)
440476   MDRV_CPU_PROGRAM_MAP(blackt96_map)
441477   MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)
442478
443479   MDRV_CPU_ADD("audiocpu", PIC16C57, 8000000)   /* ? */
444   MDRV_DEVICE_DISABLE()
445480   MDRV_CPU_IO_MAP(sound_io_map)
446481
447482   MDRV_GFXDECODE(blackt96)
r8581r8582
477512   ROM_LOAD16_BYTE( "4", 0x00000, 0x40000, CRC(caff5b4a) SHA1(9a388cbb07211fa66f27082a8a5b847168c86a4f) )
478513
479514   ROM_REGION( 0x80000, "audiocpu", 0 ) /* PIC16c57 Code */
480   ROM_LOAD( "pic16c57", 0x00000, 0x1000, NO_DUMP )
515   ROM_LOAD( "pic16c57.bin", 0x00000, 0x2000, CRC(6053ba2f) SHA1(5dd28ddff17555de0e8574b78ff9e71204c503d3) )
481516
482517   ROM_REGION( 0x080000, "oki1", 0 ) /* Samples */
483518   ROM_LOAD( "1", 0x00000, 0x80000, CRC(6a934174) SHA1(087f5fa226dc68ee217f99c64d16cdf14372d44c) )
src/mame/drivers/segag80v.c
r8581r8582
2121    Sega Vector memory map (preliminary)
2222
2323    Most of the info here comes from the wiretap archive at:
24    http://www.spies.com/arcade/simulation/gameHardware/
24    http://www.mikesarcade.com/cgi-bin/spies.cgi?action=url&type=info&page=segaxyfaq1.6.txt
2525
2626     * Sega G80 Vector Simulation
2727
r8581r8582
13671367static DRIVER_INIT( zektor )
13681368{
13691369   const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
1370   running_device *ay = devtag_get_device(machine, "aysnd");
1370   running_device *ay = machine->device("aysnd");
13711371
13721372   /* configure security */
13731373   sega_security(82);
src/mame/drivers/bottom9.c
r8581r8582
337337
338338   memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
339339
340   state->maincpu = devtag_get_device(machine, "maincpu");
341   state->audiocpu = devtag_get_device(machine, "audiocpu");
342   state->k052109 = devtag_get_device(machine, "k052109");
343   state->k051960 = devtag_get_device(machine, "k051960");
344   state->k051316 = devtag_get_device(machine, "k051316");
345   state->k007232_1 = devtag_get_device(machine, "k007232_1");
346   state->k007232_2 = devtag_get_device(machine, "k007232_2");
340   state->maincpu = machine->device("maincpu");
341   state->audiocpu = machine->device("audiocpu");
342   state->k052109 = machine->device("k052109");
343   state->k051960 = machine->device("k051960");
344   state->k051316 = machine->device("k051316");
345   state->k007232_1 = machine->device("k007232_1");
346   state->k007232_2 = machine->device("k007232_2");
347347
348348   state_save_register_global(machine, state->video_enable);
349349   state_save_register_global(machine, state->zoomreadroms);
src/mame/drivers/astrocde.c
r8581r8582
207207
208208static WRITE8_HANDLER( seawolf2_sound_1_w )  // Port 40
209209{
210   running_device *samples = devtag_get_device(space->machine, "samples");
210   running_device *samples = space->machine->device("samples");
211211   UINT8 rising_bits = data & ~port_1_last;
212212   port_1_last = data;
213213
r8581r8582
222222
223223static WRITE8_HANDLER( seawolf2_sound_2_w )  // Port 41
224224{
225   running_device *samples = devtag_get_device(space->machine, "samples");
225   running_device *samples = space->machine->device("samples");
226226   UINT8 rising_bits = data & ~port_2_last;
227227   port_2_last = data;
228228
r8581r8582
337337      case 4: astrocade_sparkle[2] = data;   break;
338338      case 5: astrocade_sparkle[3] = data;   break;
339339      case 6:
340         sound_set_output_gain(devtag_get_device(space->machine, "astrocade1"), 0, data ? 0.0 : 1.0);
341         sound_set_output_gain(devtag_get_device(space->machine, "samples"), 0, data ? 1.0 : 0.0);
340         sound_set_output_gain(space->machine->device("astrocade1"), 0, data ? 0.0 : 1.0);
341         sound_set_output_gain(space->machine->device("samples"), 0, data ? 1.0 : 0.0);
342342         break;
343343      case 7:   mame_printf_debug("io_1:%d\n", data); break;
344344   }
src/mame/drivers/megazone.c
r8581r8582
5252         C += 220000;   /* 220000pF = 0.22uF */
5353
5454      data >>= 2;
55      filter_rc_set_RC(devtag_get_device(device->machine, fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C));
55      filter_rc_set_RC(device->machine->device(fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C));
5656   }
5757}
5858
src/mame/drivers/40love.c
r8581r8582
999999{
10001000   buggychl_state *state = (buggychl_state *)machine->driver_data;
10011001
1002   state->audiocpu = devtag_get_device(machine, "audiocpu");
1003   state->mcu = devtag_get_device(machine, "mcu");
1002   state->audiocpu = machine->device("audiocpu");
1003   state->mcu = machine->device("mcu");
10041004
10051005   /* video */
10061006   state_save_register_global(machine, state->pix1);
src/mame/drivers/galaga.c
r8581r8582
745745   switch (offset)
746746   {
747747      case 0x00:   /* IRQ1 */
748         cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
748         cpu_interrupt_enable(space->machine->device("maincpu"), bit);
749749         if (!bit)
750750            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
751751         break;
752752
753753      case 0x01:   /* IRQ2 */
754         cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
754         cpu_interrupt_enable(space->machine->device("sub"), bit);
755755         if (!bit)
756756            cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
757757         break;
758758
759759      case 0x02:   /* NMION */
760         cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), !bit);
760         cpu_interrupt_enable(space->machine->device("sub2"), !bit);
761761         break;
762762
763763      case 0x03:   /* RESET */
r8581r8582
866866{
867867   int scanline = param;
868868
869   nmi_line_pulse(devtag_get_device(machine, "sub2"));
869   nmi_line_pulse(machine->device("sub2"));
870870
871871   scanline = scanline + 128;
872872   if (scanline >= 272)
src/mame/drivers/istellar.c
r8581r8582
8080
8181static MACHINE_START( istellar )
8282{
83   laserdisc = devtag_get_device(machine, "laserdisc");
83   laserdisc = machine->device("laserdisc");
8484}
8585
8686
src/mame/drivers/lasso.c
r8581r8582
466466{
467467   lasso_state *state = (lasso_state *)machine->driver_data;
468468
469   state->maincpu = devtag_get_device(machine, "maincpu");
470   state->audiocpu = devtag_get_device(machine, "audiocpu");
471   state->sn_1 = devtag_get_device(machine, "sn76489.1");
472   state->sn_2 = devtag_get_device(machine, "sn76489.2");
469   state->maincpu = machine->device("maincpu");
470   state->audiocpu = machine->device("audiocpu");
471   state->sn_1 = machine->device("sn76489.1");
472   state->sn_2 = machine->device("sn76489.2");
473473
474474   state_save_register_global(machine, state->gfxbank);
475475}
src/mame/drivers/othunder.c
r8581r8582
688688
689689   memory_configure_bank(machine, "bank10", 0, 4, memory_region(machine, "audiocpu") + 0xc000, 0x4000);
690690
691   state->maincpu = devtag_get_device(machine, "maincpu");
692   state->audiocpu = devtag_get_device(machine, "audiocpu");
693   state->eeprom = devtag_get_device(machine, "eeprom");
694   state->tc0220ioc = devtag_get_device(machine, "tc0220ioc");
695   state->tc0100scn = devtag_get_device(machine, "tc0100scn");
696   state->tc0110pcr = devtag_get_device(machine, "tc0110pcr");
697   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
698   state->_2610_0l = devtag_get_device(machine, "2610.0l");
699   state->_2610_0r = devtag_get_device(machine, "2610.0r");
700   state->_2610_1l = devtag_get_device(machine, "2610.1l");
701   state->_2610_1r = devtag_get_device(machine, "2610.1r");
702   state->_2610_2l = devtag_get_device(machine, "2610.2l");
703   state->_2610_2r = devtag_get_device(machine, "2610.2r");
691   state->maincpu = machine->device("maincpu");
692   state->audiocpu = machine->device("audiocpu");
693   state->eeprom = machine->device("eeprom");
694   state->tc0220ioc = machine->device("tc0220ioc");
695   state->tc0100scn = machine->device("tc0100scn");
696   state->tc0110pcr = machine->device("tc0110pcr");
697   state->tc0140syt = machine->device("tc0140syt");
698   state->_2610_0l = machine->device("2610.0l");
699   state->_2610_0r = machine->device("2610.0r");
700   state->_2610_1l = machine->device("2610.1l");
701   state->_2610_1r = machine->device("2610.1r");
702   state->_2610_2l = machine->device("2610.2l");
703   state->_2610_2r = machine->device("2610.2r");
704704
705705   state_save_register_global(machine, state->vblank_irq);
706706   state_save_register_global(machine, state->ad_irq);
src/mame/drivers/pacland.c
r8581r8582
233233static WRITE8_HANDLER( pacland_irq_1_ctrl_w )
234234{
235235   int bit = !BIT(offset, 11);
236   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
236   cpu_interrupt_enable(space->machine->device("maincpu"), bit);
237237   if (!bit)
238238      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
239239}
r8581r8582
241241static WRITE8_HANDLER( pacland_irq_2_ctrl_w )
242242{
243243   int bit = !BIT(offset, 13);
244   cpu_interrupt_enable(devtag_get_device(space->machine, "mcu"), bit);
244   cpu_interrupt_enable(space->machine->device("mcu"), bit);
245245   if (!bit)
246246      cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
247247}
src/mame/drivers/psikyo4.c
r8581r8582
701701{
702702   psikyo4_state *state = (psikyo4_state *)machine->driver_data;
703703
704   state->maincpu = devtag_get_device(machine, "maincpu");
704   state->maincpu = machine->device("maincpu");
705705
706706#if ROMTEST
707707//  FIXME: Too many banks! it cannot be handled in this way, currently
src/mame/drivers/popper.c
r8581r8582
309309{
310310   popper_state *state = (popper_state *)machine->driver_data;
311311
312   state->audiocpu = devtag_get_device(machine, "audiocpu");
312   state->audiocpu = machine->device("audiocpu");
313313
314314   state_save_register_global(machine, state->flipscreen);
315315   state_save_register_global(machine, state->e002);
src/mame/drivers/ladyfrog.c
r8581r8582
287287{
288288   ladyfrog_state *state = (ladyfrog_state *)machine->driver_data;
289289
290   state->audiocpu = devtag_get_device(machine, "audiocpu");
290   state->audiocpu = machine->device("audiocpu");
291291
292292   state_save_register_global(machine, state->tilebank);
293293   state_save_register_global(machine, state->palette_bank);
src/mame/drivers/djboy.c
r8581r8582
2222
2323- The "BEAST" protection device has access to dipswitches and player inputs.
2424
25Genre: Scrolling Fighter
26Orientation: Horizontal
27Type: Raster: Standard Resolution
28CRT: Color
29Conversion Class: JAMMA
30Number of Simultaneous Players: 2
31Maximum number of Players: 2
32Gameplay: Joint
33Control Panel Layout: Multiple Player
34Joystick: 8-way
35Buttons: 3 - Punch, Kick, Jump
36Sound: Amplified Mono (one channel) - Stereo sound is available
37through a 4-pin header (voice of Wolfman Jack!!)
3825
39DJ Boy
401990, Kaneko / American Sammy Corp.
41
4226PCB Layout
4327----------
4428
r8581r8582
6650
6751Notes:
6852      D780C-2 - Z80 CPU. clock 6.000MHz [12/2] (for all 3 Z80 CPUs)
69      BEAST   - DIP40 Microcontroller, 8xxx series (8041/8042/8751 etc).
53      BEAST   - DIP40 Microcontroller, 8xxx series (8041/8042/8051 etc).
7054                     Clock 6.000MHz on pins 18 & 19
7155                chip is stamped 'KANEKO Beast (C)Intel '80 (C)KANEKO 1988'
7256      YM2203  - Yamaha YM2203, clock 3.000MHz [12/4]
r8581r8582
151135                |SPEAKER     STEREO                       OFF|
152136                |OUTPUT      MONO                          ON|
153137                |--------------------------------------------|
138
139    TODO: Hook-up Beast MCU and remove simulation.
140    The internal ROM has been hand-typed from a photograph of the
141    chip die and should marked BAD_DUMP until confirmed correct.
154142*/
155143
156144#include "emu.h"
157145#include "deprecat.h"
158146#include "cpu/z80/z80.h"
147#include "cpu/mcs51/mcs51.h"
159148#include "sound/2203intf.h"
160149#include "sound/okim6295.h"
161150#include "video/kan_pand.h"
r8581r8582
726715
727716/******************************************************************************/
728717
718/* Program/data maps are defined in the 8051 core */
719
720static ADDRESS_MAP_START( djboy_mcu_io_map, ADDRESS_SPACE_IO, 8 )
721//  AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0)
722//  AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P1)
723//  AM_RANGE(MCS51_PORT_P2,MCS51_PORT_P2)
724//  AM_RANGE(MCS51_PORT_P3,MCS51_PORT_P3)
725ADDRESS_MAP_END
726
727/******************************************************************************/
728
729729static INPUT_PORTS_START( djboy )
730730   PORT_START("IN0")
731731   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r8581r8582
860860   memory_configure_bank(machine, "bank3", 3, 5,  &CPU2[0x10000], 0x4000);
861861   memory_configure_bank(machine, "bank4", 0, 1,  &MAIN[0x10000], 0x3000); /* unsure if/how this area is banked */
862862
863   state->maincpu = devtag_get_device(machine, "maincpu");
864   state->cpu1 = devtag_get_device(machine, "cpu1");
865   state->cpu2 = devtag_get_device(machine, "cpu2");
866   state->pandora = devtag_get_device(machine, "pandora");
863   state->maincpu = machine->device("maincpu");
864   state->cpu1 = machine->device("cpu1");
865   state->cpu2 = machine->device("cpu2");
866   state->pandora = machine->device("pandora");
867867
868868   state_save_register_global(machine, state->videoreg);
869869   state_save_register_global(machine, state->scrollx);
r8581r8582
930930   MDRV_CPU_IO_MAP(cpu2_port_am)
931931   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
932932
933   MDRV_CPU_ADD("mcu", I80C51, 6000000)
934   MDRV_CPU_IO_MAP(djboy_mcu_io_map)
935
933936   MDRV_QUANTUM_TIME(HZ(6000))
934937
935938   MDRV_MACHINE_START(djboy)
r8581r8582
979982   ROM_LOAD( "bs200.8c", 0x00000, 0x0c000, CRC(f6c19e51) SHA1(82193f71122df07cce0a7f057a87b89eb2d587a1) )
980983   ROM_CONTINUE( 0x10000, 0x14000 )
981984
982   ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
983   ROM_LOAD( "i8751_beast", 0x00000, 0x1000, NO_DUMP )
985   ROM_REGION( 0x1000, "mcu", 0 ) /* MSM80C51F microcontroller */
986   ROM_LOAD( "beast.9s", 0x00000, 0x1000, BAD_DUMP CRC(73cae0a8) SHA1(1456ad3387d1255b9ca44f3e3505e458b0ed078c) )
984987
985988   ROM_REGION( 0x200000, "gfx1", 0 ) /* sprites */
986989   ROM_LOAD( "bs000.1h", 0x000000, 0x80000, CRC(be4bf805) SHA1(a73c564575fe89d26225ca8ec2d98b6ac319ac18) )
r8581r8582
10151018   ROM_LOAD( "bs200.8c", 0x00000, 0x0c000, CRC(f6c19e51) SHA1(82193f71122df07cce0a7f057a87b89eb2d587a1) )
10161019   ROM_CONTINUE( 0x10000, 0x14000 )
10171020
1018   ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
1019   ROM_LOAD( "i8751_beast", 0x00000, 0x1000, NO_DUMP )
1021   ROM_REGION( 0x1000, "mcu", 0 ) /* MSM80C51F microcontroller*/
1022   ROM_LOAD( "beast.9s", 0x00000, 0x1000, BAD_DUMP CRC(73cae0a8) SHA1(1456ad3387d1255b9ca44f3e3505e458b0ed078c) )
10201023
10211024   ROM_REGION( 0x200000, "gfx1", 0 ) /* sprites */
10221025   ROM_LOAD( "bs000.1h", 0x000000, 0x80000, CRC(be4bf805) SHA1(a73c564575fe89d26225ca8ec2d98b6ac319ac18) )
r8581r8582
10511054   ROM_LOAD( "bs200.8c", 0x00000, 0x0c000, CRC(f6c19e51) SHA1(82193f71122df07cce0a7f057a87b89eb2d587a1) )
10521055   ROM_CONTINUE( 0x10000, 0x14000 )
10531056
1054   ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
1055   ROM_LOAD( "i8751_beast", 0x00000, 0x1000, NO_DUMP )
1057   ROM_REGION( 0x1000, "mcu", 0 ) /* MSM80C51F microcontroller */
1058   ROM_LOAD( "beast.9s", 0x00000, 0x1000, BAD_DUMP CRC(73cae0a8) SHA1(1456ad3387d1255b9ca44f3e3505e458b0ed078c) )
10561059
10571060   ROM_REGION( 0x200000, "gfx1", 0 ) /* sprites */
10581061   ROM_LOAD( "bs000.1h", 0x000000, 0x80000, CRC(be4bf805) SHA1(a73c564575fe89d26225ca8ec2d98b6ac319ac18) )
src/mame/drivers/tumblep.c
r8581r8582
297297{
298298   tumblep_state *state = (tumblep_state *)machine->driver_data;
299299
300   state->maincpu = devtag_get_device(machine, "maincpu");
301   state->audiocpu = devtag_get_device(machine, "audiocpu");
302   state->deco16ic = devtag_get_device(machine, "deco_custom");
300   state->maincpu = machine->device("maincpu");
301   state->audiocpu = machine->device("audiocpu");
302   state->deco16ic = machine->device("deco_custom");
303303}
304304
305305static MACHINE_DRIVER_START( tumblep )
src/mame/drivers/dietgo.c
r8581r8582
194194{
195195   dietgo_state *state = (dietgo_state *)machine->driver_data;
196196
197   state->maincpu = devtag_get_device(machine, "maincpu");
198   state->audiocpu = devtag_get_device(machine, "audiocpu");
199   state->deco16ic = devtag_get_device(machine, "deco_custom");
197   state->maincpu = machine->device("maincpu");
198   state->audiocpu = machine->device("audiocpu");
199   state->deco16ic = machine->device("deco_custom");
200200}
201201
202202static MACHINE_DRIVER_START( dietgo )
src/mame/drivers/kingobox.c
r8581r8582
458458{
459459   kingofb_state *state = (kingofb_state *)machine->driver_data;
460460
461   state->video_cpu = devtag_get_device(machine, "video");
462   state->sprite_cpu = devtag_get_device(machine, "sprite");
463   state->audio_cpu = devtag_get_device(machine, "audiocpu");
461   state->video_cpu = machine->device("video");
462   state->sprite_cpu = machine->device("sprite");
463   state->audio_cpu = machine->device("audiocpu");
464464
465465   state_save_register_global(machine, state->nmi_enable);
466466   state_save_register_global(machine, state->palette_bank);
src/mame/drivers/bfmsys85.c
r8581r8582
33    Bellfruit system85 driver, (under heavy construction !!!)
44
55    A.G.E Code Copyright J. Wallace and the AGEMAME Development Team.
6    Visit http://www.mameworld.net/agemame/ for more information.
6    Visit http://agemame.mameworld.info for more information.
77
88    M.A.M.E Core Copyright Nicola Salmoria and the MAME Team,
99    used under license from http://mamedev.org
r8581r8582
226226   for (i=0; i<8; i++)
227227   if ( changed & (1 << i) )   Mechmtr_update(i, cycles, data & (1 << i) );
228228
229   if ( data ) generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE);
229   if ( data ) generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
230230}
231231///////////////////////////////////////////////////////////////////////////
232232
src/mame/drivers/esripsys.c
r8581r8582
130130
131131static READ8_HANDLER( g_status_r )
132132{
133   int bank4 = BIT(get_rip_status(devtag_get_device(space->machine, "video_cpu")), 2);
133   int bank4 = BIT(get_rip_status(space->machine->device("video_cpu")), 2);
134134   int vblank = space->machine->primary_screen->vblank();
135135
136136   return (!vblank << 7) | (bank4 << 6) | (f_status & 0x2f);
r8581r8582
179179static READ8_HANDLER( f_status_r )
180180{
181181   int vblank = space->machine->primary_screen->vblank();
182   UINT8 rip_status = get_rip_status(devtag_get_device(space->machine, "video_cpu"));
182   UINT8 rip_status = get_rip_status(space->machine->device("video_cpu"));
183183
184184   rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) |  BIT(rip_status, 7);
185185
r8581r8582
554554   if (offset == 0)
555555   {
556556      /* TMS5220 core returns status bits in D7-D6 */
557      running_device *tms = devtag_get_device(space->machine, "tms5220nl");
557      running_device *tms = space->machine->device("tms5220nl");
558558      UINT8 status = tms5220_status_r(tms, 0);
559559
560560      status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5);
r8581r8582
567567/* TODO: Implement correctly using the state PROM */
568568static WRITE8_HANDLER( tms5220_w )
569569{
570   running_device *tms = devtag_get_device(space->machine, "tms5220nl");
570   running_device *tms = space->machine->device("tms5220nl");
571571   if (offset == 0)
572572   {
573573      tms_data = data;
src/mame/drivers/blockout.c
r8581r8582
257257{
258258   blockout_state *state = (blockout_state *)machine->driver_data;
259259
260   state->audiocpu = devtag_get_device(machine, "audiocpu");
260   state->audiocpu = machine->device("audiocpu");
261261
262262   state_save_register_global(machine, state->color);
263263}
src/mame/drivers/ettrivia.c
r8581r8582
9494      /* special case to return the value written to 0xb000 */
9595      /* does it reset the chips too ? */
9696      case 0:   break;
97      case 0xc4: b000_ret = ay8910_r(devtag_get_device(space->machine, "ay1"), 0);   break;
98      case 0x94: b000_ret = ay8910_r(devtag_get_device(space->machine, "ay2"), 0);   break;
99      case 0x86: b000_ret = ay8910_r(devtag_get_device(space->machine, "ay3"), 0);   break;
97      case 0xc4: b000_ret = ay8910_r(space->machine->device("ay1"), 0);   break;
98      case 0x94: b000_ret = ay8910_r(space->machine->device("ay2"), 0);   break;
99      case 0x86: b000_ret = ay8910_r(space->machine->device("ay3"), 0);   break;
100100
101101      case 0x80:
102102         switch(b800_prev)
103103         {
104            case 0xe0: ay8910_address_w(devtag_get_device(space->machine, "ay1"),0,b000_val);   break;
105            case 0x98: ay8910_address_w(devtag_get_device(space->machine, "ay2"),0,b000_val);   break;
106            case 0x83: ay8910_address_w(devtag_get_device(space->machine, "ay3"),0,b000_val);   break;
104            case 0xe0: ay8910_address_w(space->machine->device("ay1"),0,b000_val);   break;
105            case 0x98: ay8910_address_w(space->machine->device("ay2"),0,b000_val);   break;
106            case 0x83: ay8910_address_w(space->machine->device("ay3"),0,b000_val);   break;
107107
108            case 0xa0: ay8910_data_w(devtag_get_device(space->machine, "ay1"),0,b000_val);   break;
109            case 0x88: ay8910_data_w(devtag_get_device(space->machine, "ay2"),0,b000_val);   break;
110            case 0x81: ay8910_data_w(devtag_get_device(space->machine, "ay3"),0,b000_val);   break;
108            case 0xa0: ay8910_data_w(space->machine->device("ay1"),0,b000_val);   break;
109            case 0x88: ay8910_data_w(space->machine->device("ay2"),0,b000_val);   break;
110            case 0x81: ay8910_data_w(space->machine->device("ay3"),0,b000_val);   break;
111111
112112         }
113113      break;
src/mame/drivers/f1gp.c
r8581r8582
449449
450450   memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x8000);
451451
452   state->audiocpu = devtag_get_device(machine, "audiocpu");
453   state->k053936 = devtag_get_device(machine, "k053936");
452   state->audiocpu = machine->device("audiocpu");
453   state->k053936 = machine->device("k053936");
454454
455455   MACHINE_START_CALL(f1gpb);
456456}
src/mame/drivers/namcos2.c
r8581r8582
49754975   //
49764976   // This is used in conjunction with the interleave increase in the
49774977   // MACHINE_DRIVER
4978   cpu_set_clockscale(devtag_get_device(machine, "mcu"), 4.0f);
4978   machine->device("mcu")->set_clock_scale(4.0f);
49794979
49804980   DRIVER_INIT_CALL( assaultp );
49814981}
src/mame/drivers/thayers.c
r8581r8582
715715
716716static MACHINE_START( thayers )
717717{
718   laserdisc = devtag_get_device(machine, "laserdisc");
718   laserdisc = machine->device("laserdisc");
719719   memset(&ssi263, 0, sizeof(ssi263));
720720}
721721
src/mame/drivers/merit.c
r8581r8582
10951095
10961096static VIDEO_UPDATE( merit )
10971097{
1098   running_device *mc6845 = devtag_get_device(screen->machine, "crtc");
1098   running_device *mc6845 = screen->machine->device("crtc");
10991099   mc6845_update(mc6845, bitmap, cliprect);
11001100
11011101   return 0;
src/mame/drivers/gotya.c
r8581r8582
178178{
179179   gotya_state *state = (gotya_state *)machine->driver_data;
180180
181   state->samples = devtag_get_device(machine, "samples");
181   state->samples = machine->device("samples");
182182
183183   state_save_register_global(machine, state->scroll_bit_8);
184184   state_save_register_global(machine, state->theme_playing);
src/mame/drivers/aztarac.c
r8581r8582
3636
3737static MACHINE_RESET( aztarac )
3838{
39   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), aztarac_irq_callback);
39   cpu_set_irq_callback(machine->device("maincpu"), aztarac_irq_callback);
4040}
4141
4242
src/mame/drivers/retofinv.c
r8581r8582
5151static WRITE8_HANDLER( mcu_reset_w )
5252{
5353   /* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */
54   if (devtag_get_device(space->machine, "68705") != NULL)
54   if (space->machine->device("68705") != NULL)
5555      cputag_set_input_line(space->machine, "68705", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
5656}
5757
r8581r8582
7575{
7676   int bit = data & 1;
7777
78   cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
78   cpu_interrupt_enable(space->machine->device("maincpu"), bit);
7979   if (!bit)
8080      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
8181}
r8581r8582
8484{
8585   int bit = data & 1;
8686
87   cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
87   cpu_interrupt_enable(space->machine->device("sub"), bit);
8888   if (!bit)
8989      cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
9090}
src/mame/drivers/konamigv.c
r8581r8582
311311   psx_machine_init(machine);
312312
313313   /* also hook up CDDA audio to the CD-ROM drive */
314   cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4));
314   cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4));
315315}
316316
317317static void spu_irq(running_device *device, UINT32 data)
src/mame/drivers/firetrap.c
r8581r8582
620620   UINT8 *MAIN = memory_region(machine, "maincpu");
621621   UINT8 *SOUND = memory_region(machine, "audiocpu");
622622
623   state->maincpu = devtag_get_device(machine, "maincpu");
624   state->audiocpu = devtag_get_device(machine, "audiocpu");
625   state->msm = devtag_get_device(machine, "msm");
623   state->maincpu = machine->device("maincpu");
624   state->audiocpu = machine->device("audiocpu");
625   state->msm = machine->device("msm");
626626
627627   memory_configure_bank(machine, "bank1", 0, 4, &MAIN[0x10000], 0x4000);
628628   memory_configure_bank(machine, "bank2", 0, 2, &SOUND[0x10000], 0x4000);
src/mame/drivers/thedeep.c
r8581r8582
4074071 OSC 8 Mhz
4084081 MPU 8751 (which is read-protected)
409409
410
411
412410If you need more info or if this package doesn't
413411Work, mail me.
414412
415Visit The ROMLiST Homepage: Http://hem.passagen.se/ogg/
416
417413..............CaBBe!...................................
418414
419415***************************************************************************/
src/mame/drivers/oneshot.c
r8581r8582
345345{
346346   oneshot_state *state = (oneshot_state *)machine->driver_data;
347347
348   state->maincpu = devtag_get_device(machine, "maincpu");
349   state->audiocpu = devtag_get_device(machine, "audiocpu");
348   state->maincpu = machine->device("maincpu");
349   state->audiocpu = machine->device("audiocpu");
350350
351351   state_save_register_global(machine, state->gun_x_p1);
352352   state_save_register_global(machine, state->gun_y_p1);
src/mame/drivers/zr107.c
r8581r8582
189189
190190static VIDEO_UPDATE( jetwave )
191191{
192   running_device *k001604 = devtag_get_device(screen->machine, "k001604");
192   running_device *k001604 = screen->machine->device("k001604");
193193
194194   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
195195
r8581r8582
200200   draw_7segment_led(bitmap, 3, 3, led_reg0);
201201   draw_7segment_led(bitmap, 9, 3, led_reg1);
202202
203   sharc_set_flag_input(devtag_get_device(screen->machine, "dsp"), 1, ASSERT_LINE);
203   sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE);
204204   return 0;
205205}
206206
r8581r8582
224224
225225static VIDEO_START( zr107 )
226226{
227   running_device *k056832 = devtag_get_device(machine, "k056832");
227   running_device *k056832 = machine->device("k056832");
228228
229229   k056832_set_layer_offs(k056832, 0, -29, -27);
230230   k056832_set_layer_offs(k056832, 1, -29, -27);
r8581r8582
241241
242242static VIDEO_UPDATE( zr107 )
243243{
244   running_device *k056832 = devtag_get_device(screen->machine, "k056832");
244   running_device *k056832 = screen->machine->device("k056832");
245245   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
246246
247247   k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0);
r8581r8582
251251   draw_7segment_led(bitmap, 3, 3, led_reg0);
252252   draw_7segment_led(bitmap, 9, 3, led_reg1);
253253
254   sharc_set_flag_input(devtag_get_device(screen->machine, "dsp"), 1, ASSERT_LINE);
254   sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE);
255255   return 0;
256256}
257257
r8581r8582
379379static MACHINE_START( zr107 )
380380{
381381   /* set conservative DRC options */
382   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
382   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
383383
384384   /* configure fast RAM regions for DRC */
385   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, workram);
385   ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, workram);
386386}
387387
388388static ADDRESS_MAP_START( zr107_map, ADDRESS_SPACE_PROGRAM, 32 )
r8581r8582
443443   UINT16 ret = 0;
444444
445445   if (ACCESSING_BITS_0_7)
446      ret |= k054539_r(devtag_get_device(space->machine, "konami2"), offset);
446      ret |= k054539_r(space->machine->device("konami2"), offset);
447447   if (ACCESSING_BITS_8_15)
448      ret |= k054539_r(devtag_get_device(space->machine, "konami1"), offset)<<8;
448      ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
449449
450450   return ret;
451451}
r8581r8582
453453static WRITE16_HANDLER( dual539_w )
454454{
455455   if (ACCESSING_BITS_0_7)
456      k054539_w(devtag_get_device(space->machine, "konami2"), offset, data);
456      k054539_w(space->machine->device("konami2"), offset, data);
457457   if (ACCESSING_BITS_8_15)
458      k054539_w(devtag_get_device(space->machine, "konami1"), offset, data>>8);
458      k054539_w(space->machine->device("konami1"), offset, data>>8);
459459}
460460
461461static ADDRESS_MAP_START( sound_memmap, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/ksys573.c
r8581r8582
131131  Note:
132132       Not all games listed above are confirmed to run on System 573.
133133       * - denotes not dumped yet. If you can help with the remaining undumped System 573 games,
134       please contact http://www.mameworld.net/gurudumps/comments.html
134       please contact http://guru.mameworld.info/
135135
136136
137137  Main PCB Layout
r8581r8582
16261626   if( inserted_cdrom != new_cdrom )
16271627   {
16281628      inserted_cdrom = new_cdrom;
1629      cdda_set_cdrom(devtag_get_device(machine, "cdda"), atapi_get_device());
1629      cdda_set_cdrom(machine->device("cdda"), atapi_get_device());
16301630   }
16311631}
16321632
r8581r8582
16611661
16621662static READ32_HANDLER( ge765pwbba_r )
16631663{
1664   running_device *upd4701 = devtag_get_device(space->machine, "upd4701");
1664   running_device *upd4701 = space->machine->device("upd4701");
16651665   UINT32 data = 0;
16661666
16671667   switch (offset)
r8581r8582
16991699
17001700static WRITE32_HANDLER( ge765pwbba_w )
17011701{
1702   running_device *upd4701 = devtag_get_device(space->machine, "upd4701");
1702   running_device *upd4701 = space->machine->device("upd4701");
17031703   switch (offset)
17041704   {
17051705   case 0x04:
src/mame/drivers/sbrkout.c
r8581r8582
120120      cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
121121
122122   /* update the DAC state */
123   dac_data_w(devtag_get_device(machine, "dac"), (machine->generic.videoram.u8[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
123   dac_data_w(machine->device("dac"), (machine->generic.videoram.u8[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
124124
125125   /* on the VBLANK, read the pot and schedule an interrupt time for it */
126126   if (scanline == machine->primary_screen->visible_area().max_y + 1)
src/mame/drivers/bladestl.c
r8581r8582
311311
312312   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
313313
314   state->audiocpu = devtag_get_device(machine, "audiocpu");
315   state->k007342 = devtag_get_device(machine, "k007342");
316   state->k007420 = devtag_get_device(machine, "k007420");
314   state->audiocpu = machine->device("audiocpu");
315   state->k007342 = machine->device("k007342");
316   state->k007420 = machine->device("k007420");
317317
318318   state_save_register_global(machine, state->spritebank);
319319   state_save_register_global_array(machine, state->layer_colorbase);
src/mame/drivers/pbaction.c
r8581r8582
256256{
257257   pbaction_state *state = (pbaction_state *)machine->driver_data;
258258
259   state->maincpu = devtag_get_device(machine, "maincpu");
260   state->audiocpu = devtag_get_device(machine, "audiocpu");
259   state->maincpu = machine->device("maincpu");
260   state->audiocpu = machine->device("audiocpu");
261261
262262   state_save_register_global(machine, state->scroll);
263263}
src/mame/drivers/overdriv.c
r8581r8582
298298{
299299   overdriv_state *state = (overdriv_state *)machine->driver_data;
300300
301   state->maincpu = devtag_get_device(machine, "maincpu");
302   state->audiocpu = devtag_get_device(machine, "audiocpu");
303   state->subcpu = devtag_get_device(machine, "sub");
304   state->k051316_1 = devtag_get_device(machine, "k051316_1");
305   state->k051316_2 = devtag_get_device(machine, "k051316_2");
306   state->k053260_1 = devtag_get_device(machine, "k053260_1");
307   state->k053260_2 = devtag_get_device(machine, "k053260_2");
308   state->k053246 = devtag_get_device(machine, "k053246");
309   state->k053251 = devtag_get_device(machine, "k053251");
301   state->maincpu = machine->device("maincpu");
302   state->audiocpu = machine->device("audiocpu");
303   state->subcpu = machine->device("sub");
304   state->k051316_1 = machine->device("k051316_1");
305   state->k051316_2 = machine->device("k051316_2");
306   state->k053260_1 = machine->device("k053260_1");
307   state->k053260_2 = machine->device("k053260_2");
308   state->k053246 = machine->device("k053246");
309   state->k053251 = machine->device("k053251");
310310
311311   state_save_register_global(machine, state->cpuB_ctrl);
312312   state_save_register_global(machine, state->sprite_colorbase);
src/mame/drivers/jackpool.c
r8581r8582
100100      case 0x1c: return input_port_read(space->machine,"BET");
101101      case 0x1e: return 0xff; //ticket motor
102102      case 0x20: return 0xff; //hopper motor
103       case 0x2c: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom"));
104       case 0x2e: return eeprom_read_bit(devtag_get_device(space->machine,"eeprom"));
103       case 0x2c: return eeprom_read_bit(space->machine->device("eeprom"));
104       case 0x2e: return eeprom_read_bit(space->machine->device("eeprom"));
105105//      default: printf("R %02x\n",offset*2); break;
106106   }
107107
r8581r8582
128128      case 0x4a: /* ---- ---x Ticket motor */break;
129129      case 0x4c: /* ---- ---x Hopper motor */break;
130130      case 0x4e: map_vreg = data & 1;        break;
131      case 0x50: eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
132      case 0x52: eeprom_set_clock_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
133      case 0x54: eeprom_write_bit(devtag_get_device(space->machine,"eeprom"), data & 1); break;
134//      case 0x5a: eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
135//      case 0x5c: eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
131      case 0x50: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
132      case 0x52: eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
133      case 0x54: eeprom_write_bit(space->machine->device("eeprom"), data & 1); break;
134//      case 0x5a: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
135//      case 0x5c: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
136136      case 0x60: break;
137137//      default: printf("[%02x] <- %02x W\n",offset*2,data);      break;
138138   }
r8581r8582
141141   if(offset*2 == 0x54)
142142   {
143143      printf("Write bit %02x\n",data);
144      eeprom_write_bit(devtag_get_device(space->machine,"eeprom"), data & 1);
144      eeprom_write_bit(space->machine->device("eeprom"), data & 1);
145145   }
146146   if(offset*2 == 0x52)
147147   {
148148      printf("Clock bit %02x\n",data);
149      eeprom_set_clock_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE );
149      eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE );
150150   }
151151   if(offset*2 == 0x50)
152152   {
153153      printf("chip select bit %02x\n",data);
154      eeprom_set_cs_line(devtag_get_device(space->machine,"eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE );
154      eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE );
155155   }
156156   #endif
157157}
src/mame/drivers/spcforce.c
r8581r8582
5555
5656static READ8_HANDLER( spcforce_SN76496_select_r )
5757{
58   if (~spcforce_SN76496_select & 0x40) return sn76496_ready_r(devtag_get_device(space->machine, "sn1"), 0 );
59   if (~spcforce_SN76496_select & 0x20) return sn76496_ready_r(devtag_get_device(space->machine, "sn2"), 0 );
60   if (~spcforce_SN76496_select & 0x10) return sn76496_ready_r(devtag_get_device(space->machine, "sn3"), 0 );
58   if (~spcforce_SN76496_select & 0x40) return sn76496_ready_r(space->machine->device("sn1"));
59   if (~spcforce_SN76496_select & 0x20) return sn76496_ready_r(space->machine->device("sn2"));
60   if (~spcforce_SN76496_select & 0x10) return sn76496_ready_r(space->machine->device("sn3"));
6161
6262   return 0;
6363}
r8581r8582
6666{
6767    spcforce_SN76496_select = data;
6868
69   if (~data & 0x40)  sn76496_w(devtag_get_device(space->machine, "sn1"), 0, spcforce_SN76496_latch);
70   if (~data & 0x20)  sn76496_w(devtag_get_device(space->machine, "sn2"), 0, spcforce_SN76496_latch);
71   if (~data & 0x10)  sn76496_w(devtag_get_device(space->machine, "sn3"), 0, spcforce_SN76496_latch);
69   if (~data & 0x40)  sn76496_w(space->machine->device("sn1"), 0, spcforce_SN76496_latch);
70   if (~data & 0x20)  sn76496_w(space->machine->device("sn2"), 0, spcforce_SN76496_latch);
71   if (~data & 0x10)  sn76496_w(space->machine->device("sn3"), 0, spcforce_SN76496_latch);
7272}
7373
7474static READ8_HANDLER( spcforce_t0_r )
src/mame/drivers/gsword.c
r8581r8582
910910   ROM_REGION( 0x04000, "user1", 0 )   /* music data and samples - not sure where it's mapped */
911911   ROM_LOAD( "aa0-14.4j",    0x0000, 0x2000, CRC(436fe91f) SHA1(feb29501090c6db911e13ce6e9935ba004b0ce7e) )
912912
913   // there are other undumped chips on this, not sure how many
914   // not hooked up yet
915   ROM_REGION( 0x400, "mcu", 0 )
916   ROM_LOAD( "aa003.bin",    0x0000, 0x400, CRC(68b399d9) SHA1(053482d12c2b714c23fc80ad0589a2afd258a5a6) )
917
913918   ROM_REGION( 0x4000, "gfx1", 0 )
914919   ROM_LOAD( "aa0-10.9n",    0x0000, 0x2000, CRC(207c4f42) SHA1(4cf2922d55cfc9e68cc07c3252ea3b5619b8aca5) )   /* tiles */
915920   ROM_LOAD( "aa1-11.9p",    0x2000, 0x1000, CRC(c130464a) SHA1(9d23577b8aaaffeefff3d8f93668d1b2bd0ba3d9) )
src/mame/drivers/nmg5.c
r8581r8582
10121012{
10131013   nmg5_state *state = (nmg5_state *)machine->driver_data;
10141014
1015   state->maincpu = devtag_get_device(machine, "maincpu");
1016   state->soundcpu = devtag_get_device(machine, "soundcpu");
1015   state->maincpu = machine->device("maincpu");
1016   state->soundcpu = machine->device("soundcpu");
10171017
10181018   state_save_register_global(machine, state->gfx_bank);
10191019   state_save_register_global(machine, state->priority_reg);
src/mame/drivers/xmen.c
r8581r8582
317317   memory_configure_bank(machine, "bank4", 0, 8, &ROM[0x10000], 0x4000);
318318   memory_set_bank(machine, "bank4", 0);
319319
320   state->maincpu = devtag_get_device(machine, "maincpu");
321   state->audiocpu = devtag_get_device(machine, "audiocpu");
322   state->k053246 = devtag_get_device(machine, "k053246");
323   state->k053251 = devtag_get_device(machine, "k053251");
324   state->k052109 = devtag_get_device(machine, "k052109");
325   state->k054539 = devtag_get_device(machine, "k054539");
326   state->lscreen = devtag_get_device(machine, "lscreen");
327   state->rscreen = devtag_get_device(machine, "rscreen");
320   state->maincpu = machine->device("maincpu");
321   state->audiocpu = machine->device("audiocpu");
322   state->k053246 = machine->device("k053246");
323   state->k053251 = machine->device("k053251");
324   state->k052109 = machine->device("k052109");
325   state->k054539 = machine->device("k054539");
326   state->lscreen = machine->device("lscreen");
327   state->rscreen = machine->device("rscreen");
328328
329329   state_save_register_global(machine, state->sound_curbank);
330330   state_save_register_global(machine, state->sprite_colorbase);
src/mame/drivers/mario.c
r8581r8582
470470   ROM_LOAD( "tma1-c-4p.4p",     0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) )
471471
472472   ROM_REGION( 0x0020, "unk_proms", 0 ) /* is this the color prom? */
473   ROM_LOAD( "tma1-c-5p.5p", 0x0000, 0x0020, CRC(58d86098) SHA1(d654995004b9052b12d3b682a2b39530e70030fc) ) /* BPROM was a TBP18S030N read as 82S123, unkown use */
473   ROM_LOAD( "tma1-c-5p.5p", 0x0000, 0x0020, CRC(58d86098) SHA1(d654995004b9052b12d3b682a2b39530e70030fc) ) /* BPROM was a TBP18S030N read as 82S123, unknown use */
474474ROM_END
475475
476476ROM_START( marioj )
r8581r8582
504504   ROM_LOAD( "tma1-c-4p.4p",     0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) )
505505
506506   ROM_REGION( 0x0020, "unk_proms", 0 ) /* is this the color prom? */
507   ROM_LOAD( "tma1-c-5p.5p", 0x0000, 0x0020, CRC(58d86098) SHA1(d654995004b9052b12d3b682a2b39530e70030fc) ) /* BPROM was a TBP18S030N read as 82S123, unkown use */
507   ROM_LOAD( "tma1-c-5p.5p", 0x0000, 0x0020, CRC(58d86098) SHA1(d654995004b9052b12d3b682a2b39530e70030fc) ) /* BPROM was a TBP18S030N read as 82S123, unknown use */
508508ROM_END
509509
510510ROM_START( masao )
src/mame/drivers/atarifb.c
r8581r8582
509509{
510510   atarifb_state *state = (atarifb_state *)machine->driver_data;
511511
512   state->maincpu = devtag_get_device(machine, "maincpu");
512   state->maincpu = machine->device("maincpu");
513513
514514   state_save_register_global(machine, state->CTRLD);
515515   state_save_register_global(machine, state->sign_x_1);
src/mame/drivers/lethal.c
r8581r8582
587587
588588   machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3800 + 0x02);
589589
590   state->maincpu = devtag_get_device(machine, "maincpu");
591   state->audiocpu = devtag_get_device(machine, "soundcpu");
592   state->k054539 = devtag_get_device(machine, "k054539");
593   state->k053244 = devtag_get_device(machine, "k053244");
594   state->k056832 = devtag_get_device(machine, "k056832");
595   state->k054000 = devtag_get_device(machine, "k054000");
590   state->maincpu = machine->device("maincpu");
591   state->audiocpu = machine->device("soundcpu");
592   state->k054539 = machine->device("k054539");
593   state->k053244 = machine->device("k053244");
594   state->k056832 = machine->device("k056832");
595   state->k054000 = machine->device("k054000");
596596
597597   state_save_register_global(machine, state->cur_control2);
598598   state_save_register_global(machine, state->sprite_colorbase);
src/mame/drivers/exprraid.c
r8581r8582
477477{
478478   exprraid_state *state = (exprraid_state *)machine->driver_data;
479479
480   state->maincpu = devtag_get_device(machine, "maincpu");
481   state->slave = devtag_get_device(machine, "slave");
480   state->maincpu = machine->device("maincpu");
481   state->slave = machine->device("slave");
482482
483483   state_save_register_global_array(machine, state->bg_index);
484484}
src/mame/drivers/2mindril.c
r8581r8582
429429{
430430   _2mindril_state *state = (_2mindril_state *)machine->driver_data;
431431
432   state->maincpu = devtag_get_device(machine, "maincpu");
432   state->maincpu = machine->device("maincpu");
433433
434434   state_save_register_global(machine, state->defender_sensor);
435435   state_save_register_global(machine, state->shutter_sensor);
src/mame/drivers/taitowlf.c
r8581r8582
535535
536536static MACHINE_START(taitowlf)
537537{
538   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
538   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
539539
540   taitowlf_devices.pit8254 = devtag_get_device( machine, "pit8254" );
541   taitowlf_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
542   taitowlf_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
543   taitowlf_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
544   taitowlf_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
540   taitowlf_devices.pit8254 = machine->device( "pit8254" );
541   taitowlf_devices.pic8259_1 = machine->device( "pic8259_1" );
542   taitowlf_devices.pic8259_2 = machine->device( "pic8259_2" );
543   taitowlf_devices.dma8237_1 = machine->device( "dma8237_1" );
544   taitowlf_devices.dma8237_2 = machine->device( "dma8237_2" );
545545}
546546
547547static MACHINE_RESET(taitowlf)
src/mame/drivers/taitogn.c
r8581r8582
347347         {
348348            devtag_reset(machine, "card");
349349            locked = 0x1ff;
350            ide_set_gnet_readlock (devtag_get_device(machine, "card"), 1);
350            ide_set_gnet_readlock (machine->device("card"), 1);
351351         }
352352      break;
353353
r8581r8582
365365static WRITE32_HANDLER(rf5c296_io_w)
366366{
367367   if(offset < 2) {
368      ide_controller32_pcmcia_w(devtag_get_device(space->machine, "card"), offset, data, mem_mask);
368      ide_controller32_pcmcia_w(space->machine->device("card"), offset, data, mem_mask);
369369      return;
370370   }
371371
r8581r8582
380380static READ32_HANDLER(rf5c296_io_r)
381381{
382382   if(offset < 2)
383      return ide_controller32_pcmcia_r(devtag_get_device(space->machine, "card"), offset, mem_mask);
383      return ide_controller32_pcmcia_r(space->machine->device("card"), offset, mem_mask);
384384
385385   offset *= 4;
386386
r8581r8582
430430      else
431431         locked |= 1 << pos;
432432      if (!locked) {
433         ide_set_gnet_readlock (devtag_get_device(space->machine, "card"), 0);
433         ide_set_gnet_readlock (space->machine->device("card"), 0);
434434      }
435435   }
436436}
r8581r8582
548548   // selection too, but they're always 0.
549549
550550   UINT32 p = control;
551   running_device *mb3773 = devtag_get_device(space->machine, "mb3773");
551   running_device *mb3773 = space->machine->device("mb3773");
552552
553553   COMBINE_DATA(&control);
554554
555   mb3773_set_ck(mb3773, 0, (control & 0x20) >> 5);
555   mb3773_set_ck(mb3773, (control & 0x20) >> 5);
556556
557557#if 0
558558   if((p ^ control) & ~0x20)
r8581r8582
852852   control = 0;
853853   psx_machine_init(machine);
854854   devtag_reset(machine, "card");
855   ide_set_gnet_readlock(devtag_get_device(machine, "card"), 1);
855   ide_set_gnet_readlock(machine->device("card"), 1);
856856
857857   // halt sound CPU since it has no valid program at start
858858   cputag_set_input_line(machine, "mn10200",INPUT_LINE_RESET,ASSERT_LINE); /* MCU */
src/mame/drivers/gunbustr.c
r8581r8582
114114
115115         if (ACCESSING_BITS_0_7)
116116         {
117            running_device *device = devtag_get_device(space->machine, "eeprom");
117            running_device *device = space->machine->device("eeprom");
118118            eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
119119            eeprom_write_bit(device, data & 0x40);
120120            eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/taito_z.c
r8581r8582
15081508//  state->pandata[offset] = data;
15091509//  popmessage(" pan %02x %02x %02x %02x", state->pandata[0], state->pandata[1], state->pandata[2], state->pandata[3] );
15101510
1511   flt_volume_set_volume(devtag_get_device(space->machine, fltname[offset & 3]), data / 255.0f);
1511   flt_volume_set_volume(space->machine->device(fltname[offset & 3]), data / 255.0f);
15121512}
15131513
15141514static WRITE16_HANDLER( spacegun_pancontrol )
r8581r8582
29682968{
29692969   taitoz_state *state = (taitoz_state *)machine->driver_data;
29702970
2971   state->maincpu = devtag_get_device(machine, "maincpu");
2972   state->subcpu = devtag_get_device(machine, "sub");
2973   state->audiocpu = devtag_get_device(machine, "audiocpu");
2974   state->eeprom = devtag_get_device(machine, "eeprom");
2975   state->tc0100scn = devtag_get_device(machine, "tc0100scn");
2976   state->tc0150rod = devtag_get_device(machine, "tc0150rod");
2977   state->tc0480scp = devtag_get_device(machine, "tc0480scp");
2978   state->tc0220ioc = devtag_get_device(machine, "tc0220ioc");
2979   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
2971   state->maincpu = machine->device("maincpu");
2972   state->subcpu = machine->device("sub");
2973   state->audiocpu = machine->device("audiocpu");
2974   state->eeprom = machine->device("eeprom");
2975   state->tc0100scn = machine->device("tc0100scn");
2976   state->tc0150rod = machine->device("tc0150rod");
2977   state->tc0480scp = machine->device("tc0480scp");
2978   state->tc0220ioc = machine->device("tc0220ioc");
2979   state->tc0140syt = machine->device("tc0140syt");
29802980
29812981   state_save_register_global(machine, state->cpua_ctrl);
29822982
src/mame/drivers/msisaac.c
r8581r8582
455455{
456456   buggychl_state *state = (buggychl_state *)machine->driver_data;
457457
458   state->audiocpu = devtag_get_device(machine, "audiocpu");
458   state->audiocpu = machine->device("audiocpu");
459459
460460   /* video */
461461   state_save_register_global(machine, state->bg2_textbank);
r8581r8582
467467   state_save_register_global(machine, state->snd_ctrl1);
468468
469469#ifdef USE_MCU
470   state->mcu = devtag_get_device(machine, "mcu");
470   state->mcu = machine->device("mcu");
471471
472472   /* mcu */
473473   state_save_register_global(machine, state->from_main);
src/mame/drivers/playch10.c
r8581r8582
333333static WRITE8_HANDLER( sprite_dma_w )
334334{
335335   int source = ( data & 7 );
336   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu"), source );
336   ppu2c0x_spriteram_dma( space, space->machine->device("ppu"), source );
337337}
338338
339339static NVRAM_HANDLER( playch10 )
src/mame/drivers/cojag.c
r8581r8582
371371   jaguar_dsp_resume(machine);
372372
373373   /* halt the CPUs */
374   jaguargpu_ctrl_w(devtag_get_device(machine, "gpu"), G_CTRL, 0, 0xffffffff);
375   jaguardsp_ctrl_w(devtag_get_device(machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
374   jaguargpu_ctrl_w(machine->device("gpu"), G_CTRL, 0, 0xffffffff);
375   jaguardsp_ctrl_w(machine->device("audiocpu"), D_CTRL, 0, 0xffffffff);
376376
377377   /* set blitter idle flag */
378378   blitter_status = 1;
r8581r8582
418418      jaguar_dsp_resume(space->machine);
419419
420420      /* halt the CPUs */
421      jaguargpu_ctrl_w(devtag_get_device(space->machine, "gpu"), G_CTRL, 0, 0xffffffff);
422      jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
421      jaguargpu_ctrl_w(space->machine->device("gpu"), G_CTRL, 0, 0xffffffff);
422      jaguardsp_ctrl_w(space->machine->device("audiocpu"), D_CTRL, 0, 0xffffffff);
423423   }
424424
425425   /* adjust banking */
r8581r8582
442442
443443static READ32_HANDLER( gpuctrl_r )
444444{
445   return jaguargpu_ctrl_r(devtag_get_device(space->machine, "gpu"), offset);
445   return jaguargpu_ctrl_r(space->machine->device("gpu"), offset);
446446}
447447
448448
449449static WRITE32_HANDLER( gpuctrl_w )
450450{
451   jaguargpu_ctrl_w(devtag_get_device(space->machine, "gpu"), offset, data, mem_mask);
451   jaguargpu_ctrl_w(space->machine->device("gpu"), offset, data, mem_mask);
452452}
453453
454454
r8581r8582
461461
462462static READ32_HANDLER( dspctrl_r )
463463{
464   return jaguardsp_ctrl_r(devtag_get_device(space->machine, "audiocpu"), offset);
464   return jaguardsp_ctrl_r(space->machine->device("audiocpu"), offset);
465465}
466466
467467
468468static WRITE32_HANDLER( dspctrl_w )
469469{
470   jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), offset, data, mem_mask);
470   jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
471471}
472472
473473
src/mame/drivers/mappy.c
r8581r8582
587587
588588static WRITE8_HANDLER( superpac_latch_w )
589589{
590   running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1");
591   running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2");
590   running_device *namcoio_1 = space->machine->device("namcoio_1");
591   running_device *namcoio_2 = space->machine->device("namcoio_2");
592592   int bit = offset & 1;
593593
594594   switch (offset & 0x0e)
595595   {
596596      case 0x00:   /* INT ON 2 */
597         cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
597         cpu_interrupt_enable(space->machine->device("sub"), bit);
598598         if (!bit)
599599            cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
600600         break;
601601
602602      case 0x02:   /* INT ON */
603         cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
603         cpu_interrupt_enable(space->machine->device("maincpu"), bit);
604604         if (!bit)
605605            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
606606         break;
r8581r8582
609609         break;
610610
611611      case 0x06:   /* SOUND ON */
612         mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit);
612         mappy_sound_enable(space->machine->device("namco"), bit);
613613         break;
614614
615615      case 0x08:   /* 4 RESET */
r8581r8582
631631
632632static WRITE8_HANDLER( phozon_latch_w )
633633{
634   running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1");
635   running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2");
634   running_device *namcoio_1 = space->machine->device("namcoio_1");
635   running_device *namcoio_2 = space->machine->device("namcoio_2");
636636   int bit = offset & 1;
637637
638638   switch (offset & 0x0e)
639639   {
640640      case 0x00:
641         cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
641         cpu_interrupt_enable(space->machine->device("sub"), bit);
642642         if (!bit)
643643            cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
644644         break;
645645
646646      case 0x02:
647         cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
647         cpu_interrupt_enable(space->machine->device("maincpu"), bit);
648648         if (!bit)
649649            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
650650         break;
651651
652652      case 0x04:
653         cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), bit);
653         cpu_interrupt_enable(space->machine->device("sub2"), bit);
654654         if (!bit)
655655            cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
656656         break;
657657
658658      case 0x06:
659         mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit);
659         mappy_sound_enable(space->machine->device("namco"), bit);
660660         break;
661661
662662      case 0x08:
r8581r8582
679679
680680static WRITE8_HANDLER( mappy_latch_w )
681681{
682   running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1");
683   running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2");
682   running_device *namcoio_1 = space->machine->device("namcoio_1");
683   running_device *namcoio_2 = space->machine->device("namcoio_2");
684684   int bit = offset & 1;
685685
686686   switch (offset & 0x0e)
687687   {
688688      case 0x00:   /* INT ON 2 */
689         cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
689         cpu_interrupt_enable(space->machine->device("sub"), bit);
690690         if (!bit)
691691            cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
692692         break;
693693
694694      case 0x02:   /* INT ON */
695         cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
695         cpu_interrupt_enable(space->machine->device("maincpu"), bit);
696696         if (!bit)
697697            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
698698         break;
r8581r8582
702702         break;
703703
704704      case 0x06:   /* SOUND ON */
705         mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit);
705         mappy_sound_enable(space->machine->device("namco"), bit);
706706         break;
707707
708708      case 0x08:   /* 4 RESET */
r8581r8582
757757
758758static TIMER_CALLBACK( superpac_io_run )
759759{
760   running_device *io56xx_1 = devtag_get_device(machine, "namcoio_1");
761   running_device *io56xx_2 = devtag_get_device(machine, "namcoio_2");
760   running_device *io56xx_1 = machine->device("namcoio_1");
761   running_device *io56xx_2 = machine->device("namcoio_2");
762762
763763   switch (param)
764764   {
r8581r8582
773773
774774static INTERRUPT_GEN( superpac_interrupt_1 )
775775{
776   running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1");
777   running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2");
776   running_device *namcoio_1 = device->machine->device("namcoio_1");
777   running_device *namcoio_2 = device->machine->device("namcoio_2");
778778
779779   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
780780                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
r8581r8582
788788
789789static TIMER_CALLBACK( pacnpal_io_run )
790790{
791   running_device *io56xx = devtag_get_device(machine, "namcoio_1");
792   running_device *io59xx = devtag_get_device(machine, "namcoio_2");
791   running_device *io56xx = machine->device("namcoio_1");
792   running_device *io59xx = machine->device("namcoio_2");
793793
794794   switch (param)
795795   {
r8581r8582
804804
805805static INTERRUPT_GEN( pacnpal_interrupt_1 )
806806{
807   running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1");
808   running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2");
807   running_device *namcoio_1 = device->machine->device("namcoio_1");
808   running_device *namcoio_2 = device->machine->device("namcoio_2");
809809
810810   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
811811                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
r8581r8582
819819
820820static TIMER_CALLBACK( phozon_io_run )
821821{
822   running_device *io58xx = devtag_get_device(machine, "namcoio_1");
823   running_device *io56xx = devtag_get_device(machine, "namcoio_2");
822   running_device *io58xx = machine->device("namcoio_1");
823   running_device *io56xx = machine->device("namcoio_2");
824824
825825   switch (param)
826826   {
r8581r8582
835835
836836static INTERRUPT_GEN( phozon_interrupt_1 )
837837{
838   running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1");
839   running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2");
838   running_device *namcoio_1 = device->machine->device("namcoio_1");
839   running_device *namcoio_2 = device->machine->device("namcoio_2");
840840
841841   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
842842                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
r8581r8582
850850
851851static TIMER_CALLBACK( mappy_io_run )
852852{
853   running_device *io58xx_1 = devtag_get_device(machine, "namcoio_1");
854   running_device *io58xx_2 = devtag_get_device(machine, "namcoio_2");
853   running_device *io58xx_1 = machine->device("namcoio_1");
854   running_device *io58xx_2 = machine->device("namcoio_2");
855855
856856   switch (param)
857857   {
r8581r8582
866866
867867static INTERRUPT_GEN( mappy_interrupt_1 )
868868{
869   running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1");
870   running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2");
869   running_device *namcoio_1 = device->machine->device("namcoio_1");
870   running_device *namcoio_2 = device->machine->device("namcoio_2");
871871
872872   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
873873                  // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
r8581r8582
22582258       However, removing the 15XX from the board causes sound to disappear completely, so
22592259       the DAC might be built-in after all.
22602260      */
2261   running_device *dac = devtag_get_device(machine, "dac");
2261   running_device *dac = machine->device("dac");
22622262   memory_install_write8_device_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), dac, 0x0002, 0x0002, 0, 0, grobda_DAC_w );
22632263}
22642264
src/mame/drivers/safarir.c
r8581r8582
318318   state->ram_2 = auto_alloc_array(machine, UINT8, state->ram_size);
319319   state->port_last = 0;
320320   state->port_last2 = 0;
321   state->samples = devtag_get_device(machine, "samples");
321   state->samples = machine->device("samples");
322322
323323   /* setup for save states */
324324   state_save_register_global_pointer(machine, state->ram_1, state->ram_size);
src/mame/drivers/rastan.c
r8581r8582
370370   memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x00000], 0x4000);
371371   memory_configure_bank(machine, "bank1", 1, 3, &ROM[0x10000], 0x4000);
372372
373   state->maincpu = devtag_get_device(machine, "maincpu");
374   state->audiocpu = devtag_get_device(machine, "audiocpu");
375   state->pc080sn = devtag_get_device(machine, "pc080sn");
376   state->pc090oj = devtag_get_device(machine, "pc090oj");
373   state->maincpu = machine->device("maincpu");
374   state->audiocpu = machine->device("audiocpu");
375   state->pc080sn = machine->device("pc080sn");
376   state->pc090oj = machine->device("pc090oj");
377377
378378   state_save_register_global(machine, state->sprite_ctrl);
379379   state_save_register_global(machine, state->sprites_flipscreen);
src/mame/drivers/aristmk5.c
r8581r8582
4545   archimedes_init(machine);
4646
4747   // reset the DAC to centerline
48   dac_signed_data_w(devtag_get_device(machine, "dac"), 0x80);
48   dac_signed_data_w(machine->device("dac"), 0x80);
4949}
5050
5151static MACHINE_RESET( aristmk5 )
src/mame/drivers/metalmx.c
r8581r8582
787787   UINT8 *adsp_boot = (UINT8*)memory_region(machine, "adsp");
788788   metalmx_state *state = (metalmx_state *)machine->driver_data;
789789
790   state->maincpu = devtag_get_device(machine, "maincpu");
791   state->adsp = devtag_get_device(machine, "adsp");
792   state->gsp = devtag_get_device(machine, "gsp");
793   state->dsp32c_1 = devtag_get_device(machine, "dsp32c_1");
794   state->dsp32c_2 = devtag_get_device(machine, "dsp32c_2");
790   state->maincpu = machine->device("maincpu");
791   state->adsp = machine->device("adsp");
792   state->gsp = machine->device("gsp");
793   state->dsp32c_1 = machine->device("dsp32c_1");
794   state->dsp32c_2 = machine->device("dsp32c_2");
795795
796796   adsp2105_load_boot_data(adsp_boot, state->adsp_internal_program_ram);
797797
src/mame/drivers/equites.c
r8581r8582
11851185{
11861186   equites_state *state = (equites_state *)machine->driver_data;
11871187
1188   state->mcu = devtag_get_device(machine, "mcu");
1189   state->audio_cpu = devtag_get_device(machine, "audiocpu");
1190   state->msm = devtag_get_device(machine, "msm");
1191   state->dac_1 = devtag_get_device(machine, "dac1");
1192   state->dac_2 = devtag_get_device(machine, "dac2");
1188   state->mcu = machine->device("mcu");
1189   state->audio_cpu = machine->device("audiocpu");
1190   state->msm = machine->device("msm");
1191   state->dac_1 = machine->device("dac1");
1192   state->dac_2 = machine->device("dac2");
11931193
11941194   state_save_register_global(machine, state->fg_char_bank);
11951195   state_save_register_global(machine, state->bgcolor);
src/mame/drivers/mirax.c
r8581r8582
178178
179179static WRITE8_DEVICE_HANDLER(ay_sel)
180180{
181   if(cpu_get_previouspc(devtag_get_device(device->machine, "audiocpu"))==0x309)
181   if(cpu_get_previouspc(device->machine->device("audiocpu"))==0x309)
182182   {
183183      ay8910_address_w(device,0,nAyCtrl);
184184      ay8910_data_w(device,0,nAyData);
src/mame/drivers/gradius3.c
r8581r8582
303303{
304304   gradius3_state *state = (gradius3_state *)machine->driver_data;
305305
306   state->maincpu = devtag_get_device(machine, "maincpu");
307   state->audiocpu = devtag_get_device(machine, "audiocpu");
308   state->subcpu = devtag_get_device(machine, "sub");
309   state->k007232 = devtag_get_device(machine, "k007232");
310   state->k052109 = devtag_get_device(machine, "k052109");
311   state->k051960 = devtag_get_device(machine, "k051960");
306   state->maincpu = machine->device("maincpu");
307   state->audiocpu = machine->device("audiocpu");
308   state->subcpu = machine->device("sub");
309   state->k007232 = machine->device("k007232");
310   state->k052109 = machine->device("k052109");
311   state->k051960 = machine->device("k051960");
312312
313313   state_save_register_global(machine, state->irqAen);
314314   state_save_register_global(machine, state->irqBmask);
src/mame/drivers/omegrace.c
r8581r8582
2323
2424    --------
2525
26    Most of the info here comes from the wiretap archive at:
27    http://www.spies.com/arcade/simulation/gameHardware/
2826
29
3027    Omega Race Memory Map
3128    Version 1.1 (Jul 24,1997)
3229    ---------------------
src/mame/drivers/mystwarr.c
r8581r8582
650650   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
651651   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism" )
652652   PORT_DIPSETTING(    0x20, "Common" )
653   PORT_DIPSETTING(    0x00, "Independant" )
653   PORT_DIPSETTING(    0x00, "Independent" )
654654   PORT_DIPNAME( 0x40, 0x40, "Number of Players" )
655655   PORT_DIPSETTING(    0x00, "4" )
656656   PORT_DIPSETTING(    0x40, "2" )
r8581r8582
691691   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
692692   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism" )
693693   PORT_DIPSETTING(    0x20, "Common" )
694   PORT_DIPSETTING(    0x00, "Independant" )
694   PORT_DIPSETTING(    0x00, "Independent" )
695695   PORT_DIPNAME( 0x40, 0x40, "Number of Players" )
696696   PORT_DIPSETTING(    0x00, "4" )
697697   PORT_DIPSETTING(    0x40, "2" )
r8581r8582
737737   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
738738   PORT_DIPNAME( 0x40, 0x40, "Coin Mechanism" )
739739   PORT_DIPSETTING(    0x40, "Common" )
740   PORT_DIPSETTING(    0x00, "Independant" )
740   PORT_DIPSETTING(    0x00, "Independent" )
741741   PORT_DIPNAME( 0x80, 0x80, "Number of Players" )
742742   PORT_DIPSETTING(    0x00, "3" )
743743   PORT_DIPSETTING(    0x80, "2" )
r8581r8582
888888
889889static MACHINE_RESET(mystwarr)
890890{
891   running_device *k054539_1 = devtag_get_device(machine, "konami1");
892   running_device *k054539_2 = devtag_get_device(machine, "konami2");
891   running_device *k054539_1 = machine->device("konami1");
892   running_device *k054539_2 = machine->device("konami2");
893893   int i;
894894
895895   // soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7)
r8581r8582
905905
906906static MACHINE_RESET(dadandrn)
907907{
908   running_device *k054539_1 = devtag_get_device(machine, "konami1");
908   running_device *k054539_1 = machine->device("konami1");
909909   int i;
910910
911911   // boost voice(chip 0 channel 4-7)
r8581r8582
914914
915915static MACHINE_RESET(viostorm)
916916{
917   running_device *k054539_1 = devtag_get_device(machine, "konami1");
917   running_device *k054539_1 = machine->device("konami1");
918918   int i;
919919
920920   // boost voice(chip 0 channel 4-7)
r8581r8582
923923
924924static MACHINE_RESET(metamrph)
925925{
926   running_device *k054539_1 = devtag_get_device(machine, "konami1");
927   running_device *k054539_2 = devtag_get_device(machine, "konami2");
926   running_device *k054539_1 = machine->device("konami1");
927   running_device *k054539_2 = machine->device("konami2");
928928   int i;
929929
930930   // boost voice(chip 0 channel 4-7) and soften other channels
r8581r8582
939939
940940static MACHINE_RESET(martchmp)
941941{
942   running_device *k054539_1 = devtag_get_device(machine, "konami1");
942   running_device *k054539_1 = machine->device("konami1");
943943   int i;
944944
945945   k054539_init_flags(k054539_1, K054539_REVERSE_STEREO);
r8581r8582
950950
951951static MACHINE_RESET(gaiapols)
952952{
953   running_device *k054539_1 = devtag_get_device(machine, "konami1");
953   running_device *k054539_1 = machine->device("konami1");
954954   int i;
955955
956956   // boost voice(chip 0 channel 5-7)
src/mame/drivers/klax.c
r8581r8582
4141{
4242   /* generate 32V signals */
4343   if ((scanline & 32) == 0 && !(input_port_read(screen.machine, "P1") & 0x800))
44      atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
44      atarigen_scanline_int_gen(screen.machine->device("maincpu"));
4545}
4646
4747
src/mame/drivers/ssfindo.c
r8581r8582
4444
4545      Chips:
4646         QS1000: QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
47                 see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
48          PRIME: LGS Prime 3C 9930R, clock input of 14.31818MHz (QFP100)
47           PRIME: LGS Prime 3C 9930R, clock input of 14.31818MHz (QFP100)
4948         QL2003: QuickLogic QL2003-XPL84C 0003BA FPGA (PLCC84)
5049      CL-PS7500: Cirrus Logic CL-PS7500FE-56QC-A 84903-951BD ARM 9843J
5150                 clock input of 54.000MHz, ARM710C; ARM7-core CPU (QFP240)
r8581r8582
9695Notes:
9796      Chips:
9897         QS1000: QDSP QS1000 AdMOS 9638R, Wavetable Audio chip, clock input of 24.000MHz (QFP100)
99                 see http://www.hwass.co.kr/product.htm for more info on QS100x chips.
10098          PRIME: LGS Prime 3C 9849R, clock input of 14.31818MHz (QFP100)
10199   XILINX XCS10: Xilinx Spartan XCS10 FPGA (QFP144)
102100      CL-PS7500: Cirrus Logic CL-PS7500FE-56QC-A 84877-951BD ARM 9843J
r8581r8582
259257   PS7500_IO[IRQSTA]|=0x20;
260258   if(PS7500_IO[IRQMSKA]&0x20)
261259   {
262      generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), ARM7_IRQ_LINE);
260      generic_pulse_irq_line(machine->device("maincpu"), ARM7_IRQ_LINE);
263261   }
264262}
265263
r8581r8582
278276   PS7500_IO[IRQSTA]|=0x40;
279277   if(PS7500_IO[IRQMSKA]&0x40)
280278   {
281      generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), ARM7_IRQ_LINE);
279      generic_pulse_irq_line(machine->device("maincpu"), ARM7_IRQ_LINE);
282280   }
283281}
284282
src/mame/drivers/firetrk.c
r8581r8582
3939
4040static INPUT_CHANGED( firetrk_horn_changed )
4141{
42   running_device *discrete = devtag_get_device(field->port->machine, "discrete");
42   running_device *discrete = field->port->machine->device("discrete");
4343   discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval);
4444}
4545
r8581r8582
5454static INTERRUPT_GEN( firetrk_interrupt )
5555{
5656   /* Super Bug - ASR - when is this used and what is an ASR? */
57//  discrete_sound_w(devtag_get_device(machine, "discrete"), SUPERBUG_ASR_EN, 0);
57//  discrete_sound_w(machine->device("discrete"), SUPERBUG_ASR_EN, 0);
5858
5959   /* NMI interrupts are disabled during service mode in firetrk and montecar */
6060   if (!in_service_mode)
r8581r8582
6666{
6767   int scanline = param;
6868
69   generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), 0);
69   generic_pulse_irq_line(machine->device("maincpu"), 0);
7070
7171   /* IRQs are generated by inverse 16V signal */
7272   scanline += 32;
r8581r8582
8080
8181static WRITE8_HANDLER( firetrk_output_w )
8282{
83   running_device *discrete = devtag_get_device(space->machine, "discrete");
83   running_device *discrete = space->machine->device("discrete");
8484
8585   /* BIT0 => START1 LAMP */
8686   set_led_status(space->machine, 0, !(data & 0x01));
r8581r8582
111111
112112static WRITE8_HANDLER( superbug_output_w )
113113{
114   running_device *discrete = devtag_get_device(space->machine, "discrete");
114   running_device *discrete = space->machine->device("discrete");
115115
116116   /* BIT0 => START LAMP */
117117   set_led_status(space->machine, 0, offset & 0x01);
r8581r8582
131131
132132static WRITE8_HANDLER( montecar_output_1_w )
133133{
134   running_device *discrete = devtag_get_device(space->machine, "discrete");
134   running_device *discrete = space->machine->device("discrete");
135135
136136   /* BIT0 => START LAMP    */
137137   set_led_status(space->machine, 0, !(data & 0x01));
r8581r8582
158158
159159static WRITE8_HANDLER( montecar_output_2_w )
160160{
161   running_device *discrete = devtag_get_device(space->machine, "discrete");
161   running_device *discrete = space->machine->device("discrete");
162162
163163   firetrk_flash = data & 0x80;
164164
src/mame/drivers/peplus.c
r8581r8582
217217#define CMOS_NVRAM_SIZE     0x2000
218218#define eeprom_NVRAM_SIZE   0x200 // 4k Bit
219219
220/* EEPROM is a X2404P 4K-bit Serial I2C Bus */
221static const i2cmem_interface i2cmem_interface =
222{
223   I2CMEM_SLAVE_ADDRESS, 8, eeprom_NVRAM_SIZE
224};
225
220226/* prototypes */
221227static WRITE_LINE_DEVICE_HANDLER(crtc_vsync);
222228static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);
r8581r8582
275281         memset(cmos_ram, 0, CMOS_NVRAM_SIZE);
276282      }
277283   }
278
279   NVRAM_HANDLER_CALL(i2cmem_0);
280284}
281285
282286
r8581r8582
457461   output_set_value("pe_bnkc7",(data >> 7) & 1); /* Game Meter */
458462}
459463
460static WRITE8_HANDLER(i2c_nvram_w)
464static WRITE8_DEVICE_HANDLER(i2c_nvram_w)
461465{
462   i2cmem_write(space->machine, 0, I2CMEM_SCL, BIT(data, 2));
466   i2cmem_scl_write(device,BIT(data, 2));
463467   sda_dir = BIT(data, 1);
464   i2cmem_write(space->machine, 0, I2CMEM_SDA, BIT(data, 0));
468   i2cmem_sda_write(device,BIT(data, 0));
465469}
466470
467471
r8581r8582
531535   return 0x00; // Watchdog
532536}
533537
534static READ8_HANDLER( peplus_input_bank_a_r )
538static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
535539{
536540/*
537541        Bit 0 = COIN DETECTOR A
r8581r8582
546550   UINT8 bank_a = 0x50; // Turn Off Low Battery and Hopper Full Statuses
547551   UINT8 coin_optics = 0x00;
548552    UINT8 coin_out = 0x00;
549   UINT64 curr_cycles = space->machine->firstcpu->total_cycles();
553   UINT64 curr_cycles = device->machine->firstcpu->total_cycles();
550554   UINT16 door_wait = 500;
551555
552556   UINT8 sda = 0;
553557   if(!sda_dir)
554558   {
555      sda = i2cmem_read(space->machine, 0, I2CMEM_SDA);
559      sda = i2cmem_sda_read(device);
556560   }
557561
558   if ((input_port_read_safe(space->machine, "SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) {
562   if ((input_port_read_safe(device->machine, "SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) {
559563      coin_state = 1; // Start Coin Cycle
560      last_cycles = space->machine->firstcpu->total_cycles();
564      last_cycles = device->machine->firstcpu->total_cycles();
561565   } else {
562566      /* Process Next Coin Optic State */
563567      if (curr_cycles - last_cycles > 600000/6 && coin_state != 0) {
564568         coin_state++;
565569         if (coin_state > 5)
566570            coin_state = 0;
567         last_cycles = space->machine->firstcpu->total_cycles();
571         last_cycles = device->machine->firstcpu->total_cycles();
568572      }
569573   }
570574
r8581r8582
594598      door_wait = 12345;
595599
596600   if (curr_cycles - last_door > door_wait) {
597      if ((input_port_read_safe(space->machine, "DOOR",0xff) & 0x01) == 0x01) {
601      if ((input_port_read_safe(device->machine, "DOOR",0xff) & 0x01) == 0x01) {
598602         door_open = (!door_open & 0x01);
599603      } else {
600604         door_open = 1;
601605      }
602      last_door = space->machine->firstcpu->total_cycles();
606      last_door = device->machine->firstcpu->total_cycles();
603607   }
604608
605609   if (curr_cycles - last_coin_out > 600000/12 && coin_out_state != 0) { // Guessing with 600000
r8581r8582
609613            coin_out_state = 3; // Coin-Out On
610614        }
611615
612      last_coin_out = space->machine->firstcpu->total_cycles();
616      last_coin_out = device->machine->firstcpu->total_cycles();
613617   }
614618
615619    switch (coin_out_state)
r8581r8582
757761   AM_RANGE(0x7000, 0x7fff) AM_READWRITE(peplus_s7000_r, peplus_s7000_w) AM_BASE(&s7000_ram)
758762
759763   // Input Bank A, Output Bank C
760   AM_RANGE(0x8000, 0x8000) AM_READ(peplus_input_bank_a_r) AM_WRITE(peplus_output_bank_c_w)
764   AM_RANGE(0x8000, 0x8000) AM_DEVREAD("i2cmem",peplus_input_bank_a_r) AM_WRITE(peplus_output_bank_c_w)
761765
762766   // Drop Door, I2C EEPROM Writes
763   AM_RANGE(0x9000, 0x9000) AM_READ(peplus_dropdoor_r) AM_WRITE(i2c_nvram_w)
767   AM_RANGE(0x9000, 0x9000) AM_READ(peplus_dropdoor_r) AM_DEVWRITE("i2cmem",i2c_nvram_w)
764768
765769   // Input Banks B & C, Output Bank B
766770   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") AM_WRITE(peplus_output_bank_b_w)
r8581r8582
10371041   MDRV_PALETTE_LENGTH(16*16*2)
10381042
10391043   MDRV_MC6845_ADD("crtc", R6545_1, MC6845_CLOCK, mc6845_intf)
1044   MDRV_I2CMEM_ADD("i2cmem", i2cmem_interface)
10401045
10411046   MDRV_PALETTE_INIT(peplus)
10421047   MDRV_VIDEO_START(peplus)
r8581r8582
10571062/* Normal board */
10581063static void peplus_init(running_machine *machine)
10591064{
1060    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
1061   i2cmem_init(machine, 0, I2CMEM_SLAVE_ADDRESS, 8, eeprom_NVRAM_SIZE, NULL);
1062
10631065   /* default : no address to patch in program RAM to enable autohold feature */
10641066   autohold_addr = 0;
10651067}
src/mame/drivers/segas24.c
r8581r8582
591591         cur_input_line = (cur_input_line + 1) & 7;
592592      break;
593593   case 7: // DAC
594      dac_signed_data_w(devtag_get_device(machine, "dac"), data);
594      dac_signed_data_w(machine->device("dac"), data);
595595      break;
596596   default:
597597      fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
r8581r8582
605605   case 3: // Lamps
606606      break;
607607   case 7: // DAC
608      dac_signed_data_w(devtag_get_device(machine, "dac"), data);
608      dac_signed_data_w(machine->device("dac"), data);
609609      break;
610610   default:
611611      fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
src/mame/drivers/ddayjlc.c
r8581r8582
447447{
448448   ddayjlc_state *state = (ddayjlc_state *)machine->driver_data;
449449
450   state->audiocpu = devtag_get_device(machine, "audiocpu");
450   state->audiocpu = machine->device("audiocpu");
451451
452452   state_save_register_global(machine, state->char_bank);
453453   state_save_register_global(machine, state->bgadr);
src/mame/drivers/konamigx.c
r8581r8582
12541254   UINT16 ret = 0;
12551255
12561256   if (ACCESSING_BITS_0_7)
1257      ret |= k054539_r(devtag_get_device(space->machine, "konami2"), offset);
1257      ret |= k054539_r(space->machine->device("konami2"), offset);
12581258   if (ACCESSING_BITS_8_15)
1259      ret |= k054539_r(devtag_get_device(space->machine, "konami1"), offset)<<8;
1259      ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
12601260
12611261   return ret;
12621262}
r8581r8582
12641264static WRITE16_HANDLER( dual539_w )
12651265{
12661266   if (ACCESSING_BITS_0_7)
1267      k054539_w(devtag_get_device(space->machine, "konami2"), offset, data);
1267      k054539_w(space->machine->device("konami2"), offset, data);
12681268   if (ACCESSING_BITS_8_15)
1269      k054539_w(devtag_get_device(space->machine, "konami1"), offset, data>>8);
1269      k054539_w(space->machine->device("konami1"), offset, data>>8);
12701270}
12711271
12721272static READ16_HANDLER( sndcomm68k_r )
r8581r8582
12871287
12881288static READ16_HANDLER(tms57002_data_word_r)
12891289{
1290   return tms57002_data_r(devtag_get_device(space->machine, "dasp"), 0);
1290   return tms57002_data_r(space->machine->device("dasp"), 0);
12911291}
12921292
12931293static WRITE16_HANDLER(tms57002_data_word_w)
12941294{
12951295   if (ACCESSING_BITS_0_7)
1296      tms57002_data_w(devtag_get_device(space->machine, "dasp"), 0, data);
1296      tms57002_data_w(space->machine->device("dasp"), 0, data);
12971297}
12981298
12991299static READ16_HANDLER(tms57002_status_word_r)
13001300{
1301   return (tms57002_dready_r(devtag_get_device(space->machine, "dasp"), 0) ? 4 : 0) |
1302      (tms57002_empty_r(devtag_get_device(space->machine, "dasp"), 0) ? 1 : 0);
1301   return (tms57002_dready_r(space->machine->device("dasp"), 0) ? 4 : 0) |
1302      (tms57002_empty_r(space->machine->device("dasp"), 0) ? 1 : 0);
13031303}
13041304
13051305static WRITE16_HANDLER(tms57002_control_word_w)
13061306{
13071307   if (ACCESSING_BITS_0_7)
13081308   {
1309      tms57002_pload_w(devtag_get_device(space->machine, "dasp"), 0, data & 4);
1310      tms57002_cload_w(devtag_get_device(space->machine, "dasp"), 0, data & 8);
1309      tms57002_pload_w(space->machine->device("dasp"), 0, data & 4);
1310      tms57002_cload_w(space->machine->device("dasp"), 0, data & 8);
13111311      cputag_set_input_line(space->machine, "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE);
13121312   }
13131313}
r8581r8582
15061506   PORT_DIPSETTING(          0x00000000, DEF_STR( Mono ))
15071507   PORT_DIPNAME( 0x02000000, 0x02000000, "Coin Mechanism")
15081508   PORT_DIPSETTING(          0x02000000, "Common")
1509   PORT_DIPSETTING(          0x00000000, "Independant")
1509   PORT_DIPSETTING(          0x00000000, "Independent")
15101510   PORT_DIPNAME( 0x04000000, 0x04000000, "Stage Select" )
15111511   PORT_DIPSETTING(          0x04000000, DEF_STR( Off ) )
15121512   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
r8581r8582
36313631
36323632static MACHINE_RESET(konamigx)
36333633{
3634   running_device *k054539_2 = devtag_get_device(machine, "konami2");
3634   running_device *k054539_2 = machine->device("konami2");
36353635   int i;
36363636
36373637   konamigx_wrport1_0 = konamigx_wrport1_1 = 0;
src/mame/drivers/triforce.c
r8581r8582
454454
455455ROM_START( triforce )
456456   TRIFORCE_BIOS
457
458   ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE)
459457ROM_END
460458
461459ROM_START( vs2002j )
462460   TRIFORCE_BIOS
463461
464   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
465
466462   DISK_REGION( "gdrom" )
467463   DISK_IMAGE_READONLY( "gdt-0001", 0, SHA1(1b4b16b0715fa5717904f0b3141cc48cca99b7a4) )
468464
r8581r8582
490486ROM_START( vs2002ex )
491487   TRIFORCE_BIOS
492488
493
494   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
495
496489   DISK_REGION( "gdrom" )
497490   DISK_IMAGE_READONLY( "gdt-0002", 0, SHA1(471e896d43167c93cc229cfc94ff7ac6de7cf9a4) )
498491
r8581r8582
504497ROM_START( avalons )
505498   TRIFORCE_BIOS
506499
507
508   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
509
510500   DISK_REGION( "gdrom" )
511501   DISK_IMAGE_READONLY( "gdt-0005c", 0, SHA1(9edb3d9ff492d2207d57bfdb6859e796f76c5e0c) )
512502
r8581r8582
518508ROM_START( gekpurya )
519509   TRIFORCE_BIOS
520510
521
522   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
523
524511   DISK_REGION( "gdrom" )
525512   DISK_IMAGE_READONLY( "gdt-0008c", 0, SHA1(2c1bdb8324efc216edd771fe45c680ac726111a0) )
526513
r8581r8582
532519ROM_START( tfupdate )
533520   TRIFORCE_BIOS
534521
535
536   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
537
538522   DISK_REGION( "gdrom" )
539523   DISK_IMAGE_READONLY( "gdt-0011", 0, SHA1(71bfa8f53d211085c020d54f55eeeabf85212a0b) )
540524
r8581r8582
570554ROM_START( vs4 )
571555   TRIFORCE_BIOS
572556
573
574   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
575
576557   DISK_REGION( "gdrom" )
577558   DISK_IMAGE_READONLY( "gdt-0015", 0, SHA1(1f83712b2b170d6edf4a27c15b6f763cc3cc4b71) )
578559
r8581r8582
602583ROM_START( vs4j )
603584   TRIFORCE_BIOS
604585
605
606   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
607
608586   DISK_REGION( "gdrom" )
609587   DISK_IMAGE_READONLY( "gdt-0013e", 0, SHA1(b69cc5cab889114eda5c6e9ddcca42de9bc235b3) )
610588
r8581r8582
635613ROM_START( avalon13 )
636614   TRIFORCE_BIOS
637615
638
639   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
640
641616   DISK_REGION( "gdrom" )
642617   DISK_IMAGE_READONLY( "gdt-0010c", 0, SHA1(716c441d8dc9036a13c66ef0048cd6d32ac63c4e) )
643618
r8581r8582
669644ROM_START( avalon20 )
670645   TRIFORCE_BIOS
671646
672
673   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
674
675647   DISK_REGION( "gdrom" )
676648   DISK_IMAGE_READONLY( "gdt-0017b", 0, SHA1(e2dd32c322ffcaf38b82275d2721b71bb3dfc1f2) )
677649
r8581r8582
683655ROM_START( vs42006 )
684656   TRIFORCE_BIOS
685657
686
687   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
688
689658   DISK_REGION( "gdrom" )
690659   DISK_IMAGE_READONLY( "gdt-0020d", 0, SHA1(db256d094b9754d452d7a2b8a370699d21141c1f) )
691660
r8581r8582
705674GAME( 2004, vs4j,     triforce, triforcegd,    triforce,    0, ROT0, "Sega",           "Virtua Striker 4 (Japan) (GDT-0013E)", GAME_NO_SOUND|GAME_NOT_WORKING )
706675GAME( 2004, vs4,      triforce, triforcegd,    triforce,    0, ROT0, "Sega",           "Virtua Striker 4 (Export) (GDT-0015)", GAME_NO_SOUND|GAME_NOT_WORKING )
707676GAME( 2004, avalon20, triforce, triforcegd,    triforce,    0, ROT0, "Sega",           "The Key Of Avalon 2.0 - Eutaxy and Commandment - Client (GDT-0017B) (V3.001)", GAME_NO_SOUND|GAME_NOT_WORKING )
708//GAME( 2006, vs42006,  triforce, triforcegd,    triforce,    0, ROT0, "Sega",           "Virtua Striker 4 ver. 2006 (Rev D) (Japan) (GDT-0020D)", GAME_NO_SOUND|GAME_NOT_WORKING )
677GAME( 2006, vs42006,  triforce, triforcegd,    triforce,    0, ROT0, "Sega",           "Virtua Striker 4 ver. 2006 (Rev D) (Japan) (GDT-0020D)", GAME_NO_SOUND|GAME_NOT_WORKING )
src/mame/drivers/dorachan.c
r8581r8582
227227{
228228   dorachan_state *state = (dorachan_state *)machine->driver_data;
229229
230   state->main_cpu = devtag_get_device(machine, "maincpu");
230   state->main_cpu = machine->device("maincpu");
231231
232232   state_save_register_global(machine, state->flip_screen);
233233}
src/mame/drivers/parodius.c
r8581r8582
266266
267267   machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
268268
269   state->maincpu = devtag_get_device(machine, "maincpu");
270   state->audiocpu = devtag_get_device(machine, "audiocpu");
271   state->k053260 = devtag_get_device(machine, "k053260");
272   state->k053245 = devtag_get_device(machine, "k053245");
273   state->k053251 = devtag_get_device(machine, "k053251");
274   state->k052109 = devtag_get_device(machine, "k052109");
269   state->maincpu = machine->device("maincpu");
270   state->audiocpu = machine->device("audiocpu");
271   state->k053260 = machine->device("k053260");
272   state->k053245 = machine->device("k053245");
273   state->k053251 = machine->device("k053251");
274   state->k052109 = machine->device("k052109");
275275
276276   state_save_register_global(machine, state->videobank);
277277   state_save_register_global(machine, state->sprite_colorbase);
r8581r8582
285285   parodius_state *state = (parodius_state *)machine->driver_data;
286286   int i;
287287
288   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), parodius_banking);
288   konami_configure_set_lines(machine->device("maincpu"), parodius_banking);
289289
290290   for (i = 0; i < 3; i++)
291291   {
src/mame/drivers/combatsc.c
r8581r8582
678678   state->interleave_timer = timer_alloc(machine, NULL, NULL);
679679
680680   state->audiocpu = machine->device<cpu_device>("audiocpu");
681   state->k007121_1 = devtag_get_device(machine, "k007121_1");
682   state->k007121_2 = devtag_get_device(machine, "k007121_2");
681   state->k007121_1 = machine->device("k007121_1");
682   state->k007121_2 = machine->device("k007121_2");
683683
684684   memory_configure_bank(machine, "bank1", 0, 10, memory_region(machine, "maincpu") + 0x10000, 0x4000);
685685
src/mame/drivers/rockrage.c
r8581r8582
278278
279279   memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
280280
281   state->audiocpu = devtag_get_device(machine, "audiocpu");
282   state->k007342 = devtag_get_device(machine, "k007342");
283   state->k007420 = devtag_get_device(machine, "k007420");
281   state->audiocpu = machine->device("audiocpu");
282   state->k007342 = machine->device("k007342");
283   state->k007420 = machine->device("k007420");
284284
285285   state_save_register_global(machine, state->vreg);
286286   state_save_register_global_array(machine, state->layer_colorbase);
src/mame/drivers/egghunt.c
r8581r8582
394394{
395395   egghunt_state *state = (egghunt_state *)machine->driver_data;
396396
397   state->audiocpu = devtag_get_device(machine, "audiocpu");
397   state->audiocpu = machine->device("audiocpu");
398398
399399   state_save_register_global(machine, state->gfx_banking);
400400   state_save_register_global(machine, state->okibanking);
src/mame/drivers/midxunit.c
r8581r8582
304304   ROM_LOAD32_BYTE( "revx.53",  0x00002, 0x80000, CRC(a045b265) SHA1(b294d3a56e41f5ec4ab9bbcc0088833b1cab1879) )
305305   ROM_LOAD32_BYTE( "revx.54",  0x00003, 0x80000, CRC(24471269) SHA1(262345bd147402100785459af422dafd1c562787) )
306306
307   ROM_REGION( 0x2000, "pic", 0 )
308   ROM_LOAD( "revx_16c57.bin", 0x0000000, 0x2000, CRC(eb8a8649) SHA1(a1e1d0b7a5e9802e8f889eb7e719259656dc8133) )
309
307310   ROM_REGION( 0x1000000, "gfx1", 0 )
308311   ROM_LOAD( "revx.120", 0x0000000, 0x80000, CRC(523af1f0) SHA1(a67c0fd757e860fc1c1236945952a295b4d5df5a) )
309312   ROM_LOAD( "revx.121", 0x0080000, 0x80000, CRC(78201d93) SHA1(fb0b8f887eec433f7624f387d7fb6f633ea30d7c) )
src/mame/drivers/segac2.c
r8581r8582
341341
342342         /* otherwise, return an input port */
343343         if (offset == 0x04/2 && sound_banks)
344            return (input_port_read(space->machine, portnames[offset]) & 0xbf) | (upd7759_busy_r(devtag_get_device(space->machine, "upd")) << 6);
344            return (input_port_read(space->machine, portnames[offset]) & 0xbf) | (upd7759_busy_r(space->machine->device("upd")) << 6);
345345         return input_port_read(space->machine, portnames[offset]);
346346
347347      /* 'SEGA' protection */
r8581r8582
428428         }
429429         if (sound_banks > 1)
430430         {
431            running_device *upd = devtag_get_device(space->machine, "upd");
431            running_device *upd = space->machine->device("upd");
432432            newbank = (data >> 2) & (sound_banks - 1);
433433            upd7759_set_bank_base(upd, newbank * 0x20000);
434434         }
r8581r8582
438438      case 0x1c/2:
439439         if (sound_banks > 1)
440440         {
441            running_device *upd = devtag_get_device(space->machine, "upd");
441            running_device *upd = space->machine->device("upd");
442442            upd7759_reset_w(upd, (data >> 1) & 1);
443443         }
444444         break;
r8581r8582
18211821
18221822static void segac2_common_init(running_machine* machine, int (*func)(int in))
18231823{
1824   running_device *upd = devtag_get_device(machine, "upd");
1824   running_device *upd = machine->device("upd");
18251825
18261826   DRIVER_INIT_CALL( megadriv_c2 );
18271827
src/mame/drivers/stfight.c
r8581r8582
175175
176176The 16 colours at offset $C0 appear to be the text palette. This group of
177177colours does not appear to change throughout the game, and the lower 192
178colours fade in/out independantly of these 16 - consistent with observations
178colours fade in/out independently of these 16 - consistent with observations
179179of the real game. You'd think then that the palette would be reaonably
180180easy to deduce from the text video ram attribute byte - go ahead and try! :P
181181
r8581r8582
496496   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for the second CPU */
497497   ROM_LOAD( "ec_04.rom",  0x0000,  0x8000, CRC(aa3e7d1e) SHA1(da350384d55f011253d19ce17fc327cd2604257f) )
498498
499   // not hooked up yet, what's it for, coinage?
500   ROM_REGION( 0x0800, "mcu", 0 )
501   ROM_LOAD( "empirecity_68705.bin",  0x0000,  0x0800, CRC(182f7616) SHA1(38b4f23a559ae13f8ca1b974407a2a40fc52879f) )
502
499503   ROM_REGION( 0x02000, "gfx1", 0 )   /* character data */
500504   ROM_LOAD( "sf17.bin",   0x0000, 0x2000, CRC(1b3706b5) SHA1(61f069329a7a836523ffc8cce915b0d0129fd896) )
501505
src/mame/drivers/sandscrp.c
r8581r8582
121121
122122static VIDEO_EOF( sandscrp )
123123{
124   running_device *pandora = devtag_get_device(machine, "pandora");
124   running_device *pandora = machine->device("pandora");
125125   sprite_irq = 1;
126126   update_irq_state(machine);
127127   pandora_eof(pandora);
src/mame/drivers/gpworld.c
r8581r8582
217217
218218static MACHINE_START( gpworld )
219219{
220   laserdisc = devtag_get_device(machine, "laserdisc");
220   laserdisc = machine->device("laserdisc");
221221}
222222
223223
src/mame/drivers/homedata.c
r8581r8582
11491149{
11501150   homedata_state *state = (homedata_state *)machine->driver_data;
11511151
1152   state->maincpu = devtag_get_device(machine, "maincpu");
1153   state->audiocpu = devtag_get_device(machine, "audiocpu");
1154   state->ym = devtag_get_device(machine, "ymsnd");
1155   state->sn = devtag_get_device(machine, "snsnd");
1156   state->dac = devtag_get_device(machine, "dac");
1152   state->maincpu = machine->device("maincpu");
1153   state->audiocpu = machine->device("audiocpu");
1154   state->ym = machine->device("ymsnd");
1155   state->sn = machine->device("snsnd");
1156   state->dac = machine->device("dac");
11571157
11581158   state_save_register_global(machine, state->visible_page);
11591159   state_save_register_global(machine, state->flipscreen);
src/mame/drivers/mugsmash.c
r8581r8582
404404{
405405   mugsmash_state *state = (mugsmash_state *)machine->driver_data;
406406
407   state->maincpu = devtag_get_device(machine, "maincpu");
408   state->audiocpu = devtag_get_device(machine, "audiocpu");
407   state->maincpu = machine->device("maincpu");
408   state->audiocpu = machine->device("audiocpu");
409409}
410410
411411static MACHINE_DRIVER_START( mugsmash )
src/mame/drivers/hng64.c
r8581r8582
1717    It's capable of changing the input ports dynamically (maybe explaining Roads Edge's "do not touch" quote below).
1818    It probably has a lot to do with the network (Roads Edge network connectors are on this board).
1919
20  * The Toshiba CPU datasheet is here : http://www.semicon.toshiba.co.jp/openb2b/websearch/productDetails.jsp?partKey=TMP87CH40N
20  * The Toshiba CPU datasheet is here : http://kr.ic-on-line.cn/IOL/viewpdf/TMP87CH40N_1029113.htm
2121
2222  * From the Roads Edge manual : "The Network Check screen will be displayed for about 40 seconds whether
2323                                  the cabinet is connected for communication competition or not.  After this,
r8581r8582
16481648static MACHINE_START(hyperneo)
16491649{
16501650   /* set the fastest DRC options */
1651   mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
1651   mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
16521652
16531653   /* configure fast RAM regions for DRC */
1654   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x00ffffff, FALSE, hng_mainram);
1655   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x04000000, 0x05ffffff, TRUE,  hng_cart);
1656   mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  rombase);
1654   mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x00ffffff, FALSE, hng_mainram);
1655   mips3drc_add_fastram(machine->device("maincpu"), 0x04000000, 0x05ffffff, TRUE,  hng_cart);
1656   mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  rombase);
16571657}
16581658
16591659
src/mame/drivers/macrossp.c
r8581r8582
606606{
607607   macrossp_state *state = (macrossp_state *)machine->driver_data;
608608
609   state->maincpu = devtag_get_device(machine, "maincpu");
610   state->audiocpu = devtag_get_device(machine, "audiocpu");
609   state->maincpu = machine->device("maincpu");
610   state->audiocpu = machine->device("audiocpu");
611611
612612   state_save_register_global(machine, state->sndpending);
613613   state_save_register_global(machine, state->snd_toggle);
src/mame/drivers/imolagp.c
r8581r8582
518518{
519519   imolagp_state *state = (imolagp_state *)machine->driver_data;
520520
521   state->slavecpu = devtag_get_device(machine, "slave");
521   state->slavecpu = machine->device("slave");
522522
523523   state_save_register_global(machine, state->control);
524524   state_save_register_global(machine, state->scroll);
src/mame/drivers/puckpkmn.c
r8581r8582
231231ROM sockets U63 & U64 empty
232232
233233Hi-res PCB scan available on request.
234Screenshots available on my site at http://unemulated.emuunlim.com (under PCB Shop Raid #2)
234Screenshots available on my site at http://guru.mameworld.info/oldnews2001.html (under PCB Shop Raid #2)
235235
236236
237237****************************************************************************/
src/mame/drivers/fastlane.c
r8581r8582
205205
206206   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
207207
208   state->konami2 = devtag_get_device(machine, "konami2");
209   state->k007121 = devtag_get_device(machine, "k007121");
208   state->konami2 = machine->device("konami2");
209   state->k007121 = machine->device("k007121");
210210}
211211
212212static MACHINE_DRIVER_START( fastlane )
src/mame/drivers/gamecstl.c
r8581r8582
594594
595595static MACHINE_START(gamecstl)
596596{
597   gamecstl_devices.pit8254 = devtag_get_device( machine, "pit8254" );
598   gamecstl_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
599   gamecstl_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
600   gamecstl_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
601   gamecstl_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
597   gamecstl_devices.pit8254 = machine->device( "pit8254" );
598   gamecstl_devices.pic8259_1 = machine->device( "pic8259_1" );
599   gamecstl_devices.pic8259_2 = machine->device( "pic8259_2" );
600   gamecstl_devices.dma8237_1 = machine->device( "dma8237_1" );
601   gamecstl_devices.dma8237_2 = machine->device( "dma8237_2" );
602602}
603603
604604static MACHINE_RESET(gamecstl)
605605{
606606   memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0x30000);
607607
608   cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
608   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
609609}
610610
611611
src/mame/drivers/cidelsa.c
r8581r8582
475475{
476476   cidelsa_state *state = (cidelsa_state *)machine->driver_data;
477477
478   state->cdp1802 = devtag_get_device(machine, CDP1802_TAG);
478   state->cdp1802 = machine->device(CDP1802_TAG);
479479
480480   /* reset the CPU */
481481   state->cdp1802_mode = CDP1802_MODE_RESET;
src/mame/drivers/vendetta.c
r8581r8582
462462
463463   machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
464464
465   state->maincpu = devtag_get_device(machine, "maincpu");
466   state->audiocpu = devtag_get_device(machine, "audiocpu");
467   state->k053246 = devtag_get_device(machine, "k053246");
468   state->k053251 = devtag_get_device(machine, "k053251");
469   state->k052109 = devtag_get_device(machine, "k052109");
470   state->k054000 = devtag_get_device(machine, "k054000");
471   state->k053260 = devtag_get_device(machine, "k053260");
465   state->maincpu = machine->device("maincpu");
466   state->audiocpu = machine->device("audiocpu");
467   state->k053246 = machine->device("k053246");
468   state->k053251 = machine->device("k053251");
469   state->k052109 = machine->device("k052109");
470   state->k054000 = machine->device("k054000");
471   state->k053260 = machine->device("k053260");
472472
473473   state_save_register_global(machine, state->irq_enabled);
474474   state_save_register_global(machine, state->sprite_colorbase);
r8581r8582
482482   vendetta_state *state = (vendetta_state *)machine->driver_data;
483483   int i;
484484
485   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), vendetta_banking);
485   konami_configure_set_lines(machine->device("maincpu"), vendetta_banking);
486486
487487   for (i = 0; i < 3; i++)
488488   {
src/mame/drivers/segas16b.c
r8581r8582
10471047   workram              = auto_alloc_array(machine, UINT16, 0x04000 / 2);
10481048
10491049   /* init the memory mapper */
1050   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[state->rom_board], sound_w, NULL);
1050   segaic16_memory_mapper_init(machine->device("maincpu"), region_info_list[state->rom_board], sound_w, NULL);
10511051
10521052   /* init the FD1094 */
10531053   fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
r8581r8582
10591059   state->i8751_initial_config = NULL;
10601060   state->disable_screen_blanking = 0;
10611061
1062   state->maincpu = devtag_get_device(machine, "maincpu");
1063   state->soundcpu = devtag_get_device(machine, "soundcpu");
1064   state->mcu = devtag_get_device(machine, "mcu");
1065   state->ymsnd = devtag_get_device(machine, "ymsnd");
1066   state->_315_5248_1 = devtag_get_device(machine, "315_5248");
1067   state->_315_5250_1 = devtag_get_device(machine, "315_5250_1");
1068   state->_315_5250_2 = devtag_get_device(machine, "315_5250_2");
1062   state->maincpu = machine->device("maincpu");
1063   state->soundcpu = machine->device("soundcpu");
1064   state->mcu = machine->device("mcu");
1065   state->ymsnd = machine->device("ymsnd");
1066   state->_315_5248_1 = machine->device("315_5248");
1067   state->_315_5250_1 = machine->device("315_5250_1");
1068   state->_315_5250_2 = machine->device("315_5250_2");
10691069
10701070   state_save_register_global(machine, state->disable_screen_blanking);
10711071   state_save_register_global(machine, state->mj_input_num);
r8581r8582
11121112      segaic16_memory_mapper_config(machine, state->i8751_initial_config);
11131113   segaic16_tilemap_reset(machine, 0);
11141114
1115   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
1115   fd1094_machine_init(machine->device("maincpu"));
11161116
11171117   /* if we have a fake i8751 handler, disable the actual 8751, otherwise crank the interleave */
11181118   if (state->i8751_vblank_hook != NULL)
r8581r8582
34013401   ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
34023402   ROM_LOAD( "317-0059.key", 0x0000, 0x2000, NO_DUMP )
34033403
3404   ROM_REGION16_BE( 0x040000, "user2", ROMREGION_ERASE00 ) /* working overlay */
3405
34063404   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
34073405   ROM_LOAD( "epr-11493.b9",  0x00000, 0x10000, CRC(654485d9) SHA1(b431270564c4e33fd70c8c85af1fcbff8b59ba49) )
34083406   ROM_LOAD( "epr-11494.b10", 0x10000, 0x10000, CRC(b67971ab) SHA1(95cb6927baf425bcc290832ea9741b19852c7a1b) )
r8581r8582
35543552    Altered Beast, Sega System 16B
35553553    CPU: 68000 + i8751 (317-0078)
35563554    ROM Board: 171-5521
3555    Sega ID# for ROM board: 834-6661-10
35573556*/
35583557ROM_START( altbeast )
35593558   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
r8581r8582
37103709   ROM_LOAD( "opr-11672.a11", 0x10000, 0x20000, CRC(bbd7f460) SHA1(bbc5c2219cb3a827d84062b19affd9780da2a3cf) )
37113710   ROM_LOAD( "opr-11673.a12", 0x30000, 0x20000, CRC(400c4a36) SHA1(de4bdfa91734410e0a7f6a16bf8336db172f458a) )
37123711
3713   ROM_REGION( 0x2000, "user2", 0 ) /* MC8123 key */
3712   ROM_REGION( 0x2000, "mcu", 0 ) /* MC8123 key */
37143713   ROM_LOAD( "317-0066.key",  0x0000, 0x2000, CRC(ed85a054) SHA1(dcc84ec077a8a489f45abfd2bf4a9ba377da28a5) )
37153714ROM_END
37163715
r8581r8582
37883787   ROM_LOAD( "opr-11672.a11", 0x10000, 0x20000, CRC(bbd7f460) SHA1(bbc5c2219cb3a827d84062b19affd9780da2a3cf) )
37893788   ROM_LOAD( "opr-11673.a12", 0x30000, 0x20000, CRC(400c4a36) SHA1(de4bdfa91734410e0a7f6a16bf8336db172f458a) )
37903789
3791   ROM_REGION( 0x2000, "user2", 0 ) /* MC8123 key */
3790   ROM_REGION( 0x2000, "mcu", 0 ) /* MC8123 key */
37923791   ROM_LOAD( "317-0066.key",  0x0000, 0x2000, CRC(ed85a054) SHA1(dcc84ec077a8a489f45abfd2bf4a9ba377da28a5) )
37933792ROM_END
37943793
37953794/**************************************************************************************************************************
37963795    Jyuohki (Altered Beast), Sega System 16B
3796    CPU: FD1094 (317-0069)
3797    ROM Board: 171-5521
3798    Sega ID# for ROM board: 834-6661-07
3799*/
3800ROM_START( altbeastj2 )
3801   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
3802   ROM_LOAD16_BYTE( "epr-11742.a7", 0x000000, 0x20000, CRC(61839534) SHA1(0246985ec642fb44d33acbbbec9f6a1936afb302) )
3803   ROM_LOAD16_BYTE( "epr-11741.a5", 0x000001, 0x20000, CRC(9b2159cb) SHA1(dba53afcbb42be3e2611d00324bca6544faec071) )
3804
3805   ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
3806   ROM_LOAD( "317-0069.key", 0x0000, 0x2000, NO_DUMP ) /* The "9" was printed over a "3" */
3807
3808   ROM_REGION( 0xc0000, "gfx1", 0 ) /* tiles */
3809   ROM_LOAD( "epr-11722.a14", 0x00000, 0x10000,  CRC(adaa8db5) SHA1(3262c98d13d08c333d16052cac841f44d2f99743) ) /* plane 1 */
3810   ROM_LOAD( "epr-11736.b14", 0x20000, 0x10000,  CRC(e9ad5e89) SHA1(769628eee6e194a84aa8a3729f4e7d07dd3ba25c) )
3811   ROM_LOAD( "epr-11723.a15", 0x40000, 0x10000,  CRC(131a3f9a) SHA1(8182c3b8ce7a2f02b226cfa2081187593c9d0d0b) ) /* plane 2 */
3812   ROM_LOAD( "epr-11737.b15", 0x60000, 0x10000,  CRC(2e420023) SHA1(3aa2c3b6fccafb4d53b6ab99b95181d3eed7c77f) )
3813   ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) ) /* plane 3 */
3814   ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
3815
3816   ROM_REGION16_BE( 0x200000, "gfx2", 0 ) /* sprites */
3817   ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
3818   ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
3819   ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
3820   ROM_LOAD16_BYTE( "epr-11730.b6",  0x040000, 0x010000, CRC(3af62b55) SHA1(9f079af88aaf2447948c9ac01c6cbd1e79539704) )
3821   ROM_LOAD16_BYTE( "epr-11727.b3",  0x080001, 0x010000, CRC(b0390078) SHA1(9035d9f45c67bdc802710018722943f5b63e8b5d) )
3822   ROM_LOAD16_BYTE( "epr-11731.b7",  0x080000, 0x010000, CRC(2a87744a) SHA1(421b3926de046ddeddad05f65fc6b5078af28dbd) )
3823   ROM_LOAD16_BYTE( "epr-11728.b4",  0x0c0001, 0x010000, CRC(f3a43fd8) SHA1(d42833ecd0c1920f1a6904d32c096f12d8622141) )
3824   ROM_LOAD16_BYTE( "epr-11732.b8",  0x0c0000, 0x010000, CRC(2fb3e355) SHA1(960e0a66b23f79833b011ea35a5a412dffb47083) )
3825   ROM_LOAD16_BYTE( "epr-11717.a1",  0x100001, 0x010000, CRC(676be0cb) SHA1(1e7d4c5f231992f111cc7885e97bc5a7267a5e89) )
3826   ROM_LOAD16_BYTE( "epr-11733.b10", 0x100000, 0x010000, CRC(802cac94) SHA1(24e5aa74ce8b6c53c78cc33a41a473df3fbce639) )
3827   ROM_LOAD16_BYTE( "epr-11718.a2",  0x140001, 0x010000, CRC(882864c2) SHA1(bd44bbdc13e5fd1b5c31c343da00a75b9dd90478) )
3828   ROM_LOAD16_BYTE( "epr-11734.b11", 0x140000, 0x010000, CRC(76c704d2) SHA1(35b393071e29b8d122d3f904b923689a7dddc808) )
3829   ROM_LOAD16_BYTE( "epr-11719.a3",  0x180001, 0x010000, CRC(339987f7) SHA1(b5650f8bdbd44510e84686b20daf70bc4a564f28) )
3830   ROM_LOAD16_BYTE( "epr-11735.b12", 0x180000, 0x010000, CRC(4fe406aa) SHA1(7f068b81f35be4cc4785824ed524d28f201ff0a5) )
3831
3832   ROM_REGION( 0x50000, "soundcpu", 0 ) /* sound CPU */
3833   ROM_LOAD( "epr-11671.a10", 0x00000, 0x08000, CRC(2b71343b) SHA1(8a657f787de2b9d5161ed2c109642a148348af09) )
3834   ROM_LOAD( "opr-11672.a11", 0x10000, 0x20000, CRC(bbd7f460) SHA1(bbc5c2219cb3a827d84062b19affd9780da2a3cf) )
3835   ROM_LOAD( "opr-11673.a12", 0x30000, 0x20000, CRC(400c4a36) SHA1(de4bdfa91734410e0a7f6a16bf8336db172f458a) )
3836ROM_END
3837
3838/**************************************************************************************************************************
3839    Jyuohki (Altered Beast), Sega System 16B
37973840    CPU: FD1094 (317-0065)
37983841    ROM Board: 171-5521
37993842*/
r8581r8582
38053848   ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
38063849   ROM_LOAD( "317-0065.key", 0x0000, 0x2000, NO_DUMP )
38073850
3808   ROM_REGION16_BE( 0x040000, "user2", ROMREGION_ERASE00 ) /* working overlay */
3809
38103851   ROM_REGION( 0x60000, "gfx1", 0 ) /* tiles */
38113852   ROM_LOAD( "opr-11674.a14", 0x00000, 0x20000, CRC(a57a66d5) SHA1(5103583d48997abad12a0c5fee26431c486ced52) )
38123853   ROM_LOAD( "opr-11675.a15", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
38133854   ROM_LOAD( "opr-11676.a16", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
3855/* If this is truly a Japanese set it should use these roms:
3856    ROM_LOAD( "epr-11722.a14", 0x00000, 0x10000,  CRC(adaa8db5) SHA1(3262c98d13d08c333d16052cac841f44d2f99743) )
3857    ROM_LOAD( "epr-11736.b14", 0x20000, 0x10000,  CRC(e9ad5e89) SHA1(769628eee6e194a84aa8a3729f4e7d07dd3ba25c) )
3858    ROM_LOAD( "epr-11723.a15", 0x40000, 0x10000,  CRC(131a3f9a) SHA1(8182c3b8ce7a2f02b226cfa2081187593c9d0d0b) )
3859    ROM_LOAD( "epr-11737.b15", 0x60000, 0x10000,  CRC(2e420023) SHA1(3aa2c3b6fccafb4d53b6ab99b95181d3eed7c77f) )
3860    ROM_LOAD( "epr-11724.a16", 0x80000, 0x10000,  CRC(6f2ed50a) SHA1(55d0c4299e7240b0ef5316b48db7a158145c76ab) )
3861    ROM_LOAD( "epr-11738.b16", 0xa0000, 0x10000,  CRC(de3d6d02) SHA1(428811f21c68761022521a17fc4716f6e7214b20) )
3862*/
38143863
38153864   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) /* sprites */
38163865   ROM_LOAD16_BYTE( "epr-11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
r8581r8582
38213870   ROM_LOAD16_BYTE( "epr-11683.b7", 0x80000, 0x20000, CRC(f9a60f06) SHA1(0cffcfdb02733feaa869198b7e668c58b47c321a) )
38223871   ROM_LOAD16_BYTE( "epr-11680.b4", 0xc0001, 0x20000, CRC(f43dcdec) SHA1(2941500cf33afca487f19f2329033d5d17aad826) )
38233872   ROM_LOAD16_BYTE( "epr-11684.b8", 0xc0000, 0x20000, CRC(b20c0edb) SHA1(6c8694d05e3adac37c9015037ab800233371db36) )
3873/* If this is truly a Japanese set it should use these roms:
3874    ROM_LOAD16_BYTE( "epr-11725.b1",  0x000001, 0x010000, CRC(f8b3684e) SHA1(3de2685cae5fb3c954b8440fafce313072747469) )
3875    ROM_LOAD16_BYTE( "epr-11729.b5",  0x000000, 0x010000, CRC(ae3c2793) SHA1(c4f46861ea63ffa3c038a1ef931479b94e5382df) )
3876    ROM_LOAD16_BYTE( "epr-11726.b2",  0x040001, 0x010000, CRC(3cce5419) SHA1(fccdbd6d05f5927272e7d6e5f997418d4fa2baf5) )
3877    ROM_LOAD16_BYTE( "epr-11730.b6",  0x040000, 0x010000, CRC(3af62b55) SHA1(9f079af88aaf2447948c9ac01c6cbd1e79539704) )
3878    ROM_LOAD16_BYTE( "epr-11727.b3",  0x080001, 0x010000, CRC(b0390078) SHA1(9035d9f45c67bdc802710018722943f5b63e8b5d) )
3879    ROM_LOAD16_BYTE( "epr-11731.b7",  0x080000, 0x010000, CRC(2a87744a) SHA1(421b3926de046ddeddad05f65fc6b5078af28dbd) )
3880    ROM_LOAD16_BYTE( "epr-11728.b4",  0x0c0001, 0x010000, CRC(f3a43fd8) SHA1(d42833ecd0c1920f1a6904d32c096f12d8622141) )
3881    ROM_LOAD16_BYTE( "epr-11732.b8",  0x0c0000, 0x010000, CRC(2fb3e355) SHA1(960e0a66b23f79833b011ea35a5a412dffb47083) )
3882    ROM_LOAD16_BYTE( "epr-11717.a1",  0x100001, 0x010000, CRC(676be0cb) SHA1(1e7d4c5f231992f111cc7885e97bc5a7267a5e89) )
3883    ROM_LOAD16_BYTE( "epr-11733.b10", 0x100000, 0x010000, CRC(802cac94) SHA1(24e5aa74ce8b6c53c78cc33a41a473df3fbce639) )
3884    ROM_LOAD16_BYTE( "epr-11718.a2",  0x140001, 0x010000, CRC(882864c2) SHA1(bd44bbdc13e5fd1b5c31c343da00a75b9dd90478) )
3885    ROM_LOAD16_BYTE( "epr-11734.b11", 0x140000, 0x010000, CRC(76c704d2) SHA1(35b393071e29b8d122d3f904b923689a7dddc808) )
3886    ROM_LOAD16_BYTE( "epr-11719.a3",  0x180001, 0x010000, CRC(339987f7) SHA1(b5650f8bdbd44510e84686b20daf70bc4a564f28) )
3887    ROM_LOAD16_BYTE( "epr-11735.b12", 0x180000, 0x010000, CRC(4fe406aa) SHA1(7f068b81f35be4cc4785824ed524d28f201ff0a5) )
3888*/
38243889
38253890   ROM_REGION( 0x50000, "soundcpu", 0 ) /* sound CPU */
38263891   ROM_LOAD( "epr-11671.a10", 0x00000, 0x08000, CRC(2b71343b) SHA1(8a657f787de2b9d5161ed2c109642a148348af09) )
r8581r8582
41734238   ROM_REGION( 0x2000, "user1", 0 ) /* decryption key -- still WIP */
41744239   ROM_LOAD( "317-0041.key", 0x0000, 0x2000, BAD_DUMP CRC(a30ae46c) SHA1(5e7361ab1f1d30c59d7f29152bc6f7175a0aa102) )
41754240
4176   ROM_REGION16_BE( 0x040000, "user2", ROMREGION_ERASE00 ) /* working overlay */
4177
41784241   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
41794242   ROM_LOAD( "epr-10994.b9",  0x00000, 0x10000, CRC(3035468a) SHA1(778366815a2a74188d72d64c5e1e95215bc4ca81) )
41804243   ROM_LOAD( "epr-10995.b10", 0x10000, 0x10000, CRC(6b97aff1) SHA1(323bafe43a703476f6f4e68b46ec86bb9152f88e) )
r8581r8582
48214884*/
48224885ROM_START( goldnaxej )
48234886   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
4887   /* fails rom test on 8 & 6 ?! roms verfied from two seperate sources */
48244888   ROM_LOAD16_BYTE( "epr-12540.a7", 0x00000, 0x20000, CRC(0c7ccc6d) SHA1(25bc29eee731befc665472c2c1998cac8447cc21) )
48254889   ROM_LOAD16_BYTE( "epr-12539.a5", 0x00001, 0x20000, CRC(1f24f7d0) SHA1(a09cdf394c03069707f7ed400b8fbdc13674fa74) )
48264890   /* emtpy 0x40000 - 0x80000 */
r8581r8582
48584922    Golden Axe (Japan), Sega System 16B
48594923    CPU: FD1094 (317-0120)
48604924    ROM Board: 171-5704
4925    Sega ID# for ROM board: 834-7002-11
48614926*/
48624927ROM_START( goldnaxe3 )
48634928   ROM_REGION( 0xc0000, "maincpu", 0) /* 68000 code */
4864   /* fails rom test on 8 & 6 ?! */
4865   ROM_LOAD16_BYTE( "7.bin", 0x00000, 0x20000, CRC(48332c76) SHA1(4cdf7dc2f504a030ae63b4854bb76a3f2cc1d96b) )
4866   ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x20000, CRC(8e58f342) SHA1(a972b05f7d5d7228067f97724191fce1aeb0371d) )
4929   /* fails rom test on 8 & 6 ?! roms verfied from two seperate sources */
4930   ROM_LOAD16_BYTE( "epr-12525.a7", 0x00000, 0x20000, CRC(48332c76) SHA1(4cdf7dc2f504a030ae63b4854bb76a3f2cc1d96b) )
4931   ROM_LOAD16_BYTE( "epr-12524.a5", 0x00001, 0x20000, CRC(8e58f342) SHA1(a972b05f7d5d7228067f97724191fce1aeb0371d) )
48674932   /* emtpy 0x40000 - 0x80000 */
48684933   ROM_LOAD16_BYTE( "epr-12521.a8", 0x80000, 0x20000, CRC(5001d713) SHA1(68cf3f48d6e440e5b800503a211adda02107d956) )
48694934   ROM_LOAD16_BYTE( "epr-12519.a6", 0x80001, 0x20000, CRC(4438ca8e) SHA1(0af53d64f06abf41f4c46540d28d5f008a4835a3) )
r8581r8582
49405005    Golden Axe, Sega System 16B
49415006    CPU: FD1094 (317-0110)
49425007    ROM Board: 171-5797
5008    Sega ID# for ROM board: 834-7002
49435009*/
49445010ROM_START( goldnaxe1 )
49455011   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
r8581r8582
55235589   ROM_LOAD( "epr-11377.a10", 0x00000, 0x08000, CRC(0fb6af34) SHA1(ae9da18bd2db317ed96c5f642f90cc1eba60ba99) ) /* MC8123B (317-0054) encrypted version of epr-11361.a10 above */
55245590   ROM_LOAD( "epr-11362.a11", 0x10000, 0x20000, CRC(256af749) SHA1(041bd007ea7708c6d69f07865828b9bd17a139f5) )
55255591
5526   ROM_REGION( 0x2000, "user2", 0 ) /* MC8123 key */
5592   ROM_REGION( 0x2000, "mcu", 0 ) /* MC8123 key */
55275593   ROM_LOAD( "317-0054.key",  0x0000, 0x2000, CRC(39fd4535) SHA1(93bbb139d2d5acc6a1e338d92077e79a5e880b2e) )
55285594ROM_END
55295595
r8581r8582
55615627   ROM_LOAD( "epr-11288.a8", 0x10000, 0x8000, CRC(c8df8460) SHA1(0aeb41a493df155edb5f600f53ec43b798927dff) )
55625628   ROM_LOAD( "epr-11289.a9", 0x20000, 0x8000, CRC(e5a4cf30) SHA1(d1982da7a550c11ab2253f5d64ac6ab847da0a04) )
55635629
5564   ROM_REGION( 0x2000, "user2", 0 ) /* MC8123 key */
5630   ROM_REGION( 0x2000, "mcu", 0 ) /* MC8123 key */
55655631   ROM_LOAD( "317-0054.key",  0x0000, 0x2000, CRC(39fd4535) SHA1(93bbb139d2d5acc6a1e338d92077e79a5e880b2e) )
55665632ROM_END
55675633
r8581r8582
63346400static DRIVER_INIT( altbeas4_5521 )
63356401{
63366402   DRIVER_INIT_CALL(generic_5521);
6337   mc8123_decrypt_rom(machine, "soundcpu", "user2", NULL, 0);
6403   mc8123_decrypt_rom(machine, "soundcpu", "mcu", NULL, 0);
63386404}
63396405
63406406
r8581r8582
64316497static DRIVER_INIT( shinobi4_5521 )
64326498{
64336499   DRIVER_INIT_CALL(generic_5521);
6434   mc8123_decrypt_rom(machine, "soundcpu", "user2", NULL, 0);
6500   mc8123_decrypt_rom(machine, "soundcpu", "mcu", NULL, 0);
64356501}
64366502
64376503
64386504static DRIVER_INIT( shinobi3_5358 )
64396505{
64406506   DRIVER_INIT_CALL(generic_5358);
6441   mc8123_decrypt_rom(machine, "soundcpu", "user2", NULL, 0);
6507   mc8123_decrypt_rom(machine, "soundcpu", "mcu", NULL, 0);
64426508}
64436509
64446510
r8581r8582
65176583GAME( 1987, aliensyn3,  aliensyn, system16b,      aliensyn, aliensy3_5358,      ROT0,   "Sega",           "Alien Syndrome (set 3, System 16B, FD1089A 317-0033)", 0 )
65186584GAME( 1987, aliensynj,  aliensyn, system16b,      aliensynj,aliensy3_5358,      ROT0,   "Sega",           "Alien Syndrome (set 6, Japan, new, System 16B, FD1089A 317-0033)", 0 )
65196585
6520GAME( 1988, altbeast,   0,        system16b_8751, altbeast, altbeast_5521,      ROT0,   "Sega",           "Altered Beast (set 7, 8751 317-0078)", 0 )
6521GAME( 1988, altbeastj,  altbeast, system16b_8751, altbeast, altbeasj_5521,      ROT0,   "Sega",           "Juuouki (set 6, Japan, 8751 317-0077)", 0 )
6522GAME( 1988, altbeast5,  altbeast, system16b_8751, altbeast, altbeas5_5521,      ROT0,   "Sega",           "Altered Beast (set 5, 8751 317-0076)", 0 )
6586GAME( 1988, altbeast,   0,        system16b_8751, altbeast, altbeast_5521,      ROT0,   "Sega",           "Altered Beast (set 8, 8751 317-0078)", 0 )
6587GAME( 1988, altbeastj,  altbeast, system16b_8751, altbeast, altbeasj_5521,      ROT0,   "Sega",           "Juuouki (set 7, Japan, 8751 317-0077)", 0 )
6588GAME( 1988, altbeast5,  altbeast, system16b_8751, altbeast, altbeas5_5521,      ROT0,   "Sega",           "Altered Beast (set 6, 8751 317-0076)", 0 )
65236589GAME( 1988, altbeast4,  altbeast, system16b,      altbeast, altbeas4_5521,      ROT0,   "Sega",           "Altered Beast (set 4, MC-8123B 317-0066)", 0 )
65246590GAME( 1988, altbeastj3, altbeast, system16b,      altbeast, generic_5521,       ROT0,   "Sega",           "Juuouki (set 3, Japan, FD1094 317-0068)", 0 )
65256591GAME( 1988, altbeast2,  altbeast, system16b,      altbeast, altbeas4_5521,      ROT0,   "Sega",           "Altered Beast (set 2, MC-8123B 317-0066)", 0 )
6526GAME( 1988, altbeastj1, altbeast, system16b,      altbeast, generic_5521,       ROT0,   "Sega",           "Juuouki (set 1, Japan, FD1094 317-0065)", GAME_NOT_WORKING )
6592GAME( 1988, altbeastj1, altbeast, system16b,      altbeast, generic_5521,       ROT0,   "Sega",           "Juuouki (set 1, Japan, FD1094 317-0065)", GAME_NOT_WORKING ) /* No CPU decrypt key */
6593GAME( 1988, altbeastj2, altbeast, system16b,      altbeast, generic_5521,       ROT0,   "Sega",           "Juuouki (set 5, Japan, FD1094 317-0069)", GAME_NOT_WORKING ) /* No CPU decrypt key */
65276594
65286595GAME( 1990, aurail,     0,        system16b,      aurail,   generic_5704,       ROT0,   "Sega / Westone", "Aurail (set 3, US, unprotected)", 0 )
65296596GAME( 1990, aurail1,    aurail,   system16b,      aurail,   aurail1_5704,       ROT0,   "Sega / Westone", "Aurail (set 2, World, FD1089B 317-0168)", 0 )
src/mame/drivers/marineb.c
r8581r8582
6969{
7070   espial_state *state = (espial_state *)machine->driver_data;
7171
72   state->maincpu = devtag_get_device(machine, "maincpu");
72   state->maincpu = machine->device("maincpu");
7373   state->audiocpu = NULL;
7474
7575   state_save_register_global(machine, state->marineb_active_low_flipscreen);
src/mame/drivers/pktgaldx.c
r8581r8582
314314{
315315   pktgaldx_state *state = (pktgaldx_state *)machine->driver_data;
316316
317   state->maincpu = devtag_get_device(machine, "maincpu");
318   state->deco16ic = devtag_get_device(machine, "deco_custom");
317   state->maincpu = machine->device("maincpu");
318   state->deco16ic = machine->device("deco_custom");
319319}
320320
321321static MACHINE_DRIVER_START( pktgaldx )
src/mame/drivers/nwk-tr.c
r8581r8582
245245
246246static VIDEO_UPDATE( nwktr )
247247{
248   running_device *voodoo = devtag_get_device(screen->machine, "voodoo");
249   running_device *k001604 = devtag_get_device(screen->machine, "k001604");
248   running_device *voodoo = screen->machine->device("voodoo");
249   running_device *k001604 = screen->machine->device("k001604");
250250
251251   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
252252
r8581r8582
263263
264264static READ32_HANDLER( sysreg_r )
265265{
266   running_device *adc12138 = devtag_get_device(space->machine, "adc12138");
266   running_device *adc12138 = space->machine->device("adc12138");
267267   UINT32 r = 0;
268268   if (offset == 0)
269269   {
r8581r8582
296296
297297static WRITE32_HANDLER( sysreg_w )
298298{
299   running_device *adc12138 = devtag_get_device(space->machine, "adc12138");
299   running_device *adc12138 = space->machine->device("adc12138");
300300   if( offset == 0 )
301301   {
302302      if (ACCESSING_BITS_24_31)
r8581r8582
463463static MACHINE_START( nwktr )
464464{
465465   /* set conservative DRC options */
466   ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
466   ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
467467
468468   /* configure fast RAM regions for DRC */
469   ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, work_ram);
469   ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, work_ram);
470470}
471471
472472static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 )
r8581r8582
618618static void sound_irq_callback(running_machine *machine, int irq)
619619{
620620   if (irq == 0)
621      generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), INPUT_LINE_IRQ1);
621      generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ1);
622622   else
623      generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), INPUT_LINE_IRQ2);
623      generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ2);
624624}
625625
626626static const k056800_interface nwktr_k056800_interface =
src/mame/drivers/circus.c
r8581r8582
268268{
269269   circus_state *state = (circus_state *)machine->driver_data;
270270
271   state->maincpu = devtag_get_device(machine, "maincpu");
272   state->samples = devtag_get_device(machine, "samples");
273   state->discrete = devtag_get_device(machine, "discrete");
271   state->maincpu = machine->device("maincpu");
272   state->samples = machine->device("samples");
273   state->discrete = machine->device("discrete");
274274
275275   state_save_register_global(machine, state->clown_x);
276276   state_save_register_global(machine, state->clown_y);
src/mame/drivers/taito_f3.c
r8581r8582
36733673
36743674static DRIVER_INIT( bubsympb )
36753675{
3676   running_device *oki = devtag_get_device(machine, "oki");
3676   running_device *oki = machine->device("oki");
36773677   f3_game=BUBSYMPH;
36783678   //tile_decode(machine);
36793679
src/mame/drivers/champbas.c
r8581r8582
568568{
569569   champbas_state *state = (champbas_state *)machine->driver_data;
570570
571   state->maincpu = devtag_get_device(machine, "maincpu");
572   state->mcu = devtag_get_device(machine, CPUTAG_MCU);
571   state->maincpu = machine->device("maincpu");
572   state->mcu = machine->device(CPUTAG_MCU);
573573
574574   state_save_register_global(machine, state->watchdog_count);
575575   state_save_register_global(machine, state->palette_bank);
r8581r8582
579579static MACHINE_START( exctsccr )
580580{
581581   champbas_state *state = (champbas_state *)machine->driver_data;
582   state->audiocpu = devtag_get_device(machine, "audiocpu");
582   state->audiocpu = machine->device("audiocpu");
583583
584584   // FIXME
585585   timer_pulse(machine, ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */
src/mame/drivers/m107.c
r8581r8582
119119   }
120120
121121   if (irqvector & 0x2)      /* YM2151 has precedence */
122      cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x18);
122      cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x18);
123123   else if (irqvector & 0x1)   /* V30 */
124      cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x19);
124      cpu_set_input_line_vector(machine->device("soundcpu"), 0, 0x19);
125125
126126   if (irqvector == 0)   /* no IRQs pending */
127127      cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);
src/mame/drivers/ninjaw.c
r8581r8582
763763
764764   memory_configure_bank(machine, "bank10", 0, 8, memory_region(machine, "audiocpu") + 0xc000, 0x4000);
765765
766   state->maincpu = devtag_get_device(machine, "maincpu");
767   state->audiocpu = devtag_get_device(machine, "audiocpu");
768   state->subcpu = devtag_get_device(machine, "sub");
769   state->tc0140syt = devtag_get_device(machine, "tc0140syt");
770   state->tc0100scn_1 = devtag_get_device(machine, "tc0100scn_1");
771   state->tc0100scn_2 = devtag_get_device(machine, "tc0100scn_2");
772   state->tc0100scn_3 = devtag_get_device(machine, "tc0100scn_3");
766   state->maincpu = machine->device("maincpu");
767   state->audiocpu = machine->device("audiocpu");
768   state->subcpu = machine->device("sub");
769   state->tc0140syt = machine->device("tc0140syt");
770   state->tc0100scn_1 = machine->device("tc0100scn_1");
771   state->tc0100scn_2 = machine->device("tc0100scn_2");
772   state->tc0100scn_3 = machine->device("tc0100scn_3");
773773
774   state->lscreen = devtag_get_device(machine, "lscreen");
775   state->mscreen = devtag_get_device(machine, "mscreen");
776   state->rscreen = devtag_get_device(machine, "rscreen");
774   state->lscreen = machine->device("lscreen");
775   state->mscreen = machine->device("mscreen");
776   state->rscreen = machine->device("rscreen");
777777
778   state->_2610_1l = devtag_get_device(machine, "2610.1.l");
779   state->_2610_1r = devtag_get_device(machine, "2610.1.r");
780   state->_2610_2l = devtag_get_device(machine, "2610.2.l");
781   state->_2610_2r = devtag_get_device(machine, "2610.2.r");
778   state->_2610_1l = machine->device("2610.1.l");
779   state->_2610_1r = machine->device("2610.1.r");
780   state->_2610_2l = machine->device("2610.2.l");
781   state->_2610_2r = machine->device("2610.2.r");
782782
783783   state_save_register_global(machine, state->cpua_ctrl);
784784   state_save_register_global(machine, state->banknum);
src/mame/drivers/arkanoid.c
r8581r8582
22
33    Arkanoid driver
44
5    - I think the MCU dump we're using with the original sets is actually
6      from a bootleg?  It's similar to the ones dumped from other bootlegs
7      and the 2/3 of the decapped MCUs appear to be very different.  Another
8      bootleg had a dump very similar to the fresh decaps instead.  This
9      needs sorting out properly.  The hookups for the different types of MCU
10      is not identical.
511
612    Japanese version support cocktail mode (DSW #7), the others don't.
713
r8581r8582
910916{
911917   arkanoid_state *state = (arkanoid_state *)machine->driver_data;
912918
913   state->mcu = devtag_get_device(machine, "mcu");
919   state->mcu = machine->device("mcu");
914920
915921   state_save_register_global(machine, state->bootleg_cmd);
916922
r8581r8582
10441050
10451051ROM_START( arkanoid )
10461052   ROM_REGION( 0x10000, "maincpu", 0 )
1047   ROM_LOAD( "a75-01-1.rom", 0x0000, 0x8000, CRC(5bcda3b0) SHA1(52cadd38b5f8e8856f007a9c602d6b508f30be65) )
1048   ROM_LOAD( "a75-11.rom",   0x8000, 0x8000, CRC(eafd7191) SHA1(d2f8843b716718b1de209e97a874e8ce600f3f87) )
1053   ROM_LOAD( "a75-01-1.ic17", 0x0000, 0x8000, CRC(5bcda3b0) SHA1(52cadd38b5f8e8856f007a9c602d6b508f30be65) )
1054   ROM_LOAD( "a75-11.ic16",   0x8000, 0x8000, CRC(eafd7191) SHA1(d2f8843b716718b1de209e97a874e8ce600f3f87) )
10491055
10501056   ROM_REGION( 0x0800, "mcu", 0 )   /* 2k for the microcontroller */
1051   ROM_LOAD( "arkanoid.uc",  0x0000, 0x0800, CRC(515d77b6) SHA1(a302937683d11f663abd56a2fd7c174374e4d7fb) )
1057   ROM_LOAD( "arkanoid.ic14",  0x0000, 0x0800, CRC(515d77b6) SHA1(a302937683d11f663abd56a2fd7c174374e4d7fb) ) /* The real MCU should be A75-06 @ IC14 */
10521058
10531059   ROM_REGION( 0x18000, "gfx1", 0 )
1054   ROM_LOAD( "a75-03.rom",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1055   ROM_LOAD( "a75-04.rom",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1056   ROM_LOAD( "a75-05.rom",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
1060   ROM_LOAD( "a75-03.ic64",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1061   ROM_LOAD( "a75-04.ic63",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1062   ROM_LOAD( "a75-05.ic62",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
10571063
1058   ROM_REGION( 0x0600, "proms", 0 )
1059   ROM_LOAD( "a75-07.bpr",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1060   ROM_LOAD( "a75-08.bpr",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1061   ROM_LOAD( "a75-09.bpr",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
1064   ROM_REGION( 0x0600, "proms", 0 ) /* BPROMs are silkscreened as 7621, actual BPROMs used are MMI 6306-1N */
1065   ROM_LOAD( "a75-07.ic24",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1066   ROM_LOAD( "a75-08.ic23",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1067   ROM_LOAD( "a75-09.ic22",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
1068
1069   // these were decapped, sort them!
1070   ROM_REGION( 0x0800, "alt_mcus", 0 )   /* 2k for the microcontroller */
1071   ROM_LOAD( "arkanoid1_68705p3.ic14",  0x0000, 0x0800, CRC(1b68e2d8) SHA1(f642a7cb624ee14fb0e410de5ae1fc799d2fa1c2) ) // this is close to the supported MCU, is it a bootleg?
1072   ROM_LOAD( "arkanoid_mcu.ic14",       0x0000, 0x0800, CRC(4e44b50a) SHA1(c61e7d158dc8e2b003c8158053ec139b904599af) ) // this has a more genuine Programmed By Yasu 1986 string in it with 0x00 fill near the end
1073   ROM_LOAD( "arkanoid_68705p5.ic14",   0x0000, 0x0800, CRC(0be83647) SHA1(625fd1e6061123df612f115ef14a06cd6009f5d1) ) // same as above, but with 0xff fill
10621074ROM_END
10631075
10641076ROM_START( arkanoidu )
10651077   ROM_REGION( 0x10000, "maincpu", 0 )
1066   ROM_LOAD( "a75-19.bin",   0x0000, 0x8000, CRC(d3ad37d7) SHA1(a172a1ef5bb83ee2d8ed2842ef8968af19ad411e) )
1067   ROM_LOAD( "a75-18.bin",   0x8000, 0x8000, CRC(cdc08301) SHA1(05f54353cc8333af14fa985a2764960e20e8161a) )
1078   ROM_LOAD( "a75-19.ic17",   0x0000, 0x8000, CRC(d3ad37d7) SHA1(a172a1ef5bb83ee2d8ed2842ef8968af19ad411e) )
1079   ROM_LOAD( "a75-18.ic16",   0x8000, 0x8000, CRC(cdc08301) SHA1(05f54353cc8333af14fa985a2764960e20e8161a) )
10681080
10691081   ROM_REGION( 0x0800, "mcu", 0 )   /* 2k for the microcontroller */
1070   ROM_LOAD( "arknoidu.uc",  0x0000, 0x0800, BAD_DUMP CRC(de518e47) SHA1(b8eddd1c566505fb69e3d1207c7a9720dfb9f503)  )
1082   ROM_LOAD( "arknoidu.ic14",  0x0000, 0x0800, BAD_DUMP CRC(de518e47) SHA1(b8eddd1c566505fb69e3d1207c7a9720dfb9f503)  ) /* The real MCU should be A75-15 @ IC14?? */
10711083
10721084   ROM_REGION( 0x18000, "gfx1", 0 )
1073   ROM_LOAD( "a75-03.rom",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1074   ROM_LOAD( "a75-04.rom",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1075   ROM_LOAD( "a75-05.rom",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
1085   ROM_LOAD( "a75-03.ic64",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1086   ROM_LOAD( "a75-04.ic63",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1087   ROM_LOAD( "a75-05.ic62",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
10761088
1077   ROM_REGION( 0x0600, "proms", 0 )
1078   ROM_LOAD( "a75-07.bpr",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1079   ROM_LOAD( "a75-08.bpr",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1080   ROM_LOAD( "a75-09.bpr",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
1089   ROM_REGION( 0x0600, "proms", 0 ) /* BPROMs are silkscreened as 7621, actual BPROMs used are MMI 6306-1N */
1090   ROM_LOAD( "a75-07.ic24",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1091   ROM_LOAD( "a75-08.ic23",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1092   ROM_LOAD( "a75-09.ic22",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
10811093ROM_END
10821094
10831095ROM_START( arkanoiduo )
10841096   ROM_REGION( 0x10000, "maincpu", 0 )
1085   ROM_LOAD( "a75-01-1.rom", 0x0000, 0x8000, CRC(5bcda3b0) SHA1(52cadd38b5f8e8856f007a9c602d6b508f30be65) )
1086   ROM_LOAD( "a75-10.rom",   0x8000, 0x8000, CRC(a1769e15) SHA1(fbb45731246a098b29eb08de5d63074b496aaaba) )
1097   ROM_LOAD( "a75-01-1.ic17", 0x0000, 0x8000, CRC(5bcda3b0) SHA1(52cadd38b5f8e8856f007a9c602d6b508f30be65) )
1098   ROM_LOAD( "a75-10.ic16",   0x8000, 0x8000, CRC(a1769e15) SHA1(fbb45731246a098b29eb08de5d63074b496aaaba) )
10871099
10881100   ROM_REGION( 0x0800, "mcu", 0 )   /* 2k for the microcontroller */
1089   ROM_LOAD( "arkanoid.uc",  0x0000, 0x0800, CRC(515d77b6) SHA1(a302937683d11f663abd56a2fd7c174374e4d7fb) )
1101   ROM_LOAD( "arkanoid.ic14",  0x0000, 0x0800, CRC(515d77b6) SHA1(a302937683d11f663abd56a2fd7c174374e4d7fb) ) /* The real MCU should be A75-06 @ IC14 */
10901102
10911103   ROM_REGION( 0x18000, "gfx1", 0 )
1092   ROM_LOAD( "a75-03.rom",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1093   ROM_LOAD( "a75-04.rom",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1094   ROM_LOAD( "a75-05.rom",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
1104   ROM_LOAD( "a75-03.ic64",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1105   ROM_LOAD( "a75-04.ic63",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1106   ROM_LOAD( "a75-05.ic62",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
10951107
1096   ROM_REGION( 0x0600, "proms", 0 )
1097   ROM_LOAD( "a75-07.bpr",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1098   ROM_LOAD( "a75-08.bpr",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1099   ROM_LOAD( "a75-09.bpr",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
1108   ROM_REGION( 0x0600, "proms", 0 ) /* BPROMs are silkscreened as 7621, actual BPROMs used are MMI 6306-1N */
1109   ROM_LOAD( "a75-07.ic24",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1110   ROM_LOAD( "a75-08.ic23",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1111   ROM_LOAD( "a75-09.ic23",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
11001112ROM_END
11011113
11021114ROM_START( arkatour )
11031115   ROM_REGION( 0x10000, "maincpu", 0 )
1104   ROM_LOAD( "a75-27.17",   0x0000, 0x8000, CRC(e3b8faf5) SHA1(4c09478fa41881fa89ee6afb676aeb780f17ac2e) )
1105   ROM_LOAD( "a75-28.18",   0x8000, 0x8000, CRC(326aca4d) SHA1(5a194b7a0361236d471b24905dc6434372f81252) )
1116   ROM_LOAD( "a75-27.ic17",   0x0000, 0x8000, CRC(e3b8faf5) SHA1(4c09478fa41881fa89ee6afb676aeb780f17ac2e) )
1117   ROM_LOAD( "a75-28.ic16",   0x8000, 0x8000, CRC(326aca4d) SHA1(5a194b7a0361236d471b24905dc6434372f81252) )
11061118
11071119   ROM_REGION( 0x0800, "mcu", 0 )   /* 2k for the microcontroller */
1108   ROM_LOAD( "a75-32.14",  0x0000, 0x0800, BAD_DUMP CRC(d3249559) SHA1(b1542764450016614e9e03cedd6a2f1e59961789)  )
1120   ROM_LOAD( "a75-32.ic14",  0x0000, 0x0800, BAD_DUMP CRC(d3249559) SHA1(b1542764450016614e9e03cedd6a2f1e59961789)  )
11091121
11101122   ROM_REGION( 0x18000, "gfx1", 0 )
1111   ROM_LOAD( "a75-29.64",   0x00000, 0x8000, CRC(5ddea3cf) SHA1(58f16515898b7cc2697bf7663a60d9ca0db6da95) )
1112   ROM_LOAD( "a75-30.63",   0x08000, 0x8000, CRC(5fcf2e85) SHA1(f721f0afb0550cc64bff26681856a7576398d9b5) )
1113   ROM_LOAD( "a75-31.62",   0x10000, 0x8000, CRC(7b76b192) SHA1(a68aa08717646a6c322cf3455df07f50df9e9f33) )
1123   ROM_LOAD( "a75-29.ic64",   0x00000, 0x8000, CRC(5ddea3cf) SHA1(58f16515898b7cc2697bf7663a60d9ca0db6da95) )
1124   ROM_LOAD( "a75-30.ic63",   0x08000, 0x8000, CRC(5fcf2e85) SHA1(f721f0afb0550cc64bff26681856a7576398d9b5) )
1125   ROM_LOAD( "a75-31.ic62",   0x10000, 0x8000, CRC(7b76b192) SHA1(a68aa08717646a6c322cf3455df07f50df9e9f33) )
11141126
1115   ROM_REGION( 0x0600, "proms", 0 )
1116   ROM_LOAD( "a75-33.24",    0x0000, 0x0200, CRC(b4bf3c81) SHA1(519188937ac9728c653fabac877e37dc43c3f71a) )   /* red component */
1117   ROM_LOAD( "a75-34.23",    0x0200, 0x0200, CRC(de85a803) SHA1(325214995996de36a0470fbfc00e4e393c0b17ad) )   /* green component */
1118   ROM_LOAD( "a75-35.35",    0x0400, 0x0200, CRC(38acfd3b) SHA1(2841e9db047aa039eff8567a518b6250b355507b) )   /* blue component */
1127   ROM_REGION( 0x0600, "proms", 0 ) /* BPROMs are silkscreened as 7621, actual BPROMs used are MMI 6306-1N */
1128   ROM_LOAD( "a75-33.ic24",    0x0000, 0x0200, CRC(b4bf3c81) SHA1(519188937ac9728c653fabac877e37dc43c3f71a) )   /* red component */
1129   ROM_LOAD( "a75-34.ic23",    0x0200, 0x0200, CRC(de85a803) SHA1(325214995996de36a0470fbfc00e4e393c0b17ad) )   /* green component */
1130   ROM_LOAD( "a75-35.ic22",    0x0400, 0x0200, CRC(38acfd3b) SHA1(2841e9db047aa039eff8567a518b6250b355507b) )   /* blue component */
11191131ROM_END
11201132
11211133ROM_START( arkanoidj )
11221134   ROM_REGION( 0x10000, "maincpu", 0 )
1123   ROM_LOAD( "a75-21.rom",   0x0000, 0x8000, CRC(bf0455fc) SHA1(250522b84b9f491c3f4efc391bf6aa6124361369) )
1124   ROM_LOAD( "a75-22.rom",   0x8000, 0x8000, CRC(3a2688d3) SHA1(9633a661352def3d85f95ca830f6d761b0b5450e) )
1135   ROM_LOAD( "a75-21.ic17",   0x0000, 0x8000, CRC(bf0455fc) SHA1(250522b84b9f491c3f4efc391bf6aa6124361369) )
1136   ROM_LOAD( "a75-22.ic16",   0x8000, 0x8000, CRC(3a2688d3) SHA1(9633a661352def3d85f95ca830f6d761b0b5450e) )
11251137
11261138   ROM_REGION( 0x0800, "mcu", 0 )   /* 2k for the microcontroller */
11271139   ROM_LOAD( "arknoidj.uc",  0x0000, 0x0800, BAD_DUMP CRC(0a4abef6) SHA1(fdce0b7a2eab7fd4f1f4fc3b93120b1ebc16078e)  )
11281140
11291141   ROM_REGION( 0x18000, "gfx1", 0 )
1130   ROM_LOAD( "a75-03.rom",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1131   ROM_LOAD( "a75-04.rom",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1132   ROM_LOAD( "a75-05.rom",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
1142   ROM_LOAD( "a75-03.ic64",   0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
1143   ROM_LOAD( "a75-04.ic63",   0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
1144   ROM_LOAD( "a75-05.ic62",   0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
11331145
1134   ROM_REGION( 0x0600, "proms", 0 )
1135   ROM_LOAD( "a75-07.bpr",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1136   ROM_LOAD( "a75-08.bpr",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1137   ROM_LOAD( "a75-09.bpr",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
1146   ROM_REGION( 0x0600, "proms", 0 ) /* BPROMs are silkscreened as 7621, actual BPROMs used are MMI 6306-1N */
1147   ROM_LOAD( "a75-07.ic24",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1148   ROM_LOAD( "a75-08.ic23",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1149   ROM_LOAD( "a75-09.ic22",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
11381150ROM_END
11391151
11401152ROM_START( arkmcubl )
r8581r8582
11581170
11591171   /* Until we know what this MCU is supposed to do, we put it here */
11601172   ROM_REGION( 0x0800, "user1", 0 )
1161   ROM_LOAD( "68705p3.6i",   0x0000, 0x0800, CRC(389a8cfb) SHA1(9530c051b61b5bdec7018c6fdc1ea91288a406bd) )
1173   ROM_LOAD( "68705p3.6i",   0x0000, 0x0800, CRC(389a8cfb) SHA1(9530c051b61b5bdec7018c6fdc1ea91288a406bd) ) // this has the 1986 by Yasu copyright like some of the new decaps loaded in the parent set!
11621174ROM_END
11631175
11641176ROM_START( ark1ball )
src/mame/drivers/megasys1.c
r8581r8582
38533853
38543854static DRIVER_INIT( jitsupro )
38553855{
3856   running_device *oki1 = devtag_get_device(machine, "oki1");
3857   running_device *oki2 = devtag_get_device(machine, "oki2");
3856   running_device *oki1 = machine->device("oki1");
3857   running_device *oki2 = machine->device("oki2");
38583858   UINT16 *RAM  = (UINT16 *) memory_region(machine, "maincpu");
38593859
38603860   astyanax_rom_decode(machine, "maincpu");      // Code
src/mame/drivers/crshrace.c
r8581r8582
449449{
450450   crshrace_state *state = (crshrace_state *)machine->driver_data;
451451
452   state->audiocpu = devtag_get_device(machine, "audiocpu");
453   state->k053936 = devtag_get_device(machine, "k053936");
452   state->audiocpu = machine->device("audiocpu");
453   state->k053936 = machine->device("k053936");
454454
455455   state_save_register_global(machine, state->roz_bank);
456456   state_save_register_global(machine, state->gfxctrl);
src/mame/drivers/airbustr.c
r8581r8582
587587   memory_configure_bank(machine, "bank3", 0, 3, &AUDIO[0x00000], 0x4000);
588588   memory_configure_bank(machine, "bank3", 3, 5, &AUDIO[0x10000], 0x4000);
589589
590   state->master = devtag_get_device(machine, "master");
591   state->slave = devtag_get_device(machine, "slave");
592   state->audiocpu = devtag_get_device(machine, "audiocpu");
593   state->pandora = devtag_get_device(machine, "pandora");
590   state->master = machine->device("master");
591   state->slave = machine->device("slave");
592   state->audiocpu = machine->device("audiocpu");
593   state->pandora = machine->device("pandora");
594594
595595   state_save_register_global(machine, state->soundlatch_status);
596596   state_save_register_global(machine, state->soundlatch2_status);
src/mame/drivers/pacman.c
r8581r8582
397397
398398static WRITE8_HANDLER( pacman_interrupt_vector_w )
399399{
400   cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data);
400   cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data);
401401   cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
402402}
403403
r8581r8582
479479{
480480   if (data == 0xfa) data = 0x78;
481481   if (data == 0xfc) data = 0xfc;
482   cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data );
482   cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data );
483483}
484484
485485
r8581r8582
488488   if (data == 0xbf) data = 0x3c;
489489   if (data == 0xc6) data = 0x40;
490490   if (data == 0xfc) data = 0xfc;
491   cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data );
491   cpu_set_input_line_vector(space->machine->device("maincpu"), 0, data );
492492}
493493
494494
r8581r8582
528528   /* since the sound region in Ali Baba is not contiguous, translate the
529529       offset into the 0-0x1f range */
530530   if (offset < 0x10)
531      pacman_sound_w(devtag_get_device(space->machine, "namco"), offset, data);
531      pacman_sound_w(space->machine->device("namco"), offset, data);
532532   else if (offset < 0x20)
533533      space->machine->generic.spriteram2.u8[offset - 0x10] = data;
534534   else
535      pacman_sound_w(devtag_get_device(space->machine, "namco"), offset - 0x10, data);
535      pacman_sound_w(space->machine->device("namco"), offset - 0x10, data);
536536}
537537
538538
src/mame/drivers/bwing.c
r8581r8582
376376{
377377   bwing_state *state = (bwing_state *)machine->driver_data;
378378
379   state->maincpu = devtag_get_device(machine, "maincpu");
380   state->subcpu = devtag_get_device(machine, "sub");
381   state->audiocpu = devtag_get_device(machine, "audiocpu");
379   state->maincpu = machine->device("maincpu");
380   state->subcpu = machine->device("sub");
381   state->audiocpu = machine->device("audiocpu");
382382
383383   state_save_register_global(machine, state->coin);
384384   state_save_register_global(machine, state->palatch);
src/mame/drivers/sf.c
r8581r8582
809809   sf_state *state = (sf_state *)machine->driver_data;
810810
811811   /* devices */
812   state->maincpu = devtag_get_device(machine, "maincpu");
813   state->audiocpu = devtag_get_device(machine, "audiocpu");
812   state->maincpu = machine->device("maincpu");
813   state->audiocpu = machine->device("audiocpu");
814814
815815   state_save_register_global(machine, state->sf_active);
816816   state_save_register_global(machine, state->bgscroll);
src/mame/drivers/konamim2.c
r8581r8582
10751075
10761076   if (ACCESSING_BITS_32_63)
10771077   {
1078      r = (UINT64)((space->cpu != devtag_get_device(space->machine, "maincpu")) ? 0x80000000 : 0);
1078      r = (UINT64)((space->cpu != space->machine->device("maincpu")) ? 0x80000000 : 0);
10791079      //r |= 0x40000000;  // sets Video-LowRes !?
10801080      return r << 32;
10811081   }
src/mame/drivers/cball.c
r8581r8582
8888static MACHINE_START( cball )
8989{
9090   cball_state *state = (cball_state *)machine->driver_data;
91   state->maincpu = devtag_get_device(machine, "maincpu");
91   state->maincpu = machine->device("maincpu");
9292}
9393
9494static MACHINE_RESET( cball )
src/mame/drivers/cave.c
r8581r8582
17121712{
17131713   cave_state *state = (cave_state *)machine->driver_data;
17141714
1715   state->maincpu = devtag_get_device(machine, "maincpu");
1716   state->audiocpu = devtag_get_device(machine, "audiocpu");
1715   state->maincpu = machine->device("maincpu");
1716   state->audiocpu = machine->device("audiocpu");
17171717
17181718   state_save_register_global(machine, state->soundbuf_len);
17191719   state_save_register_global_array(machine, state->soundbuf_data);
src/mame/drivers/williams.c
r8581r8582
526526
527527void defender_install_io_space(const address_space *space)
528528{
529   running_device *pia_0 = devtag_get_device(space->machine, "pia_0");
530   running_device *pia_1 = devtag_get_device(space->machine, "pia_1");
529   running_device *pia_0 = space->machine->device("pia_0");
530   running_device *pia_1 = space->machine->device("pia_1");
531531
532532   /* this routine dynamically installs the memory mapped above from c000-cfff */
533533   memory_install_write_bank    (space, 0xc000, 0xc00f, 0, 0x03e0, "bank4");
r8581r8582
28092809
28102810static DRIVER_INIT( spdball )
28112811{
2812   running_device *pia_3 = devtag_get_device(machine, "pia_3");
2812   running_device *pia_3 = machine->device("pia_3");
28132813
28142814   CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
28152815
src/mame/drivers/dec8.c
r8581r8582
19311931{
19321932   dec8_state *state = (dec8_state *)machine->driver_data;
19331933
1934   state->maincpu = devtag_get_device(machine, "maincpu");
1935   state->subcpu = devtag_get_device(machine, "sub");
1936   state->audiocpu = devtag_get_device(machine, "audiocpu");
1937   state->mcu = devtag_get_device(machine, "mcu");
1934   state->maincpu = machine->device("maincpu");
1935   state->subcpu = machine->device("sub");
1936   state->audiocpu = machine->device("audiocpu");
1937   state->mcu = machine->device("mcu");
19381938
19391939   state_save_register_global(machine, state->latch);
19401940   state_save_register_global(machine, state->nmi_enable);
src/mame/drivers/fuukifg3.c
r8581r8582
515515
516516   memory_configure_bank(machine, "bank1", 0, 0x3e, &ROM[0x10000], 0x8000);
517517
518   state->maincpu = devtag_get_device(machine, "maincpu");
519   state->audiocpu = devtag_get_device(machine, "soundcpu");
518   state->maincpu = machine->device("maincpu");
519   state->audiocpu = machine->device("soundcpu");
520520
521521   state->raster_interrupt_timer = timer_alloc(machine, raster_interrupt_callback, NULL);
522522
src/mame/drivers/rcorsair.c
r8581r8582
1111
1212Red Corsair EPROM dump (dumped by Phil Morris) - notes follow:
1313
14As of 14th January 2003 a picture can be found here:
14http://www.morris0.fsnet.co.uk
1515
16http://www.morris0.fsnet.co.uk/red_corsair.jpg
17
18But that will no doubt be removed in the coming months, so grab it while
19you can. :)
20
2116The game itself involves you guiding a pirate around various obstacles and
2217picking up treasure. It's a top-down viewpoint.
2318
src/mame/drivers/slotcarn.c
r8581r8582
525525
526526static VIDEO_UPDATE( slotcarn )
527527{
528   running_device *mc6845 = devtag_get_device(screen->machine, "crtc");
528   running_device *mc6845 = screen->machine->device("crtc");
529529   mc6845_update(mc6845, bitmap, cliprect);
530530
531531   return 0;
src/mame/drivers/tbowl.c
r8581r8582
163163
164164static WRITE8_HANDLER( tbowl_adpcm_start_w )
165165{
166   running_device *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1");
166   running_device *adpcm = space->machine->device((offset & 1) ? "msm2" : "msm1");
167167   adpcm_pos[offset & 1] = data << 8;
168168   msm5205_reset_w(adpcm,0);
169169}
r8581r8582
175175
176176static WRITE8_HANDLER( tbowl_adpcm_vol_w )
177177{
178   running_device *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1");
178   running_device *adpcm = space->machine->device((offset & 1) ? "msm2" : "msm1");
179179   msm5205_set_volume(adpcm, (data & 0x7f) * 100 / 0x7f);
180180}
181181
src/mame/drivers/battlane.c
r8581r8582
278278{
279279   battlane_state *state = (battlane_state *)machine->driver_data;
280280
281   state->maincpu = devtag_get_device(machine, "maincpu");
282   state->subcpu = devtag_get_device(machine, "sub");
281   state->maincpu = machine->device("maincpu");
282   state->subcpu = machine->device("sub");
283283
284284   state_save_register_global(machine, state->video_ctrl);
285285   state_save_register_global(machine, state->cpu_control);
src/mame/drivers/atarigt.c
r8581r8582
8484   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
8585
8686   if (reason)
87      atarigen_sound_int_gen(devtag_get_device(machine, "maincpu"));
87      atarigen_sound_int_gen(machine->device("maincpu"));
8888   else
8989      atarigen_sound_int_ack_w(space,0,0,0xffff);
9090}
src/mame/drivers/crimfght.c
r8581r8582
263263   memory_configure_bank(machine, "bank2", 0, 12, &ROM[0x10000], 0x2000);
264264   memory_set_bank(machine, "bank2", 0);
265265
266   state->maincpu = devtag_get_device(machine, "maincpu");
267   state->audiocpu = devtag_get_device(machine, "audiocpu");
268   state->k052109 = devtag_get_device(machine, "k052109");
269   state->k051960 = devtag_get_device(machine, "k051960");
270   state->k007232 = devtag_get_device(machine, "k007232");
266   state->maincpu = machine->device("maincpu");
267   state->audiocpu = machine->device("audiocpu");
268   state->k052109 = machine->device("k052109");
269   state->k051960 = machine->device("k051960");
270   state->k007232 = machine->device("k007232");
271271}
272272
273273static MACHINE_RESET( crimfght )
274274{
275   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), crimfght_banking);
275   konami_configure_set_lines(machine->device("maincpu"), crimfght_banking);
276276}
277277
278278static MACHINE_DRIVER_START( crimfght )
src/mame/drivers/triplhnt.c
r8581r8582
3838
3939static void triplhnt_update_misc(running_machine *machine, int offset)
4040{
41   running_device *samples = devtag_get_device(machine, "samples");
42   running_device *discrete = devtag_get_device(machine, "discrete");
41   running_device *samples = machine->device("samples");
42   running_device *discrete = machine->device("discrete");
4343   UINT8 is_witch_hunt;
4444   UINT8 bit = offset >> 1;
4545
src/mame/drivers/asuka.c
r8581r8582
837837{
838838   asuka_state *state = (asuka_state *)machine->driver_data;
839839
840   state->maincpu = devtag_get_device(machine, "maincpu");
841   state->audiocpu = devtag_get_device(machine, "audiocpu");
842   state->pc090oj = devtag_get_device(machine, "pc090oj");
843   state->tc0100scn = devtag_get_device(machine, "tc0100scn");
840   state->maincpu = machine->device("maincpu");
841   state->audiocpu = machine->device("audiocpu");
842   state->pc090oj = machine->device("pc090oj");
843   state->tc0100scn = machine->device("tc0100scn");
844844
845845   /* configure the banks */
846846   memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "audiocpu"), 0);
src/mame/drivers/rollerg.c
r8581r8582
243243   memory_configure_bank(machine, "bank1", 6, 2, &ROM[0x10000], 0x4000);
244244   memory_set_bank(machine, "bank1", 0);
245245
246   state->maincpu = devtag_get_device(machine, "maincpu");
247   state->audiocpu = devtag_get_device(machine, "audiocpu");
248   state->k053244 = devtag_get_device(machine, "k053244");
249   state->k051316 = devtag_get_device(machine, "k051316");
250   state->k053260 = devtag_get_device(machine, "k053260");
246   state->maincpu = machine->device("maincpu");
247   state->audiocpu = machine->device("audiocpu");
248   state->k053244 = machine->device("k053244");
249   state->k051316 = machine->device("k051316");
250   state->k053260 = machine->device("k053260");
251251
252252   state_save_register_global(machine, state->readzoomroms);
253253}
r8581r8582
256256{
257257   rollerg_state *state = (rollerg_state *)machine->driver_data;
258258
259   konami_configure_set_lines(devtag_get_device(machine, "maincpu"), rollerg_banking);
259   konami_configure_set_lines(machine->device("maincpu"), rollerg_banking);
260260
261261   state->readzoomroms = 0;
262262}
src/mame/drivers/hvyunit.c
r8581r8582
295295
296296static VIDEO_UPDATE(hvyunit)
297297{
298   running_device *pandora = devtag_get_device(screen->machine, "pandora");
298   running_device *pandora = screen->machine->device("pandora");
299299   tilemap_set_scrollx( bg_tilemap,0, ((port0_data&0x40)<<2)+ hu_scrollx + SX_POS); //TODO
300300   tilemap_set_scrolly( bg_tilemap,0, ((port0_data&0x80)<<1)+ hu_scrolly + SY_POS); // TODO
301301
r8581r8582
309309
310310static VIDEO_EOF(hvyunit)
311311{
312   running_device *pandora = devtag_get_device(machine, "pandora");
312   running_device *pandora = machine->device("pandora");
313313   pandora_eof(pandora);
314314}
315315
src/mame/drivers/wolfpack.c
r8581r8582
6161
6262static READ8_HANDLER( wolfpack_misc_r )
6363{
64   running_device *device = devtag_get_device(space->machine, "speech");
64   running_device *device = space->machine->device("speech");
6565   UINT8 val = 0;
6666
6767   /* BIT0 => SPEECH BUSY */
src/mame/drivers/pirates.c
r8581r8582
149149       602e and 62a6 */
150150   /* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */
151151
152   pc = cpu_get_pc(devtag_get_device(field->port->machine, "main"));
152   pc = cpu_get_pc(field->port->machine->device("main"));
153153   if (pc == 0x6134)
154154   {
155155      bit = prot & 1;
src/mame/drivers/tankbatt.c
r8581r8582
107107   tankbatt_sound_enable = !data;
108108
109109   /* hack - turn off the engine noise if the normal game nmi's are disabled */
110   if (data) sample_stop (devtag_get_device(space->machine, "samples"), 2);
110   if (data) sample_stop (space->machine->device("samples"), 2);
111111//  interrupt_enable_w (offset, !data);
112112}
113113
r8581r8582
121121{
122122   if (tankbatt_sound_enable)
123123   {
124      running_device *samples = devtag_get_device(space->machine, "samples");
124      running_device *samples = space->machine->device("samples");
125125      sample_start (samples, 1, 3, 0);
126126   }
127127}
128128
129129static WRITE8_HANDLER( tankbatt_sh_engine_w )
130130{
131   running_device *samples = devtag_get_device(space->machine, "samples");
131   running_device *samples = space->machine->device("samples");
132132   if (tankbatt_sound_enable)
133133   {
134134      if (data)
r8581r8582
143143{
144144   if (tankbatt_sound_enable)
145145   {
146      running_device *samples = devtag_get_device(space->machine, "samples");
146      running_device *samples = space->machine->device("samples");
147147      sample_start (samples, 0, 0, 0);
148148   }
149149}
src/mame/drivers/royalmah.c
r8581r8582
798798   {
799799      case 0x8000:   return input_port_read(space->machine, "DSW4");      // dsw 4
800800      case 0x8200:   return input_port_read(space->machine, "DSW3");      // dsw 3
801      case 0x9001:   return ay8910_r(devtag_get_device(space->machine,"aysnd"), 0);   // inputs
801      case 0x9001:   return ay8910_r(space->machine->device("aysnd"), 0);   // inputs
802802      case 0x9011:   return input_port_read(space->machine, "SYSTEM");
803803   }
804804
r8581r8582
819819   switch(offset)
820820   {
821821      case 0x8e00:   palette_base = data & 0x1f;   return;
822      case 0x9002:   ay8910_data_w(devtag_get_device(space->machine,"aysnd"),0,data);         return;
823      case 0x9003:   ay8910_address_w(devtag_get_device(space->machine,"aysnd"),0,data);      return;
822      case 0x9002:   ay8910_data_w(space->machine->device("aysnd"),0,data);         return;
823      case 0x9003:   ay8910_address_w(space->machine->device("aysnd"),0,data);      return;
824824      case 0x9010:
825825         mjifb_coin_counter_w(space,0,data);
826826         return;
r8581r8582
905905   {
906906      case 0x8000:   return input_port_read(space->machine, "DSW2");      // dsw 2
907907      case 0x8001:   return input_port_read(space->machine, "DSW1");      // dsw 1
908      case 0x9001:   return ay8910_r(devtag_get_device(space->machine,"aysnd"), 0);   // inputs
908      case 0x9001:   return ay8910_r(space->machine->device("aysnd"), 0);   // inputs
909909      case 0x9011:   return input_port_read(space->machine, "SYSTEM");
910910   }
911911
r8581r8582
925925   switch(offset)
926926   {
927927      case 0x8802:   palette_base = data & 0x1f;               return;
928      case 0x9002:   ay8910_data_w(devtag_get_device(space->machine,"aysnd"),0,data);      return;
929      case 0x9003:   ay8910_address_w(devtag_get_device(space->machine,"aysnd"),0,data);   return;
928      case 0x9002:   ay8910_data_w(space->machine->device("aysnd"),0,data);      return;
929      case 0x9003:   ay8910_address_w(space->machine->device("aysnd"),0,data);   return;
930930      case 0x9010:   mjifb_coin_counter_w(space,0,data);      return;
931931      case 0x9011:   input_port_select_w(space,0,data);      return;
932932      case 0x9013:
r8581r8582
11051105      case 0x800e:
11061106      case 0x800f:
11071107      {
1108         running_device *rtc = devtag_get_device(space->machine, "rtc");
1108         running_device *rtc = space->machine->device("rtc");
11091109         return msm6242_r(rtc, offset-0x8000);
11101110      }
11111111   }
r8581r8582
11421142      case 0x800e:
11431143      case 0x800f:
11441144      {
1145         running_device *rtc = devtag_get_device(space->machine, "rtc");
1145         running_device *rtc = space->machine->device("rtc");
11461146         msm6242_w(rtc, offset-0x8000, data);
11471147         return;
11481148      }
r8581r8582
43264326
43274327
43284328dumped by sayu
4329
43304329--- Team Japump!!! ---
4331http://japump.i.am/
43324330
43334331*/
43344332
src/mame/drivers/crospang.c
r8581r8582
1212
1313  Cross Pang New - Is shown on the website but is not currently dumped
1414
15  No Copyright Notice is displayed for Cross Pang however the following page
16  lists it as being by F2 System, Released April 1998
17  http://www.f2.co.kr/eng/f2system/intro5.asp (page no longer valid, check www.f2.co.kr)
15  No Copyright Notice is displayed for Cross Pang however http://www.f2.co.kr
16  at one time did list it as being by F2 System, Released April 1998
1817
19
2018  Cross Pang:
2119    Audio Test isn't correct when a sound is tested, instead musics are right.
2220    The sample rom says 'Oksan' (Oksan made Pass, its unclear how they are
r8581r8582
289287{
290288   crospang_state *state = (crospang_state *)machine->driver_data;
291289
292   state->audiocpu = devtag_get_device(machine, "audiocpu");
290   state->audiocpu = machine->device("audiocpu");
293291
294292   state_save_register_global(machine, state->bestri_tilebank);
295293   state_save_register_global(machine, state->xsproff);
src/mame/drivers/mquake.c
r8581r8582
319319static MACHINE_RESET(mquake)
320320{
321321   /* set ES5503 wave memory (this is banked in 64k increments) */
322   es5503_set_base(devtag_get_device(machine, "ensoniq"), memory_region(machine, "ensoniq"));
322   es5503_set_base(machine->device("ensoniq"), memory_region(machine, "ensoniq"));
323323
324324   MACHINE_RESET_CALL(amiga);
325325}
src/mame/drivers/funybubl.c
r8581r8582
205205   funybubl_state *state = (funybubl_state *)machine->driver_data;
206206   UINT8 *ROM = memory_region(machine, "maincpu");
207207
208   state->audiocpu = devtag_get_device(machine, "audiocpu");
208   state->audiocpu = machine->device("audiocpu");
209209
210210   state->banked_vram = auto_alloc_array(machine, UINT8, 0x2000);
211211   state_save_register_global_pointer(machine, state->banked_vram, 0x2000);
src/mame/drivers/nmk16.c
r8581r8582
15721572   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15731573
15741574   PORT_START("DSW1")
1575   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW2:1,2,3")
1575   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW2:8,7,6")
15761576   PORT_DIPSETTING(    0x0100, DEF_STR( 4C_1C ) )
15771577   PORT_DIPSETTING(    0x0200, DEF_STR( 3C_1C ) )
15781578   PORT_DIPSETTING(    0x0300, DEF_STR( 2C_1C ) )
r8581r8582
15811581   PORT_DIPSETTING(    0x0500, DEF_STR( 1C_3C ) )
15821582   PORT_DIPSETTING(    0x0400, DEF_STR( 1C_4C ) )
15831583   PORT_DIPSETTING(    0x0000, DEF_STR( Free_Play ) )
1584   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW2:4,5,6")
1584   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW2:5,4,3")
15851585   PORT_DIPSETTING(    0x0800, DEF_STR( 4C_1C ) )
15861586   PORT_DIPSETTING(    0x1000, DEF_STR( 3C_1C ) )
15871587   PORT_DIPSETTING(    0x1800, DEF_STR( 2C_1C ) )
r8581r8582
15901590   PORT_DIPSETTING(    0x2800, DEF_STR( 1C_3C ) )
15911591   PORT_DIPSETTING(    0x2000, DEF_STR( 1C_4C ) )
15921592   PORT_DIPSETTING(    0x0000, DEF_STR( Free_Play ) )
1593   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:7")
1593   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:2")
15941594   PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
15951595   PORT_DIPSETTING(    0x4000, DEF_STR( On ) )
1596   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW2:8")
1596   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW2:1")
15971597   PORT_DIPSETTING(    0x8000, DEF_STR( Off ) )
15981598   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
15991599   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:8")
src/mame/drivers/m10.c
r8581r8582
196196{
197197   m10_state *state = (m10_state *)machine->driver_data;
198198
199   state->maincpu = devtag_get_device(machine, "maincpu");
200   state->ic8j1 = devtag_get_device(machine, "ic8j1");
201   state->ic8j2 = devtag_get_device(machine, "ic8j2");
202   state->samples = devtag_get_device(machine, "samples");
199   state->maincpu = machine->device("maincpu");
200   state->ic8j1 = machine->device("ic8j1");
201   state->ic8j2 = machine->device("ic8j2");
202   state->samples = machine->device("samples");
203203
204204   state_save_register_global(machine, state->bottomline);
205205   state_save_register_global(machine, state->flip);
src/tools/jedutil.c
r8581r8582
312312   if (err != 0)
313313      return 1;
314314
315   printf("Target file written succesfully\n");
315   printf("Target file written successfully\n");
316316   return 0;
317317}
src/osd/sdl/man/jedutil.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" jedutil.1
4.\"
5.\" Man page created from source and usage information
6.\" Cesare Falco <cesare.falco@gmail.com>, February 2007
7.\"
8.\" References
9.\" http://aarongiles.com/?p=159
10.\"
11.TH JEDUTIL 1 2010-06-26 0.138u4 "jedutil"
12.\"
13.\" NAME chapter
14.SH NAME
15jedutil \- convert a .JED file into its binary form, and vice\-versa
16.\"
17.\" SYNOPSIS chapter
18.SH SYNOPSIS
19.B jedutil
20.IR source ".jed " target .bin
21.br
22.B jedutil
23.IR source ".bin " target .jed
24.\"
25.\" DESCRIPTION chapter
26.SH DESCRIPTION
27Data for Programmable Logic Devices (PLDs) are usually stored in a format known
28as JEDEC, basically a text file allowing insertion of further information by
29programmers.
30.PP
31MAME uses a raw binary representation of the same data, in order to
32achieve correct identification of PLD data through CRC and SHA1 algorithms
33(i.e. with the \-romident option).
34.PP
35.B jedutil
36provides an easy way to convert PLDs data between these two formats.
src/osd/sdl/man/ldverify.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" ldverify.1
4.\"
5.\" Man page created from source and usage information by
6.\" Cesare Falco <cesare.falco@gmail.com>, August 2008
7.\"
8.TH LDVERIFY 1 2010-06-26 0.138u4 "ldverify"
9.\"
10.\" NAME chapter
11.SH NAME
12ldverify \- MAME laserdisc data checker
13.\"
14.\" SYNOPSIS chapter
15.SH SYNOPSIS
16.B ldverify \fR[\fIavifile.avi\fR|\fIchdfile.chd\fR]
17.\"
18.\" DESCRIPTION chapter
19.SH DESCRIPTION
20.B ldverify
21is a tool which walks through either an AVI or CHD capture from a
22laserdisc and ensures that there are no anomalies lurking in
23the VBI data.
24
src/osd/sdl/man/chdman.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" chdman.1
4.\"
5.\" Man page created from source and usage information by
6.\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005
7.\" updated by Cesare Falco <cesare.falco@gmail.com>, February 2007
8.\"
9.TH CHDMAN 1 2010-06-26 0.138u4 "chdman"
10.\"
11.\" NAME chapter
12.SH NAME
13chdman \- MAME Compressed Hunks of Data (CHD) manager
14.\"
15.\" SYNOPSIS chapter
16.SH SYNOPSIS
17.B chdman
18.I option file
19.\"
20.\" DESCRIPTION chapter
21.SH DESCRIPTION
22.B chdman
23is the (C)ompressed (H)unks of (D)ata (CHD) manager for MAME.
24It is a tool to manage CHD images.
25.\"
26.\" OPTIONS chapter
27.SH OPTIONS
28.TP
29.B \-info \fIinput\fR.chd
30Dump the header information from a drive image.
31.TP
32.B \-createraw \fIinputhd\fR.raw \fIoutput\fR.chd [\fIinputoffs\fR [\fIhunksize\fR]]
33Create a new compressed raw image from a raw file.
34.TP
35.B \-createhd \fIinputhd\fR.raw \fIoutput\fR.chd [\fIinputoffs\fR [\fIcylinders \
36heads sectors \fR[\fIsectorsize\fR [\fIhunksize\fR]]]]
37Create a new compressed hard disk image from a raw file.
38.TP
39.B \-createblankhd \fIoutput\fR.chd \fIcylinders heads sectors\fR [\fIsectorsize \
40\fR[\fIhunksize\fR]]
41Create a new non\-compressed hard disk image, with all hunks filled with 0s.
42.TP
43.B \-createcd \fIinput\fR.toc \fIoutput\fR.chd
44Create a new compressed CD image from a raw file.
45.TP
46.B \-copydata \fIinput\fR.chd \fIoutput\fR.chd
47Copy all hunks of data from one CHD file to another. The hunk sizes do not need to match.
48If the source is shorter than the destination, the source data will be padded with 0s.
49.TP
50.B \-extract \fIinput\fR.chd \fIoutput\fR.raw
51Extract a raw file from a CHD image.
52.TP
53.B \-extractcd \fIinput\fR.chd \fIoutput\fR.toc \fIoutput\fR.bin
54Extract a CDRDAO .toc/.bin file from a CHD\-CD image.
55.TP
56.B \-verify \fIinput\fR.chd
57Validate the MD5/SHA1 on a drive image.
58.TP
59.B \-verifyfix \fIinput\fR.chd
60Validate and fix the MD5/SHA1 on a drive image.
61.TP
62.B \-update \fIinput\fR.chd \fIoutput\fR.chd
63Update CHD image using metadata from input file.
64.TP
65.B \-chomp \fIinput\fR.chd \fIoutput\fR.chd \fImaxhunk
66Chomp hunk from CHD image.
67.TP
68.B \-merge \fIparent\fR.chd \fIdiff\fR.chd \fIoutput\fR.chd
69Merge a parent and its child together.
70.TP
71.B \-diff \fIparent\fR.chd \fIcompare\fR.chd \fIdiff\fR.chd
72Generate a difference between two CHD files.
73.TP
74.B \-setchs \fIinout\fR.chd \fIcylinders heads sections
75Change the CHS values on a hard disk image.
76.TP
77.B \-split \fIinput\fR.chd \fIoutput\fR.chd \fIlength
78Split a CHD file into multiple parts.
src/osd/sdl/man/testkeys.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" testkeys.1
4.\"
5.\" Man page created from source and usage information
6.\" Cesare Falco <cesare.falco@gmail.com>, February 2007
7.\"
8.TH TESTKEYS 1 2010-06-26 0.138u4 "testkeys"
9.\"
10.\" NAME chapter
11.SH NAME
12testkeys \- returns SDL keycode for key pressed.
13.\"
14.\" SYNOPSIS chapter
15.SH SYNOPSIS
16.B testkeys
17.\"
18.\" DESCRIPTION chapter
19.SH DESCRIPTION
20Since 0.113 SDLMAME introduced keymap files to handle keyboards with non\-us layouts.
21.PP
22This simple utility helps determining which SDL keycode is bound to each key, thus
23making the process of compiling keymap files a bit easier.
src/osd/sdl/man/ldplayer.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" ldplayer.1
4.\"
5.\" Man page created from source and usage information by
6.\" Cesare Falco <cesare.falco@gmail.com>, August 2008
7.\"
8.TH LDPLAYER 1 2010-07-07 0.138u4 "ldplayer"
9.\"
10.\"
11.\" NAME chapter
12.SH NAME
13ldplayer \- MAME laserdisc image player
14.\"
15.\"
16.\" SYNOPSIS chapter
17.SH SYNOPSIS
18.B ldplayer pr8210
19\-rompath \fI/path/to/pr8210.zip\fP\fB\\;\fP\fI/path/to/image.chd\fP
20.\"
21.\"
22.\" DESCRIPTION chapter
23.SH DESCRIPTION
24.B ldplayer
25is an optional utility that simply plays the audio and video from laserdisc
26CHD files. It actually emulates and therefore behaves just like a real
27laserdisc player \- you can pause, fast-forward, rewind, and all the rest.
28.\"
29.\"
30.\" NOTES chapter
31.SH NOTES
32First of all, you need to go to your MAME ROMs folder and make a copy of
33\fBcubeqst.zip\fP (the ROMs for Cube Quest). Rename it as \fBpr8210.zip\fP.
34.P
35Next, run ldplayer.
36Note that the first path in the \fB\-rompath\fP option is the full path
37to the \fBpr8210.zip\fP file and the second is the full path to the laserdisc
38CHD file you wish to play. \fINote\fP the backslash and the semicolon 
39\- \fB\\;\fP \- between them.
40.P
41Once ldplayer is running, you can hit \fBTAB\fP like usual and check out
42Inputs (this game) to see the controls. Space is the Play/Pause button, for
43instance. Note that some laserdiscs (notably Cube Quest) have 30 seconds or
44more of nothing at the start, so you either need to be patient or use
45fast-forward to start seeing video.
46.\"
47.\"
48.\" FILES chapter
49.SH FILES
50.TP
51.B /etc/mame/ldplayer.ini
52Main configuration file.
src/osd/sdl/man/romcmp.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" romcmp.1
4.\"
5.\" Man page created from FAQs, source and usage information by
6.\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005
7.\" updated by Cesare Falco <cesare.falco@gmail.com>, February 2007
8.\"
9.\" References
10.\" http://www.mame.net/mamefaq.html
11.\"
12.TH ROMCMP 1 2010-06-26 0.138u4 "romcmp"
13.\"
14.\" NAME chapter
15.SH NAME
16romcmp \- MAME rom and romsets check and comparison tool
17.\"
18.\" SYNOPSIS chapter
19.SH SYNOPSIS
20.B romcmp
21.RI [ \-option ]
22.RI [ dir1 | zip1 ]
23.RI [ dir2 | zip2 ]
24.\"
25.\" DESCRIPTION chapter
26.SH DESCRIPTION
27An eternal nuisance in arcade emulation are incomplete or corrupt dumps of the ROM chips.
28\fBromcmp\fP is a tool developed to detect the most common errors that can occur when dumping ROMS,
29for example stuck bits and address line errors.
30.PP
31It can check the ROMs in ZIP files or subdirectories.
32.PP
33\fBromcmp\fP can also be used to compare two ROM sets, by giving it two files or subdirectories
34as parameters. It will determine which ROMS are identical and which are the closest matches.
35This is useful when figuring out if a newly dumped ROM set is a clone of another ROM set.
36.\"
37.\" OPTIONS chapter
38.SH OPTIONS
39.TP
40.B \-d
41Enables a slower, more comprehensive comparison.
42.\"
43.\" EXAMPLES chapter
44.SH EXAMPLES
45.B romcmp \fIjumpkids.zip\fP
46will output the following:
47
48  11 files
49  23.3c         FIXED BITS (xxxxxx1x)
50  23.3c           FIRST AND SECOND HALF IDENTICAL
51     
52This tells us that the 23.3C ROM in Jump Kids is bad, and incidentally, it causes the missing sound in that game.
src/osd/sdl/man/mame.1
r0r8582
1.\"  -*- nroff -*-
2.\"
3.\" mame.1
4.\"
5.\" Man page created from usage and source information:
6.\" * commands: see src/emu/clifront.c clifront.h
7.\" * options: core entries, see src/emu/emuopts.c emuopts.h
8.\"            SDL-specific entries, see src/osd/sdl/sdlmain.c osdsdl.h
9.\" Cesare Falco <cesare.falco@gmail.com>, February 2007
10.\"
11.\" Also, some text borrowed from the xmame 0.106 man page,
12.\" done by Rene Herrmann <rene.herrmann@berlin.de>, September 2000
13.\" and updated by Andrew Burton <burtona@gol.com>, July 2003
14.\"
15.\"
16.TH MAME 1 2010-07-07 0.138u4 "MAME - The Multiple Arcade Machine Emulator"
17.\"
18.\"
19.\" NAME chapter
20.SH NAME
21MAME \- The Multiple Arcade Machine Emulator
22.\"
23.\"
24.\" SYNOPSIS chapter
25.SH SYNOPSIS
26.B mame
27.RI [ options ]
28.I gamename
29.\"
30.\"
31.\" DESCRIPTION chapter
32.SH DESCRIPTION
33Started in 1997 by Nicola Salmoria, MAME was originally intended as a series
34of emulators for individual games, which were later combined into a single
35multi\-game emulator. In the following years, MAME grew over and over up to
36the actual size, with more than 100 contributors to the project.
37.\"
38.\"
39.\" OPTIONS chapter
40.SH OPTIONS
41.\"
42.\" *******************************************************
43.SS Core commands
44.\" *******************************************************
45.TP
46.B \-help, \-?
47Displays current MAME version and copyright notice.
48.TP
49.B \-validate, \-valid
50Performs internal validation on every driver in the system. Run this
51before submitting changes to ensure that you haven't violated any of
52the core system rules.
53.\"
54.\" *******************************************************
55.SS Configuration commands
56.\" *******************************************************
57.TP
58.B \-createconfig, \-cc
59Creates the default \fBmame.ini\fP file in the current directory. All the
60configuration options (not commands) described below can be permanently
61changed by editing this configuration file.
62.TP
63.B \-showconfig, \-sc
64Displays the current configuration settings.
65.TP
66.B \-showusage, \-su
67Displays a summary of all the command line options. For options that
68are not mentioned here, the short summary given by
69\fBmame \-showusage\fR is usually sufficient.
70.\"
71.\" *******************************************************
72.SS Frontend commands
73.\" *******************************************************
74.B NOTE:
75By default, all the '\-list' commands below write info to the screen.
76If you wish to write the info to a textfile instead, use redirection, e.g.
77.B mame \-listxml > ~/mamelist.xml
78writes the full list of supported game to file \fImamelist.xml\fR in your home
79directory.
80.TP
81.B \-listxml, \-lx \fR[\fIgamename\fR|\fIwildcard\fR]
82List comprehensive details for all of the supported games. The output
83is quite long, so it is usually better to redirect this into a file.
84The output is in XML format. By default all games are listed; however,
85you can limit this list by specifying a driver name or wildcard after
86the \-listxml command.
87.TP
88.B \-listfull, \-ll \fR[\fIgamename\fR|\fIwildcard\fR]
89Displays a list of game driver names and descriptions. By default all
90games are listed; however, you can limit this list by specifying a
91driver name or wildcard after the \-listfull command.
92.TP
93.B \-listsource, \-ls \fR[\fIgamename\fR|\fIwildcard\fR]
94Displays a list of drivers and the names of the source files their game
95drivers live in. Useful for finding which driver a game runs on in
96order to fix bugs. By default all games are listed; however, you can
97limit this list by specifying a driver name or wildcard after the
98\-listsource command.
99.TP
100.B \-listclones, \-lc \fR[\fIgamename\fR|\fIwildcard\fR]
101Displays a list of clones. By default all clones are listed; however,
102you can limit this list by specifying a driver name or wildcard after
103the \-listclones command.
104.TP
105.B \-listbrothers, \-lb \fR[\fIgamename\fR|\fIwildcard\fR]
106Displays a list of "brothers" or other drivers from same sourcefile.
107By default all games are listed; however, you can limit this list by
108specifying a driver name or wildcard after the \-listbrothers command.
109.TP
110.B \-listcrc
111Displays a full list of CRCs of all ROM images referenced by all
112drivers within MAME code.
113.TP
114.B \-listroms \fIgamename
115Displays a list of ROM images referenced by the specified game.
116.TP
117.B \-listsamples \fIgamename
118Displays a list of samples referenced by the specified game.
119.TP
120.B \-verifyroms \fR[\fIgamename\fR|\fIwildcard\fR]
121Checks for invalid or missing ROM images. By default all drivers that
122have valid ZIP files or directories in the rompath are verified;
123however, you can limit this list by specifying a driver name or
124wildcard after the \-verifyroms command.
125.TP
126.B \-verifysamples \fR[\fIgamename\fR|\fIwildcard\fR]
127Checks for invalid or missing samples. By default all drivers that
128have valid ZIP files or directories in the samplepath are verified;
129however, you can limit this list by specifying a driver name or
130wildcard after the \-verifyroms command.
131.TP
132.B \-romident
133Attempts to identify ROM files, if they are known to MAME, in the
134specified .zip file or directory. This command can be used to try and
135identify ROM sets taken from unknown boards. On exit, the errorlevel
136is returned as one of the following:
137.br
138\fB0\fR  all files were identified
139.br
140\fB7\fR  all files were identified except for some "non\-ROM" files
141.br
142\fB8\fR  some files were identified
143.br
144\fB9\fR  no files were identified
145.TP
146.B \-listdevices, \-ld
147Output the list of devices referenced by a given game or set of games.
148.TP
149.B \-listmedia, \-lm
150Output the list of available media for the system.
151.TP
152.B \-listsoftware
153Output the list of known software for the system.
154.\"
155.\" *******************************************************
156.SS Configuration options
157.\" *******************************************************
158.TP
159.B \-[no]readconfig, \-[no]rc
160Enables or disables the reading of the config files. When enabled
161(which is the default), MAME reads the following config files in order:
162.br
1631. \fBmame.ini\fR
164.br
165the main configuration file
166.br
1672. \fI[name]\fB.ini\fR
168.br
169where \fIname\fR is your executable name, i.e. mame unless you changed it
170(e.g. if you renamed mame to mame0137, the parsed file will be
171\fImame0137.ini\fR)
172.br
1733. \fBdebug.ini\fR, if the debugger is enabled
174.br
1754. \fBvector.ini\fR, for vector games only
176.br
1775. \fI[driver]\fB.ini\fR
178.br
179based on the source filename of the game driver
180.br
1816. \fI[parent]\fB.ini\fR
182.br
183for clones only, may be called recursively
184.br
1857. \fI[gamename]\fB.ini\fR
186.br
187note this sometimes resolves to the same of the source driver
188.br
189The settings in the later ini's override those in the earlier ini's.
190So, for example, if you wanted to disable overlay effects in the
191vector games, you can create a vector.ini with the "effect none" line
192in it, and it will override whatever effect value you have in your
193mame.ini. The default is ON (\-readconfig).
194.\"
195.\" *******************************************************
196.SS Search path options
197.\" *******************************************************
198.B IMPORTANT\fR: Please use the path, directory and file options in
199mame.ini \fBONLY\fR. Otherwise, the outcome may be unpredictable and not
200consistent across releases.
201.TP
202.B \-rompath, \-rp, \-biospath, \-bp, \fIpathname
203Specifies a list of paths within which to find ROM or hard disk images.
204Multiple paths can be specified by separating them with semicolons.
205The default is 'roms' (that is, a directory "roms" in the same directory
206as the MAME executable).
207.TP
208.B \-samplepath, \-sp \fIpathname
209Specifies a list of paths within which to find sample files. Multiple
210paths can be specified by separating them with semicolons. The default
211is 'samples' (that is, a directory "samples" in the same directory as
212the MAME executable).
213.TP
214.B \-artpath, \-artwork_directory \fIpathname
215Specifies a list of paths within which to find artwork files. Multiple
216paths can be specified by separating them with semicolons. The default
217is 'artwork' (that is, a directory "artwork" in the same directory as
218the MAME executable).
219.TP
220.B \-ctrlrpath, \-ctrlr_directory \fIpathname
221Specifies a list of paths within which to find controller\-specific
222configuration files. Multiple paths can be specified by separating
223them with semicolons. The default is 'ctrlr' (that is, a directory
224"ctrlr" in the same directory as the MAME executable).
225.TP
226.B \-inipath \fIpathname
227Specifies a list of paths within which to find .INI files. Multiple
228paths can be specified by separating them with semicolons. The default
229is '/etc/mame/'.
230.TP
231.B \-fontpath \fIpathname
232Specifies a list of paths within which to find .BDF font files. Multiple
233paths can be specified by separating them with semicolons. The default
234is '.' (that is, search in the same directory as the MAME executable).
235.TP
236.B \-cheatpath \fIpathname
237Specifies a list of paths within which to find cheat files. Multiple
238paths can be specified by separating them with semicolons. The default
239is 'cheat' (that is, a directory "cheat" in the same directory as
240the MAME executable).
241.TP
242.B \-crosshairpath \fIpathname
243Specifies a list of paths within which to find crosshair files. Multiple
244paths can be specified by separating them with semicolons. The default
245is 'crosshair' (that is, a directory "crosshair" in the same directory as
246the MAME executable).  If the Crosshair is set to default in the menu,
247MAME will look for gamename\cross#.png and then cross#.png in the
248specified crosshairpath, where # is the player number.  Failing that,
249MAME will use built\-in default crosshairs.
250.\"
251.\" *******************************************************
252.SS Output Directory Options
253.\" *******************************************************
254.TP
255.B \-cfg_directory \fIpathname
256Specifies a single directory where configuration files are stored.
257Configuration files store user configurable settings that are read at
258startup and written when MAME exits. The default is 'cfg' (that is,
259a directory "cfg" in the same directory as the MAME executable). If this
260directory does not exist, it will be automatically created.
261.TP
262.B \-nvram_directory \fIpathname
263Specifies a single directory where NVRAM files are stored. NVRAM files
264store the contents of EEPROM and non\-volatile RAM (NVRAM) for games
265which used this type of hardware. This data is read at startup and
266written when MAME exits. The default is 'nvram' (that is, a directory
267"nvram" in the same directory as the MAME executable). If this directory
268does not exist, it will be automatically created.
269.TP
270.B \-memcard_directory \fIpathname
271Specifies a single directory where memory card files are stored. Memory
272card files store the contents of removable memory cards for games which
273used this type of hardware. This data is read and written under control
274of the user via the "Memory Card" menu in the user interface. The
275default is 'memcard' (that is, a directory "memcard" in the same
276directory as the MAME executable). If this directory does not exist,
277it will be automatically created.
278.TP
279.B \-input_directory \fIpathname
280Specifies a single directory where input recording files are stored.
281Input recordings are created via the \-record option and played back via
282the \-playback option. The default is 'inp' (that is, a directory
283"inp" in the same directory as the MAME executable). If this directory
284does not exist, it will be automatically created.
285.TP
286.B \-state_directory \fIpathname
287Specifies a single directory where save state files are stored. Save
288state files are read and written either upon user request, or when using
289the \-autosave option. The default is 'sta' (that is, a directory "sta"
290in the same directory as the MAME executable). If this directory does
291not exist, it will be automatically created.
292.TP
293.B \-snapshot_directory \fIpathname
294Specifies a single directory where screen snapshots are stored, when
295requested by the user. The default is 'snap' (that is, a directory
296"snap" in the same directory as the MAME executable). If this directory
297does not exist, it will be automatically created.
298.TP
299.B \-diff_directory \fIpathname
300Specifies a single directory where hard drive differencing files are
301stored. Hard drive differencing files store any data that is written
302back to a hard disk image, in order to preserve the original image. The
303differencing files are created at startup when a game with a hard disk
304image. The default is 'diff' (that is, a directory "diff" in the same
305directory as the MAME executable). If this directory does not exist,
306it will be automatically created.
307.TP
308.B \-comment_directory \fIpathname
309Specifies a single directory where debugger comment files are stored.
310Debugger comment files are written by the debugger when comments are
311added to the disassembly for a game. The default is 'comments' (that is,
312a directory "comments" in the same directory as the MAME executable).
313If this directory does not exist, it will be automatically created.
314.\"
315.\" *******************************************************
316.SS State/playback options
317.\" *******************************************************
318.TP
319.B \-state \fIslot
320Immediately after starting the specified game, will cause the save
321state in the specified \fIslot\fP to be loaded.
322.TP
323.B \-[no]autosave
324When enabled, automatically creates a save state file when exiting MAME
325and automatically attempts to reload it when later starting MAME with
326the same game. This only works for games that have explicitly enabled
327save state support in their driver. The default is OFF (\-noautosave).
328.TP
329.B \-playback, \-pb \fIfilename
330Specifies a file from which to play back a series of game inputs. This
331feature does not work reliably for all games, but can be used to watch
332a previously recorded game session from start to finish. In order to
333make things consistent, you should only record and playback with all
334configuration (.cfg), NVRAM (.nv), and memory card files deleted. The
335default is NULL (no playback).
336.TP
337.B \-record, \-rec \fIfilename
338Specifies a file to record all input from a game session. This can be
339used to record a game session for later playback. This feature does not
340work reliably for all games, but can be used to watch a previously
341recorded game session from start to finish. In order to make things
342consistent, you should only record and playback with all configuration
343(.cfg), NVRAM (.nv), and memory card files deleted. The default is NULL
344(no recording).
345.TP
346.B \-snapname \fIname
347Describes how MAME should name files for snapshots. \fIname\fP is a string
348that provides a template that is used to generate a filename. Three
349simple substitutions are provided: the / character represents the
350path separator on any target platform (even Windows); the string \fI%g\fP
351represents the driver name of the current game; and the string \fI%i\fP
352represents an incrementing index. If \fI%i\fP is omitted, then each
353snapshot taken will overwrite the previous one; otherwise, MAME will
354find the next empty value for \fI%i\fP and use that for a filename. The
355default is \fI%g/%i\fP, which creates a separate folder for each game,
356and names the snapshots under it starting with 0000 and increasing
357from there.
358.TP
359.B \-snapsize \fIwidth\fPx\fIheight\fP
360Hard\-codes the size for snapshots and movie recording. By default,
361MAME will create snapshots at the game's current resolution in raw
362pixels, and will create movies at the game's starting resolution in
363raw pixels. If you specify this option, then MAME will create both
364snapshots and movies at the size specified, and will bilinear filter
365the result. Note that this size does not automatically rotate if the
366game is vertically oriented. The default is 'auto'.
367.TP
368.B \-snapview \fIviewname\fP
369Specifies the view to use when rendering snapshots and movies. By
370default, both use a special 'internal' view, which renders a separate
371snapshot per screen or renders movies only of the first screen. By
372specifying this option, you can override this default behavior and
373select a single view that will apply to all snapshots and movies.
374Note that \fIviewname\fP does not need to be a perfect match; rather, it
375will select the first view whose name matches all the characters
376specified by \fIviewname\fP. For example, \-snapview native will match the
377"Native (15:14)" view even though it is not a perfect match.
378\fIviewname\fP can also be 'auto', which selects the first view with all
379screens present. The default value is 'internal'.
380.TP
381.B \-mngwrite \fIfilename
382Writes each video frame to the given \fIfilename\fP in MNG format, producing
383an animation of the   game session. Note that \-mngwrite only writes video
384frames; it does not save any audio data. Use \-wavwrite for that, and
385reassemble the audio/video using offline tools. The default is NULL (no
386recording).
387.TP
388.B \-aviwrite \fIfilename
389Stream video and sound data to the given \fIfilename\fP in AVI format,
390producing an animation of the game session complete with sound. The
391default is NULL (no recording).
392.TP
393.B \-wavwrite \fIfilename
394Writes the final mixer output to the given \fIfilename\fP in WAV format,
395producing an audio recording of the   game session. The default is NULL
396(no recording).
397.TP
398.B \-[no]burnin
399Tracks brightness of the screen during play and at the end of
400emulation generates a PNG that can be used to simulate burn\-in
401effects on other games. The resulting PNG is created such that the
402least used\-areas of the screen are fully white (since burned\-in areas
403are darker, all other areas of the screen must be lightened a touch).
404The intention is that this PNG can be loaded via an artwork file with
405a low alpha (e.g, 0.1\-0.2 seems to work well) and blended over the
406entire screen. The PNG files are saved in the snap directory under
407the gamename\\burnin\-<screen.name>.png. The default is OFF (\-noburnin).
408.\"
409.\" *******************************************************
410.SS Performance options
411.\" *******************************************************
412.TP
413.B \-[no]autoframeskip, \-[no]afs
414Automatically determines the frameskip level while you're playing the
415game, adjusting it constantly in a frantic attempt to keep the game
416running at full speed. Turning this on overrides the value you have set
417for \-frameskip below. The default is OFF (\-noautoframeskip).
418.TP
419.B \-frameskip, \-fs \fIvalue
420Specifies the frameskip value (autoframeskip must be disabled). This is the
421number of frames out of every 12 to drop when running. For example, if you
422say \-frameskip 2, then MAME will display 10 out of every 12 frames. By
423skipping those frames, you may be able to get full speed in a game that
424requires more horsepower than your computer has. The default value is 0,
425which skips no frames.
426.TP
427.B \-seconds_to_run, \-str \fIvalue
428This option can be used for benchmarking and automated testing. It tells
429MAME to stop execution after a fixed number of seconds. By combining
430this with a fixed set of other command line options, you can set up a
431consistent environment for benchmarking MAME performance. In addition,
432upon exit, the \-str option will write a screenshot called final.png
433to the game's snapshot directory.
434.TP
435.B \-[no]throttle
436Configures the default thottling setting. When throttling is on, MAME
437attempts to keep the game running at the game's intended speed. When
438throttling is off, MAME runs the game as fast as it can. Note that the
439fastest speed is more often than not limited by your graphics card,
440especially for older games. The default is ON (\-throttle).
441.TP
442.B \-[no]sleep
443Allows MAME to give time back to the system when running with \-throttle.
444This allows other programs to have some CPU time, assuming that the
445game isn't taxing 100% of your CPU resources. This option can potentially
446cause hiccups in performance if other demanding programs are running.
447The default is ON (\-sleep).
448.TP
449.B \-speed
450Controls the speed of gameplay, relative to realtime; smaller numbers are
451slower. Default is 1.00.
452.TP
453.B \-refreshspeed, \-rs
454Automatically adjusts the \fB\-speed\fR parameter to keep the effective refresh
455rate below that of the lowest screen refresh rate.
456.\"
457.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
458.\" SDL specific
459.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
460.TP
461.B \-multithreading, \-mt
462Enable multithreading; this enables rendering and blitting on a separate
463thread. The default is OFF.
464.TP
465.B \-numprocessors, \-np
466Set number of processors; this overrides the number the system reports.
467.TP
468.B \-sdlvideofps
469Show SDL video performance.
470.\"
471.\" *******************************************************
472.SS Rotation options
473.\" *******************************************************
474.TP
475.B \-[no]rotate
476Rotate the game to match its normal state (horizontal/vertical). This
477ensures that both vertically and horizontally oriented games show up
478correctly without the need to rotate your monitor. If you want to keep
479the game displaying 'raw' on the screen the way it would have in the
480arcade, turn this option OFF. The default is ON (\-rotate).
481.TP
482.B \-[no]ror | \-[no]rol
483Rotate the game screen to the right (clockwise) or left (counter\-
484clockwise) relative to either its normal state (if \-rotate is specified)
485or its native state (if \-norotate is specified). The default for both of
486these options is OFF (\-noror \-norol).
487.TP
488.B \-[no]autoror | \-[no]autorol
489These options are designed for use with pivoting screens that only
490pivot in a single direction. If your screen only pivots clockwise,
491use \-autorol to ensure that the game will fill the screen either
492horizontally or vertically in one of the directions you can handle.
493If your screen only pivots counter\-clockwise, use \-autoror.
494.TP
495.B \-[no]flipx
496.TP
497.B \-[no]flipy
498Flip (mirror) the game screen either horizontally (\-flipx) or
499vertically (\-flipy). The flips are applied after the \-rotate and
500\-ror/\-rol options are applied. The default for both of these options
501is OFF (\-noflipx \-noflipy).
502.\"
503.\" *******************************************************
504.SS Artwork options
505.\" *******************************************************
506.TP
507.B \-[no]artwork_crop, \-[no]artcrop
508Enable cropping of artwork to the game screen area only. This
509option can also be controlled via the Video Options menu in the user
510interface. The default is OFF (\-noartwork_crop).
511.TP
512.B \-[no]use_backdrops, \-[no]backdrop
513Enables/disables the display of backdrops. The default is ON
514(\-use_backdrops).
515.TP
516.B \-[no]use_overlays, \-[no]overlay
517Enables/disables the display of overlays. The default is ON
518(\-use_overlays).
519.TP
520.B \-[no]use_bezels, \-[no]bezel
521Enables/disables the display of bezels. The default is ON
522(\-use_bezels).
523.\"
524.\" *******************************************************
525.SS Screen options
526.\" *******************************************************
527.TP
528.B \-brightness \fIvalue
529Controls the default brightness, or black level, of the game screens.
530This option does not affect the artwork or other parts of the display.
531Using the MAME UI, you can individually set the brightness for each game
532screen; this option controls the initial value for all visible game
533screens. The standard value is 1.0. Selecting lower values (down to 0.1)
534will produce a darkened display, while selecting higher values (up to
5352.0) will give a brighter display. The default is 1.0.
536.TP
537.B \-contrast \fIvalue
538Controls the contrast, or white level, of the game screens. This option
539does not affect the artwork or other parts of the display. Using the
540MAME UI, you can individually set the contrast for each game screen;
541this option controls the initial value for all visible game screens. The
542standard value is 1.0. Selecting lower values (down to 0.1) will produce
543a dimmer display, while selecting higher values (up to 2.0) will
544give a more saturated display. The default is 1.0.
545.TP
546.B \-gamma \fIvalue
547Controls the gamma, which produces a potentially nonlinear black to
548white ramp, for the game screens. This option does not affect the
549artwork or other parts of the display. Using the MAME UI, you can
550individually set the gamma for each game screen; this option controls
551the initial value for all visible game screens. The standard value is
5521.0, which gives a linear ramp from black to white. Selecting lower
553values (down to 0.1) will increase the nonlinearity toward black,
554while selecting higher values (up to 3.0) will push the nonlinearity
555toward white. The default is 1.0.
556.TP
557.B \-pause_brightness \fIvalue
558This controls the brightness level when MAME is paused. The default
559value is 0.65.
560.\"
561.\" *******************************************************
562.SS Vector rendering options
563.\" *******************************************************
564.TP
565.B \-[no]antialias, \-[no]aa
566Enables antialiased line rendering for vector games. The default is ON
567(\-antialias).
568.TP
569.B \-beam \fIwidth
570Sets the width of the vectors. This is a scaling factor against the
571standard vector width. A value of 1.0 will keep the default vector line
572width. Smaller values will reduce the width, and larger values will
573increase the width. The default is 1.0.
574.TP
575.B \-flicker \fIvalue
576Simulates a vector "flicker" effect, similar to a vector monitor that
577needs adjustment. This option requires a float argument in the range of
5780.00\-100.00 (0=none, 100=maximum). The default is 0.
579.\"
580.\" *******************************************************
581.SS Video options
582.\" *******************************************************
583.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
584.\" SDL specific
585.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
586.TP
587.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fIopengl16\fR|\fInone\fR]
588Specifies which video subsystem to use for drawing:
589.br
590\fBsoft\fR  uses software rendering, which is slower but more compatible.
591.br
592\fBopengl\fR  uses OpenGL and your graphics accelerator to speed up many
593aspects of drawing MAME including compositing artwork, overlays, and
594bezels, as well as stretching the image to fit your screen.
595.br
596\fBopengl16\fR  uses alternate OpenGL code, which should provide faster
597output on some cards.
598.br
599\fBnone\fR  does no drawing and is intended for CPU benchmarking.
600.br
601Default is SOFT.
602.TP
603.B \-numscreens
604Reserved for future use.
605.TP
606.B \-[no]window, \-[no]w
607Run MAME in either full screen or a window. This is a fully\-featured window
608mode where the window resizes as necessary to track what the game does.
609And you can resize it  yourself with your OS's standard window controls.
610The default is OFF (\-nowindow).
611.TP
612.B \-[no]maximize, \-[no]max
613Controls initial window size in windowed mode. If it is set on, the
614window will initially be set to the maximum supported size when you
615start MAME. If it is turned off, the window will start out at the
616smallest supported size. This option only has an effect when the
617\-window option is used. The default is ON (\-maximize).
618.TP
619.B \-keepaspect, \-ka
620Forces the correct aspect ratio. This means when you're resizing the window
621in windowed mode the actual game image will resize in discrete steps to
622maintain the proper shape of the game graphics. If you turn this off you can
623resize the window to anything you like and get funny squishing and stretching.
624The same applies for full\-screen. Default is ON (\-keepaspect).
625.TP
626.B \-unevenstretch, \-ues
627Allow non\-integer stretch factors. Video purists should stay far, far away
628from this option, while everyone else will be happy to know that it lets you
629fill the screen properly in full\-screen mode. Default is ON (\-unevenstretch).
630.TP
631.B \-effect
632Name of a PNG file to use for visual effects, or 'none'. Default is 'none'.
633.TP
634.B \-centerh
635Center horizontally within the view area. Default is ON (\-centerh).
636.TP
637.B \-centerv
638Center vertically within the view area. Default is ON (\-centerv).
639.TP
640.B \-waitvsync
641Enable waiting for the start of VBLANK before flipping screens;
642reduces tearing effects.
643.\"
644.\" *******************************************************
645.SS Software video rendering subsystem options
646.\" *******************************************************
647.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
648.\" SDL specific
649.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
650.B NOTE:
651All the options in this group are available only with softare video
652rendering subsystem, i.e \fB\-video soft\fR.
653.TP
654.B \-prescale
655Scale screen rendering by this amount in software. Default is 1.
656.TP
657.B \-scalemode, \-sm \fR[\fInone\fR|\fIasync\fR|\fIyv12\fR|\fIyuy2\fR|\fIyv12x2\fR|\fIyuy2x2\fR]
658Hardware scaling mode.
659.br
660\fBnone\fR    use software rendering.
661.br
662\fBasync\fR   async overlay.
663.br
664\fByv12\fR    yv12 overlay.
665.br
666\fByuy2\fR    yuy2 overlay.
667.br
668\fByv12x2\fR  yv12 overlay using x2 prescaling.
669.br
670\fByuy2x2\fR  yuy2 overlay using x2 prescaling.
671.br
672Default is NONE.
673.\"
674.\" *******************************************************
675.SS OpenGL video rendering subsystem options
676.\" *******************************************************
677.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
678.\" SDL specific
679.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
680.B NOTE:
681All the options in this group are available only with OpenGL video
682rendering subsystem, i.e \fB\-video opengl\fR or \fB\-video opengl16\fR.
683.TP
684.B \-filter, \-glfilter, \-flt
685Enable bilinear filtering on screen output. Default is ON (\-filter).
686.TP
687.B \-prescale
688Scale screen rendering by this amount in software. Default is 1.
689.TP
690.B \-gl_forcepow2texture
691Force power of two textures. Default is NO.
692.TP
693.B \-gl_notexturerect
694Don't use OpenGL GL_ARB_texture_rectangle. Default is ON: turn off
695(set this to 0) if corruption occurs in OpenGL mode, at cost of some
696performance loss.
697.TP
698.B \-gl_vbo
699Enable OpenGL VBO, if available, for a performance increase.
700Default is ON: turn off (set this to 0) if corruption occurs.
701.TP
702.B \-gl_pbo
703Enable OpenGL PBO, if available, for a performance increase.
704Default is ON: turn off (set this to 0) if corruption occurs.
705.TP
706.B \-gl_glsl
707Enable OpenGL GLSL, if available, for a performance increase.
708.TP
709.B \-gl_glsl_filter
710Enable OpenGL GLSL filtering instead of FF filtering 0=plain, 1=bilinear.
711Default is 1: bilinear.
712.TP
713.B \-glsl_shader_mame[0\-9]
714Preferred custom OpenGL GLSL shader set mame bitmap (from 0 to 9).
715.TP
716.B \-glsl_shader_screen[0\-9]
717Preferred custom OpenGL GLSL shader screen bitmap (from 0 to 9).
718.TP
719.B \-gl_glsl_vid_attr
720Enable OpenGL GLSL handling of brightness and contrast. Better RGB game
721performance for free. Default is ON.
722.TP
723.B \-resolution, \-r
724Select the resolution to use in full\-screen mode.
725\fB\-switchres\fR must be enabled for this to work.
726.TP
727.B \-screen
728.TP
729.B \-aspect, \-screen_aspect
730.TP
731.B \-view
732.TP
733.B \-screen[0\-3]
734.TP
735.B \-aspect[0\-3]
736.TP
737.B \-resolution[0\-3], \-r[0\-3]
738.TP
739.B \-view[0\-3]
740All these options are reserved for future use.
741.\"
742.\" *******************************************************
743.SS Full screen options
744.\" *******************************************************
745.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
746.\" SDL specific
747.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
748.TP
749.B \-[no]switchres
750Affects full screen mode only. Chooses if MAME can try to change the screen
751resolution (color depth is normally left alone) when in full\-screen mode. If
752it's off, you always get your desktop resolution in full\-screen mode (which can
753be useful for LCDs).
754.TP
755.B \-useallheads
756Split full screen image across monitors.
757.\"
758.\" *******************************************************
759.SS Sound options
760.\" *******************************************************
761.TP
762.B \-[no]sound
763Enable or disable sound altogether. The default is ON (\-sound).
764.TP
765.B \-samplerate, \-sr \fIvalue
766Sets the audio sample rate. Smaller values (e.g. 11025) cause lower
767audio quality but faster emulation speed. Higher values (e.g. 48000)
768cause higher audio quality but slower emulation speed. The default is
76948000.
770.TP
771.B \-[no]samples
772Use samples if available. The default is ON (\-samples).
773.TP
774.B \-volume, \-vol \fIvalue
775Sets the startup volume. It can later be changed with the user interface
776(see Keys section). The volume is an attenuation in dB: e.g.,
777"\-volume \-12" will start with \-12dB attenuation. The default is 0.
778.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
779.\" SDL specific
780.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
781.TP
782.B \-audio_latency \fIvalue
783This controls the amount of latency built into the audio streaming.
784The latency parameter controls the lower threshold. The default is 1
785(meaning lower=1/5 and upper=2/5). Set it to 2 (\-audio_latency 2) to keep
786the sound buffer between 2/5 and 3/5 full. If you crank it up to 4,
787you can definitely notice the lag.
788.\"
789.\" *******************************************************
790.SS Input options
791.\" *******************************************************
792.TP
793.B \-[no]coin_lockout, \-[no]coinlock
794Enables simulation of the "coin lockout" feature that is implmeneted
795on a number of game PCBs. It was up to the operator whether or not
796the coin lockout outputs were actually connected to the coin
797mechanisms. If this feature is enabled, then attempts to enter a coin
798while the lockout is active will fail and will display a popup message
799in the user interface. If this feature is disabled, the coin lockout
800signal will be ignored. The default is ON (\-coin_lockout).
801.TP
802.B \-ctrlr \fIcontroller
803Enables support for special controllers. Configuration files are
804loaded from the ctrlrpath. They are in the same format as the .cfg
805files that are saved, but only control configuration data is read
806from the file. The default is NULL (no controller file).
807.TP
808.B \-[no]mouse
809Controls whether or not MAME looks for a mouse controller to use. Note
810that in many cases, lightguns are treated as mice by the operating
811system, so you may need to enable this to enable lightgun support. When
812this is enabled, you will not be able to use your mouse while playing
813a game. If you want to get control of your computer back, you will need
814to either pause the game or quit. The default is OFF (\-nomouse).
815.TP
816.B \-[no]joystick, \-[no]joy
817Controls whether or not MAME looks for joystick/gamepad controllers.
818The default is ON (\-joystick).
819.TP
820.B \-[no]lightgun, \-[no]gun
821Controls whether or not MAME makes use of lightgun controllers.
822Note that most lightguns map to the mouse, so using \-lightgun and
823\-mouse together may produce strange results. The default is OFF
824(\-nolightgun).
825.TP
826.B \-[no]multikeyboard, \-[no]multikey
827Determines whether MAME differentiates between multiple keyboards.
828Some systems may report more than one keyboard; by default, the data
829from all of these keyboards is combined so that it looks like a single
830keyboard. Turning this option on will enable MAME to report keypresses
831on different keyboards independently. The default is OFF
832(\-nomultikeyboard).
833.TP
834.B \-[no]multimouse
835Determines whether MAME differentiates between multiple mice. Some
836systems may report more than one mouse device; by default, the data
837from all of these mice is combined so that it looks like a single
838mouse. Turning this option on will enable MAME to report mouse
839movement and button presses on different mice independently. The
840default is OFF (\-nomultimouse).
841.TP
842.B \-[no]steadykey, \-[no]steady
843Some games require two or more buttons to be pressed at exactly the
844same time to make special moves. Due to limitations in the PC keyboard
845hardware, it can be difficult or even impossible to accomplish that
846using the standard keyboard handling. This option selects a different
847handling that makes it easier to register simultaneous button presses,
848but has the disadvantage of making controls less responsive. The
849default is OFF (\-nosteadykey).
850.TP
851.B \-[no]offscreen_reload, \-[no]reload
852Controls whether or not MAME treats a second button input from a
853lightgun as a reload signal. In this case, MAME will report the gun's
854position as (0,MAX) with the trigger held, which is equivalent to an
855offscreen reload. This is only needed for games that required you to
856shoot offscreen to reload, and then only if your gun does not support
857off screen reloads. The default is OFF (\-nooffscreen_reload).
858.TP
859.B \-joystick_map, \-joymap \fImap
860Controls how joystick values map to digital joystick controls.
861See /usr/share/doc/mame/config.txt for full details on \fImap\fR format.
862.TP
863.B \-joystick_deadzone, \-joy_deadzone, \-jdz \fIvalue
864If you play with an analog joystick, the center can drift a little.
865joystick_deadzone tells how far along an axis you must move before the
866axis starts to change. This option expects a float in the range of
8670.0 to 1.0. Where 0 is the center of the joystick and 1 is the outer
868limit. The default is 0.3.
869.TP
870.B \-joystick_saturation, \-joy_saturation, \-jsat \fIvalue
871If you play with an analog joystick, the ends can drift a little,
872and may not match in the +/\- directions. joystick_saturation tells how
873far along an axis movement change will be accepted before it reaches
874the maximum range. This option expects a float in the range of 0.0 to
8751.0, where 0 is the center of the joystick and 1 is the outer limit.
876The default is 0.85.
877.TP
878.B \-natural, \-nat
879Specifies whether to use a natural keyboard or not.
880.TP
881.B \-uimodekey, \-umk
882Specifies the key used to toggle between full and partial UI mode.
883.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
884.\" SDL specific
885.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
886.TP
887.B \-keymap
888Enable keymap for non\-QWERTY keyboards. Used in conjuction with
889\fB\-keymap_file\fR.
890.TP
891.B \-keymap_file \fIkeymap_file\fR
892Specifies the full path to the keymap file to be used. Shipped keymap files lie
893in \fB/usr/share/games/mame/keymaps\fR.
894.TP
895.B \-joy_idx1 \fIjoystick
896.TP
897.B \-joy_idx2 \fIjoystick
898.TP
899.B \-joy_idx3 \fIjoystick
900.TP
901.B \-joy_idx4 \fIjoystick
902.TP
903.B \-joy_idx5 \fIjoystick
904.TP
905.B \-joy_idx6 \fIjoystick
906.TP
907.B \-joy_idx7 \fIjoystick
908.TP
909.B \-joy_idx8 \fIjoystick
910With these options you can assign a joystick to a
911specific index in MAME. Even if the kernel will list the joysticks
912in a different order on the next boot, MAME will still see the joystick
913as e.g. "Joystick 2". Use mame \-v to see which joysticks are recognized.
914Default is AUTO.
915.TP
916.B \-sixaxis
917Use special handling for PS3 Sixaxis controllers.
918.TP
919.B \-videodriver, \-vd \fIx11\fR|\fIdirectfb\fR|\fIauto\fR
920SDL video driver to use; auto selects SDL default.
921.TP
922.B \-audiodriver, \-ad \fIalsa\fR|\fIarts\fR|\fIauto\fR
923SDL audio driver to use; auto selects SDL default.
924.TP
925.B \-gl_lib \fIalsa\fR|\fIarts\fR|\fIauto\fR
926Alternative libGL.so to use; auto selects SDL default.
927.\"
928.\" *******************************************************
929.SS Input automatic enable options
930.\" *******************************************************
931.TP
932.B \-paddle_device, \-paddle \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
933.TP
934.B \-adstick_device, \-adstick \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
935.TP
936.B \-pedal_device, \-pedal \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
937.TP
938.B \-dial_device, \-dial \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
939.TP
940.B \-trackball_device, \-trackball \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
941.TP
942.B \-lightgun_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
943.TP
944.B \-positional_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
945.TP
946.B \-mouse_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
947Each of these options controls autoenabling the mouse, or joystick
948depending on the presence of a particular class of analog
949control for a particular game. For example, if you specify the option
950\-paddle mouse, then any game that has a paddle control will automatically
951enable mouse controls just as if you had explicitly specified \-mouse.
952Note that these controls override the values of \-[no]mouse,
953\-[no]joystick, etc.
954.\"
955.\" *******************************************************
956.SS Debugging options
957.\" *******************************************************
958.TP
959.B \-[no]log
960Creates a file called error.log which contains all of the internal
961log messages generated by the MAME core and game drivers. The default
962is OFF (\-nolog).
963.TP
964.B \-[no]verbose, \-[no]v
965Displays internal diagnostic information. This information is very
966useful for debugging problems with your configuration. \fBIMPORTANT\fP: when
967reporting bugs, please run with mame \-verbose and include the resulting
968information. The default is off (\-noverbose).
969.TP
970.B \-update_in_pause
971Enables updating the screen bitmap while the game is paused. This is
972useful for debuggin in some scenarios (and gets in the way in others).
973.TP
974.B \-[no]debug, \-[no]d
975Activates the integrated debugger. By default, the debugger is entered
976by pressing the tilde (~) key during emulation. It is also entered
977immediately at startup. The default is OFF (\-nodebug).
978.TP
979.B \-debugscript \fIfilename
980Specifies a file that contains a list of debugger commands to execute
981immediately upon startup. The default is NULL (no commands).
982.TP
983.B \-debug_internal, \-di
984Use the internal debugger for debugging.
985.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
986.\" SDL specific
987.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
988.TP
989.B \-[no]oslog
990Outputs the error.log data to the system debugger. This can be used at
991the same time as \-log to output the log data to both targets as well.
992Default is OFF (\-nooslog).
993.\"
994.\" *******************************************************
995.SS Misc options
996.\" *******************************************************
997.TP
998.B \-bios \fIbiosname
999Specifies the specific BIOS to use with the current game, for game
1000systems that make use of a BIOS. The \-listxml output will list all of
1001the possible BIOS names for a game. The default is 'default'.
1002.TP
1003.B \-[no]cheat, \-[no]c
1004Enables the reading of the cheat database, if present, and the Cheat
1005menu in the user interface. The   default is OFF (\-nocheat).
1006.TP
1007.B \-[no]skip_gameinfo
1008Forces MAME to skip displaying the game info screen. The default is OFF
1009(\-noskip_gameinfo).
1010.\"
1011.\"
1012.\" LEGAL NOTICE chapter
1013.SH LEGAL NOTICE
1014Please visit the MAME website for some important legal information:
1015.PP
1016http://mamedev.org/legal.html
src/osd/sdl/sound.c
r8581r8582
447447
448448   // set up the audio specs
449449   aspec.freq = machine->sample_rate;
450   aspec.format = AUDIO_S16SYS;   // keep endian independant
450   aspec.format = AUDIO_S16SYS;   // keep endian independent
451451   aspec.channels = n_channels;
452452   aspec.samples = sdl_xfer_samples;
453453   aspec.callback = sdl_callback;
src/emu/debug/dvstate.c
r8581r8582
149149   *tailptr = auto_alloc(&m_machine, state_item(REG_CYCLES, "cycles", 8));
150150   tailptr = &(*tailptr)->m_next;
151151
152   // add a beam entry: beamx:123
153   *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMX, "beamx", 3));
152   // add a beam entry: beamx:1234
153   *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMX, "beamx", 4));
154154   tailptr = &(*tailptr)->m_next;
155155
156   // add a beam entry: beamy:456
157   *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMY, "beamy", 3));
156   // add a beam entry: beamy:5678
157   *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMY, "beamy", 4));
158158   tailptr = &(*tailptr)->m_next;
159159
160160   // add a beam entry: frame:123456
r8581r8582
290290                  if (screen != NULL)
291291                  {
292292                     curitem->m_currval = screen->frame_number();
293                     valstr.printf("%6d", (UINT32)curitem->m_currval);
293                     valstr.printf("%3d", (UINT32)curitem->m_currval);
294294                  }
295295                  break;
296296            }
src/emu/debug/debugcmd.c
r8581r8582
12531253   {
12541254      bool found = false;
12551255      for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
1256         if (device->debug()->breakpoint_enable(ref))
1256         if (device->debug()->breakpoint_enable(bpindex, ref))
12571257            found = true;
12581258      if (found)
12591259         debug_console_printf(machine, "Breakpoint %X %s\n", (UINT32)bpindex, ref ? "enabled" : "disabled");
src/emu/cpu/h83002/h8_8.c
r8581r8582
416416
417417   if (h8->TCORA[t])
418418   {
419      time = (cpu_get_clock(h8->device) / dividers[div]) / (h8->TCORA[t] - h8->TCNT[t]);
419      time = (h8->device->unscaled_clock() / dividers[div]) / (h8->TCORA[t] - h8->TCNT[t]);
420420      timer_adjust_oneshot(h8->timer[(t*2)], ATTOTIME_IN_HZ(time), 0);
421421   }
422422
423423   if (h8->TCORB[t])
424424   {
425      time = (cpu_get_clock(h8->device) / dividers[div]) / (h8->TCORB[t] - h8->TCNT[t]);
425      time = (h8->device->unscaled_clock() / dividers[div]) / (h8->TCORB[t] - h8->TCNT[t]);
426426      timer_adjust_oneshot(h8->timer[(t*2)+1], ATTOTIME_IN_HZ(time), 0);
427427   }
428428}
src/emu/cpu/h83002/h8periph.c
r8581r8582
9696   ourTCR = h8->per_regs[tcr[tnum]];
9797   ourTVAL = h8->h8TCNT[tnum];
9898
99   period = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(h8->device)), tscales[ourTCR & 3] * (65536 - ourTVAL));
99   period = attotime_mul(ATTOTIME_IN_HZ(h8->device->unscaled_clock()), tscales[ourTCR & 3] * (65536 - ourTVAL));
100100
101101   if (ourTCR & 4)
102102   {
r8581r8582
115115   ourTCR = h8->per_regs[tcr[tnum]];
116116
117117   // get the time per unit
118   cycle_time = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(h8->device)), tscales[ourTCR & 3]);
118   cycle_time = attotime_mul(ATTOTIME_IN_HZ(h8->device->unscaled_clock()), tscales[ourTCR & 3]);
119119   cur = timer_timeelapsed(h8->timer[tnum]);
120120
121121   ratio = attotime_to_double(cur) / attotime_to_double(cycle_time);
r8581r8582
457457   attotime period;
458458   int ourTCR = h8->per_regs[0x68+(tnum*8)];
459459
460   period = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(h8->device)), tscales[ourTCR & 3]);
460   period = attotime_mul(ATTOTIME_IN_HZ(h8->device->unscaled_clock()), tscales[ourTCR & 3]);
461461
462462   if (ourTCR & 4)
463463   {
src/emu/cpu/m37710/m37710.c
r8581r8582
327327         switch (cpustate->m37710_regs[0x56+timer] & 0x3)
328328         {
329329            case 0:          // timer mode
330               time = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(cpustate->device)), tscales[cpustate->m37710_regs[tcr[timer]]>>6]);
330               time = attotime_mul(ATTOTIME_IN_HZ(cpustate->device->unscaled_clock()), tscales[cpustate->m37710_regs[tcr[timer]]>>6]);
331331               time = attotime_mul(time, tval + 1);
332332
333333               #if M37710_DEBUG
r8581r8582
362362         switch (cpustate->m37710_regs[0x56+timer] & 0x3)
363363         {
364364            case 0:          // timer mode
365               time = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(cpustate->device)), tscales[cpustate->m37710_regs[tcr[timer]]>>6]);
365               time = attotime_mul(ATTOTIME_IN_HZ(cpustate->device->unscaled_clock()), tscales[cpustate->m37710_regs[tcr[timer]]>>6]);
366366               time = attotime_mul(time, tval + 1);
367367
368368               #if M37710_DEBUG
src/emu/cpu/cpu.mak
r8581r8582
194194endif
195195
196196$(CPUOBJ)/dsp32/dsp32.o:   $(CPUSRC)/dsp32/dsp32.c \
197                     $(CPUSRC)/dsp32/dsp32.h
197                     $(CPUSRC)/dsp32/dsp32.h \
198                     $(CPUSRC)/dsp32/dsp32ops.c
198199
199200
200201
r8581r8582
657658
658659$(CPUOBJ)/i86/i86.o:   $(CPUSRC)/i86/i86.c \
659660                  $(CPUSRC)/i86/i86.h \
661                  $(CPUSRC)/i86/i86mem.c \
662                  $(CPUSRC)/i86/i86time.c \
660663                  $(CPUSRC)/i86/instr86.c \
661664                  $(CPUSRC)/i86/instr186.c \
662665                  $(I86DEPS)
663666
664667$(CPUOBJ)/i86/i286.o:   $(CPUSRC)/i86/i286.c \
665668                  $(CPUSRC)/i86/i286.h \
669                  $(CPUSRC)/i86/i86mem.c \
670                  $(CPUSRC)/i86/i86time.c \
666671                  $(CPUSRC)/i86/instr86.c \
667672                  $(CPUSRC)/i86/instr186.c \
668673                  $(CPUSRC)/i86/instr286.c \
r8581r8582
909914DASMOBJS += $(CPUOBJ)/m6502/6502dasm.o
910915endif
911916
917$(CPUOBJ)/m6502/m4510.o:   $(CPUSRC)/m6502/m4510.c \
918                     $(CPUSRC)/m6502/t65ce02.c
919
912920$(CPUOBJ)/m6502/m6502.o:   $(CPUSRC)/m6502/m6502.c \
913921                     $(CPUSRC)/m6502/m6502.h \
914922                     $(CPUSRC)/m6502/ops02.h \
r8581r8582
916924                     $(CPUSRC)/m6502/t65c02.c \
917925                     $(CPUSRC)/m6502/t65sc02.c \
918926                     $(CPUSRC)/m6502/t6510.c \
927                     $(CPUSRC)/m6502/tn2a03.c \
919928                     $(CPUSRC)/m6502/tdeco16.c
920929
921930$(CPUOBJ)/m6502/m65ce02.o:   $(CPUSRC)/m6502/m65ce02.c \
r8581r8582
9911000endif
9921001
9931002$(CPUOBJ)/mc68hc11/mc68hc11.o:   $(CPUSRC)/mc68hc11/mc68hc11.c \
994                        $(CPUSRC)/mc68hc11/hc11dasm.c
1003                        $(CPUSRC)/mc68hc11/hc11ops.c
9951004
9961005
9971006
r8581r8582
11611170                  $(CPUSRC)/v60/optable.c \
11621171                  $(CPUSRC)/v60/v60.c \
11631172                  $(CPUSRC)/v60/v60.h \
1173                  $(CPUSRC)/v60/v60mem.c \
11641174                  $(CPUSRC)/v60/v60d.c
11651175
11661176
r8581r8582
12221232
12231233ifneq ($(filter RSP,$(CPUS)),)
12241234OBJDIRS += $(CPUOBJ)/rsp
1225CPUOBJS += $(CPUOBJ)/rsp/rspdrc.o   $(CPUOBJ)/rsp/rspfe.o   $(DRCOBJ)
1235CPUOBJS += $(CPUOBJ)/rsp/rsp.o $(CPUOBJ)/rsp/rspdrc.o $(CPUOBJ)/rsp/rspfe.o $(DRCOBJ)
12261236DASMOBJS += $(CPUOBJ)/rsp/rsp_dasm.o
12271237endif
12281238
1239$(CPUOBJ)/rsp/rsp.o:   $(CPUSRC)/rsp/rsp.c \
1240            $(CPUSRC)/rsp/rsp.h
1241
12291242$(CPUOBJ)/rsp/rspdrc.o:   $(CPUSRC)/rsp/rspdrc.c \
12301243         $(CPUSRC)/rsp/rsp.h \
12311244         $(CPUSRC)/rsp/rspfe.h \
r8581r8582
14051418endif
14061419
14071420$(CPUOBJ)/tms7000/tms7000.o:   $(CPUSRC)/tms7000/tms7000.h \
1408                        $(CPUSRC)/tms7000/tms7000.c
1421                        $(CPUSRC)/tms7000/tms7000.c \
1422                        $(CPUSRC)/tms7000/tms70op.c \
1423                        $(CPUSRC)/tms7000/tms70tb.c
14091424
14101425$(CPUOBJ)/tms7000/7000dasm.o:   $(CPUSRC)/tms7000/tms7000.h \
14111426                        $(CPUSRC)/tms7000/7000dasm.c
r8581r8582
15231538endif
15241539
15251540$(CPUOBJ)/tms32051/tms32051.o:   $(CPUSRC)/tms32051/tms32051.c \
1526                        $(CPUSRC)/tms32051/tms32051.h
1541                        $(CPUSRC)/tms32051/tms32051.h \
1542                        $(CPUSRC)/tms32051/32051ops.c
15271543
15281544
15291545
src/emu/cpu/tlcs90/tlcs90.c
r8581r8582
27152715   cpustate->program = device->space(AS_PROGRAM);
27162716   cpustate->io = device->space(AS_IO);
27172717
2718   cpustate->timer_period = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(device)), 8);
2718   cpustate->timer_period = attotime_mul(ATTOTIME_IN_HZ(device->unscaled_clock()), 8);
27192719
27202720   // Reset registers to their initial values
27212721
src/emu/cpu/mcs51/mcs51dasm.c
r8581r8582
252252   { FEATURE_I83C751, 0x1fe, "idle"   },
253253   { FEATURE_I83C751, 0x1ff, "i2sta.7"   },
254254
255   /* unkown
255   /* unknown
256256     * "ibf",    "obf",    "idsm",   "obfc",    e8 - eb
257257     * "ma0",    "ma1",    "mb0",    "mb1",     ec - ef
258258     */
src/emu/cpu/rsp/rsp.c
r8581r8582
1010
1111CPU_DISASSEMBLE( rsp );
1212
13#ifndef USE_RSPDRC
14
1315#define LOG_INSTRUCTION_EXECUTION      0
1416#define SAVE_DISASM                  0
1517#define SAVE_DMEM                  0
r8581r8582
183185{
184186   if (reg >= 0 && reg < 8)
185187   {
186      return (rsp->config->sp_reg_r)(rsp->program, reg, 0x00000000);
188      return (rsp->config->sp_reg_r)(rsp->device, reg, 0x00000000);
187189   }
188190   else if (reg >= 8 && reg < 16)
189191   {
190      return (rsp->config->dp_reg_r)(rsp->program, reg - 8, 0x00000000);
192      return (rsp->config->dp_reg_r)(rsp->device, reg - 8, 0x00000000);
191193   }
192194   else
193195   {
r8581r8582
199201{
200202   if (reg >= 0 && reg < 8)
201203   {
202      (rsp->config->sp_reg_w)(rsp->program, reg, data, 0x00000000);
204      (rsp->config->sp_reg_w)(rsp->device, reg, data, 0x00000000);
203205   }
204206   else if (reg >= 8 && reg < 16)
205207   {
206      (rsp->config->dp_reg_w)(rsp->program, reg - 8, data, 0x00000000);
208      (rsp->config->dp_reg_w)(rsp->device, reg - 8, data, 0x00000000);
207209   }
208210   else
209211   {
r8581r8582
298300static CPU_INIT( rsp )
299301{
300302   rsp_state *rsp = get_safe_token(device);
301    int regIdx;
302    int accumIdx;
303   int regIdx;
304   int accumIdx;
303305   rsp->config = (const rsp_config *)device->baseconfig().static_config();
304306
305307   if (LOG_INSTRUCTION_EXECUTION)
r8581r8582
310312   rsp->program = device->space(AS_PROGRAM);
311313
312314#if 1
313    // Inaccurate.  RSP registers power on to a random state...
315   // Inaccurate.  RSP registers power on to a random state...
314316   for(regIdx = 0; regIdx < 32; regIdx++ )
315317   {
316318      rsp->r[regIdx] = 0;
r8581r8582
327329   rsp->reciprocal_high = 0;
328330#endif
329331
330    // ...except for the accumulators.
331    // We're not calling mame_rand() because initializing something with mame_rand()
332    //   makes me retch uncontrollably.
333    for(accumIdx = 0; accumIdx < 8; accumIdx++ )
334    {
335        rsp->accum[accumIdx].l = 0;
336    }
332   // ...except for the accumulators.
333   // We're not calling mame_rand() because initializing something with mame_rand()
334   //   makes me retch uncontrollably.
335   for(accumIdx = 0; accumIdx < 8; accumIdx++ )
336   {
337      rsp->accum[accumIdx].l = 0;
338   }
337339
338340   rsp->sr = RSP_STATUS_HALT;
339    rsp->step_count = 0;
341   rsp->step_count = 0;
340342}
341343
342344static CPU_EXIT( rsp )
r8581r8582
10341036#if 0
10351037static float float_round(float input)
10361038{
1037    INT32 integer = (INT32)input;
1038    float fraction = input - (float)integer;
1039    float output = 0.0f;
1040    if( fraction >= 0.5f )
1041    {
1042        output = (float)( integer + 1 );
1043    }
1044    else
1045    {
1046        output = (float)integer;
1047    }
1048    return output;
1039   INT32 integer = (INT32)input;
1040   float fraction = input - (float)integer;
1041   float output = 0.0f;
1042   if( fraction >= 0.5f )
1043   {
1044      output = (float)( integer + 1 );
1045   }
1046   else
1047   {
1048      output = (float)integer;
1049   }
1050   return output;
10491051}
10501052#endif
10511053
r8581r8582
18901892               {
18911893                  if (rsp->flag[2] & (1 << (del)))
18921894                  {
1893                     if (((UINT32)(INT16)(s1) + (UINT32)(INT16)(s2)) > 0x10000)
1895                     if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) > 0x10000)
18941896                     {
18951897                        W_ACCUM_L(del, s1);
18961898                        CLEAR_COMPARE_FLAG(del);
r8581r8582
26682670                  // ------------------------------------------------
26692671                  //
26702672
2671                        if (RTREG)
2672                        {
2673                            if (RDREG == 2)
2674                            {
2675                                // Anciliary clipping flags
2676                                RTVAL = rsp->flag[RDREG] & 0x00ff;
2677                            }
2678                            else
2679                            {
2680                                // All other flags are 16 bits but sign-extended at retrieval
2681                                RTVAL = (UINT32)rsp->flag[RDREG] | ( ( rsp->flag[RDREG] & 0x8000 ) ? 0xffff0000 : 0 );
2682                            }
2683                        }
2673                  if (RTREG)
2674                  {
2675                     if (RDREG == 2)
2676                     {
2677                        // Anciliary clipping flags
2678                        RTVAL = rsp->flag[RDREG] & 0x00ff;
2679                     }
2680                     else
2681                     {
2682                        // All other flags are 16 bits but sign-extended at retrieval
2683                        RTVAL = (UINT32)rsp->flag[RDREG] | ( ( rsp->flag[RDREG] & 0x8000 ) ? 0xffff0000 : 0 );
2684                     }
2685                  }
26842686                  break;
26852687               }
26862688               case 0x04:   /* MTC2 */
r8581r8582
27872789
27882790      if( rsp->sr & RSP_STATUS_SSTEP )
27892791      {
2790            if( rsp->step_count )
2791            {
2792                rsp->step_count--;
2793            }
2794            else
2795            {
2796                rsp->sr |= RSP_STATUS_BROKE;
2797            }
2792         if( rsp->step_count )
2793         {
2794            rsp->step_count--;
2795         }
2796         else
2797         {
2798            rsp->sr |= RSP_STATUS_BROKE;
2799         }
27982800      }
27992801
28002802      if( rsp->sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
r8581r8582
28182820   {
28192821      /* --- the following bits of info are set as 64-bit signed integers --- */
28202822      case CPUINFO_INT_PC:
2821        case CPUINFO_INT_REGISTER + RSP_PC:             rsp->pc = info->i;        break;
2822        case CPUINFO_INT_REGISTER + RSP_R0:             rsp->r[0] = info->i;        break;
2823        case CPUINFO_INT_REGISTER + RSP_R1:             rsp->r[1] = info->i;        break;
2824        case CPUINFO_INT_REGISTER + RSP_R2:             rsp->r[2] = info->i;        break;
2825        case CPUINFO_INT_REGISTER + RSP_R3:             rsp->r[3] = info->i;        break;
2826        case CPUINFO_INT_REGISTER + RSP_R4:             rsp->r[4] = info->i;        break;
2827        case CPUINFO_INT_REGISTER + RSP_R5:             rsp->r[5] = info->i;        break;
2828        case CPUINFO_INT_REGISTER + RSP_R6:             rsp->r[6] = info->i;        break;
2829        case CPUINFO_INT_REGISTER + RSP_R7:             rsp->r[7] = info->i;        break;
2830        case CPUINFO_INT_REGISTER + RSP_R8:             rsp->r[8] = info->i;        break;
2831        case CPUINFO_INT_REGISTER + RSP_R9:             rsp->r[9] = info->i;        break;
2832        case CPUINFO_INT_REGISTER + RSP_R10:            rsp->r[10] = info->i;        break;
2833        case CPUINFO_INT_REGISTER + RSP_R11:            rsp->r[11] = info->i;        break;
2834        case CPUINFO_INT_REGISTER + RSP_R12:            rsp->r[12] = info->i;        break;
2835        case CPUINFO_INT_REGISTER + RSP_R13:            rsp->r[13] = info->i;        break;
2836        case CPUINFO_INT_REGISTER + RSP_R14:            rsp->r[14] = info->i;        break;
2837        case CPUINFO_INT_REGISTER + RSP_R15:            rsp->r[15] = info->i;        break;
2838        case CPUINFO_INT_REGISTER + RSP_R16:            rsp->r[16] = info->i;        break;
2839        case CPUINFO_INT_REGISTER + RSP_R17:            rsp->r[17] = info->i;        break;
2840        case CPUINFO_INT_REGISTER + RSP_R18:            rsp->r[18] = info->i;        break;
2841        case CPUINFO_INT_REGISTER + RSP_R19:            rsp->r[19] = info->i;        break;
2842        case CPUINFO_INT_REGISTER + RSP_R20:            rsp->r[20] = info->i;        break;
2843        case CPUINFO_INT_REGISTER + RSP_R21:            rsp->r[21] = info->i;        break;
2844        case CPUINFO_INT_REGISTER + RSP_R22:            rsp->r[22] = info->i;        break;
2845        case CPUINFO_INT_REGISTER + RSP_R23:            rsp->r[23] = info->i;        break;
2846        case CPUINFO_INT_REGISTER + RSP_R24:            rsp->r[24] = info->i;        break;
2847        case CPUINFO_INT_REGISTER + RSP_R25:            rsp->r[25] = info->i;        break;
2848        case CPUINFO_INT_REGISTER + RSP_R26:            rsp->r[26] = info->i;        break;
2849        case CPUINFO_INT_REGISTER + RSP_R27:            rsp->r[27] = info->i;        break;
2850        case CPUINFO_INT_REGISTER + RSP_R28:            rsp->r[28] = info->i;        break;
2851        case CPUINFO_INT_REGISTER + RSP_R29:            rsp->r[29] = info->i;        break;
2852        case CPUINFO_INT_REGISTER + RSP_R30:            rsp->r[30] = info->i;        break;
2853        case CPUINFO_INT_SP:
2854        case CPUINFO_INT_REGISTER + RSP_R31:            rsp->r[31] = info->i;        break;
2855        case CPUINFO_INT_REGISTER + RSP_SR:             rsp->sr = info->i;           break;
2856        case CPUINFO_INT_REGISTER + RSP_NEXTPC:         rsp->nextpc = info->i;       break;
2857        case CPUINFO_INT_REGISTER + RSP_STEPCNT:        rsp->step_count = info->i;   break;
2823      case CPUINFO_INT_REGISTER + RSP_PC:             rsp->pc = info->i;        break;
2824      case CPUINFO_INT_REGISTER + RSP_R0:             rsp->r[0] = info->i;        break;
2825      case CPUINFO_INT_REGISTER + RSP_R1:             rsp->r[1] = info->i;        break;
2826      case CPUINFO_INT_REGISTER + RSP_R2:             rsp->r[2] = info->i;        break;
2827      case CPUINFO_INT_REGISTER + RSP_R3:             rsp->r[3] = info->i;        break;
2828      case CPUINFO_INT_REGISTER + RSP_R4:             rsp->r[4] = info->i;        break;
2829      case CPUINFO_INT_REGISTER + RSP_R5:             rsp->r[5] = info->i;        break;
2830      case CPUINFO_INT_REGISTER + RSP_R6:             rsp->r[6] = info->i;        break;
2831      case CPUINFO_INT_REGISTER + RSP_R7:             rsp->r[7] = info->i;        break;
2832      case CPUINFO_INT_REGISTER + RSP_R8:             rsp->r[8] = info->i;        break;
2833      case CPUINFO_INT_REGISTER + RSP_R9:             rsp->r[9] = info->i;        break;
2834      case CPUINFO_INT_REGISTER + RSP_R10:            rsp->r[10] = info->i;        break;
2835      case CPUINFO_INT_REGISTER + RSP_R11:            rsp->r[11] = info->i;        break;
2836      case CPUINFO_INT_REGISTER + RSP_R12:            rsp->r[12] = info->i;        break;
2837      case CPUINFO_INT_REGISTER + RSP_R13:            rsp->r[13] = info->i;        break;
2838      case CPUINFO_INT_REGISTER + RSP_R14:            rsp->r[14] = info->i;        break;
2839      case CPUINFO_INT_REGISTER + RSP_R15:            rsp->r[15] = info->i;        break;
2840      case CPUINFO_INT_REGISTER + RSP_R16:            rsp->r[16] = info->i;        break;
2841      case CPUINFO_INT_REGISTER + RSP_R17:            rsp->r[17] = info->i;        break;
2842      case CPUINFO_INT_REGISTER + RSP_R18:            rsp->r[18] = info->i;        break;
2843      case CPUINFO_INT_REGISTER + RSP_R19:            rsp->r[19] = info->i;        break;
2844      case CPUINFO_INT_REGISTER + RSP_R20:            rsp->r[20] = info->i;        break;
2845      case CPUINFO_INT_REGISTER + RSP_R21:            rsp->r[21] = info->i;        break;
2846      case CPUINFO_INT_REGISTER + RSP_R22:            rsp->r[22] = info->i;        break;
2847      case CPUINFO_INT_REGISTER + RSP_R23:            rsp->r[23] = info->i;        break;
2848      case CPUINFO_INT_REGISTER + RSP_R24:            rsp->r[24] = info->i;        break;
2849      case CPUINFO_INT_REGISTER + RSP_R25:            rsp->r[25] = info->i;        break;
2850      case CPUINFO_INT_REGISTER + RSP_R26:            rsp->r[26] = info->i;        break;
2851      case CPUINFO_INT_REGISTER + RSP_R27:            rsp->r[27] = info->i;        break;
2852      case CPUINFO_INT_REGISTER + RSP_R28:            rsp->r[28] = info->i;        break;
2853      case CPUINFO_INT_REGISTER + RSP_R29:            rsp->r[29] = info->i;        break;
2854      case CPUINFO_INT_REGISTER + RSP_R30:            rsp->r[30] = info->i;        break;
2855      case CPUINFO_INT_SP:
2856      case CPUINFO_INT_REGISTER + RSP_R31:            rsp->r[31] = info->i;        break;
2857      case CPUINFO_INT_REGISTER + RSP_SR:             rsp->sr = info->i;           break;
2858      case CPUINFO_INT_REGISTER + RSP_NEXTPC:         rsp->nextpc = info->i;       break;
2859      case CPUINFO_INT_REGISTER + RSP_STEPCNT:        rsp->step_count = info->i;   break;
28582860   }
28592861}
28602862
r8581r8582
29282930      case CPUINFO_INT_REGISTER + RSP_R31:         info->i = rsp->r[31];               break;
29292931      case CPUINFO_INT_REGISTER + RSP_SR:             info->i = rsp->sr;                       break;
29302932      case CPUINFO_INT_REGISTER + RSP_NEXTPC:         info->i = rsp->nextpc;                   break;
2931        case CPUINFO_INT_REGISTER + RSP_STEPCNT:        info->i = rsp->step_count;               break;
2933      case CPUINFO_INT_REGISTER + RSP_STEPCNT:        info->i = rsp->step_count;               break;
29322934
29332935      /* --- the following bits of info are returned as pointers to data or functions --- */
29342936      case CPUINFO_FCT_SET_INFO:                  info->setinfo = CPU_SET_INFO_NAME(rsp);         break;
r8581r8582
29852987      case CPUINFO_STR_REGISTER + RSP_R31:         sprintf(info->s, "R31: %08X", rsp->r[31]); break;
29862988      case CPUINFO_STR_REGISTER + RSP_SR:             sprintf(info->s, "SR: %08X",  rsp->sr);    break;
29872989      case CPUINFO_STR_REGISTER + RSP_NEXTPC:         sprintf(info->s, "NPC: %08X", rsp->nextpc);break;
2988        case CPUINFO_STR_REGISTER + RSP_STEPCNT:        sprintf(info->s, "STEP: %d",  rsp->step_count);  break;
2990      case CPUINFO_STR_REGISTER + RSP_STEPCNT:        sprintf(info->s, "STEP: %d",  rsp->step_count);  break;
29892991   }
29902992}
29912993
2994void rspdrc_set_options(running_device *device, UINT32 options)
2995{
2996}
2997
2998void rspdrc_add_imem(running_device *device, void *base)
2999{
3000}
3001
3002void rspdrc_add_dmem(running_device *device, void *base)
3003{
3004}
3005
3006void rspdrc_flush_drc_cache(running_device *device)
3007{
3008}
3009
29923010DEFINE_LEGACY_CPU_DEVICE(RSP, rsp);
3011
3012#endif // USE_RSPDRC
src/emu/cpu/rsp/rsp.h
r8581r8582
1616#ifndef __RSP_H__
1717#define __RSP_H__
1818
19#define USE_RSPDRC
1920
20
2121/***************************************************************************
2222    REGISTER ENUMERATION
2323***************************************************************************/
r8581r8582
197197   VECTOR_REG v[32];
198198   UINT16 flag[4];
199199   UINT32 sr;
200    UINT32 step_count;
200   UINT32 step_count;
201201
202202   ACCUMULATOR accum[8];
203203   INT32 square_root_res;
src/emu/cpu/rsp/rspdrc.c
r8581r8582
3131
3232extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op);
3333
34#ifdef USE_RSPDRC
35
3436/***************************************************************************
3537    DEBUGGING
3638***************************************************************************/
r8581r8582
546548    debugging
547549-------------------------------------------------*/
548550
549//static void cfunc_printf_debug(void *param)
550//{
551//  rsp_state *rsp = (rsp_state *)param;
552//  printf(rsp->impstate->format, rsp->impstate->arg0, rsp->impstate->arg1);
553//  logerror(rsp->impstate->format, rsp->impstate->arg0, rsp->impstate->arg1);
554//}
551#ifdef UNUSED_FUNCTION
552static void cfunc_printf_debug(void *param)
553{
554   rsp_state *rsp = (rsp_state *)param;
555   printf(rsp->impstate->format, rsp->impstate->arg0, rsp->impstate->arg1);
556   logerror(rsp->impstate->format, rsp->impstate->arg0, rsp->impstate->arg1);
557}
558#endif
555559
556560
557561/*-------------------------------------------------
r8581r8582
559563    debugging 64-bit values
560564-------------------------------------------------*/
561565
562//static void cfunc_printf_debug64(void *param)
563//{
564//  rsp_state *rsp = (rsp_state *)param;
565//  printf(rsp->impstate->format, (UINT32)(rsp->impstate->arg64 >> 32), (UINT32)(rsp->impstate->arg64 & 0x00000000ffffffff));
566//  logerror(rsp->impstate->format, (UINT32)(rsp->impstate->arg64 >> 32), (UINT32)(rsp->impstate->arg64 & 0x00000000ffffffff));
567//}
566#ifdef UNUSED_FUNCTION
567static void cfunc_printf_debug64(void *param)
568{
569   rsp_state *rsp = (rsp_state *)param;
570   printf(rsp->impstate->format, (UINT32)(rsp->impstate->arg64 >> 32), (UINT32)(rsp->impstate->arg64 & 0x00000000ffffffff));
571   logerror(rsp->impstate->format, (UINT32)(rsp->impstate->arg64 >> 32), (UINT32)(rsp->impstate->arg64 & 0x00000000ffffffff));
572}
573#endif
568574
569
570575static void cfunc_get_cop0_reg(void *param)
571576{
572577   rsp_state *rsp = (rsp_state*)param;
r8581r8582
713718   rsp->reciprocal_high = 0;
714719#endif
715720
716    // ...except for the accumulators.
717    for(accumIdx = 0; accumIdx < 8; accumIdx++ )
718    {
719        rsp->accum[accumIdx].l = 0;
720    }
721   // ...except for the accumulators.
722   for(accumIdx = 0; accumIdx < 8; accumIdx++ )
723   {
724      rsp->accum[accumIdx].l = 0;
725   }
721726
722727   rsp->sr = RSP_STATUS_HALT;
723    rsp->step_count = 0;
728   rsp->step_count = 0;
724729}
725730
726731static CPU_INIT( rsp )
r8581r8582
14521457#endif
14531458      case 0x07:      /* LUV */
14541459#if (DRC_LUV)
1455   /*
1456    ea = (base) ? rsp->r[base] + (offset * 8) : (offset * 8);
1460#ifdef UNUSED_CODE
1461   ea = (base) ? rsp->r[base] + (offset * 8) : (offset * 8);
14571462
1458    for (i=0; i < 8; i++)
1459    {
1460        W_VREG_S(dest, i, READ8(rsp, ea + (((16-index) + i) & 0xf)) << 7);
1461    }
1462    */
1463   for (i=0; i < 8; i++)
1464   {
1465      W_VREG_S(dest, i, READ8(rsp, ea + (((16-index) + i) & 0xf)) << 7);
1466   }
1467#endif
14631468         offset <<= 3;
14641469
14651470         UML_ADD(block, IREG(2), R32(RSREG), IMM(offset));                  // add     i2,<rsreg>,offset
r8581r8582
21152120#if (DRC_VMADN)
21162121static void generate_saturate_accum_unsigned(rsp_state *rsp, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int accum)
21172122{
2118   /*
2119    int skip, skip2;
2123#ifdef UNUSED_CODE
2124   int skip, skip2;
21202125
2121    UML_CMP(block, VACCUMWMH(accum), IMM(-32768));
2122    UML_JMPc(block, IF_GE, skip = compiler->labelnum++);
2123    UML_MOV(block, IREG(0), IMM(0));
2124    UML_JMP(block, skip2 = compiler->labelnum++);
2126   UML_CMP(block, VACCUMWMH(accum), IMM(-32768));
2127   UML_JMPc(block, IF_GE, skip = compiler->labelnum++);
2128   UML_MOV(block, IREG(0), IMM(0));
2129   UML_JMP(block, skip2 = compiler->labelnum++);
21252130
2126    UML_LABEL(block, skip);
2127    UML_CMP(block, VACCUMWMH(accum), IMM(32767));
2128    UML_JMPc(block, IF_L, skip = compiler->labelnum++);
2129    UML_MOV(block, IREG(0), IMM(0x0000ffff));
2130    UML_JMP(block, skip2);
2131   UML_LABEL(block, skip);
2132   UML_CMP(block, VACCUMWMH(accum), IMM(32767));
2133   UML_JMPc(block, IF_L, skip = compiler->labelnum++);
2134   UML_MOV(block, IREG(0), IMM(0x0000ffff));
2135   UML_JMP(block, skip2);
21312136
2132    UML_LABEL(block, skip);
2133    UML_SEXT(block, IREG(0), VACCUMHL(accum), WORD);
2134    UML_AND(block, IREG(0), IREG(0), IMM(0x0000ffff));
2135    UML_LABEL(block, skip2);
2136    */
2137   UML_LABEL(block, skip);
21372138   UML_SEXT(block, IREG(0), VACCUMHL(accum), WORD);
21382139   UML_AND(block, IREG(0), IREG(0), IMM(0x0000ffff));
2140   UML_LABEL(block, skip2);
2141#endif
2142   UML_SEXT(block, IREG(0), VACCUMHL(accum), WORD);
2143   UML_AND(block, IREG(0), IREG(0), IMM(0x0000ffff));
21392144   UML_CMP(block, VACCUMWMH(accum), IMM(-32768));
21402145   UML_MOVc(block, IF_L, IREG(0), IMM(0));
21412146   UML_CMP(block, VACCUMWMH(accum), IMM(32767));
r8581r8582
22102215#if 0
22112216static float float_round(float input)
22122217{
2213    INT32 integer = (INT32)input;
2214    float fraction = input - (float)integer;
2215    float output = 0.0f;
2216    if( fraction >= 0.5f )
2217    {
2218        output = (float)( integer + 1 );
2219    }
2220    else
2221    {
2222        output = (float)integer;
2223    }
2224    return output;
2218   INT32 integer = (INT32)input;
2219   float fraction = input - (float)integer;
2220   float output = 0.0f;
2221   if( fraction >= 0.5f )
2222   {
2223      output = (float)( integer + 1 );
2224   }
2225   else
2226   {
2227      output = (float)integer;
2228   }
2229   return output;
22252230}
22262231#endif
22272232
r8581r8582
28652870         break;
28662871   }
28672872
2868   /*
2869    for (i=0; i < 8; i++)
2870    {
2871        int del = VEC_EL_1(EL, i);
2872        int sel = VEC_EL_2(EL, del);
2873        INT32 s1 = (INT32)(INT16)R_VREG_S(VS1REG, del);
2874        INT32 s2 = (UINT16)R_VREG_S(VS2REG, sel);   // not sign-extended
2875        INT32 r =  s1 * s2;
2873#ifdef UNUSED_CODE
2874   for (i=0; i < 8; i++)
2875   {
2876      int del = VEC_EL_1(EL, i);
2877      int sel = VEC_EL_2(EL, del);
2878      INT32 s1 = (INT32)(INT16)R_VREG_S(VS1REG, del);
2879      INT32 s2 = (UINT16)R_VREG_S(VS2REG, sel);   // not sign-extended
2880      INT32 r =  s1 * s2;
28762881
2877        W_ACCUM_H(del, (r < 0) ? 0xffff : 0);       // sign-extend to 48-bit
2878        W_ACCUM_M(del, (INT16)(r >> 16));
2879        W_ACCUM_L(del, (UINT16)(r));
2882      W_ACCUM_H(del, (r < 0) ? 0xffff : 0);       // sign-extend to 48-bit
2883      W_ACCUM_M(del, (INT16)(r >> 16));
2884      W_ACCUM_L(del, (UINT16)(r));
28802885
2881        vres[del] = ACCUM(del).h.mid;
2882    }
2883    WRITEBACK_RESULT();
2884    */
2886      vres[del] = ACCUM(del).h.mid;
2887   }
2888   WRITEBACK_RESULT();
2889#endif
28852890}
28862891#endif
28872892
r8581r8582
51465151         {
51475152            if (rsp->flag[2] & (1 << (del)))
51485153            {
5149               if (((UINT32)(INT16)(s1) + (UINT32)(INT16)(s2)) > 0x10000)
5154               if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) > 0x10000)
51505155               {
51515156                  W_ACCUM_L(del, s1);
51525157                  CLEAR_COMPARE_FLAG(del);
r8581r8582
73067311    cfunc_fatalerror - a generic fatalerror call
73077312-------------------------------------------------*/
73087313
7309//static void cfunc_fatalerror(void *param)
7310//{
7311   //fatalerror("fatalerror");
7312//}
7314#ifdef UNUSED_CODE
7315static void cfunc_fatalerror(void *param)
7316{
7317   fatalerror("fatalerror");
7318}
7319#endif
73137320
73147321
73157322/***************************************************************************
r8581r8582
76547661   }
76557662
76567663   /* if we hit an unmapped address, fatal error */
7657   //if (desc->flags & OPFLAG_COMPILER_UNMAPPED)
7658   //{
7659   //  UML_MOV(block, MEM(&rsp->pc), IMM(desc->pc));                               // mov     [pc],desc->pc
7660   //  save_fast_iregs(rsp, block);
7661   //  UML_EXIT(block, IMM(EXECUTE_UNMAPPED_CODE));                                // exit    EXECUTE_UNMAPPED_CODE
7662   //}
7664#if 0
7665   if (desc->flags & OPFLAG_COMPILER_UNMAPPED)
7666   {
7667      UML_MOV(block, MEM(&rsp->pc), IMM(desc->pc));                        // mov     [pc],desc->pc
7668      save_fast_iregs(rsp, block);
7669      UML_EXIT(block, IMM(EXECUTE_UNMAPPED_CODE));                        // exit EXECUTE_UNMAPPED_CODE
7670   }
7671#endif
76637672
76647673   /* otherwise, unless this is a virtual no-op, it's a regular instruction */
76657674   /*else*/ if (!(desc->flags & OPFLAG_VIRTUAL_NOOP))
r8581r8582
81968205
81978206      /* ----- unimplemented/illegal instructions ----- */
81988207
8199//      default:    /* ??? */       invalid_instruction(op);                                                break;
8208      //default:    /* ??? */       invalid_instruction(op);                                                break;
82008209   }
82018210
82028211   return FALSE;
r8581r8582
85478556   {
85488557      /* --- the following bits of info are set as 64-bit signed integers --- */
85498558      case CPUINFO_INT_PC:
8550        case CPUINFO_INT_REGISTER + RSP_PC:             rsp->pc = info->i;        break;
8551        case CPUINFO_INT_REGISTER + RSP_R0:             rsp->r[0] = info->i;        break;
8552        case CPUINFO_INT_REGISTER + RSP_R1:             rsp->r[1] = info->i;        break;
8553        case CPUINFO_INT_REGISTER + RSP_R2:             rsp->r[2] = info->i;        break;
8554        case CPUINFO_INT_REGISTER + RSP_R3:             rsp->r[3] = info->i;        break;
8555        case CPUINFO_INT_REGISTER + RSP_R4:             rsp->r[4] = info->i;        break;
8556        case CPUINFO_INT_REGISTER + RSP_R5:             rsp->r[5] = info->i;        break;
8557        case CPUINFO_INT_REGISTER + RSP_R6:             rsp->r[6] = info->i;        break;
8558        case CPUINFO_INT_REGISTER + RSP_R7:             rsp->r[7] = info->i;        break;
8559        case CPUINFO_INT_REGISTER + RSP_R8:             rsp->r[8] = info->i;        break;
8560        case CPUINFO_INT_REGISTER + RSP_R9:             rsp->r[9] = info->i;        break;
8561        case CPUINFO_INT_REGISTER + RSP_R10:            rsp->r[10] = info->i;        break;
8562        case CPUINFO_INT_REGISTER + RSP_R11:            rsp->r[11] = info->i;        break;
8563        case CPUINFO_INT_REGISTER + RSP_R12:            rsp->r[12] = info->i;        break;
8564        case CPUINFO_INT_REGISTER + RSP_R13:            rsp->r[13] = info->i;        break;
8565        case CPUINFO_INT_REGISTER + RSP_R14:            rsp->r[14] = info->i;        break;
8566        case CPUINFO_INT_REGISTER + RSP_R15:            rsp->r[15] = info->i;        break;
8567        case CPUINFO_INT_REGISTER + RSP_R16:            rsp->r[16] = info->i;        break;
8568        case CPUINFO_INT_REGISTER + RSP_R17:            rsp->r[17] = info->i;        break;
8569        case CPUINFO_INT_REGISTER + RSP_R18:            rsp->r[18] = info->i;        break;
8570        case CPUINFO_INT_REGISTER + RSP_R19:            rsp->r[19] = info->i;        break;
8571        case CPUINFO_INT_REGISTER + RSP_R20:            rsp->r[20] = info->i;        break;
8572        case CPUINFO_INT_REGISTER + RSP_R21:            rsp->r[21] = info->i;        break;
8573        case CPUINFO_INT_REGISTER + RSP_R22:            rsp->r[22] = info->i;        break;
8574        case CPUINFO_INT_REGISTER + RSP_R23:            rsp->r[23] = info->i;        break;
8575        case CPUINFO_INT_REGISTER + RSP_R24:            rsp->r[24] = info->i;        break;
8576        case CPUINFO_INT_REGISTER + RSP_R25:            rsp->r[25] = info->i;        break;
8577        case CPUINFO_INT_REGISTER + RSP_R26:            rsp->r[26] = info->i;        break;
8578        case CPUINFO_INT_REGISTER + RSP_R27:            rsp->r[27] = info->i;        break;
8579        case CPUINFO_INT_REGISTER + RSP_R28:            rsp->r[28] = info->i;        break;
8580        case CPUINFO_INT_REGISTER + RSP_R29:            rsp->r[29] = info->i;        break;
8581        case CPUINFO_INT_REGISTER + RSP_R30:            rsp->r[30] = info->i;        break;
8582        case CPUINFO_INT_SP:
8583        case CPUINFO_INT_REGISTER + RSP_R31:            rsp->r[31] = info->i;        break;
8584        case CPUINFO_INT_REGISTER + RSP_SR:             rsp->sr = info->i;           break;
8585        case CPUINFO_INT_REGISTER + RSP_NEXTPC:         rsp->nextpc = info->i;       break;
8586        case CPUINFO_INT_REGISTER + RSP_STEPCNT:        rsp->step_count = info->i;   break;
8559      case CPUINFO_INT_REGISTER + RSP_PC:             rsp->pc = info->i;        break;
8560      case CPUINFO_INT_REGISTER + RSP_R0:             rsp->r[0] = info->i;        break;
8561      case CPUINFO_INT_REGISTER + RSP_R1:             rsp->r[1] = info->i;        break;
8562      case CPUINFO_INT_REGISTER + RSP_R2:             rsp->r[2] = info->i;        break;
8563      case CPUINFO_INT_REGISTER + RSP_R3:             rsp->r[3] = info->i;        break;
8564      case CPUINFO_INT_REGISTER + RSP_R4:             rsp->r[4] = info->i;        break;
8565      case CPUINFO_INT_REGISTER + RSP_R5:             rsp->r[5] = info->i;        break;
8566      case CPUINFO_INT_REGISTER + RSP_R6:             rsp->r[6] = info->i;        break;
8567      case CPUINFO_INT_REGISTER + RSP_R7:             rsp->r[7] = info->i;        break;
8568      case CPUINFO_INT_REGISTER + RSP_R8:             rsp->r[8] = info->i;        break;
8569      case CPUINFO_INT_REGISTER + RSP_R9:             rsp->r[9] = info->i;        break;
8570      case CPUINFO_INT_REGISTER + RSP_R10:            rsp->r[10] = info->i;        break;
8571      case CPUINFO_INT_REGISTER + RSP_R11:            rsp->r[11] = info->i;        break;
8572      case CPUINFO_INT_REGISTER + RSP_R12:            rsp->r[12] = info->i;        break;
8573      case CPUINFO_INT_REGISTER + RSP_R13:            rsp->r[13] = info->i;        break;
8574      case CPUINFO_INT_REGISTER + RSP_R14:            rsp->r[14] = info->i;        break;
8575      case CPUINFO_INT_REGISTER + RSP_R15:            rsp->r[15] = info->i;        break;
8576      case CPUINFO_INT_REGISTER + RSP_R16:            rsp->r[16] = info->i;        break;
8577      case CPUINFO_INT_REGISTER + RSP_R17:            rsp->r[17] = info->i;        break;
8578      case CPUINFO_INT_REGISTER + RSP_R18:            rsp->r[18] = info->i;        break;
8579      case CPUINFO_INT_REGISTER + RSP_R19:            rsp->r[19] = info->i;        break;
8580      case CPUINFO_INT_REGISTER + RSP_R20:            rsp->r[20] = info->i;        break;
8581      case CPUINFO_INT_REGISTER + RSP_R21:            rsp->r[21] = info->i;        break;
8582      case CPUINFO_INT_REGISTER + RSP_R22:            rsp->r[22] = info->i;        break;
8583      case CPUINFO_INT_REGISTER + RSP_R23:            rsp->r[23] = info->i;        break;
8584      case CPUINFO_INT_REGISTER + RSP_R24:            rsp->r[24] = info->i;        break;
8585      case CPUINFO_INT_REGISTER + RSP_R25:            rsp->r[25] = info->i;        break;
8586      case CPUINFO_INT_REGISTER + RSP_R26:            rsp->r[26] = info->i;        break;
8587      case CPUINFO_INT_REGISTER + RSP_R27:            rsp->r[27] = info->i;        break;
8588      case CPUINFO_INT_REGISTER + RSP_R28:            rsp->r[28] = info->i;        break;
8589      case CPUINFO_INT_REGISTER + RSP_R29:            rsp->r[29] = info->i;        break;
8590      case CPUINFO_INT_REGISTER + RSP_R30:            rsp->r[30] = info->i;        break;
8591      case CPUINFO_INT_SP:
8592      case CPUINFO_INT_REGISTER + RSP_R31:            rsp->r[31] = info->i;        break;
8593      case CPUINFO_INT_REGISTER + RSP_SR:             rsp->sr = info->i;           break;
8594      case CPUINFO_INT_REGISTER + RSP_NEXTPC:         rsp->nextpc = info->i;       break;
8595      case CPUINFO_INT_REGISTER + RSP_STEPCNT:        rsp->step_count = info->i;   break;
85878596   }
85888597}
85898598
r8581r8582
86578666      case CPUINFO_INT_REGISTER + RSP_R31:         info->i = rsp->r[31];               break;
86588667      case CPUINFO_INT_REGISTER + RSP_SR:             info->i = rsp->sr;                       break;
86598668      case CPUINFO_INT_REGISTER + RSP_NEXTPC:         info->i = rsp->nextpc;                   break;
8660        case CPUINFO_INT_REGISTER + RSP_STEPCNT:        info->i = rsp->step_count;               break;
8669      case CPUINFO_INT_REGISTER + RSP_STEPCNT:        info->i = rsp->step_count;               break;
86618670
86628671      /* --- the following bits of info are returned as pointers to data or functions --- */
86638672      case CPUINFO_FCT_SET_INFO:                  info->setinfo = CPU_SET_INFO_NAME(rsp);         break;
r8581r8582
87148723      case CPUINFO_STR_REGISTER + RSP_R31:         sprintf(info->s, "R31: %08X", rsp->r[31]); break;
87158724      case CPUINFO_STR_REGISTER + RSP_SR:             sprintf(info->s, "SR: %08X",  rsp->sr);    break;
87168725      case CPUINFO_STR_REGISTER + RSP_NEXTPC:         sprintf(info->s, "NPC: %08X", rsp->nextpc);break;
8717        case CPUINFO_STR_REGISTER + RSP_STEPCNT:        sprintf(info->s, "STEP: %d",  rsp->step_count);  break;
8726      case CPUINFO_STR_REGISTER + RSP_STEPCNT:        sprintf(info->s, "STEP: %d",  rsp->step_count);  break;
87188727   }
87198728}
87208729
87218730DEFINE_LEGACY_CPU_DEVICE(RSP, rsp);
8731
8732#endif // USE_RSPDRC
src/emu/cpu/powerpc/ppc_dasm.c
r8581r8582
451451      case SPR4XX_PBL2:   strcat(dest, "pbl2");   break;
452452      case SPR4XX_PBU2:   strcat(dest, "pbu2");   break;
453453
454      default:   sprintf(dest, "%s%d", dest, spr); break;
454      default:         sprintf(dest + strlen(dest), "%d", spr); break;
455455   }
456456}
457457
r8581r8582
515515      case 64:   strcat(dest, "exisr"); break;
516516      case 160:   strcat(dest, "iocr"); break;
517517
518      default:    sprintf(dest, "%s%d", dest, dcr); break;
518      default:   sprintf(dest + strlen(dest), "%d", dcr); break;
519519   }
520520}
521521
r8581r8582
11041104
11051105         case F_MTSPR:
11061106            SPR(oprs, G_SPR(op));
1107            sprintf(oprs, "%s,r%d", oprs, G_RT(op));
1107            sprintf(oprs + strlen(oprs), ",r%d", G_RT(op));
11081108            break;
11091109
11101110         case F_MTDCR:
11111111            DCR(oprs, G_DCR(op));
1112            sprintf(oprs, "%s,r%d", oprs, G_RT(op));
1112            sprintf(oprs + strlen(oprs), ",r%d", G_RT(op));
11131113            break;
11141114
11151115         case F_MTSR:
src/emu/cpu/tms32010/tms32010.h
r8581r8582
3131#define TMS32010_INT_PENDING   0x80000000
3232#define TMS32010_INT_NONE      0
3333
34#define  TMS32010_ADDR_MASK  0x0fff      /* TMS32010 can only address 0x0fff */
35                              /* however other TMS3201x devices   */
36                              /* can address up to 0xffff (incase */
37                              /* their support is ever added).    */
3834
39
4035enum
4136{
4237   TMS32010_PC=1, TMS32010_SP,   TMS32010_STR,  TMS32010_ACC,
r8581r8582
5045 */
5146
5247DECLARE_LEGACY_CPU_DEVICE(TMS32010, tms32010);
48DECLARE_LEGACY_CPU_DEVICE(TMS32015, tms32015);
49DECLARE_LEGACY_CPU_DEVICE(TMS32016, tms32016);
5350
5451
5552CPU_DISASSEMBLE( tms32010 );
src/emu/cpu/tms32010/tms32010.c
r8581r8582
4848 *  RK  (23-Nov-2006) Ver 1.22                                              *
4949 *   - Fixed state of the Overflow Flag on reset                            *
5050 *   - Fixed the SUBC instruction which was incorrectly zeroing the divisor *
51 *  TLP (13-Jul-2010) Ver 1.30                                              *
52 *   - LST instruction was incorrectly setting an Indirect Addressing       *
53 *     feature when Direct Addressing mode was selected                     *
54 *   - Added TMS32015 and TMS32016 variants                                 *
5155 *                                                                          *
5256 \**************************************************************************/
5357
r8581r8582
100104INLINE tms32010_state *get_safe_token(running_device *device)
101105{
102106   assert(device != NULL);
103   assert(device->type() == TMS32010);
107   assert(device->type() == TMS32010 ||
108         device->type() == TMS32015 ||
109         device->type() == TMS32016);
104110   return (tms32010_state *)downcast<legacy_cpu_device *>(device)->token();
105111}
106112
r8581r8582
111117   UINT8   cycles;
112118   void   (*function)(tms32010_state *);
113119};
114/* opcode table entry (Opcode 7F has sub-opcodes) */
115typedef struct _tms32010_opcode_7F tms32010_opcode_7F;
116struct _tms32010_opcode_7F
117{
118   UINT8   cycles;
119   void   (*function)(tms32010_state *);
120};
121120
122121
123122/*********  The following is the Status (Flag) register definition.  *********/
r8581r8582
476475{
477476   cpustate->PC++ ;
478477   PUSH_STACK(cpustate, cpustate->PC);
479   cpustate->PC = M_RDOP_ARG((cpustate->PC - 1)) & cpustate->addr_mask;
478   cpustate->PC = M_RDOP_ARG((cpustate->PC - 1));
480479}
481480static void dint(tms32010_state *cpustate)
482481{
r8581r8582
547546}
548547static void lst(tms32010_state *cpustate)
549548{
550   cpustate->opcode.b.l |= 0x08; /* Next arp not supported here, so mask it */
549   if (cpustate->opcode.b.l & 0x80) {
550      cpustate->opcode.b.l |= 0x08; /* In Indirect Addressing mode, next ARP is not supported here so mask it */
551   }
551552   getdata(cpustate, 0,0);
552553   cpustate->ALU.w.l &= (~INTM_FLAG);   /* Must not affect INTM */
553554   cpustate->STR &= INTM_FLAG;
r8581r8582
761762/*F8*/  {2, call   },{2, br      },{2, blz      },{2, blez      },{2, bgz      },{2, bgez      },{2, bnz      },{2, bz      }
762763};
763764
764static const tms32010_opcode_7F opcode_7F[32]=
765static const tms32010_opcode opcode_7F[32]=
765766{
766767/*80*/  {1, nop      },{1, dint      },{1, eint      },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
767768/*88*/  {1, abst   },{1, zac      },{1, rovm      },{1, sovm      },{2, cala      },{2, ret      },{1, pac      },{1, apac      },
r8581r8582
774775/****************************************************************************
775776 *  Inits CPU emulation
776777 ****************************************************************************/
778
777779static CPU_INIT( tms32010 )
778780{
779781   tms32010_state *cpustate = get_safe_token(device);
r8581r8582
806808
807809
808810/****************************************************************************
809 *  Reset registers to their initial values
811 *  Shut down CPU emulation
810812 ****************************************************************************/
811static CPU_RESET( tms32010 )
812{
813   tms32010_state *cpustate = get_safe_token(device);
814813
815   cpustate->PC    = 0;
816   cpustate->STR   = 0x7efe;   // OV cleared
817   cpustate->ACC.d = 0;
818   cpustate->INTF  = TMS32010_INT_NONE;
819   cpustate->addr_mask = 0x0fff;   /* TMS32010 can only address 0x0fff */
820                           /* however other TMS3201x devices   */
821                           /* can address up to 0xffff (incase */
822                           /* their support is ever added).    */
823}
814static CPU_EXIT( tms32010 ) { }
824815
825816
826817/****************************************************************************
827 *  Shut down CPU emulation
818 *  Set IRQ line state
828819 ****************************************************************************/
829static CPU_EXIT( tms32010 ) { }
830820
821static void set_irq_line(tms32010_state *cpustate, int irqline, int state)
822{
823   /* Pending Interrupts cannot be cleared! */
824   if (state == ASSERT_LINE) cpustate->INTF |= TMS32010_INT_PENDING;
825}
831826
827
828
832829/****************************************************************************
833830 *  Issue an interrupt if necessary
834831 ****************************************************************************/
832
835833static int Ext_IRQ(tms32010_state *cpustate)
836834{
837835   if (INTM == 0)
r8581r8582
847845}
848846
849847
850
851848/****************************************************************************
852849 *  Execute IPeriod. Return 0 if emulation should be stopped
853850 ****************************************************************************/
851
854852static CPU_EXECUTE( tms32010 )
855853{
856854   tms32010_state *cpustate = get_safe_token(device);
r8581r8582
884882
885883
886884/****************************************************************************
887 *  Set IRQ line state
885 *  TMS32010 Internal Memory Map
888886 ****************************************************************************/
889static void set_irq_line(tms32010_state *cpustate, int irqline, int state)
890{
891   /* Pending Interrupts cannot be cleared! */
892   if (state == ASSERT_LINE) cpustate->INTF |=  TMS32010_INT_PENDING;
893}
894887
895
896/****************************************************************************
897 *  Internal Memory Map
898 ****************************************************************************/
899
900888static ADDRESS_MAP_START( tms32010_ram, ADDRESS_SPACE_DATA, 16 )
901889   AM_RANGE(0x00, 0x7f) AM_RAM      /* Page 0 */
902890   AM_RANGE(0x80, 0x8f) AM_RAM      /* Page 1 */
903891ADDRESS_MAP_END
904892
905893
894/****************************************************************************
895 *  TMS32010 Reset registers to their initial values
896 ****************************************************************************/
897
898static CPU_RESET( tms32010 )
899{
900   tms32010_state *cpustate = get_safe_token(device);
901
902   cpustate->PC    = 0;
903   cpustate->ACC.d = 0;
904   cpustate->INTF  = TMS32010_INT_NONE;
905   /* Setup Status Register : 7efe */
906   CLR(cpustate, (OV_FLAG | ARP_REG | DP_REG));
907   SET(cpustate, (OVM_FLAG | INTM_FLAG));
908
909   cpustate->addr_mask = 0x0fff;
910}
911
912
906913/**************************************************************************
907 *  Generic set_info
914 *  TMS32010 set_info
908915 **************************************************************************/
909916
910917static CPU_SET_INFO( tms32010 )
r8581r8582
934941
935942
936943/**************************************************************************
937 *  Generic get_info
944 *  TMS32010 get_info
938945 **************************************************************************/
939946
940947CPU_GET_INFO( tms32010 )
r8581r8582
990997      case CPUINFO_FCT_BURN:                     info->burn = NULL;                           break;
991998      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(tms32010);   break;
992999      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;               break;
993      case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:   info->internal_map16 = ADDRESS_MAP_NAME(tms32010_ram); break;
1000      case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:   info->internal_map16 = ADDRESS_MAP_NAME(tms32010_ram);   break;
9941001
9951002      /* --- the following bits of info are returned as NULL-terminated strings --- */
9961003      case DEVINFO_STR_NAME:                     strcpy(info->s, "TMS32010");               break;
997      case DEVINFO_STR_FAMILY:               strcpy(info->s, "Texas Instruments TMS32010");   break;
998      case DEVINFO_STR_VERSION:               strcpy(info->s, "1.22");                  break;
999      case DEVINFO_STR_SOURCE_FILE:                  strcpy(info->s, __FILE__);                  break;
1000      case DEVINFO_STR_CREDITS:               strcpy(info->s, "Copyright Tony La Porta");      break;
1004      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Texas Instruments TMS32010");   break;
1005      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.30");                  break;
1006      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                  break;
1007      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright Tony La Porta");      break;
10011008
10021009      case CPUINFO_STR_FLAGS:
10031010         sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
r8581r8582
10341041   }
10351042}
10361043
1044
1045/****************************************************************************
1046 *  TMS32015 Internal Memory Map
1047 ****************************************************************************/
1048
1049static ADDRESS_MAP_START( tms32015_ram, ADDRESS_SPACE_DATA, 16 )
1050   AM_RANGE(0x00, 0x7f) AM_RAM      /* Page 0 */
1051   AM_RANGE(0x80, 0xff) AM_RAM      /* Page 1 */
1052ADDRESS_MAP_END
1053
1054
1055/**************************************************************************
1056 *  TMS32015 CPU-specific get_info
1057 **************************************************************************/
1058
1059CPU_GET_INFO( tms32015 )
1060{
1061   switch (state)
1062   {
1063      /* --- the following bits of info are returned as pointers to data or functions --- */
1064      case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:      info->internal_map16 = ADDRESS_MAP_NAME(tms32015_ram);   break;
1065
1066      /* --- the following bits of info are returned as NULL-terminated strings --- */
1067      case DEVINFO_STR_NAME:                     strcpy(info->s, "TMS32015");   break;
1068
1069      default:                              CPU_GET_INFO_CALL(tms32010);   break;
1070   }
1071}
1072
1073
1074
1075/****************************************************************************
1076 *  TMS32016 Reset registers to their initial values
1077 ****************************************************************************/
1078
1079static CPU_RESET( tms32016 )
1080{
1081   tms32010_state *cpustate = get_safe_token(device);
1082
1083   CPU_RESET_CALL(tms32010);
1084   cpustate->addr_mask = 0xffff;
1085}
1086
1087
1088/**************************************************************************
1089 *  TMS32016 CPU-specific get_info
1090 **************************************************************************/
1091
1092CPU_GET_INFO( tms32016 )
1093{
1094   switch (state)
1095   {
1096      /* --- the following bits of info are returned as pointers to data or functions --- */
1097      case CPUINFO_FCT_RESET:                     info->reset = CPU_RESET_NAME(tms32016);      break;
1098      case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:      info->internal_map16 = ADDRESS_MAP_NAME(tms32015_ram);   break;
1099
1100      /* --- the following bits of info are returned as NULL-terminated strings --- */
1101      case DEVINFO_STR_NAME:                     strcpy(info->s, "TMS32016");   break;
1102
1103      default:                              CPU_GET_INFO_CALL(tms32010);   break;
1104   }
1105}
1106
1107
1108
10371109DEFINE_LEGACY_CPU_DEVICE(TMS32010, tms32010);
1110DEFINE_LEGACY_CPU_DEVICE(TMS32015, tms32015);
1111DEFINE_LEGACY_CPU_DEVICE(TMS32016, tms32016);
src/emu/cpu/sh2/sh2comn.h
r8581r8582
128128   int      frt_input;
129129   int    internal_irq_level;
130130   int    internal_irq_vector;
131   int            icount;
131132
132133   emu_timer *timer;
133134   emu_timer *dma_timer[2];
r8581r8582
144145   drcfe_state *      drcfe;               /* pointer to the DRC front-end state */
145146   UINT32            drcoptions;         /* configurable DRC options */
146147
147   int            icount;
148
149148   /* internal stuff */
150149   UINT8            cache_dirty;             /* true if we need to flush the cache */
151150
src/emu/cpu/sh2/sh2.c
r8581r8582
115115
116116#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
117117
118static int sh2_icount;
119sh2_state *sh2;
118INLINE sh2_state *get_safe_token(running_device *device)
119{
120   assert(device != NULL);
121   assert(device->token != NULL);
122   assert(device->type() == CPU);
123   assert(cpu_get_type(device) == CPU_SH1 ||
124         cpu_get_type(device) == CPU_SH2);
125   return (sh2_state *)downcast<legacy_cpu_device *>(device)->token();
126}
120127
121INLINE UINT8 RB(offs_t A)
128INLINE UINT8 RB(sh2_state *sh2, offs_t A)
122129{
123130   if (A >= 0xe0000000)
124131      return sh2_internal_r(sh2->internal, (A & 0x1fc)>>2, 0xff << (((~A) & 3)*8)) >> (((~A) & 3)*8);
r8581r8582
132139   return memory_read_byte_32be(sh2->program, A & AM);
133140}
134141
135INLINE UINT16 RW(offs_t A)
142INLINE UINT16 RW(sh2_state *sh2, offs_t A)
136143{
137144   if (A >= 0xe0000000)
138145      return sh2_internal_r(sh2->internal, (A & 0x1fc)>>2, 0xffff << (((~A) & 2)*8)) >> (((~A) & 2)*8);
r8581r8582
146153   return memory_read_word_32be(sh2->program, A & AM);
147154}
148155
149INLINE UINT32 RL(offs_t A)
156INLINE UINT32 RL(sh2_state *sh2, offs_t A)
150157{
151158   if (A >= 0xe0000000)
152159      return sh2_internal_r(sh2->internal, (A & 0x1fc)>>2, 0xffffffff);
r8581r8582
160167  return memory_read_dword_32be(sh2->program, A & AM);
161168}
162169
163INLINE void WB(offs_t A, UINT8 V)
170INLINE void WB(sh2_state *sh2, offs_t A, UINT8 V)
164171{
165172
166173   if (A >= 0xe0000000)
r8581r8582
181188   memory_write_byte_32be(sh2->program, A & AM,V);
182189}
183190
184INLINE void WW(offs_t A, UINT16 V)
191INLINE void WW(sh2_state *sh2, offs_t A, UINT16 V)
185192{
186193   if (A >= 0xe0000000)
187194   {
r8581r8582
201208   memory_write_word_32be(sh2->program, A & AM,V);
202209}
203210
204INLINE void WL(offs_t A, UINT32 V)
211INLINE void WL(sh2_state *sh2, offs_t A, UINT32 V)
205212{
206213   if (A >= 0xe0000000)
207214   {
r8581r8582
225232 *  0011 nnnn mmmm 1100  1       -
226233 *  ADD     Rm,Rn
227234 */
228INLINE void ADD(UINT32 m, UINT32 n)
235INLINE void ADD(sh2_state *sh2, UINT32 m, UINT32 n)
229236{
230237   sh2->r[n] += sh2->r[m];
231238}
r8581r8582
234241 *  0111 nnnn iiii iiii  1       -
235242 *  ADD     #imm,Rn
236243 */
237INLINE void ADDI(UINT32 i, UINT32 n)
244INLINE void ADDI(sh2_state *sh2, UINT32 i, UINT32 n)
238245{
239246   sh2->r[n] += (INT32)(INT16)(INT8)i;
240247}
r8581r8582
243250 *  0011 nnnn mmmm 1110  1       carry
244251 *  ADDC    Rm,Rn
245252 */
246INLINE void ADDC(UINT32 m, UINT32 n)
253INLINE void ADDC(sh2_state *sh2, UINT32 m, UINT32 n)
247254{
248255   UINT32 tmp0, tmp1;
249256
r8581r8582
262269 *  0011 nnnn mmmm 1111  1       overflow
263270 *  ADDV    Rm,Rn
264271 */
265INLINE void ADDV(UINT32 m, UINT32 n)
272INLINE void ADDV(sh2_state *sh2, UINT32 m, UINT32 n)
266273{
267274   INT32 dest, src, ans;
268275
r8581r8582
296303 *  0010 nnnn mmmm 1001  1       -
297304 *  AND     Rm,Rn
298305 */
299INLINE void AND(UINT32 m, UINT32 n)
306INLINE void AND(sh2_state *sh2, UINT32 m, UINT32 n)
300307{
301308   sh2->r[n] &= sh2->r[m];
302309}
r8581r8582
306313 *  1100 1001 iiii iiii  1       -
307314 *  AND     #imm,R0
308315 */
309INLINE void ANDI(UINT32 i)
316INLINE void ANDI(sh2_state *sh2, UINT32 i)
310317{
311318   sh2->r[0] &= i;
312319}
r8581r8582
315322 *  1100 1101 iiii iiii  1       -
316323 *  AND.B   #imm,@(R0,GBR)
317324 */
318INLINE void ANDM(UINT32 i)
325INLINE void ANDM(sh2_state *sh2, UINT32 i)
319326{
320327   UINT32 temp;
321328
322329   sh2->ea = sh2->gbr + sh2->r[0];
323   temp = i & RB( sh2->ea );
324   WB( sh2->ea, temp );
325   sh2_icount -= 2;
330   temp = i & RB( sh2, sh2->ea );
331   WB( sh2, sh2->ea, temp );
332   sh2->icount -= 2;
326333}
327334
328335/*  code                 cycles  t-bit
329336 *  1000 1011 dddd dddd  3/1     -
330337 *  BF      disp8
331338 */
332INLINE void BF(UINT32 d)
339INLINE void BF(sh2_state *sh2, UINT32 d)
333340{
334341   if ((sh2->sr & T) == 0)
335342   {
336343      INT32 disp = ((INT32)d << 24) >> 24;
337344      sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;
338      sh2_icount -= 2;
345      sh2->icount -= 2;
339346   }
340347}
341348
r8581r8582
343350 *  1000 1111 dddd dddd  3/1     -
344351 *  BFS     disp8
345352 */
346INLINE void BFS(UINT32 d)
353INLINE void BFS(sh2_state *sh2, UINT32 d)
347354{
348355   if ((sh2->sr & T) == 0)
349356   {
350357      INT32 disp = ((INT32)d << 24) >> 24;
351358      sh2->delay = sh2->pc;
352359      sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;
353      sh2_icount--;
360      sh2->icount--;
354361   }
355362}
356363
r8581r8582
358365 *  1010 dddd dddd dddd  2       -
359366 *  BRA     disp12
360367 */
361INLINE void BRA(UINT32 d)
368INLINE void BRA(sh2_state *sh2, UINT32 d)
362369{
363370   INT32 disp = ((INT32)d << 20) >> 20;
364371
365372#if BUSY_LOOP_HACKS
366373   if (disp == -2)
367374   {
368      UINT32 next_opcode = RW(sh2->ppc & AM);
375      UINT32 next_opcode = RW( sh2, sh2->ppc & AM );
369376      /* BRA  $
370377         * NOP
371378         */
372379      if (next_opcode == 0x0009)
373         sh2_icount %= 3;   /* cycles for BRA $ and NOP taken (3) */
380         sh2->icount %= 3;   /* cycles for BRA $ and NOP taken (3) */
374381   }
375382#endif
376383   sh2->delay = sh2->pc;
377384   sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;
378   sh2_icount--;
385   sh2->icount--;
379386}
380387
381388/*  code                 cycles  t-bit
382389 *  0000 mmmm 0010 0011  2       -
383390 *  BRAF    Rm
384391 */
385INLINE void BRAF(UINT32 m)
392INLINE void BRAF(sh2_state *sh2, UINT32 m)
386393{
387394   sh2->delay = sh2->pc;
388395   sh2->pc += sh2->r[m] + 2;
389   sh2_icount--;
396   sh2->icount--;
390397}
391398
392399/*  code                 cycles  t-bit
393400 *  1011 dddd dddd dddd  2       -
394401 *  BSR     disp12
395402 */
396INLINE void BSR(UINT32 d)
403INLINE void BSR(sh2_state *sh2, UINT32 d)
397404{
398405   INT32 disp = ((INT32)d << 20) >> 20;
399406
400407   sh2->pr = sh2->pc + 2;
401408   sh2->delay = sh2->pc;
402409   sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;
403   sh2_icount--;
410   sh2->icount--;
404411}
405412
406413/*  code                 cycles  t-bit
407414 *  0000 mmmm 0000 0011  2       -
408415 *  BSRF    Rm
409416 */
410INLINE void BSRF(UINT32 m)
417INLINE void BSRF(sh2_state *sh2, UINT32 m)
411418{
412419   sh2->pr = sh2->pc + 2;
413420   sh2->delay = sh2->pc;
414421   sh2->pc += sh2->r[m] + 2;
415   sh2_icount--;
422   sh2->icount--;
416423}
417424
418425/*  code                 cycles  t-bit
419426 *  1000 1001 dddd dddd  3/1     -
420427 *  BT      disp8
421428 */
422INLINE void BT(UINT32 d)
429INLINE void BT(sh2_state *sh2, UINT32 d)
423430{
424431   if ((sh2->sr & T) != 0)
425432   {
426433      INT32 disp = ((INT32)d << 24) >> 24;
427434      sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;
428      sh2_icount -= 2;
435      sh2->icount -= 2;
429436   }
430437}
431438
r8581r8582
433440 *  1000 1101 dddd dddd  2/1     -
434441 *  BTS     disp8
435442 */
436INLINE void BTS(UINT32 d)
443INLINE void BTS(sh2_state *sh2, UINT32 d)
437444{
438445   if ((sh2->sr & T) != 0)
439446   {
440447      INT32 disp = ((INT32)d << 24) >> 24;
441448      sh2->delay = sh2->pc;
442449      sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;
443      sh2_icount--;
450      sh2->icount--;
444451   }
445452}
446453
r8581r8582
448455 *  0000 0000 0010 1000  1       -
449456 *  CLRMAC
450457 */
451INLINE void CLRMAC(void)
458INLINE void CLRMAC(sh2_state *sh2)
452459{
453460   sh2->mach = 0;
454461   sh2->macl = 0;
r8581r8582
458465 *  0000 0000 0000 1000  1       -
459466 *  CLRT
460467 */
461INLINE void CLRT(void)
468INLINE void CLRT(sh2_state *sh2)
462469{
463470   sh2->sr &= ~T;
464471}
r8581r8582
467474 *  0011 nnnn mmmm 0000  1       comparison result
468475 *  CMP_EQ  Rm,Rn
469476 */
470INLINE void CMPEQ(UINT32 m, UINT32 n)
477INLINE void CMPEQ(sh2_state *sh2, UINT32 m, UINT32 n)
471478{
472479   if (sh2->r[n] == sh2->r[m])
473480      sh2->sr |= T;
r8581r8582
479486 *  0011 nnnn mmmm 0011  1       comparison result
480487 *  CMP_GE  Rm,Rn
481488 */
482INLINE void CMPGE(UINT32 m, UINT32 n)
489INLINE void CMPGE(sh2_state *sh2, UINT32 m, UINT32 n)
483490{
484491   if ((INT32) sh2->r[n] >= (INT32) sh2->r[m])
485492      sh2->sr |= T;
r8581r8582
491498 *  0011 nnnn mmmm 0111  1       comparison result
492499 *  CMP_GT  Rm,Rn
493500 */
494INLINE void CMPGT(UINT32 m, UINT32 n)
501INLINE void CMPGT(sh2_state *sh2, UINT32 m, UINT32 n)
495502{
496503   if ((INT32) sh2->r[n] > (INT32) sh2->r[m])
497504      sh2->sr |= T;
r8581r8582
503510 *  0011 nnnn mmmm 0110  1       comparison result
504511 *  CMP_HI  Rm,Rn
505512 */
506INLINE void CMPHI(UINT32 m, UINT32 n)
513INLINE void CMPHI(sh2_state *sh2, UINT32 m, UINT32 n)
507514{
508515   if ((UINT32) sh2->r[n] > (UINT32) sh2->r[m])
509516      sh2->sr |= T;
r8581r8582
515522 *  0011 nnnn mmmm 0010  1       comparison result
516523 *  CMP_HS  Rm,Rn
517524 */
518INLINE void CMPHS(UINT32 m, UINT32 n)
525INLINE void CMPHS(sh2_state *sh2, UINT32 m, UINT32 n)
519526{
520527   if ((UINT32) sh2->r[n] >= (UINT32) sh2->r[m])
521528      sh2->sr |= T;
r8581r8582
528535 *  0100 nnnn 0001 0101  1       comparison result
529536 *  CMP_PL  Rn
530537 */
531INLINE void CMPPL(UINT32 n)
538INLINE void CMPPL(sh2_state *sh2, UINT32 n)
532539{
533540   if ((INT32) sh2->r[n] > 0)
534541      sh2->sr |= T;
r8581r8582
540547 *  0100 nnnn 0001 0001  1       comparison result
541548 *  CMP_PZ  Rn
542549 */
543INLINE void CMPPZ(UINT32 n)
550INLINE void CMPPZ(sh2_state *sh2, UINT32 n)
544551{
545552   if ((INT32) sh2->r[n] >= 0)
546553      sh2->sr |= T;
r8581r8582
552559 *  0010 nnnn mmmm 1100  1       comparison result
553560 * CMP_STR  Rm,Rn
554561 */
555INLINE void CMPSTR(UINT32 m, UINT32 n)
562INLINE void CMPSTR(sh2_state *sh2, UINT32 m, UINT32 n)
556563 {
557564  UINT32 temp;
558565  INT32 HH, HL, LH, LL;
r8581r8582
572579 *  1000 1000 iiii iiii  1       comparison result
573580 *  CMP/EQ #imm,R0
574581 */
575INLINE void CMPIM(UINT32 i)
582INLINE void CMPIM(sh2_state *sh2, UINT32 i)
576583{
577584   UINT32 imm = (UINT32)(INT32)(INT16)(INT8)i;
578585
r8581r8582
586593 *  0010 nnnn mmmm 0111  1       calculation result
587594 *  DIV0S   Rm,Rn
588595 */
589INLINE void DIV0S(UINT32 m, UINT32 n)
596INLINE void DIV0S(sh2_state *sh2, UINT32 m, UINT32 n)
590597{
591598   if ((sh2->r[n] & 0x80000000) == 0)
592599      sh2->sr &= ~Q;
r8581r8582
606613 *  0000 0000 0001 1001  1       0
607614 *  DIV0U
608615 */
609INLINE void DIV0U(void)
616INLINE void DIV0U(sh2_state *sh2)
610617{
611618   sh2->sr &= ~(M | Q | T);
612619}
r8581r8582
615622 *  0011 nnnn mmmm 0100  1       calculation result
616623 *  DIV1 Rm,Rn
617624 */
618INLINE void DIV1(UINT32 m, UINT32 n)
625INLINE void DIV1(sh2_state *sh2, UINT32 m, UINT32 n)
619626{
620627   UINT32 tmp0;
621628   UINT32 old_q;
r8581r8582
707714}
708715
709716/*  DMULS.L Rm,Rn */
710INLINE void DMULS(UINT32 m, UINT32 n)
717INLINE void DMULS(sh2_state *sh2, UINT32 m, UINT32 n)
711718{
712719   UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
713720   UINT32 temp0, temp1, temp2, temp3;
r8581r8582
752759   }
753760   sh2->mach = Res2;
754761   sh2->macl = Res0;
755   sh2_icount--;
762   sh2->icount--;
756763}
757764
758765/*  DMULU.L Rm,Rn */
759INLINE void DMULU(UINT32 m, UINT32 n)
766INLINE void DMULU(sh2_state *sh2, UINT32 m, UINT32 n)
760767{
761768   UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
762769   UINT32 temp0, temp1, temp2, temp3;
r8581r8582
780787   Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3;
781788   sh2->mach = Res2;
782789   sh2->macl = Res0;
783   sh2_icount--;
790   sh2->icount--;
784791}
785792
786793/*  DT      Rn */
787INLINE void DT(UINT32 n)
794INLINE void DT(sh2_state *sh2, UINT32 n)
788795{
789796   sh2->r[n]--;
790797   if (sh2->r[n] == 0)
r8581r8582
793800      sh2->sr &= ~T;
794801#if BUSY_LOOP_HACKS
795802   {
796      UINT32 next_opcode = RW(sh2->ppc & AM);
803      UINT32 next_opcode = RW( sh2, sh2->ppc & AM );
797804      /* DT   Rn
798805         * BF   $-2
799806         */
800807      if (next_opcode == 0x8bfd)
801808      {
802         while (sh2->r[n] > 1 && sh2_icount > 4)
809         while (sh2->r[n] > 1 && sh2->icount > 4)
803810         {
804811            sh2->r[n]--;
805            sh2_icount -= 4;   /* cycles for DT (1) and BF taken (3) */
812            sh2->icount -= 4;   /* cycles for DT (1) and BF taken (3) */
806813         }
807814      }
808815   }
r8581r8582
810817}
811818
812819/*  EXTS.B  Rm,Rn */
813INLINE void EXTSB(UINT32 m, UINT32 n)
820INLINE void EXTSB(sh2_state *sh2, UINT32 m, UINT32 n)
814821{
815822   sh2->r[n] = ((INT32)sh2->r[m] << 24) >> 24;
816823}
817824
818825/*  EXTS.W  Rm,Rn */
819INLINE void EXTSW(UINT32 m, UINT32 n)
826INLINE void EXTSW(sh2_state *sh2, UINT32 m, UINT32 n)
820827{
821828   sh2->r[n] = ((INT32)sh2->r[m] << 16) >> 16;
822829}
823830
824831/*  EXTU.B  Rm,Rn */
825INLINE void EXTUB(UINT32 m, UINT32 n)
832INLINE void EXTUB(sh2_state *sh2, UINT32 m, UINT32 n)
826833{
827834   sh2->r[n] = sh2->r[m] & 0x000000ff;
828835}
829836
830837/*  EXTU.W  Rm,Rn */
831INLINE void EXTUW(UINT32 m, UINT32 n)
838INLINE void EXTUW(sh2_state *sh2, UINT32 m, UINT32 n)
832839{
833840   sh2->r[n] = sh2->r[m] & 0x0000ffff;
834841}
835842
836843/*  JMP     @Rm */
837INLINE void JMP(UINT32 m)
844INLINE void JMP(sh2_state *sh2, UINT32 m)
838845{
839846   sh2->delay = sh2->pc;
840847   sh2->pc = sh2->ea = sh2->r[m];
841848}
842849
843850/*  JSR     @Rm */
844INLINE void JSR(UINT32 m)
851INLINE void JSR(sh2_state *sh2, UINT32 m)
845852{
846853   sh2->delay = sh2->pc;
847854   sh2->pr = sh2->pc + 2;
848855   sh2->pc = sh2->ea = sh2->r[m];
849   sh2_icount--;
856   sh2->icount--;
850857}
851858
852859
853860/*  LDC     Rm,SR */
854INLINE void LDCSR(UINT32 m)
861INLINE void LDCSR(sh2_state *sh2, UINT32 m)
855862{
856863   sh2->sr = sh2->r[m] & FLAGS;
857864   sh2->test_irq = 1;
858865}
859866
860867/*  LDC     Rm,GBR */
861INLINE void LDCGBR(UINT32 m)
868INLINE void LDCGBR(sh2_state *sh2, UINT32 m)
862869{
863870   sh2->gbr = sh2->r[m];
864871}
865872
866873/*  LDC     Rm,VBR */
867INLINE void LDCVBR(UINT32 m)
874INLINE void LDCVBR(sh2_state *sh2, UINT32 m)
868875{
869876   sh2->vbr = sh2->r[m];
870877}
871878
872879/*  LDC.L   @Rm+,SR */
873INLINE void LDCMSR(UINT32 m)
880INLINE void LDCMSR(sh2_state *sh2, UINT32 m)
874881{
875882   sh2->ea = sh2->r[m];
876   sh2->sr = RL( sh2->ea ) & FLAGS;
883   sh2->sr = RL( sh2, sh2->ea ) & FLAGS;
877884   sh2->r[m] += 4;
878   sh2_icount -= 2;
885   sh2->icount -= 2;
879886   sh2->test_irq = 1;
880887}
881888
882889/*  LDC.L   @Rm+,GBR */
883INLINE void LDCMGBR(UINT32 m)
890INLINE void LDCMGBR(sh2_state *sh2, UINT32 m)
884891{
885892   sh2->ea = sh2->r[m];
886   sh2->gbr = RL( sh2->ea );
893   sh2->gbr = RL( sh2, sh2->ea );
887894   sh2->r[m] += 4;
888   sh2_icount -= 2;
895   sh2->icount -= 2;
889896}
890897
891898/*  LDC.L   @Rm+,VBR */
892INLINE void LDCMVBR(UINT32 m)
899INLINE void LDCMVBR(sh2_state *sh2, UINT32 m)
893900{
894901   sh2->ea = sh2->r[m];
895   sh2->vbr = RL( sh2->ea );
902   sh2->vbr = RL( sh2, sh2->ea );
896903   sh2->r[m] += 4;
897   sh2_icount -= 2;
904   sh2->icount -= 2;
898905}
899906
900907/*  LDS     Rm,MACH */
901INLINE void LDSMACH(UINT32 m)
908INLINE void LDSMACH(sh2_state *sh2, UINT32 m)
902909{
903910   sh2->mach = sh2->r[m];
904911}
905912
906913/*  LDS     Rm,MACL */
907INLINE void LDSMACL(UINT32 m)
914INLINE void LDSMACL(sh2_state *sh2, UINT32 m)
908915{
909916   sh2->macl = sh2->r[m];
910917}
911918
912919/*  LDS     Rm,PR */
913INLINE void LDSPR(UINT32 m)
920INLINE void LDSPR(sh2_state *sh2, UINT32 m)
914921{
915922   sh2->pr = sh2->r[m];
916923}
917924
918925/*  LDS.L   @Rm+,MACH */
919INLINE void LDSMMACH(UINT32 m)
926INLINE void LDSMMACH(sh2_state *sh2, UINT32 m)
920927{
921928   sh2->ea = sh2->r[m];
922   sh2->mach = RL( sh2->ea );
929   sh2->mach = RL( sh2, sh2->ea );
923930   sh2->r[m] += 4;
924931}
925932
926933/*  LDS.L   @Rm+,MACL */
927INLINE void LDSMMACL(UINT32 m)
934INLINE void LDSMMACL(sh2_state *sh2, UINT32 m)
928935{
929936   sh2->ea = sh2->r[m];
930   sh2->macl = RL( sh2->ea );
937   sh2->macl = RL( sh2, sh2->ea );
931938   sh2->r[m] += 4;
932939}
933940
934941/*  LDS.L   @Rm+,PR */
935INLINE void LDSMPR(UINT32 m)
942INLINE void LDSMPR(sh2_state *sh2, UINT32 m)
936943{
937944   sh2->ea = sh2->r[m];
938   sh2->pr = RL( sh2->ea );
945   sh2->pr = RL( sh2, sh2->ea );
939946   sh2->r[m] += 4;
940947}
941948
942949/*  MAC.L   @Rm+,@Rn+ */
943INLINE void MAC_L(UINT32 m, UINT32 n)
950INLINE void MAC_L(sh2_state *sh2, UINT32 m, UINT32 n)
944951{
945952   UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
946953   UINT32 temp0, temp1, temp2, temp3;
947954   INT32 tempm, tempn, fnLmL;
948955
949   tempn = (INT32) RL( sh2->r[n] );
956   tempn = (INT32) RL( sh2, sh2->r[n] );
950957   sh2->r[n] += 4;
951   tempm = (INT32) RL( sh2->r[m] );
958   tempm = (INT32) RL( sh2, sh2->r[m] );
952959   sh2->r[m] += 4;
953960   if ((INT32) (tempn ^ tempm) < 0)
954961      fnLmL = -1;
r8581r8582
10131020      sh2->mach = Res2;
10141021      sh2->macl = Res0;
10151022   }
1016   sh2_icount -= 2;
1023   sh2->icount -= 2;
10171024}
10181025
10191026/*  MAC.W   @Rm+,@Rn+ */
1020INLINE void MAC_W(UINT32 m, UINT32 n)
1027INLINE void MAC_W(sh2_state *sh2, UINT32 m, UINT32 n)
10211028{
10221029   INT32 tempm, tempn, dest, src, ans;
10231030   UINT32 templ;
10241031
1025   tempn = (INT32) RW( sh2->r[n] );
1032   tempn = (INT32) RW( sh2, sh2->r[n] );
10261033   sh2->r[n] += 2;
1027   tempm = (INT32) RW( sh2->r[m] );
1034   tempm = (INT32) RW( sh2, sh2->r[m] );
10281035   sh2->r[m] += 2;
10291036   templ = sh2->macl;
10301037   tempm = ((INT32) (short) tempn * (INT32) (short) tempm);
r8581r8582
10651072      if (templ > sh2->macl)
10661073         sh2->mach += 1;
10671074   }
1068   sh2_icount -= 2;
1075   sh2->icount -= 2;
10691076}
10701077
10711078/*  MOV     Rm,Rn */
1072INLINE void MOV(UINT32 m, UINT32 n)
1079INLINE void MOV(sh2_state *sh2, UINT32 m, UINT32 n)
10731080{
10741081   sh2->r[n] = sh2->r[m];
10751082}
10761083
10771084/*  MOV.B   Rm,@Rn */
1078INLINE void MOVBS(UINT32 m, UINT32 n)
1085INLINE void MOVBS(sh2_state *sh2, UINT32 m, UINT32 n)
10791086{
10801087   sh2->ea = sh2->r[n];
1081   WB( sh2->ea, sh2->r[m] & 0x000000ff);
1088   WB( sh2, sh2->ea, sh2->r[m] & 0x000000ff);
10821089}
10831090
10841091/*  MOV.W   Rm,@Rn */
1085INLINE void MOVWS(UINT32 m, UINT32 n)
1092INLINE void MOVWS(sh2_state *sh2, UINT32 m, UINT32 n)
10861093{
10871094   sh2->ea = sh2->r[n];
1088   WW( sh2->ea, sh2->r[m] & 0x0000ffff);
1095   WW( sh2, sh2->ea, sh2->r[m] & 0x0000ffff);
10891096}
10901097
10911098/*  MOV.L   Rm,@Rn */
1092INLINE void MOVLS(UINT32 m, UINT32 n)
1099INLINE void MOVLS(sh2_state *sh2, UINT32 m, UINT32 n)
10931100{
10941101   sh2->ea = sh2->r[n];
1095   WL( sh2->ea, sh2->r[m] );
1102   WL( sh2, sh2->ea, sh2->r[m] );
10961103}
10971104
10981105/*  MOV.B   @Rm,Rn */
1099INLINE void MOVBL(UINT32 m, UINT32 n)
1106INLINE void MOVBL(sh2_state *sh2, UINT32 m, UINT32 n)
11001107{
11011108   sh2->ea = sh2->r[m];
1102   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea );
1109   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2, sh2->ea );
11031110}
11041111
11051112/*  MOV.W   @Rm,Rn */
1106INLINE void MOVWL(UINT32 m, UINT32 n)
1113INLINE void MOVWL(sh2_state *sh2, UINT32 m, UINT32 n)
11071114{
11081115   sh2->ea = sh2->r[m];
1109   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->ea );
1116   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2, sh2->ea );
11101117}
11111118
11121119/*  MOV.L   @Rm,Rn */
1113INLINE void MOVLL(UINT32 m, UINT32 n)
1120INLINE void MOVLL(sh2_state *sh2, UINT32 m, UINT32 n)
11141121{
11151122   sh2->ea = sh2->r[m];
1116   sh2->r[n] = RL( sh2->ea );
1123   sh2->r[n] = RL( sh2, sh2->ea );
11171124}
11181125
11191126/*  MOV.B   Rm,@-Rn */
1120INLINE void MOVBM(UINT32 m, UINT32 n)
1127INLINE void MOVBM(sh2_state *sh2, UINT32 m, UINT32 n)
11211128{
11221129   /* SMG : bug fix, was reading sh2->r[n] */
11231130   UINT32 data = sh2->r[m] & 0x000000ff;
11241131
11251132   sh2->r[n] -= 1;
1126   WB( sh2->r[n], data );
1133   WB( sh2, sh2->r[n], data );
11271134}
11281135
11291136/*  MOV.W   Rm,@-Rn */
1130INLINE void MOVWM(UINT32 m, UINT32 n)
1137INLINE void MOVWM(sh2_state *sh2, UINT32 m, UINT32 n)
11311138{
11321139   UINT32 data = sh2->r[m] & 0x0000ffff;
11331140
11341141   sh2->r[n] -= 2;
1135   WW( sh2->r[n], data );
1142   WW( sh2, sh2->r[n], data );
11361143}
11371144
11381145/*  MOV.L   Rm,@-Rn */
1139INLINE void MOVLM(UINT32 m, UINT32 n)
1146INLINE void MOVLM(sh2_state *sh2, UINT32 m, UINT32 n)
11401147{
11411148   UINT32 data = sh2->r[m];
11421149
11431150   sh2->r[n] -= 4;
1144   WL( sh2->r[n], data );
1151   WL( sh2, sh2->r[n], data );
11451152}
11461153
11471154/*  MOV.B   @Rm+,Rn */
1148INLINE void MOVBP(UINT32 m, UINT32 n)
1155INLINE void MOVBP(sh2_state *sh2, UINT32 m, UINT32 n)
11491156{
1150   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->r[m] );
1157   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2, sh2->r[m] );
11511158   if (n != m)
11521159      sh2->r[m] += 1;
11531160}
11541161
11551162/*  MOV.W   @Rm+,Rn */
1156INLINE void MOVWP(UINT32 m, UINT32 n)
1163INLINE void MOVWP(sh2_state *sh2, UINT32 m, UINT32 n)
11571164{
1158   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->r[m] );
1165   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2, sh2->r[m] );
11591166   if (n != m)
11601167      sh2->r[m] += 2;
11611168}
11621169
11631170/*  MOV.L   @Rm+,Rn */
1164INLINE void MOVLP(UINT32 m, UINT32 n)
1171INLINE void MOVLP(sh2_state *sh2, UINT32 m, UINT32 n)
11651172{
1166   sh2->r[n] = RL( sh2->r[m] );
1173   sh2->r[n] = RL( sh2, sh2->r[m] );
11671174   if (n != m)
11681175      sh2->r[m] += 4;
11691176}
11701177
11711178/*  MOV.B   Rm,@(R0,Rn) */
1172INLINE void MOVBS0(UINT32 m, UINT32 n)
1179INLINE void MOVBS0(sh2_state *sh2, UINT32 m, UINT32 n)
11731180{
11741181   sh2->ea = sh2->r[n] + sh2->r[0];
1175   WB( sh2->ea, sh2->r[m] & 0x000000ff );
1182   WB( sh2, sh2->ea, sh2->r[m] & 0x000000ff );
11761183}
11771184
11781185/*  MOV.W   Rm,@(R0,Rn) */
1179INLINE void MOVWS0(UINT32 m, UINT32 n)
1186INLINE void MOVWS0(sh2_state *sh2, UINT32 m, UINT32 n)
11801187{
11811188   sh2->ea = sh2->r[n] + sh2->r[0];
1182   WW( sh2->ea, sh2->r[m] & 0x0000ffff );
1189   WW( sh2, sh2->ea, sh2->r[m] & 0x0000ffff );
11831190}
11841191
11851192/*  MOV.L   Rm,@(R0,Rn) */
1186INLINE void MOVLS0(UINT32 m, UINT32 n)
1193INLINE void MOVLS0(sh2_state *sh2, UINT32 m, UINT32 n)
11871194{
11881195   sh2->ea = sh2->r[n] + sh2->r[0];
1189   WL( sh2->ea, sh2->r[m] );
1196   WL( sh2, sh2->ea, sh2->r[m] );
11901197}
11911198
11921199/*  MOV.B   @(R0,Rm),Rn */
1193INLINE void MOVBL0(UINT32 m, UINT32 n)
1200INLINE void MOVBL0(sh2_state *sh2, UINT32 m, UINT32 n)
11941201{
11951202   sh2->ea = sh2->r[m] + sh2->r[0];
1196   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea );
1203   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2, sh2->ea );
11971204}
11981205
11991206/*  MOV.W   @(R0,Rm),Rn */
1200INLINE void MOVWL0(UINT32 m, UINT32 n)
1207INLINE void MOVWL0(sh2_state *sh2, UINT32 m, UINT32 n)
12011208{
12021209   sh2->ea = sh2->r[m] + sh2->r[0];
1203   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->ea );
1210   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2, sh2->ea );
12041211}
12051212
12061213/*  MOV.L   @(R0,Rm),Rn */
1207INLINE void MOVLL0(UINT32 m, UINT32 n)
1214INLINE void MOVLL0(sh2_state *sh2, UINT32 m, UINT32 n)
12081215{
12091216   sh2->ea = sh2->r[m] + sh2->r[0];
1210   sh2->r[n] = RL( sh2->ea );
1217   sh2->r[n] = RL( sh2, sh2->ea );
12111218}
12121219
12131220/*  MOV     #imm,Rn */
1214INLINE void MOVI(UINT32 i, UINT32 n)
1221INLINE void MOVI(sh2_state *sh2, UINT32 i, UINT32 n)
12151222{
12161223   sh2->r[n] = (UINT32)(INT32)(INT16)(INT8) i;
12171224}
12181225
12191226/*  MOV.W   @(disp8,PC),Rn */
1220INLINE void MOVWI(UINT32 d, UINT32 n)
1227INLINE void MOVWI(sh2_state *sh2, UINT32 d, UINT32 n)
12211228{
12221229   UINT32 disp = d & 0xff;
12231230   sh2->ea = sh2->pc + disp * 2 + 2;
1224   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2->ea );
1231   sh2->r[n] = (UINT32)(INT32)(INT16) RW( sh2, sh2->ea );
12251232}
12261233
12271234/*  MOV.L   @(disp8,PC),Rn */
1228INLINE void MOVLI(UINT32 d, UINT32 n)
1235INLINE void MOVLI(sh2_state *sh2, UINT32 d, UINT32 n)
12291236{
12301237   UINT32 disp = d & 0xff;
12311238   sh2->ea = ((sh2->pc + 2) & ~3) + disp * 4;
1232   sh2->r[n] = RL( sh2->ea );
1239   sh2->r[n] = RL( sh2, sh2->ea );
12331240}
12341241
12351242/*  MOV.B   @(disp8,GBR),R0 */
1236INLINE void MOVBLG(UINT32 d)
1243INLINE void MOVBLG(sh2_state *sh2, UINT32 d)
12371244{
12381245   UINT32 disp = d & 0xff;
12391246   sh2->ea = sh2->gbr + disp;
1240   sh2->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea );
1247   sh2->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2, sh2->ea );
12411248}
12421249
12431250/*  MOV.W   @(disp8,GBR),R0 */
1244INLINE void MOVWLG(UINT32 d)
1251INLINE void MOVWLG(sh2_state *sh2, UINT32 d)
12451252{
12461253   UINT32 disp = d & 0xff;
12471254   sh2->ea = sh2->gbr + disp * 2;
1248   sh2->r[0] = (INT32)(INT16) RW( sh2->ea );
1255   sh2->r[0] = (INT32)(INT16) RW( sh2, sh2->ea );
12491256}
12501257
12511258/*  MOV.L   @(disp8,GBR),R0 */
1252INLINE void MOVLLG(UINT32 d)
1259INLINE void MOVLLG(sh2_state *sh2, UINT32 d)
12531260{
12541261   UINT32 disp = d & 0xff;
12551262   sh2->ea = sh2->gbr + disp * 4;
1256   sh2->r[0] = RL( sh2->ea );
1263   sh2->r[0] = RL( sh2, sh2->ea );
12571264}
12581265
12591266/*  MOV.B   R0,@(disp8,GBR) */
1260INLINE void MOVBSG(UINT32 d)
1267INLINE void MOVBSG(sh2_state *sh2, UINT32 d)
12611268{
12621269   UINT32 disp = d & 0xff;
12631270   sh2->ea = sh2->gbr + disp;
1264   WB( sh2->ea, sh2->r[0] & 0x000000ff );
1271   WB( sh2, sh2->ea, sh2->r[0] & 0x000000ff );
12651272}
12661273
12671274/*  MOV.W   R0,@(disp8,GBR) */
1268INLINE void MOVWSG(UINT32 d)
1275INLINE void MOVWSG(sh2_state *sh2, UINT32 d)
12691276{
12701277   UINT32 disp = d & 0xff;
12711278   sh2->ea = sh2->gbr + disp * 2;
1272   WW( sh2->ea, sh2->r[0] & 0x0000ffff );
1279   WW( sh2, sh2->ea, sh2->r[0] & 0x0000ffff );
12731280}
12741281
12751282/*  MOV.L   R0,@(disp8,GBR) */
1276INLINE void MOVLSG(UINT32 d)
1283INLINE void MOVLSG(sh2_state *sh2, UINT32 d)
12771284{
12781285   UINT32 disp = d & 0xff;
12791286   sh2->ea = sh2->gbr + disp * 4;
1280   WL( sh2->ea, sh2->r[0] );
1287   WL( sh2, sh2->ea, sh2->r[0] );
12811288}
12821289
12831290/*  MOV.B   R0,@(disp4,Rn) */
1284INLINE void MOVBS4(UINT32 d, UINT32 n)
1291INLINE void MOVBS4(sh2_state *sh2, UINT32 d, UINT32 n)
12851292{
12861293   UINT32 disp = d & 0x0f;
12871294   sh2->ea = sh2->r[n] + disp;
1288   WB( sh2->ea, sh2->r[0] & 0x000000ff );
1295   WB( sh2, sh2->ea, sh2->r[0] & 0x000000ff );
12891296}
12901297
12911298/*  MOV.W   R0,@(disp4,Rn) */
1292INLINE void MOVWS4(UINT32 d, UINT32 n)
1299INLINE void MOVWS4(sh2_state *sh2, UINT32 d, UINT32 n)
12931300{
12941301   UINT32 disp = d & 0x0f;
12951302   sh2->ea = sh2->r[n] + disp * 2;
1296   WW( sh2->ea, sh2->r[0] & 0x0000ffff );
1303   WW( sh2, sh2->ea, sh2->r[0] & 0x0000ffff );
12971304}
12981305
12991306/* MOV.L Rm,@(disp4,Rn) */
1300INLINE void MOVLS4(UINT32 m, UINT32 d, UINT32 n)
1307INLINE void MOVLS4(sh2_state *sh2, UINT32 m, UINT32 d, UINT32 n)
13011308{
13021309   UINT32 disp = d & 0x0f;
13031310   sh2->ea = sh2->r[n] + disp * 4;
1304   WL( sh2->ea, sh2->r[m] );
1311   WL( sh2, sh2->ea, sh2->r[m] );
13051312}
13061313
13071314/*  MOV.B   @(disp4,Rm),R0 */
1308INLINE void MOVBL4(UINT32 m, UINT32 d)
1315INLINE void MOVBL4(sh2_state *sh2, UINT32 m, UINT32 d)
13091316{
13101317   UINT32 disp = d & 0x0f;
13111318   sh2->ea = sh2->r[m] + disp;
1312   sh2->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2->ea );
1319   sh2->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2, sh2->ea );
13131320}
13141321
13151322/*  MOV.W   @(disp4,Rm),R0 */
1316INLINE void MOVWL4(UINT32 m, UINT32 d)
1323INLINE void MOVWL4(sh2_state *sh2, UINT32 m, UINT32 d)
13171324{
13181325   UINT32 disp = d & 0x0f;
13191326   sh2->ea = sh2->r[m] + disp * 2;
1320   sh2->r[0] = (UINT32)(INT32)(INT16) RW( sh2->ea );
1327   sh2->r[0] = (UINT32)(INT32)(INT16) RW( sh2, sh2->ea );
13211328}
13221329
13231330/*  MOV.L   @(disp4,Rm),Rn */
1324INLINE void MOVLL4(UINT32 m, UINT32 d, UINT32 n)
1331INLINE void MOVLL4(sh2_state *sh2, UINT32 m, UINT32 d, UINT32 n)
13251332{
13261333   UINT32 disp = d & 0x0f;
13271334   sh2->ea = sh2->r[m] + disp * 4;
1328   sh2->r[n] = RL( sh2->ea );
1335   sh2->r[n] = RL( sh2, sh2->ea );
13291336}
13301337
13311338/*  MOVA    @(disp8,PC),R0 */
1332INLINE void MOVA(UINT32 d)
1339INLINE void MOVA(sh2_state *sh2, UINT32 d)
13331340{
13341341   UINT32 disp = d & 0xff;
13351342   sh2->ea = ((sh2->pc + 2) & ~3) + disp * 4;
r8581r8582
13371344}
13381345
13391346/*  MOVT    Rn */
1340INLINE void MOVT(UINT32 n)
1347INLINE void MOVT(sh2_state *sh2, UINT32 n)
13411348{
13421349   sh2->r[n] = sh2->sr & T;
13431350}
13441351
13451352/*  MUL.L   Rm,Rn */
1346INLINE void MULL(UINT32 m, UINT32 n)
1353INLINE void MULL(sh2_state *sh2, UINT32 m, UINT32 n)
13471354{
13481355   sh2->macl = sh2->r[n] * sh2->r[m];
1349   sh2_icount--;
1356   sh2->icount--;
13501357}
13511358
13521359/*  MULS    Rm,Rn */
1353INLINE void MULS(UINT32 m, UINT32 n)
1360INLINE void MULS(sh2_state *sh2, UINT32 m, UINT32 n)
13541361{
13551362   sh2->macl = (INT16) sh2->r[n] * (INT16) sh2->r[m];
13561363}
13571364
13581365/*  MULU    Rm,Rn */
1359INLINE void MULU(UINT32 m, UINT32 n)
1366INLINE void MULU(sh2_state *sh2, UINT32 m, UINT32 n)
13601367{
13611368   sh2->macl = (UINT16) sh2->r[n] * (UINT16) sh2->r[m];
13621369}
13631370
13641371/*  NEG     Rm,Rn */
1365INLINE void NEG(UINT32 m, UINT32 n)
1372INLINE void NEG(sh2_state *sh2, UINT32 m, UINT32 n)
13661373{
13671374   sh2->r[n] = 0 - sh2->r[m];
13681375}
13691376
13701377/*  NEGC    Rm,Rn */
1371INLINE void NEGC(UINT32 m, UINT32 n)
1378INLINE void NEGC(sh2_state *sh2, UINT32 m, UINT32 n)
13721379{
13731380   UINT32 temp;
13741381
r8581r8582
13861393}
13871394
13881395/*  NOT     Rm,Rn */
1389INLINE void NOT(UINT32 m, UINT32 n)
1396INLINE void NOT(sh2_state *sh2, UINT32 m, UINT32 n)
13901397{
13911398   sh2->r[n] = ~sh2->r[m];
13921399}
13931400
13941401/*  OR      Rm,Rn */
1395INLINE void OR(UINT32 m, UINT32 n)
1402INLINE void OR(sh2_state *sh2, UINT32 m, UINT32 n)
13961403{
13971404   sh2->r[n] |= sh2->r[m];
13981405}
13991406
14001407/*  OR      #imm,R0 */
1401INLINE void ORI(UINT32 i)
1408INLINE void ORI(sh2_state *sh2, UINT32 i)
14021409{
14031410   sh2->r[0] |= i;
1404   sh2_icount -= 2;
1411   sh2->icount -= 2;
14051412}
14061413
14071414/*  OR.B    #imm,@(R0,GBR) */
1408INLINE void ORM(UINT32 i)
1415INLINE void ORM(sh2_state *sh2, UINT32 i)
14091416{
14101417   UINT32 temp;
14111418
14121419   sh2->ea = sh2->gbr + sh2->r[0];
1413   temp = RB( sh2->ea );
1420   temp = RB( sh2, sh2->ea );
14141421   temp |= i;
1415   WB( sh2->ea, temp );
1422   WB( sh2, sh2->ea, temp );
14161423}
14171424
14181425/*  ROTCL   Rn */
1419INLINE void ROTCL(UINT32 n)
1426INLINE void ROTCL(sh2_state *sh2, UINT32 n)
14201427{
14211428   UINT32 temp;
14221429
r8581r8582
14261433}
14271434
14281435/*  ROTCR   Rn */
1429INLINE void ROTCR(UINT32 n)
1436INLINE void ROTCR(sh2_state *sh2, UINT32 n)
14301437{
14311438   UINT32 temp;
14321439   temp = (sh2->sr & T) << 31;
r8581r8582
14381445}
14391446
14401447/*  ROTL    Rn */
1441INLINE void ROTL(UINT32 n)
1448INLINE void ROTL(sh2_state *sh2, UINT32 n)
14421449{
14431450   sh2->sr = (sh2->sr & ~T) | ((sh2->r[n] >> 31) & T);
14441451   sh2->r[n] = (sh2->r[n] << 1) | (sh2->r[n] >> 31);
14451452}
14461453
14471454/*  ROTR    Rn */
1448INLINE void ROTR(UINT32 n)
1455INLINE void ROTR(sh2_state *sh2, UINT32 n)
14491456{
14501457   sh2->sr = (sh2->sr & ~T) | (sh2->r[n] & T);
14511458   sh2->r[n] = (sh2->r[n] >> 1) | (sh2->r[n] << 31);
14521459}
14531460
14541461/*  RTE */
1455INLINE void RTE(void)
1462INLINE void RTE(sh2_state *sh2)
14561463{
14571464   sh2->ea = sh2->r[15];
14581465   sh2->delay = sh2->pc;
1459   sh2->pc = RL( sh2->ea );
1466   sh2->pc = RL( sh2, sh2->ea );
14601467   sh2->r[15] += 4;
14611468   sh2->ea = sh2->r[15];
1462   sh2->sr = RL( sh2->ea ) & FLAGS;
1469   sh2->sr = RL( sh2, sh2->ea ) & FLAGS;
14631470   sh2->r[15] += 4;
1464   sh2_icount -= 3;
1471   sh2->icount -= 3;
14651472   sh2->test_irq = 1;
14661473}
14671474
14681475/*  RTS */
1469INLINE void RTS(void)
1476INLINE void RTS(sh2_state *sh2)
14701477{
14711478   sh2->delay = sh2->pc;
14721479   sh2->pc = sh2->ea = sh2->pr;
1473   sh2_icount--;
1480   sh2->icount--;
14741481}
14751482
14761483/*  SETT */
1477INLINE void SETT(void)
1484INLINE void SETT(sh2_state *sh2)
14781485{
14791486   sh2->sr |= T;
14801487}
14811488
14821489/*  SHAL    Rn      (same as SHLL) */
1483INLINE void SHAL(UINT32 n)
1490INLINE void SHAL(sh2_state *sh2, UINT32 n)
14841491{
14851492   sh2->sr = (sh2->sr & ~T) | ((sh2->r[n] >> 31) & T);
14861493   sh2->r[n] <<= 1;
14871494}
14881495
14891496/*  SHAR    Rn */
1490INLINE void SHAR(UINT32 n)
1497INLINE void SHAR(sh2_state *sh2, UINT32 n)
14911498{
14921499   sh2->sr = (sh2->sr & ~T) | (sh2->r[n] & T);
14931500   sh2->r[n] = (UINT32)((INT32)sh2->r[n] >> 1);
14941501}
14951502
14961503/*  SHLL    Rn      (same as SHAL) */
1497INLINE void SHLL(UINT32 n)
1504INLINE void SHLL(sh2_state *sh2, UINT32 n)
14981505{
14991506   sh2->sr = (sh2->sr & ~T) | ((sh2->r[n] >> 31) & T);
15001507   sh2->r[n] <<= 1;
15011508}
15021509
15031510/*  SHLL2   Rn */
1504INLINE void SHLL2(UINT32 n)
1511INLINE void SHLL2(sh2_state *sh2, UINT32 n)
15051512{
15061513   sh2->r[n] <<= 2;
15071514}
15081515
15091516/*  SHLL8   Rn */
1510INLINE void SHLL8(UINT32 n)
1517INLINE void SHLL8(sh2_state *sh2, UINT32 n)
15111518{
15121519   sh2->r[n] <<= 8;
15131520}
15141521
15151522/*  SHLL16  Rn */
1516INLINE void SHLL16(UINT32 n)
1523INLINE void SHLL16(sh2_state *sh2, UINT32 n)
15171524{
15181525   sh2->r[n] <<= 16;
15191526}
15201527
15211528/*  SHLR    Rn */
1522INLINE void SHLR(UINT32 n)
1529INLINE void SHLR(sh2_state *sh2, UINT32 n)
15231530{
15241531   sh2->sr = (sh2->sr & ~T) | (sh2->r[n] & T);
15251532   sh2->r[n] >>= 1;
15261533}
15271534
15281535/*  SHLR2   Rn */
1529INLINE void SHLR2(UINT32 n)
1536INLINE void SHLR2(sh2_state *sh2, UINT32 n)
15301537{
15311538   sh2->r[n] >>= 2;
15321539}
15331540
15341541/*  SHLR8   Rn */
1535INLINE void SHLR8(UINT32 n)
1542INLINE void SHLR8(sh2_state *sh2, UINT32 n)
15361543{
15371544   sh2->r[n] >>= 8;
15381545}
15391546
15401547/*  SHLR16  Rn */
1541INLINE void SHLR16(UINT32 n)
1548INLINE void SHLR16(sh2_state *sh2, UINT32 n)
15421549{
15431550   sh2->r[n] >>= 16;
15441551}
15451552
15461553/*  SLEEP */
1547INLINE void SLEEP(void)
1554INLINE void SLEEP(sh2_state *sh2)
15481555{
15491556   sh2->pc -= 2;
1550   sh2_icount -= 2;
1557   sh2->icount -= 2;
15511558   /* Wait_for_exception; */
15521559}
15531560
15541561/*  STC     SR,Rn */
1555INLINE void STCSR(UINT32 n)
1562INLINE void STCSR(sh2_state *sh2, UINT32 n)
15561563{
15571564   sh2->r[n] = sh2->sr;
15581565}
15591566
15601567/*  STC     GBR,Rn */
1561INLINE void STCGBR(UINT32 n)
1568INLINE void STCGBR(sh2_state *sh2, UINT32 n)
15621569{
15631570   sh2->r[n] = sh2->gbr;
15641571}
15651572
15661573/*  STC     VBR,Rn */
1567INLINE void STCVBR(UINT32 n)
1574INLINE void STCVBR(sh2_state *sh2, UINT32 n)
15681575{
15691576   sh2->r[n] = sh2->vbr;
15701577}
15711578
15721579/*  STC.L   SR,@-Rn */
1573INLINE void STCMSR(UINT32 n)
1580INLINE void STCMSR(sh2_state *sh2, UINT32 n)
15741581{
15751582   sh2->r[n] -= 4;
15761583   sh2->ea = sh2->r[n];
1577   WL( sh2->ea, sh2->sr );
1578   sh2_icount--;
1584   WL( sh2, sh2->ea, sh2->sr );
1585   sh2->icount--;
15791586}
15801587
15811588/*  STC.L   GBR,@-Rn */
1582INLINE void STCMGBR(UINT32 n)
1589INLINE void STCMGBR(sh2_state *sh2, UINT32 n)
15831590{
15841591   sh2->r[n] -= 4;
15851592   sh2->ea = sh2->r[n];
1586   WL( sh2->ea, sh2->gbr );
1587   sh2_icount--;
1593   WL( sh2, sh2->ea, sh2->gbr );
1594   sh2->icount--;
15881595}
15891596
15901597/*  STC.L   VBR,@-Rn */
1591INLINE void STCMVBR(UINT32 n)
1598INLINE void STCMVBR(sh2_state *sh2, UINT32 n)
15921599{
15931600   sh2->r[n] -= 4;
15941601   sh2->ea = sh2->r[n];
1595   WL( sh2->ea, sh2->vbr );
1596   sh2_icount--;
1602   WL( sh2, sh2->ea, sh2->vbr );
1603   sh2->icount--;
15971604}
15981605
15991606/*  STS     MACH,Rn */
1600INLINE void STSMACH(UINT32 n)
1607INLINE void STSMACH(sh2_state *sh2, UINT32 n)
16011608{
16021609   sh2->r[n] = sh2->mach;
16031610}
16041611
16051612/*  STS     MACL,Rn */
1606INLINE void STSMACL(UINT32 n)
1613INLINE void STSMACL(sh2_state *sh2, UINT32 n)
16071614{
16081615   sh2->r[n] = sh2->macl;
16091616}
16101617
16111618/*  STS     PR,Rn */
1612INLINE void STSPR(UINT32 n)
1619INLINE void STSPR(sh2_state *sh2, UINT32 n)
16131620{
16141621   sh2->r[n] = sh2->pr;
16151622}
16161623
16171624/*  STS.L   MACH,@-Rn */
1618INLINE void STSMMACH(UINT32 n)
1625INLINE void STSMMACH(sh2_state *sh2, UINT32 n)
16191626{
16201627   sh2->r[n] -= 4;
16211628   sh2->ea = sh2->r[n];
1622   WL( sh2->ea, sh2->mach );
1629   WL( sh2, sh2->ea, sh2->mach );
16231630}
16241631
16251632/*  STS.L   MACL,@-Rn */
1626INLINE void STSMMACL(UINT32 n)
1633INLINE void STSMMACL(sh2_state *sh2, UINT32 n)
16271634{
16281635   sh2->r[n] -= 4;
16291636   sh2->ea = sh2->r[n];
1630   WL( sh2->ea, sh2->macl );
1637   WL( sh2, sh2->ea, sh2->macl );
16311638}
16321639
16331640/*  STS.L   PR,@-Rn */
1634INLINE void STSMPR(UINT32 n)
1641INLINE void STSMPR(sh2_state *sh2, UINT32 n)
16351642{
16361643   sh2->r[n] -= 4;
16371644   sh2->ea = sh2->r[n];
1638   WL( sh2->ea, sh2->pr );
1645   WL( sh2, sh2->ea, sh2->pr );
16391646}
16401647
16411648/*  SUB     Rm,Rn */
1642INLINE void SUB(UINT32 m, UINT32 n)
1649INLINE void SUB(sh2_state *sh2, UINT32 m, UINT32 n)
16431650{
16441651   sh2->r[n] -= sh2->r[m];
16451652}
16461653
16471654/*  SUBC    Rm,Rn */
1648INLINE void SUBC(UINT32 m, UINT32 n)
1655INLINE void SUBC(sh2_state *sh2, UINT32 m, UINT32 n)
16491656{
16501657   UINT32 tmp0, tmp1;
16511658
r8581r8582
16611668}
16621669
16631670/*  SUBV    Rm,Rn */
1664INLINE void SUBV(UINT32 m, UINT32 n)
1671INLINE void SUBV(sh2_state *sh2, UINT32 m, UINT32 n)
16651672{
16661673   INT32 dest, src, ans;
16671674
r8581r8582
16921699}
16931700
16941701/*  SWAP.B  Rm,Rn */
1695INLINE void SWAPB(UINT32 m, UINT32 n)
1702INLINE void SWAPB(sh2_state *sh2, UINT32 m, UINT32 n)
16961703{
16971704   UINT32 temp0, temp1;
16981705
r8581r8582
17031710}
17041711
17051712/*  SWAP.W  Rm,Rn */
1706INLINE void SWAPW(UINT32 m, UINT32 n)
1713INLINE void SWAPW(sh2_state *sh2, UINT32 m, UINT32 n)
17071714{
17081715   UINT32 temp;
17091716
r8581r8582
17121719}
17131720
17141721/*  TAS.B   @Rn */
1715INLINE void TAS(UINT32 n)
1722INLINE void TAS(sh2_state *sh2, UINT32 n)
17161723{
17171724   UINT32 temp;
17181725   sh2->ea = sh2->r[n];
17191726   /* Bus Lock enable */
1720   temp = RB( sh2->ea );
1727   temp = RB( sh2, sh2->ea );
17211728   if (temp == 0)
17221729      sh2->sr |= T;
17231730   else
17241731      sh2->sr &= ~T;
17251732   temp |= 0x80;
17261733   /* Bus Lock disable */
1727   WB( sh2->ea, temp );
1728   sh2_icount -= 3;
1734   WB( sh2, sh2->ea, temp );
1735   sh2->icount -= 3;
17291736}
17301737
17311738/*  TRAPA   #imm */
1732INLINE void TRAPA(UINT32 i)
1739INLINE void TRAPA(sh2_state *sh2, UINT32 i)
17331740{
17341741   UINT32 imm = i & 0xff;
17351742
17361743   sh2->ea = sh2->vbr + imm * 4;
17371744
17381745   sh2->r[15] -= 4;
1739   WL( sh2->r[15], sh2->sr );
1746   WL( sh2, sh2->r[15], sh2->sr );
17401747   sh2->r[15] -= 4;
1741   WL( sh2->r[15], sh2->pc );
1748   WL( sh2, sh2->r[15], sh2->pc );
17421749
1743   sh2->pc = RL( sh2->ea );
1750   sh2->pc = RL( sh2, sh2->ea );
17441751
1745   sh2_icount -= 7;
1752   sh2->icount -= 7;
17461753}
17471754
17481755/*  TST     Rm,Rn */
1749INLINE void TST(UINT32 m, UINT32 n)
1756INLINE void TST(sh2_state *sh2, UINT32 m, UINT32 n)
17501757{
17511758   if ((sh2->r[n] & sh2->r[m]) == 0)
17521759      sh2->sr |= T;
r8581r8582
17551762}
17561763
17571764/*  TST     #imm,R0 */
1758INLINE void TSTI(UINT32 i)
1765INLINE void TSTI(sh2_state *sh2, UINT32 i)
17591766{
17601767   UINT32 imm = i & 0xff;
17611768
r8581r8582
17661773}
17671774
17681775/*  TST.B   #imm,@(R0,GBR) */
1769INLINE void TSTM(UINT32 i)
1776INLINE void TSTM(sh2_state *sh2, UINT32 i)
17701777{
17711778   UINT32 imm = i & 0xff;
17721779
17731780   sh2->ea = sh2->gbr + sh2->r[0];
1774   if ((imm & RB( sh2->ea )) == 0)
1781   if ((imm & RB( sh2, sh2->ea )) == 0)
17751782      sh2->sr |= T;
17761783   else
17771784      sh2->sr &= ~T;
1778   sh2_icount -= 2;
1785   sh2->icount -= 2;
17791786}
17801787
17811788/*  XOR     Rm,Rn */
1782INLINE void XOR(UINT32 m, UINT32 n)
1789INLINE void XOR(sh2_state *sh2, UINT32 m, UINT32 n)
17831790{
17841791   sh2->r[n] ^= sh2->r[m];
17851792}
17861793
17871794/*  XOR     #imm,R0 */
1788INLINE void XORI(UINT32 i)
1795INLINE void XORI(sh2_state *sh2, UINT32 i)
17891796{
17901797   UINT32 imm = i & 0xff;
17911798   sh2->r[0] ^= imm;
17921799}
17931800
17941801/*  XOR.B   #imm,@(R0,GBR) */
1795INLINE void XORM(UINT32 i)
1802INLINE void XORM(sh2_state *sh2, UINT32 i)
17961803{
17971804   UINT32 imm = i & 0xff;
17981805   UINT32 temp;
17991806
18001807   sh2->ea = sh2->gbr + sh2->r[0];
1801   temp = RB( sh2->ea );
1808   temp = RB( sh2, sh2->ea );
18021809   temp ^= imm;
1803   WB( sh2->ea, temp );
1804   sh2_icount -= 2;
1810   WB( sh2, sh2->ea, temp );
1811   sh2->icount -= 2;
18051812}
18061813
18071814/*  XTRCT   Rm,Rn */
1808INLINE void XTRCT(UINT32 m, UINT32 n)
1815INLINE void XTRCT(sh2_state *sh2, UINT32 m, UINT32 n)
18091816{
18101817   UINT32 temp;
18111818
r8581r8582
18181825 *  OPCODE DISPATCHERS
18191826 *****************************************************************************/
18201827
1821INLINE void op0000(UINT16 opcode)
1828INLINE void op0000(sh2_state *sh2, UINT16 opcode)
18221829{
18231830   switch (opcode & 0x3F)
18241831   {
18251832   case 0x00: NOP();                  break;
18261833   case 0x01: NOP();                  break;
1827   case 0x02: STCSR(Rn);               break;
1828   case 0x03: BSRF(Rn);               break;
1829   case 0x04: MOVBS0(Rm, Rn);            break;
1830   case 0x05: MOVWS0(Rm, Rn);            break;
1831   case 0x06: MOVLS0(Rm, Rn);            break;
1832   case 0x07: MULL(Rm, Rn);            break;
1833   case 0x08: CLRT();                  break;
1834   case 0x02: STCSR(sh2, Rn);               break;
1835   case 0x03: BSRF(sh2, Rn);               break;
1836   case 0x04: MOVBS0(sh2, Rm, Rn);            break;
1837   case 0x05: MOVWS0(sh2, Rm, Rn);            break;
1838   case 0x06: MOVLS0(sh2, Rm, Rn);            break;
1839   case 0x07: MULL(sh2, Rm, Rn);            break;
1840   case 0x08: CLRT(sh2);                  break;
18341841   case 0x09: NOP();                  break;
1835   case 0x0a: STSMACH(Rn);             break;
1836   case 0x0b: RTS();                  break;
1837   case 0x0c: MOVBL0(Rm, Rn);            break;
1838   case 0x0d: MOVWL0(Rm, Rn);            break;
1839   case 0x0e: MOVLL0(Rm, Rn);            break;
1840   case 0x0f: MAC_L(Rm, Rn);            break;
1842   case 0x0a: STSMACH(sh2, Rn);            break;
1843   case 0x0b: RTS(sh2);                  break;
1844   case 0x0c: MOVBL0(sh2, Rm, Rn);            break;
1845   case 0x0d: MOVWL0(sh2, Rm, Rn);            break;
1846   case 0x0e: MOVLL0(sh2, Rm, Rn);            break;
1847   case 0x0f: MAC_L(sh2, Rm, Rn);            break;
18411848
18421849   case 0x10: NOP();                  break;
18431850   case 0x11: NOP();                  break;
1844   case 0x12: STCGBR(Rn);               break;
1851   case 0x12: STCGBR(sh2, Rn);               break;
18451852   case 0x13: NOP();                  break;
1846   case 0x14: MOVBS0(Rm, Rn);            break;
1847   case 0x15: MOVWS0(Rm, Rn);            break;
1848   case 0x16: MOVLS0(Rm, Rn);            break;
1849   case 0x17: MULL(Rm, Rn);            break;
1850   case 0x18: SETT();                  break;
1851   case 0x19: DIV0U();                break;
1852   case 0x1a: STSMACL(Rn);             break;
1853   case 0x1b: SLEEP();                break;
1854   case 0x1c: MOVBL0(Rm, Rn);            break;
1855   case 0x1d: MOVWL0(Rm, Rn);            break;
1856   case 0x1e: MOVLL0(Rm, Rn);            break;
1857   case 0x1f: MAC_L(Rm, Rn);            break;
1853   case 0x14: MOVBS0(sh2, Rm, Rn);            break;
1854   case 0x15: MOVWS0(sh2, Rm, Rn);            break;
1855   case 0x16: MOVLS0(sh2, Rm, Rn);            break;
1856   case 0x17: MULL(sh2, Rm, Rn);            break;
1857   case 0x18: SETT(sh2);                  break;
1858   case 0x19: DIV0U(sh2);               break;
1859   case 0x1a: STSMACL(sh2, Rn);            break;
1860   case 0x1b: SLEEP(sh2);               break;
1861   case 0x1c: MOVBL0(sh2, Rm, Rn);            break;
1862   case 0x1d: MOVWL0(sh2, Rm, Rn);            break;
1863   case 0x1e: MOVLL0(sh2, Rm, Rn);            break;
1864   case 0x1f: MAC_L(sh2, Rm, Rn);            break;
18581865
18591866   case 0x20: NOP();                  break;
18601867   case 0x21: NOP();                  break;
1861   case 0x22: STCVBR(Rn);               break;
1862   case 0x23: BRAF(Rn);               break;
1863   case 0x24: MOVBS0(Rm, Rn);            break;
1864   case 0x25: MOVWS0(Rm, Rn);            break;
1865   case 0x26: MOVLS0(Rm, Rn);            break;
1866   case 0x27: MULL(Rm, Rn);            break;
1867   case 0x28: CLRMAC();               break;
1868   case 0x29: MOVT(Rn);               break;
1869   case 0x2a: STSPR(Rn);               break;
1870   case 0x2b: RTE();                  break;
1871   case 0x2c: MOVBL0(Rm, Rn);            break;
1872   case 0x2d: MOVWL0(Rm, Rn);            break;
1873   case 0x2e: MOVLL0(Rm, Rn);            break;
1874   case 0x2f: MAC_L(Rm, Rn);            break;
1868   case 0x22: STCVBR(sh2, Rn);               break;
1869   case 0x23: BRAF(sh2, Rn);               break;
1870   case 0x24: MOVBS0(sh2, Rm, Rn);            break;
1871   case 0x25: MOVWS0(sh2, Rm, Rn);            break;
1872   case 0x26: MOVLS0(sh2, Rm, Rn);            break;
1873   case 0x27: MULL(sh2, Rm, Rn);            break;
1874   case 0x28: CLRMAC(sh2);               break;
1875   case 0x29: MOVT(sh2, Rn);               break;
1876   case 0x2a: STSPR(sh2, Rn);               break;
1877   case 0x2b: RTE(sh2);                  break;
1878   case 0x2c: MOVBL0(sh2, Rm, Rn);            break;
1879   case 0x2d: MOVWL0(sh2, Rm, Rn);            break;
1880   case 0x2e: MOVLL0(sh2, Rm, Rn);            break;
1881   case 0x2f: MAC_L(sh2, Rm, Rn);            break;
18751882
18761883   case 0x30: NOP();                  break;
18771884   case 0x31: NOP();                  break;
18781885   case 0x32: NOP();                  break;
18791886   case 0x33: NOP();                  break;
1880   case 0x34: MOVBS0(Rm, Rn);            break;
1881   case 0x35: MOVWS0(Rm, Rn);            break;
1882   case 0x36: MOVLS0(Rm, Rn);            break;
1883   case 0x37: MULL(Rm, Rn);            break;
1887   case 0x34: MOVBS0(sh2, Rm, Rn);            break;
1888   case 0x35: MOVWS0(sh2, Rm, Rn);            break;
1889   case 0x36: MOVLS0(sh2, Rm, Rn);            break;
1890   case 0x37: MULL(sh2, Rm, Rn);            break;
18841891   case 0x38: NOP();                  break;
18851892   case 0x39: NOP();                  break;
1886   case 0x3c: MOVBL0(Rm, Rn);            break;
1887   case 0x3d: MOVWL0(Rm, Rn);            break;
1888   case 0x3e: MOVLL0(Rm, Rn);            break;
1889   case 0x3f: MAC_L(Rm, Rn);            break;
1893   case 0x3c: MOVBL0(sh2, Rm, Rn);            break;
1894   case 0x3d: MOVWL0(sh2, Rm, Rn);            break;
1895   case 0x3e: MOVLL0(sh2, Rm, Rn);            break;
1896   case 0x3f: MAC_L(sh2, Rm, Rn);            break;
18901897   case 0x3a: NOP();                  break;
18911898   case 0x3b: NOP();                  break;
18921899
r8581r8582
18951902   }
18961903}
18971904
1898INLINE void op0001(UINT16 opcode)
1905INLINE void op0001(sh2_state *sh2, UINT16 opcode)
18991906{
1900   MOVLS4(Rm, opcode & 0x0f, Rn);
1907   MOVLS4(sh2, Rm, opcode & 0x0f, Rn);
19011908}
19021909
1903INLINE void op0010(UINT16 opcode)
1910INLINE void op0010(sh2_state *sh2, UINT16 opcode)
19041911{
19051912   switch (opcode & 15)
19061913   {
1907   case  0: MOVBS(Rm, Rn);             break;
1908   case  1: MOVWS(Rm, Rn);             break;
1909   case  2: MOVLS(Rm, Rn);             break;
1914   case  0: MOVBS(sh2, Rm, Rn);            break;
1915   case  1: MOVWS(sh2, Rm, Rn);            break;
1916   case  2: MOVLS(sh2, Rm, Rn);            break;
19101917   case  3: NOP();                   break;
1911   case  4: MOVBM(Rm, Rn);             break;
1912   case  5: MOVWM(Rm, Rn);             break;
1913   case  6: MOVLM(Rm, Rn);             break;
1914   case  7: DIV0S(Rm, Rn);             break;
1915   case  8: TST(Rm, Rn);               break;
1916   case  9: AND(Rm, Rn);               break;
1917   case 10: XOR(Rm, Rn);               break;
1918   case 11: OR(Rm, Rn);               break;
1919   case 12: CMPSTR(Rm, Rn);            break;
1920   case 13: XTRCT(Rm, Rn);             break;
1921   case 14: MULU(Rm, Rn);               break;
1922   case 15: MULS(Rm, Rn);               break;
1918   case  4: MOVBM(sh2, Rm, Rn);            break;
1919   case  5: MOVWM(sh2, Rm, Rn);            break;
1920   case  6: MOVLM(sh2, Rm, Rn);            break;
1921   case  7: DIV0S(sh2, Rm, Rn);            break;
1922   case  8: TST(sh2, Rm, Rn);               break;
1923   case  9: AND(sh2, Rm, Rn);               break;
1924   case 10: XOR(sh2, Rm, Rn);               break;
1925   case 11: OR(sh2, Rm, Rn);               break;
1926   case 12: CMPSTR(sh2, Rm, Rn);            break;
1927   case 13: XTRCT(sh2, Rm, Rn);            break;
1928   case 14: MULU(sh2, Rm, Rn);               break;
1929   case 15: MULS(sh2, Rm, Rn);               break;
19231930   }
19241931}
19251932
1926INLINE void op0011(UINT16 opcode)
1933INLINE void op0011(sh2_state *sh2, UINT16 opcode)
19271934{
19281935   switch (opcode & 15)
19291936   {
1930   case  0: CMPEQ(Rm, Rn);             break;
1937   case  0: CMPEQ(sh2, Rm, Rn);            break;
19311938   case  1: NOP();                   break;
1932   case  2: CMPHS(Rm, Rn);             break;
1933   case  3: CMPGE(Rm, Rn);             break;
1934   case  4: DIV1(Rm, Rn);               break;
1935   case  5: DMULU(Rm, Rn);             break;
1936   case  6: CMPHI(Rm, Rn);             break;
1937   case  7: CMPGT(Rm, Rn);             break;
1938   case  8: SUB(Rm, Rn);               break;
1939   case  2: CMPHS(sh2, Rm, Rn);            break;
1940   case  3: CMPGE(sh2, Rm, Rn);            break;
1941   case  4: DIV1(sh2, Rm, Rn);               break;
1942   case  5: DMULU(sh2, Rm, Rn);            break;
1943   case  6: CMPHI(sh2, Rm, Rn);            break;
1944   case  7: CMPGT(sh2, Rm, Rn);            break;
1945   case  8: SUB(sh2, Rm, Rn);               break;
19391946   case  9: NOP();                   break;
1940   case 10: SUBC(Rm, Rn);               break;
1941   case 11: SUBV(Rm, Rn);               break;
1942   case 12: ADD(Rm, Rn);               break;
1943   case 13: DMULS(Rm, Rn);             break;
1944   case 14: ADDC(Rm, Rn);               break;
1945   case 15: ADDV(Rm, Rn);               break;
1947   case 10: SUBC(sh2, Rm, Rn);               break;
1948   case 11: SUBV(sh2, Rm, Rn);               break;
1949   case 12: ADD(sh2, Rm, Rn);               break;
1950   case 13: DMULS(sh2, Rm, Rn);            break;
1951   case 14: ADDC(sh2, Rm, Rn);               break;
1952   case 15: ADDV(sh2, Rm, Rn);               break;
19461953   }
19471954}
19481955
1949INLINE void op0100(UINT16 opcode)
1956INLINE void op0100(sh2_state *sh2, UINT16 opcode)
19501957{
19511958   switch (opcode & 0x3F)
19521959   {
1953   case 0x00: SHLL(Rn);               break;
1954   case 0x01: SHLR(Rn);               break;
1955   case 0x02: STSMMACH(Rn);            break;
1956   case 0x03: STCMSR(Rn);               break;
1957   case 0x04: ROTL(Rn);               break;
1958   case 0x05: ROTR(Rn);               break;
1959   case 0x06: LDSMMACH(Rn);            break;
1960   case 0x07: LDCMSR(Rn);               break;
1961   case 0x08: SHLL2(Rn);               break;
1962   case 0x09: SHLR2(Rn);               break;
1963   case 0x0a: LDSMACH(Rn);             break;
1964   case 0x0b: JSR(Rn);                break;
1960   case 0x00: SHLL(sh2, Rn);               break;
1961   case 0x01: SHLR(sh2, Rn);               break;
1962   case 0x02: STSMMACH(sh2, Rn);            break;
1963   case 0x03: STCMSR(sh2, Rn);               break;
1964   case 0x04: ROTL(sh2, Rn);               break;
1965   case 0x05: ROTR(sh2, Rn);               break;
1966   case 0x06: LDSMMACH(sh2, Rn);            break;
1967   case 0x07: LDCMSR(sh2, Rn);               break;
1968   case 0x08: SHLL2(sh2, Rn);               break;
1969   case 0x09: SHLR2(sh2, Rn);               break;
1970   case 0x0a: LDSMACH(sh2, Rn);            break;
1971   case 0x0b: JSR(sh2, Rn);               break;
19651972   case 0x0c: NOP();                  break;
19661973   case 0x0d: NOP();                  break;
1967   case 0x0e: LDCSR(Rn);               break;
1968   case 0x0f: MAC_W(Rm, Rn);            break;
1974   case 0x0e: LDCSR(sh2, Rn);               break;
1975   case 0x0f: MAC_W(sh2, Rm, Rn);            break;
19691976
1970   case 0x10: DT(Rn);                  break;
1971   case 0x11: CMPPZ(Rn);               break;
1972   case 0x12: STSMMACL(Rn);            break;
1973   case 0x13: STCMGBR(Rn);             break;
1977   case 0x10: DT(sh2, Rn);                  break;
1978   case 0x11: CMPPZ(sh2, Rn);               break;
1979   case 0x12: STSMMACL(sh2, Rn);            break;
1980   case 0x13: STCMGBR(sh2, Rn);            break;
19741981   case 0x14: NOP();                  break;
1975   case 0x15: CMPPL(Rn);               break;
1976   case 0x16: LDSMMACL(Rn);            break;
1977   case 0x17: LDCMGBR(Rn);             break;
1978   case 0x18: SHLL8(Rn);               break;
1979   case 0x19: SHLR8(Rn);               break;
1980   case 0x1a: LDSMACL(Rn);             break;
1981   case 0x1b: TAS(Rn);                break;
1982   case 0x15: CMPPL(sh2, Rn);               break;
1983   case 0x16: LDSMMACL(sh2, Rn);            break;
1984   case 0x17: LDCMGBR(sh2, Rn);            break;
1985   case 0x18: SHLL8(sh2, Rn);               break;
1986   case 0x19: SHLR8(sh2, Rn);               break;
1987   case 0x1a: LDSMACL(sh2, Rn);            break;
1988   case 0x1b: TAS(sh2, Rn);               break;
19821989   case 0x1c: NOP();                  break;
19831990   case 0x1d: NOP();                  break;
1984   case 0x1e: LDCGBR(Rn);               break;
1985   case 0x1f: MAC_W(Rm, Rn);            break;
1991   case 0x1e: LDCGBR(sh2, Rn);               break;
1992   case 0x1f: MAC_W(sh2, Rm, Rn);            break;
19861993
1987   case 0x20: SHAL(Rn);               break;
1988   case 0x21: SHAR(Rn);               break;
1989   case 0x22: STSMPR(Rn);               break;
1990   case 0x23: STCMVBR(Rn);             break;
1991   case 0x24: ROTCL(Rn);               break;
1992   case 0x25: ROTCR(Rn);               break;
1993   case 0x26: LDSMPR(Rn);               break;
1994   case 0x27: LDCMVBR(Rn);             break;
1995   case 0x28: SHLL16(Rn);               break;
1996   case 0x29: SHLR16(Rn);               break;
1997   case 0x2a: LDSPR(Rn);               break;
1998   case 0x2b: JMP(Rn);                break;
1994   case 0x20: SHAL(sh2, Rn);               break;
1995   case 0x21: SHAR(sh2, Rn);               break;
1996   case 0x22: STSMPR(sh2, Rn);               break;
1997   case 0x23: STCMVBR(sh2, Rn);            break;
1998   case 0x24: ROTCL(sh2, Rn);               break;
1999   case 0x25: ROTCR(sh2, Rn);               break;
2000   case 0x26: LDSMPR(sh2, Rn);               break;
2001   case 0x27: LDCMVBR(sh2, Rn);            break;
2002   case 0x28: SHLL16(sh2, Rn);               break;
2003   case 0x29: SHLR16(sh2, Rn);               break;
2004   case 0x2a: LDSPR(sh2, Rn);               break;
2005   case 0x2b: JMP(sh2, Rn);               break;
19992006   case 0x2c: NOP();                  break;
20002007   case 0x2d: NOP();                  break;
2001   case 0x2e: LDCVBR(Rn);               break;
2002   case 0x2f: MAC_W(Rm, Rn);            break;
2008   case 0x2e: LDCVBR(sh2, Rn);               break;
2009   case 0x2f: MAC_W(sh2, Rm, Rn);            break;
20032010
20042011   case 0x30: NOP();                  break;
20052012   case 0x31: NOP();                  break;
r8581r8582
20162023   case 0x3c: NOP();                  break;
20172024   case 0x3d: NOP();                  break;
20182025   case 0x3e: NOP();                  break;
2019   case 0x3f: MAC_W(Rm, Rn);            break;
2026   case 0x3f: MAC_W(sh2, Rm, Rn);            break;
20202027
20212028   }
20222029}
20232030
2024INLINE void op0101(UINT16 opcode)
2031INLINE void op0101(sh2_state *sh2, UINT16 opcode)
20252032{
2026   MOVLL4(Rm, opcode & 0x0f, Rn);
2033   MOVLL4(sh2, Rm, opcode & 0x0f, Rn);
20272034}
20282035
2029INLINE void op0110(UINT16 opcode)
2036INLINE void op0110(sh2_state *sh2, UINT16 opcode)
20302037{
20312038   switch (opcode & 15)
20322039   {
2033   case  0: MOVBL(Rm, Rn);             break;
2034   case  1: MOVWL(Rm, Rn);             break;
2035   case  2: MOVLL(Rm, Rn);             break;
2036   case  3: MOV(Rm, Rn);               break;
2037   case  4: MOVBP(Rm, Rn);             break;
2038   case  5: MOVWP(Rm, Rn);             break;
2039   case  6: MOVLP(Rm, Rn);             break;
2040   case  7: NOT(Rm, Rn);               break;
2041   case  8: SWAPB(Rm, Rn);             break;
2042   case  9: SWAPW(Rm, Rn);             break;
2043   case 10: NEGC(Rm, Rn);               break;
2044   case 11: NEG(Rm, Rn);               break;
2045   case 12: EXTUB(Rm, Rn);             break;
2046   case 13: EXTUW(Rm, Rn);             break;
2047   case 14: EXTSB(Rm, Rn);             break;
2048   case 15: EXTSW(Rm, Rn);             break;
2040   case  0: MOVBL(sh2, Rm, Rn);            break;
2041   case  1: MOVWL(sh2, Rm, Rn);            break;
2042   case  2: MOVLL(sh2, Rm, Rn);            break;
2043   case  3: MOV(sh2, Rm, Rn);               break;
2044   case  4: MOVBP(sh2, Rm, Rn);            break;
2045   case  5: MOVWP(sh2, Rm, Rn);            break;
2046   case  6: MOVLP(sh2, Rm, Rn);            break;
2047   case  7: NOT(sh2, Rm, Rn);               break;
2048   case  8: SWAPB(sh2, Rm, Rn);            break;
2049   case  9: SWAPW(sh2, Rm, Rn);            break;
2050   case 10: NEGC(sh2, Rm, Rn);               break;
2051   case 11: NEG(sh2, Rm, Rn);               break;
2052   case 12: EXTUB(sh2, Rm, Rn);            break;
2053   case 13: EXTUW(sh2, Rm, Rn);            break;
2054   case 14: EXTSB(sh2, Rm, Rn);            break;
2055   case 15: EXTSW(sh2, Rm, Rn);            break;
20492056   }
20502057}
20512058
2052INLINE void op0111(UINT16 opcode)
2059INLINE void op0111(sh2_state *sh2, UINT16 opcode)
20532060{
2054   ADDI(opcode & 0xff, Rn);
2061   ADDI(sh2, opcode & 0xff, Rn);
20552062}
20562063
2057INLINE void op1000(UINT16 opcode)
2064INLINE void op1000(sh2_state *sh2, UINT16 opcode)
20582065{
20592066   switch ( opcode  & (15<<8) )
20602067   {
2061   case  0 << 8: MOVBS4(opcode & 0x0f, Rm);   break;
2062   case  1 << 8: MOVWS4(opcode & 0x0f, Rm);   break;
2068   case  0 << 8: MOVBS4(sh2, opcode & 0x0f, Rm);   break;
2069   case  1 << 8: MOVWS4(sh2, opcode & 0x0f, Rm);   break;
20632070   case  2<< 8: NOP();             break;
20642071   case  3<< 8: NOP();             break;
2065   case  4<< 8: MOVBL4(Rm, opcode & 0x0f);    break;
2066   case  5<< 8: MOVWL4(Rm, opcode & 0x0f);    break;
2072   case  4<< 8: MOVBL4(sh2, Rm, opcode & 0x0f);   break;
2073   case  5<< 8: MOVWL4(sh2, Rm, opcode & 0x0f);   break;
20672074   case  6<< 8: NOP();             break;
20682075   case  7<< 8: NOP();             break;
2069   case  8<< 8: CMPIM(opcode & 0xff);      break;
2070   case  9<< 8: BT(opcode & 0xff);       break;
2076   case  8<< 8: CMPIM(sh2, opcode & 0xff);      break;
2077   case  9<< 8: BT(sh2, opcode & 0xff);      break;
20712078   case 10<< 8: NOP();             break;
2072   case 11<< 8: BF(opcode & 0xff);       break;
2079   case 11<< 8: BF(sh2, opcode & 0xff);      break;
20732080   case 12<< 8: NOP();             break;
2074   case 13<< 8: BTS(opcode & 0xff);      break;
2081   case 13<< 8: BTS(sh2, opcode & 0xff);      break;
20752082   case 14<< 8: NOP();             break;
2076   case 15<< 8: BFS(opcode & 0xff);      break;
2083   case 15<< 8: BFS(sh2, opcode & 0xff);      break;
20772084   }
20782085}
20792086
20802087
2081INLINE void op1001(UINT16 opcode)
2088INLINE void op1001(sh2_state *sh2, UINT16 opcode)
20822089{
2083   MOVWI(opcode & 0xff, Rn);
2090   MOVWI(sh2, opcode & 0xff, Rn);
20842091}
20852092
2086INLINE void op1010(UINT16 opcode)
2093INLINE void op1010(sh2_state *sh2, UINT16 opcode)
20872094{
2088   BRA(opcode & 0xfff);
2095   BRA(sh2, opcode & 0xfff);
20892096}
20902097
2091INLINE void op1011(UINT16 opcode)
2098INLINE void op1011(sh2_state *sh2, UINT16 opcode)
20922099{
2093   BSR(opcode & 0xfff);
2100   BSR(sh2, opcode & 0xfff);
20942101}
20952102
2096INLINE void op1100(UINT16 opcode)
2103INLINE void op1100(sh2_state *sh2, UINT16 opcode)
20972104{
20982105   switch (opcode & (15<<8))
20992106   {
2100   case  0<<8: MOVBSG(opcode & 0xff);      break;
2101   case  1<<8: MOVWSG(opcode & 0xff);      break;
2102   case  2<<8: MOVLSG(opcode & 0xff);      break;
2103   case  3<<8: TRAPA(opcode & 0xff);      break;
2104   case  4<<8: MOVBLG(opcode & 0xff);      break;
2105   case  5<<8: MOVWLG(opcode & 0xff);      break;
2106   case  6<<8: MOVLLG(opcode & 0xff);      break;
2107   case  7<<8: MOVA(opcode & 0xff);      break;
2108   case  8<<8: TSTI(opcode & 0xff);      break;
2109   case  9<<8: ANDI(opcode & 0xff);      break;
2110   case 10<<8: XORI(opcode & 0xff);      break;
2111   case 11<<8: ORI(opcode & 0xff);         break;
2112   case 12<<8: TSTM(opcode & 0xff);      break;
2113   case 13<<8: ANDM(opcode & 0xff);      break;
2114   case 14<<8: XORM(opcode & 0xff);      break;
2115   case 15<<8: ORM(opcode & 0xff);         break;
2107   case  0<<8: MOVBSG(sh2, opcode & 0xff);      break;
2108   case  1<<8: MOVWSG(sh2, opcode & 0xff);      break;
2109   case  2<<8: MOVLSG(sh2, opcode & 0xff);      break;
2110   case  3<<8: TRAPA(sh2, opcode & 0xff);      break;
2111   case  4<<8: MOVBLG(sh2, opcode & 0xff);      break;
2112   case  5<<8: MOVWLG(sh2, opcode & 0xff);      break;
2113   case  6<<8: MOVLLG(sh2, opcode & 0xff);      break;
2114   case  7<<8: MOVA(sh2, opcode & 0xff);      break;
2115   case  8<<8: TSTI(sh2, opcode & 0xff);      break;
2116   case  9<<8: ANDI(sh2, opcode & 0xff);      break;
2117   case 10<<8: XORI(sh2, opcode & 0xff);      break;
2118   case 11<<8: ORI(sh2, opcode & 0xff);         break;
2119   case 12<<8: TSTM(sh2, opcode & 0xff);      break;
2120   case 13<<8: ANDM(sh2, opcode & 0xff);      break;
2121   case 14<<8: XORM(sh2, opcode & 0xff);      break;
2122   case 15<<8: ORM(sh2, opcode & 0xff);         break;
21162123   }
21172124}
21182125
2119INLINE void op1101(UINT16 opcode)
2126INLINE void op1101(sh2_state *sh2, UINT16 opcode)
21202127{
2121   MOVLI(opcode & 0xff, Rn);
2128   MOVLI(sh2, opcode & 0xff, Rn);
21222129}
21232130
2124INLINE void op1110(UINT16 opcode)
2131INLINE void op1110(sh2_state *sh2, UINT16 opcode)
21252132{
2126   MOVI(opcode & 0xff, Rn);
2133   MOVI(sh2, opcode & 0xff, Rn);
21272134}
21282135
2129INLINE void op1111(UINT16 opcode)
2136INLINE void op1111(sh2_state *sh2, UINT16 opcode)
21302137{
21312138   NOP();
21322139}
r8581r8582
21372144
21382145static CPU_RESET( sh2 )
21392146{
2140   void *tsave, *tsaved0, *tsaved1;
2147   sh2_state *sh2 = get_safe_token(device);
2148   emu_timer *tsave, *tsaved0, *tsaved1;
21412149   UINT32 *m;
2150   int  (*dma_callback_kludge)(UINT32 src, UINT32 dst, UINT32 data, int size);
21422151   int save_is_slave;
21432152
21442153   void (*f)(UINT32 data);
r8581r8582
21542163   save_is_slave = sh2->is_slave;
21552164   dma_callback_kludge = sh2->dma_callback_kludge;
21562165
2157   memset(sh2, 0, sizeof(sh2_state));
2166   sh2->ppc = sh2->pc = sh2->pr = sh2->sr = sh2->gbr = sh2->vbr = sh2->mach = sh2->macl = 0;
2167   sh2->evec = sh2->irqsr = 0;
2168   memset(&sh2->r[0], 0, sizeof(sh2->r[0])*16);
2169   sh2->ea = sh2->delay = sh2->cpu_off = sh2->dvsr = sh2->dvdnth = sh2->dvdntl = sh2->dvcr = 0;
2170   sh2->pending_irq = sh2->test_irq = 0;
2171   memset(&sh2->irq_queue[0], 0, sizeof(sh2->irq_queue[0])*16);
2172   memset(&sh2->irq_line_state[0], 0, sizeof(sh2->irq_line_state[0])*17);
2173   sh2->frc = sh2->ocra = sh2->ocrb = sh2->icr = 0;
2174   sh2->frc_base = 0;
2175   sh2->frt_input = sh2->internal_irq_level = sh2->internal_irq_vector = 0;
2176   sh2->dma_timer_active[0] = sh2->dma_timer_active[1] = 0;
21582177
21592178   sh2->dma_callback_kludge = dma_callback_kludge;
21602179   sh2->is_slave = save_is_slave;
r8581r8582
21682187   sh2->m = m;
21692188   memset(sh2->m, 0, 0x200);
21702189
2171   sh2->pc = RL(0);
2172   sh2->r[15] = RL(4);
2190   sh2->pc = RL(sh2, 0);
2191   sh2->r[15] = RL(sh2, 4);
21732192   sh2->sr = I;
21742193
21752194   sh2->internal_irq_level = -1;
r8581r8582
21812200
21822201static CPU_RESET( sh1 )
21832202{
2184   sh2_reset();
2203   sh2_state *sh2 = get_safe_token(device);
2204   CPU_RESET_CALL( sh2 );
21852205   sh2->cpu_type = CPU_TYPE_SH1;
21862206}
21872207
21882208/* Execute cycles - returns number of cycles actually run */
21892209static CPU_EXECUTE( sh2 )
21902210{
2211   sh2_state *sh2 = get_safe_token(device);
2212
21912213   if (sh2->cpu_off)
21922214   {
21932215      sh2->icount = 0;
r8581r8582
22142236
22152237      switch (opcode & ( 15 << 12))
22162238      {
2217      case  0<<12: op0000(opcode); break;
2218      case  1<<12: op0001(opcode); break;
2219      case  2<<12: op0010(opcode); break;
2220      case  3<<12: op0011(opcode); break;
2221      case  4<<12: op0100(opcode); break;
2222      case  5<<12: op0101(opcode); break;
2223      case  6<<12: op0110(opcode); break;
2224      case  7<<12: op0111(opcode); break;
2225      case  8<<12: op1000(opcode); break;
2226      case  9<<12: op1001(opcode); break;
2227      case 10<<12: op1010(opcode); break;
2228      case 11<<12: op1011(opcode); break;
2229      case 12<<12: op1100(opcode); break;
2230      case 13<<12: op1101(opcode); break;
2231      case 14<<12: op1110(opcode); break;
2232      default: op1111(opcode); break;
2239      case  0<<12: op0000(sh2, opcode); break;
2240      case  1<<12: op0001(sh2, opcode); break;
2241      case  2<<12: op0010(sh2, opcode); break;
2242      case  3<<12: op0011(sh2, opcode); break;
2243      case  4<<12: op0100(sh2, opcode); break;
2244      case  5<<12: op0101(sh2, opcode); break;
2245      case  6<<12: op0110(sh2, opcode); break;
2246      case  7<<12: op0111(sh2, opcode); break;
2247      case  8<<12: op1000(sh2, opcode); break;
2248      case  9<<12: op1001(sh2, opcode); break;
2249      case 10<<12: op1010(sh2, opcode); break;
2250      case 11<<12: op1011(sh2, opcode); break;
2251      case 12<<12: op1100(sh2, opcode); break;
2252      case 13<<12: op1101(sh2, opcode); break;
2253      case 14<<12: op1110(sh2, opcode); break;
2254      default: op1111(sh2, opcode); break;
22332255      }
22342256
22352257      if(sh2->test_irq && !sh2->delay)
r8581r8582
22372259         CHECK_PENDING_IRQ("mame_sh2_execute");
22382260         sh2->test_irq = 0;
22392261      }
2240      sh2_icount--;
2241   } while( sh2_icount > 0 );
2262      sh2->icount--;
2263   } while( sh2->icount > 0 );
22422264}
22432265
22442266static CPU_INIT( sh2 )
22452267{
2246   /* allocate the core memory */
2247   sh2 = auto_alloc_clear(device->machine, SH2);
2268   sh2_state *sh2 = get_safe_token(device);
22482269
22492270   /* initialize the common core parts */
22502271   sh2_common_init(sh2, device, irqcallback);
r8581r8582
22562277
22572278static CPU_SET_INFO( sh2 )
22582279{
2280   sh2_state *sh2 = get_safe_token(device);
22592281   switch (state)
22602282   {
22612283      /* --- the following bits of info are set as 64-bit signed integers --- */
r8581r8582
23152337
23162338CPU_GET_INFO( sh2 )
23172339{
2340   sh2_state *sh2 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL;
23182341   switch (state)
23192342   {
23202343      /* --- the following bits of info are returned as 64-bit signed integers --- */
r8581r8582
23942417      case CPUINFO_FCT_EXECUTE:                  info->execute = CPU_EXECUTE_NAME(sh2);         break;
23952418      case CPUINFO_FCT_BURN:                     info->burn = NULL;                  break;
23962419      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(sh2);         break;
2397      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sh2_icount;            break;
2420      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sh2->icount;            break;
23982421
23992422      /* --- the following bits of info are returned as NULL-terminated strings --- */
24002423      case DEVINFO_STR_NAME:                     strcpy(info->s, "SH-2");            break;
src/emu/cpu/mn10200/mn10200.c
r8581r8582
188188         if (cpustate->prescaler[source-2].mode & 0x80)
189189         {
190190            // rate = (sysclock / prescaler) / our count
191            rate = cpu_get_clock(cpustate->device) / cpustate->prescaler[source-2].cycles;
191            rate = cpustate->device->unscaled_clock() / cpustate->prescaler[source-2].cycles;
192192            rate /= cpustate->simple_timer[tmr].base;
193193
194194            if (tmr != 8)   // HACK: timer 8 is run at 500 kHz by the Taito program for no obvious reason, which kills performance
src/emu/cpu/mb88xx/mb88xx.c
r8581r8582
245245static void set_irq_line(mb88_state *cpustate, int state)
246246{
247247   /* on falling edge trigger interrupt */
248   if ( (cpustate->pio & 0x04) && cpustate->nf && state == CLEAR_LINE )
248   if ( (cpustate->pio & 0x04) && cpustate->nf == 0 && state != CLEAR_LINE )
249249   {
250250      cpustate->pending_interrupt |= INT_CAUSE_EXTERNAL;
251251   }
r8581r8582
593593
594594         case 0x24: /* tstr ZCS:..x */
595595            arg = READPORT( MB88_PORTR0+(cpustate->Y/4) );
596            cpustate->st = ( arg & ( 1 << (cpustate->Y%4) ) ) ? 1 : 0;
596            cpustate->st = ( arg & ( 1 << (cpustate->Y%4) ) ) ? 0 : 1;
597597            break;
598598
599599         case 0x25: /* tsti ZCS:..x */
r8581r8582
679679
680680         case 0x38: case 0x39: case 0x3a: case 0x3b: /* tbit ZCS:... */
681681            arg = RDMEM(GETEA());
682            cpustate->st = ( arg & (1 << (opcode&3) ) ) ? 1 : 0;
682            cpustate->st = ( arg & (1 << (opcode&3) ) ) ? 0 : 1;
683683            break;
684684
685685         case 0x3c: /* rti ZCS:... */
r8581r8582
729729
730730         case 0x48:   case 0x49:   case 0x4a:   case 0x4b: /* tstD ZCS:..x */
731731            arg = READPORT(MB88_PORTR2);
732            cpustate->st = (arg & (1 << (opcode&3))) ? 1 : 0;
732            cpustate->st = (arg & (1 << (opcode&3))) ? 0 : 1;
733733            break;
734734
735735         case 0x4c:   case 0x4d:   case 0x4e:   case 0x4f: /* tba ZCS:..x */
736            cpustate->st = (cpustate->A & (1 << (opcode&3))) ? 1 : 0;
736            cpustate->st = (cpustate->A & (1 << (opcode&3))) ? 0 : 1;
737737            break;
738738
739739         case 0x50:   case 0x51:   case 0x52:   case 0x53: /* xd ZCS:x.. */
src/emu/devintrf.h
r8581r8582
5656#define DERIVED_CLOCK(num, den)      (0xff000000 | ((num) << 12) | ((den) << 0))
5757
5858// shorthand for accessing devices by machine/type/tag
59#define devtag_get_device(mach,tag)                     (mach)->device(tag)
6059#define devtag_reset(mach,tag)                        (mach)->device(tag)->reset()
6160
6261
r8581r8582
552551}
553552
554553
555
556// ======================> device clock management
557
558// returns the current device's unscaled running clock speed
559inline int device_get_clock(device_t *device)
560{
561   return device->unscaled_clock();
562}
563
564// sets the current device's clock speed and then adjusts for scaling
565inline void device_set_clock(device_t *device, int clock)
566{
567   device->set_unscaled_clock(clock);
568}
569
570// returns the current scaling factor for a device's clock speed
571inline double device_get_clock_scale(device_t *device)
572{
573   return device->clock_scale();
574}
575
576// sets the current scaling factor for a device's clock speed
577inline void device_set_clock_scale(device_t *device, double clockscale)
578{
579   device->set_clock_scale(clockscale);
580}
581
582
583554#endif   /* __DEVINTRF_H__ */
src/emu/diimage.c
r8581r8582
672672    image_battery_save_by_name(astring_c(fname), buffer, length);
673673    astring_free(fname);
674674}
675   
675
src/emu/sound/mos6560.c
r8581r8582
803803   const mos6560_interface *intf = (mos6560_interface *)device->baseconfig().static_config();
804804   int width, height;
805805
806   mos6560->screen = downcast<screen_device *>(devtag_get_device(device->machine, intf->screen));
806   mos6560->screen = downcast<screen_device *>(device->machine->device(intf->screen));
807807   width = mos6560->screen->width();
808808   height = mos6560->screen->height();
809809
src/emu/sound/discrete.c
r8581r8582
581581   /* print statistics */
582582   printf("Total Samples  : %16" I64FMT "d\n", info->total_samples);
583583   tresh = total / count;
584   printf("Treshold (mean): %16" I64FMT "d\n", tresh / info->total_samples );
584   printf("Threshold (mean): %16" I64FMT "d\n", tresh / info->total_samples );
585585   for (entry = info->node_list; entry != NULL; entry = entry->next)
586586   {
587587      node_description *node = (node_description *) entry->ptr;
src/emu/sound/cdp1864.c
r8581r8582
365365
366366   if (cdp1864->aoe)
367367   {
368      double frequency = cpu_get_clock(cdp1864->cpu) / 8 / 4 / (cdp1864->latch + 1) / 2;
368      double frequency = cdp1864->cpu->unscaled_clock() / 8 / 4 / (cdp1864->latch + 1) / 2;
369369      int rate = device->machine->sample_rate / 2;
370370
371371      /* get progress through wave */
src/emu/sound/sound.mak
r8581r8582
413413SOUNDOBJS += $(SOUNDOBJ)/aica.o $(SOUNDOBJ)/aicadsp.o
414414endif
415415
416$(SOUNDOBJ)/scsp.o:   $(SOUNDSRC)/scsplfo.c
417$(SOUNDOBJ)/aica.o:   $(SOUNDSRC)/aicalfo.c
416418
417419
418420#-------------------------------------------------
r8581r8582
556558SOUNDOBJS += $(SOUNDOBJ)/tms5220.o
557559endif
558560
561$(SOUNDOBJ)/tms5110.o:   $(SOUNDSRC)/tms5110r.c
562$(SOUNDOBJ)/tms5220.o:   $(SOUNDSRC)/tms5220r.c
559563
560564
561565#-------------------------------------------------
src/emu/sound/tms5220.c
r8581r8582
262262/* must be defined; if 0, output the waveform as if it was tapped on the speaker pin as usual, if 1, output the waveform as if it was tapped on the i/o pin (volume is much lower in the latter case) */
263263#define FORCE_DIGITAL 0
264264
265/* must be defined; if 1, normal speech (1xA, 1xB per interpolation step); if 0; speak as if SPKSLOW was used (2xA, 1xB per interpolation step) */
265/* must be defined; if 1, normal speech (one A cycle, one B cycle per interpolation step); if 0; speak as if SPKSLOW was used (two A cycles, one B cycle per interpolation step) */
266266#define FORCE_SUBC_RELOAD 1
267267
268268/* if defined, outputs the low 4 bits of the lattice filter to the i/o or clip logic, even though the real hardware doesn't do this */
r8581r8582
301301#undef DEBUG_IO_READY
302302// above debugs the io ready callback
303303#undef DEBUG_RS_WS
304// above debugs the new tms5220_data_r and data_w access methods which actually respect rs and ws
304// above debugs the tms5220_data_r and data_w access methods which actually respect rs and ws
305305
306306#define MAX_SAMPLE_CHUNK   512
307307#define FIFO_SIZE 16
r8581r8582
314314
315315#define TMS5220_IS_TMC0285   TMS5220_IS_5200
316316
317static const UINT8 reload_table[4] = { 0, 2, 4, 6 }; //is the sample count reload for 5220c only; 5200 and 5220 always reload with 0
317static const UINT8 reload_table[4] = { 0, 2, 4, 6 }; //sample count reload for 5220c only; 5200 and 5220 always reload with 0; keep in mind this is loaded on IP=0 PC=12 subcycle=1 so it immediately will increment after one sample, effectively being 1,3,5,7 as in the comments above.
318318
319319typedef struct _tms5220_state tms5220_state;
320320struct _tms5220_state
r8581r8582
871871   while ((size > 0) && tms->speaking_now)
872872    {
873873        /* if it is the appropriate time to update the old energy/pitch idxes,
874         * i.e. when IP=7, do so. */
875        if (tms->interp_period == 7)
874         * i.e. when IP=7, PC=12, do so. */
875        if ((tms->interp_period == 7) && (tms->PC == 12))
876876      {
877877         tms->OLDE = (tms->new_frame_energy_idx == 0);
878878         tms->OLDP = (tms->new_frame_pitch_idx == 0);
879879      }
880880
881        /* if we're ready for a new frame, i.e. when IP=0, PC=12, Sub=1 */
881        /* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1 */
882      /* (In reality, the frame was really loaded incrementally during the entire IP=0 PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens) */
882883        if ((tms->interp_period == 0) && (tms->PC == 12) && (tms->subcycle == 1))
883884        {
884885         // HACK for regression testing, be sure to comment out before release!
885886         //tms->RNG = 0x1234;
886887         // end HACK
887888
888         /* appropriately override the interp count if needed */
889         /* appropriately override the interp count if needed; this will be incremented after the frame parse! */
889890         tms->interp_period = reload_table[tms->tms5220c_rate&0x3];
890891
891892#ifdef PERFECT_INTERPOLATION_HACK
r8581r8582
966967      }
967968      else // Not a new frame, just interpolate the existing frame.
968969      {
969      if (tms->interp_period == 0) tms->inhibit = 0; // disable inhibit when reaching the last interp period
970         if (tms->interp_period == 0) tms->inhibit = 0; // disable inhibit when reaching the last interp period
970971#ifdef PERFECT_INTERPOLATION_HACK
971      int samples_per_frame = tms->subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
972      int current_sample = ((tms->PC*(3-tms->subc_reload))+((tms->subc_reload?38:25)*tms->interp_period));
973      zpar = OLD_FRAME_UNVOICED_FLAG;
974      // reset the current energy, pitch, etc to what it was at frame start
975      tms->current_energy = tms->coeff->energytable[tms->old_frame_energy_idx];
976      tms->current_pitch = tms->coeff->pitchtable[tms->old_frame_pitch_idx];
977      for (i = 0; i < 4; i++)
978         tms->current_k[i] = tms->coeff->ktable[i][tms->old_frame_k_idx[i]];
979      for (i = 4; i < tms->coeff->num_k; i++)
980         tms->current_k[i] = (tms->coeff->ktable[i][tms->old_frame_k_idx[i]] * (1-zpar));
981      // now adjust each value to be exactly correct for each of the samples per frsme
982      tms->current_energy += (((tms->target_energy - tms->current_energy)*(1-tms->inhibit))*current_sample)/samples_per_frame;
983      tms->current_pitch += (((tms->target_pitch - tms->current_pitch)*(1-tms->inhibit))*current_sample)/samples_per_frame;
984      for (i = 0; i < tms->coeff->num_k; i++)
985         tms->current_k[i] += (((tms->target_k[i] - tms->current_k[i])*(1-tms->inhibit))*current_sample)/samples_per_frame;
972         int samples_per_frame = tms->subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
973         int current_sample = ((tms->PC*(3-tms->subc_reload))+((tms->subc_reload?38:25)*tms->interp_period));
974         zpar = OLD_FRAME_UNVOICED_FLAG;
975         // reset the current energy, pitch, etc to what it was at frame start
976         tms->current_energy = tms->coeff->energytable[tms->old_frame_energy_idx];
977         tms->current_pitch = tms->coeff->pitchtable[tms->old_frame_pitch_idx];
978         for (i = 0; i < 4; i++)
979            tms->current_k[i] = tms->coeff->ktable[i][tms->old_frame_k_idx[i]];
980         for (i = 4; i < tms->coeff->num_k; i++)
981            tms->current_k[i] = (tms->coeff->ktable[i][tms->old_frame_k_idx[i]] * (1-zpar));
982         // now adjust each value to be exactly correct for each of the samples per frsme
983         tms->current_energy += (((tms->target_energy - tms->current_energy)*(1-tms->inhibit))*current_sample)/samples_per_frame;
984         tms->current_pitch += (((tms->target_pitch - tms->current_pitch)*(1-tms->inhibit))*current_sample)/samples_per_frame;
985         for (i = 0; i < tms->coeff->num_k; i++)
986            tms->current_k[i] += (((tms->target_k[i] - tms->current_k[i])*(1-tms->inhibit))*current_sample)/samples_per_frame;
986987#else
987      //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
988      if (tms->subcycle == 2)
989      {
990         switch(tms->PC)
988         //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
989         if (tms->subcycle == 2)
991990         {
992            case 0: /* PC = 0, B cycle, write updated energy */
993            tms->current_energy += (((tms->target_energy - tms->current_energy)*(1-tms->inhibit)) INTERP_SHIFT);
994            break;
995            case 1: /* PC = 1, B cycle, write updated pitch */
996            tms->current_pitch += (((tms->target_pitch - tms->current_pitch)*(1-tms->inhibit)) INTERP_SHIFT);
997            break;
998            case 2: /* PC = 2, B cycle, write updated K1 */
999            tms->current_k[0] += (((tms->target_k[0] - tms->current_k[0])*(1-tms->inhibit)) INTERP_SHIFT);
1000            break;
1001            case 3: /* PC = 3, B cycle, write updated K2 */
1002            tms->current_k[1] += (((tms->target_k[1] - tms->current_k[1])*(1-tms->inhibit)) INTERP_SHIFT);
1003            break;
1004            case 4: /* PC = 4, B cycle, write updated K3 */
1005            tms->current_k[2] += (((tms->target_k[2] - tms->current_k[2])*(1-tms->inhibit)) INTERP_SHIFT);
1006            break;
1007            case 5: /* PC = 5, B cycle, write updated K4 */
1008            tms->current_k[3] += (((tms->target_k[3] - tms->current_k[3])*(1-tms->inhibit)) INTERP_SHIFT);
1009            break;
1010            case 6: /* PC = 6, B cycle, write updated K5 */
1011            tms->current_k[4] += (((tms->target_k[4] - tms->current_k[4])*(1-tms->inhibit)) INTERP_SHIFT);
1012            break;
1013            case 7: /* PC = 7, B cycle, write updated K6 */
1014            tms->current_k[5] += (((tms->target_k[5] - tms->current_k[5])*(1-tms->inhibit)) INTERP_SHIFT);
1015            break;
1016            case 8: /* PC = 8, B cycle, write updated K7 */
1017            tms->current_k[6] += (((tms->target_k[6] - tms->current_k[6])*(1-tms->inhibit)) INTERP_SHIFT);
1018            break;
1019            case 9: /* PC = 9, B cycle, write updated K8 */
1020            tms->current_k[7] += (((tms->target_k[7] - tms->current_k[7])*(1-tms->inhibit)) INTERP_SHIFT);
1021            break;
1022            case 10: /* PC = 10, B cycle, write updated K9 */
1023            tms->current_k[8] += (((tms->target_k[8] - tms->current_k[8])*(1-tms->inhibit)) INTERP_SHIFT);
1024            break;
1025            case 11: /* PC = 11, B cycle, write updated K10 */
1026            tms->current_k[9] += (((tms->target_k[9] - tms->current_k[9])*(1-tms->inhibit)) INTERP_SHIFT);
1027            break;
991            switch(tms->PC)
992            {
993               case 0: /* PC = 0, B cycle, write updated energy */
994               tms->current_energy += (((tms->target_energy - tms->current_energy)*(1-tms->inhibit)) INTERP_SHIFT);
995               break;
996               case 1: /* PC = 1, B cycle, write updated pitch */
997               tms->current_pitch += (((tms->target_pitch - tms->current_pitch)*(1-tms->inhibit)) INTERP_SHIFT);
998               break;
999               case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
1000               /* PC = 2 thru 11, B cycle, write updated K1 thru K10 */
1001               tms->current_k[tms->PC-2] += (((tms->target_k[tms->PC-2] - tms->current_k[tms->PC-2])*(1-tms->inhibit)) INTERP_SHIFT);
1002               break;
1003               case 12: /* PC = 12, do nothing */
1004               break;
1005            }
10281006         }
1029      }
10301007#endif
10311008        }
10321009
r8581r8582
10691046#endif
10701047        }
10711048
1072        /* Update LFSR *20* times every sample, like patent shows */
1049        /* Update LFSR *20* times every sample (once per T cycle), like patent shows */
10731050   for (i=0; i<20; i++)
10741051   {
10751052            bitout = ((tms->RNG >> 12) & 1) ^
r8581r8582
11101087      }
11111088        /* Update all counts */
11121089
1113        size--;
11141090        tms->subcycle++;
11151091        if ((tms->subcycle == 2) && (tms->PC == 12))
11161092        {
r8581r8582
11271103        tms->pitch_count++;
11281104        if (tms->pitch_count >= tms->current_pitch) tms->pitch_count = 0;
11291105        buf_count++;
1106        size--;
11301107    }
11311108
11321109empty:
src/emu/ui.c
r8581r8582
753753                target_y - UI_BOX_TB_BORDER,
754754                target_x + target_width + UI_BOX_LR_BORDER,
755755                target_y + target_height + UI_BOX_TB_BORDER, backcolor);
756   ui_draw_text_full(container, text, target_x, target_y, target_width + UI_BOX_LR_BORDER,
756   ui_draw_text_full(container, text, target_x, target_y, target_width,
757757            justify, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
758758}
759759
r8581r8582
18171817{
18181818   device_t *cpu = (device_t *)arg;
18191819   if (newval != SLIDER_NOCHANGE)
1820      cpu_set_clockscale(cpu, (float)newval * 0.001f);
1820      cpu->set_clock_scale((float)newval * 0.001f);
18211821   if (string != NULL)
1822      string->printf("%3.0f%%", floor(cpu_get_clockscale(cpu) * 100.0f + 0.5f));
1823   return floor(cpu_get_clockscale(cpu) * 1000.0f + 0.5f);
1822      string->printf("%3.0f%%", floor(cpu->clock_scale() * 100.0f + 0.5f));
1823   return floor(cpu->clock_scale() * 1000.0f + 0.5f);
18241824}
18251825
18261826
src/emu/softlist.c
r8581r8582
11361136
11371137      /* Tell the world which part we actually loaded */
11381138      *full_sw_name = auto_alloc_array( image->device().machine, char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 );
1139      sprintf( *full_sw_name, "%s:%s:%s", swlist_name, software_info_ptr->shortname, software_part_ptr->name );     
1139      sprintf( *full_sw_name, "%s:%s:%s", swlist_name, software_info_ptr->shortname, software_part_ptr->name );
11401140   }
11411141
11421142   /* Close the software list if it's still open */
src/emu/devimage.c
r8581r8582
315315            UINT32 crc = 0;
316316            UINT8 crcbytes[4];
317317            file_error filerr;
318           
318
319319            bool has_crc = hash_data_extract_binary_checksum(ROM_GETHASHDATA(romp), HASH_CRC, crcbytes);
320320            if (has_crc)
321321               crc = (crcbytes[0] << 24) | (crcbytes[1] << 16) | (crcbytes[2] << 8) | crcbytes[3];
322               
322
323323            astring fname(swlist, PATH_SEPARATOR, swname, PATH_SEPARATOR, ROM_GETNAME(romp));
324324            if (has_crc)
325325               filerr = mame_fopen_crc(SEARCHPATH_ROM, fname, crc, OPEN_FLAG_READ, &m_mame_file);
326326            else
327327               filerr = mame_fopen(SEARCHPATH_ROM, fname, OPEN_FLAG_READ, &m_mame_file);
328               
328
329329            if (filerr == FILERR_NONE)
330330            {
331331               m_file = mame_core_file(m_mame_file);
r8581r8582
380380            goto done;
381381      }
382382   }
383   
383
384384   /* Copy some image information when we have been loaded through a software list */
385385   if ( m_software_info_ptr )
386386   {
r8581r8582
606606void *legacy_image_device_base::get_device_specific_call()
607607{
608608   return (void*) m_config.get_legacy_config_fct(DEVINFO_FCT_DEVICE_SPECIFIC);
609}
No newline at end of file
609}
src/emu/devcpu.h
r8581r8582
295295#define cpu_spinuntil_time               device_spin_until_time
296296#define cpu_spinuntil_int               device_spin_until_interrupt
297297
298// CPU clock management
299#define cpu_get_clock                  device_get_clock
300#define cpu_set_clock                  device_set_clock
301#define cpu_get_clockscale               device_get_clock_scale
302#define cpu_set_clockscale               device_set_clock_scale
303
304298// CPU timing
305299#define cpu_eat_cycles                  device_eat_cycles
306300#define cpu_adjust_icount               device_adjust_icount
src/emu/emu.mak
r8581r8582
259259
260260$(EMUOBJ)/rendfont.o:   $(EMUOBJ)/uismall.fh
261261
262$(EMUOBJ)/video.o:      $(EMUSRC)/rendersw.c
262$(EMUOBJ)/video.o:   $(EMUSRC)/rendersw.c
263$(EMUVIDEO)/v9938.o:   $(EMUSRC)/video/v9938mod.c
263264
264265
265
266266#-------------------------------------------------
267267# core layouts
268268#-------------------------------------------------
src/emu/mame.c
r8581r8582
564564   filerr = mame_fopen_options(options, SEARCHPATH_INI, fname, OPEN_FLAG_READ, &file);
565565   if (filerr != FILERR_NONE)
566566      return FALSE;
567   
567
568568   /* update game name so depending callback options could be added */
569   if (priority==OPTION_PRIORITY_DRIVER_INI) {     
569   if (priority==OPTION_PRIORITY_DRIVER_INI) {
570570      options_force_option_callback(options, OPTION_GAMENAME, name, priority);
571571   }
572   
572
573573   /* parse the file and close it */
574   mame_printf_verbose("Parsing %s.ini\n", name);   
574   mame_printf_verbose("Parsing %s.ini\n", name);
575575   options_parse_ini_file(options, mame_core_file(file), priority);
576576   mame_fclose(file);
577577   return TRUE;
src/emu/machine/6840ptm.c
r8581r8582
5959
6060static const char *const opmode[] =
6161{
62   "000 continous mode",
62   "000 continuous mode",
6363   "001 freq comparison mode",
64   "010 continous mode",
64   "010 continuous mode",
6565   "011 pulse width comparison mode",
6666   "100 single shot mode",
6767   "101 freq comparison mode",
src/emu/machine/tmp68301.c
r8581r8582
9090      {
9191         int scale = (TCR & 0x3c00)>>10;         // P4..1
9292         if (scale > 8) scale = 8;
93         duration = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(machine->firstcpu)), (1 << scale) * max);
93         duration = attotime_mul(ATTOTIME_IN_HZ(machine->firstcpu->unscaled_clock()), (1 << scale) * max);
9494      }
9595      break;
9696   }
src/emu/machine/i2cmem.c
r8581r8582
126126      *static_cast<i2cmem_interface *>(this) = *intf;
127127   }
128128
129   m_space_config = address_space_config( "ic2mem", ENDIANNESS_BIG, 8,  m_address_bits, 0, *ADDRESS_MAP_NAME( i2cmem_map8 ) );
129   m_space_config = address_space_config( "i2cmem", ENDIANNESS_BIG, 8,  m_address_bits, 0, *ADDRESS_MAP_NAME( i2cmem_map8 ) );
130130}
131131
132132
src/emu/machine/mb3773.c
r8581r8582
88    Todo:
99        Calculate the timeout from parameters.
1010
11
12    2009-06 Converted to be a device
13
1411***************************************************************************/
1512
1613#include "emu.h"
1714#include "mb3773.h"
1815
19/***************************************************************************
20    TYPE DEFINITIONS
21***************************************************************************/
2216
23typedef struct _mb3773_state mb3773_state;
24struct _mb3773_state
17
18//**************************************************************************
19//  DEVICE CONFIGURATION
20//**************************************************************************
21
22//-------------------------------------------------
23//  mb3773_device_config - constructor
24//-------------------------------------------------
25
26mb3773_device_config::mb3773_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock ) :
27   device_config( mconfig, static_alloc_device_config, "MB3773", tag, owner, clock)
2528{
26   emu_timer *watchdog_timer;
27   UINT8 ck;
28};
29}
2930
30/***************************************************************************
31    INLINE FUNCTIONS
32***************************************************************************/
3331
34INLINE mb3773_state *get_safe_token(running_device *device)
32
33//-------------------------------------------------
34//  static_alloc_device_config - allocate a new
35//  configuration object
36//-------------------------------------------------
37
38device_config *mb3773_device_config::static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
3539{
36   assert(device != NULL);
37   assert((device->type() == MB3773));
38   return (mb3773_state *)downcast<legacy_device_base *>(device)->token();
40   return global_alloc( mb3773_device_config( mconfig, tag, owner, clock ) );
3941}
4042
41/***************************************************************************
42    IMPLEMENTATION
43***************************************************************************/
4443
45/*-------------------------------------------------
46    TIMER_CALLBACK( watchdog_timeout )
47-------------------------------------------------*/
4844
49static TIMER_CALLBACK( watchdog_timeout )
45//-------------------------------------------------
46//  alloc_device - allocate a new device object
47//-------------------------------------------------
48
49device_t *mb3773_device_config::alloc_device( running_machine &machine ) const
5050{
51   machine->schedule_soft_reset();
51   return auto_alloc( &machine, mb3773_device( machine, *this ) );
5252}
5353
54/*-------------------------------------------------
55    reset_timer
56-------------------------------------------------*/
5754
58static void reset_timer( running_device *device )
55
56//-------------------------------------------------
57//  device_config_complete - perform any
58//  operations now that the configuration is
59//  complete
60//-------------------------------------------------
61
62void mb3773_device_config::device_config_complete()
5963{
60   mb3773_state *mb3773 = get_safe_token(device);
61   timer_adjust_oneshot(mb3773->watchdog_timer, ATTOTIME_IN_SEC( 5 ), 0);
6264}
6365
64/*-------------------------------------------------
65    mb3773_set_ck
66-------------------------------------------------*/
6766
68WRITE8_DEVICE_HANDLER( mb3773_set_ck )
67//-------------------------------------------------
68//  device_validity_check - perform validity checks
69//  on this device
70//-------------------------------------------------
71
72bool mb3773_device_config::device_validity_check( const game_driver &driver ) const
6973{
70   mb3773_state *mb3773 = get_safe_token(device);
71   if( data == 0 && mb3773->ck != 0 )
72   {
73      reset_timer(device);
74   }
75   mb3773->ck = data;
74   return false;
7675}
7776
78/*-------------------------------------------------
79    DEVICE_START( mb3773 )
80-------------------------------------------------*/
8177
82static DEVICE_START( mb3773 )
78
79
80//**************************************************************************
81//  LIVE DEVICE
82//**************************************************************************
83
84//-------------------------------------------------
85//  mb3773_device - constructor
86//-------------------------------------------------
87
88mb3773_device::mb3773_device( running_machine &_machine, const mb3773_device_config &config ) :
89   device_t( _machine, config ),
90   m_config( config )
8391{
84   mb3773_state *mb3773 = get_safe_token(device);
92}
8593
86   /* create the timer */
87   mb3773->watchdog_timer = timer_alloc(device->machine, watchdog_timeout, NULL);
88   reset_timer(device);
8994
90   /* register for state saving */
91   state_save_register_device_item(device, 0, mb3773->ck);
95//-------------------------------------------------
96//  device_start - device-specific startup
97//-------------------------------------------------
98
99void mb3773_device::device_start()
100{
101   m_watchdog_timer = timer_alloc( &m_machine, watchdog_timeout, this );
102   reset_timer();
103
104   state_save_register_device_item( this, 0, m_ck );
92105}
93106
94/*-------------------------------------------------
95    DEVICE_RESET( mb3773 )
96-------------------------------------------------*/
97107
98static DEVICE_RESET( mb3773 )
108//-------------------------------------------------
109//  device_reset - device-specific reset
110//-------------------------------------------------
111
112void mb3773_device::device_reset()
99113{
100   mb3773_state *mb3773 = get_safe_token(device);
101   mb3773->ck = 0;
114   m_ck = 0;
102115}
103116
104/*-------------------------------------------------
105    DEVICE_GET_INFO( mb3773 )
106-------------------------------------------------*/
107117
108static const char DEVTEMPLATE_SOURCE[] = __FILE__;
109118
110#define DEVTEMPLATE_ID(p,s)      p##mb3773##s
111#define DEVTEMPLATE_FEATURES   DT_HAS_START | DT_HAS_RESET
112#define DEVTEMPLATE_NAME      "Fujistu MB3773"
113#define DEVTEMPLATE_FAMILY      "Fujistu Power Supply Monitor"
114#include "devtempl.h"
119//**************************************************************************
120//  READ/WRITE HANDLERS
121//**************************************************************************
115122
123WRITE_LINE_DEVICE_HANDLER( mb3773_set_ck )
124{
125   downcast<mb3773_device *>( device )->set_ck( state );
126}
116127
117DEFINE_LEGACY_DEVICE(MB3773, mb3773);
128void mb3773_device::set_ck( int state )
129{
130   state &= 1;
131
132   if( state == 0 && m_ck != 0 )
133   {
134      reset_timer();
135   }
136
137   m_ck = state;
138}
139
140
141//**************************************************************************
142//  INTERNAL HELPERS
143//**************************************************************************
144
145void mb3773_device::reset_timer()
146{
147   timer_adjust_oneshot( m_watchdog_timer, ATTOTIME_IN_SEC( 5 ), 0 );
148}
149
150TIMER_CALLBACK( mb3773_device::watchdog_timeout )
151{
152   reinterpret_cast<mb3773_device *>(ptr)->m_machine.schedule_soft_reset();
153}
154
155
156
157const device_type MB3773 = mb3773_device_config::static_alloc_device_config;
src/emu/machine/mb3773.h
r8581r8582
66
77***************************************************************************/
88
9#pragma once
10
911#ifndef __MB3773_H__
1012#define __MB3773_H__
1113
12#include "devlegcy.h"
1314
15//**************************************************************************
16//  INTERFACE CONFIGURATION MACROS
17//**************************************************************************
1418
15/***************************************************************************
16    MACROS / CONSTANTS
17***************************************************************************/
18
19DECLARE_LEGACY_DEVICE(MB3773, mb3773);
20
2119#define MDRV_MB3773_ADD(_tag) \
2220   MDRV_DEVICE_ADD(_tag, MB3773, 0)
2321
2422
25/***************************************************************************
26    PROTOTYPES
27***************************************************************************/
23// ======================> mb3773_device_config
2824
29extern WRITE8_DEVICE_HANDLER( mb3773_set_ck );
25class mb3773_device_config :
26   public device_config
27{
28   friend class mb3773_device;
3029
31#endif   /* __MB3773_H__ */
30   // construction/destruction
31   mb3773_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
32
33public:
34   // allocators
35   static device_config *static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
36   virtual device_t *alloc_device( running_machine &machine ) const;
37
38protected:
39   // device_config overrides
40   virtual void device_config_complete();
41   virtual bool device_validity_check( const game_driver &driver ) const;
42};
43
44
45// ======================> mb3773_device
46
47class mb3773_device :
48   public device_t
49{
50   friend class mb3773_device_config;
51
52   // construction/destruction
53   mb3773_device( running_machine &_machine, const mb3773_device_config &config );
54
55public:
56   // I/O operations
57   void set_ck( int state );
58
59protected:
60   // device-level overrides
61   virtual void device_start();
62   virtual void device_reset();
63
64   // internal helpers
65   static TIMER_CALLBACK( watchdog_timeout );
66   void reset_timer();
67
68   // internal state
69   const mb3773_device_config &m_config;
70   emu_timer *m_watchdog_timer;
71   int m_ck;
72};
73
74
75// device type definition
76extern const device_type MB3773;
77
78
79//**************************************************************************
80//  READ/WRITE HANDLERS
81//**************************************************************************
82
83WRITE_LINE_DEVICE_HANDLER( mb3773_set_ck );
84
85#endif
src/emu/machine/at28c16.c
r8581r8582
88#include "emu.h"
99#include "machine/at28c16.h"
1010
11#define SIZE_DATA ( 0x800 )
12#define SIZE_ID ( 0x020 )
13#define OFFSET_ID ( SIZE_DATA - SIZE_ID )
11#define AT28C16_DATA_BYTES ( 0x800 )
12#define AT28C16_ID_BYTES ( 0x20 )
13#define AT28C16_TOTAL_BYTES ( AT28C16_DATA_BYTES + AT28C16_ID_BYTES )
1414
15typedef struct
15#define AT28C16_ID_OFFSET ( AT28C16_DATA_BYTES - AT28C16_ID_BYTES )
16
17
18
19//**************************************************************************
20//  GLOBAL VARIABLES
21//**************************************************************************
22
23
24static ADDRESS_MAP_START( at28c16_map8, ADDRESS_SPACE_PROGRAM, 8 )
25   AM_RANGE(0x0000, 0x081f) AM_RAM
26ADDRESS_MAP_END
27
28
29
30//**************************************************************************
31//  DEVICE CONFIGURATION
32//**************************************************************************
33
34//-------------------------------------------------
35//  at28c16_device_config - constructor
36//-------------------------------------------------
37
38at28c16_device_config::at28c16_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock ) :
39   device_config( mconfig, static_alloc_device_config, "AT28C16", tag, owner, clock),
40   device_config_memory_interface(mconfig, *this),
41   device_config_nvram_interface(mconfig, *this)
1642{
17   UINT8 *data;
18   UINT8 *id;
19   UINT8 *default_data;
20   UINT8 *default_id;
21   int last_write;
22   int a9_12v;
23   int oe_12v;
24   emu_timer *write_timer;
25} at28c16_state;
43}
2644
27static TIMER_CALLBACK( write_finished )
45
46
47//-------------------------------------------------
48//  static_alloc_device_config - allocate a new
49//  configuration object
50//-------------------------------------------------
51
52device_config *at28c16_device_config::static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
2853{
29   at28c16_state *c = (at28c16_state *) ptr;
30   c->last_write = -1;
54   return global_alloc( at28c16_device_config( mconfig, tag, owner, clock ) );
3155}
3256
33/*-------------------------------------------------
34    get_safe_token - makes sure that the passed
35    in device is, in fact, an AT28C16
36-------------------------------------------------*/
3757
38INLINE at28c16_state *get_safe_token(running_device *device)
58
59//-------------------------------------------------
60//  alloc_device - allocate a new device object
61//-------------------------------------------------
62
63device_t *at28c16_device_config::alloc_device( running_machine &machine ) const
3964{
40   assert(device != NULL);
41   assert(device->type() == AT28C16);
65   return auto_alloc( &machine, at28c16_device( machine, *this ) );
66}
4267
43   return (at28c16_state *)downcast<legacy_device_base *>(device)->token();
68
69//-------------------------------------------------
70//  device_config_complete - perform any
71//  operations now that the configuration is
72//  complete
73//-------------------------------------------------
74
75void at28c16_device_config::device_config_complete()
76{
77   m_space_config = address_space_config( "at28c16", ENDIANNESS_BIG, 8,  12, 0, *ADDRESS_MAP_NAME( at28c16_map8 ) );
4478}
4579
46WRITE8_DEVICE_HANDLER( at28c16_w )
80
81//-------------------------------------------------
82//  device_validity_check - perform validity checks
83//  on this device
84//-------------------------------------------------
85
86bool at28c16_device_config::device_validity_check( const game_driver &driver ) const
4787{
48   at28c16_state *c = get_safe_token(device);
88   return false;
89}
4990
50   if( c->last_write >= 0 )
91
92//-------------------------------------------------
93//  memory_space_config - return a description of
94//  any address spaces owned by this device
95//-------------------------------------------------
96
97const address_space_config *at28c16_device_config::memory_space_config( int spacenum ) const
98{
99   return ( spacenum == 0 ) ? &m_space_config : NULL;
100}
101
102
103
104
105//**************************************************************************
106//  LIVE DEVICE
107//**************************************************************************
108
109//-------------------------------------------------
110//  at28c16_device - constructor
111//-------------------------------------------------
112
113at28c16_device::at28c16_device( running_machine &_machine, const at28c16_device_config &config ) :
114   device_t( _machine, config ),
115   device_memory_interface( _machine, config, *this ),
116   device_nvram_interface( _machine, config, *this ),
117   m_config( config ),
118   m_a9_12v( 0 ),
119   m_oe_12v( 0 ),
120   m_last_write( -1 )
121{
122}
123
124
125//-------------------------------------------------
126//  device_start - device-specific startup
127//-------------------------------------------------
128
129void at28c16_device::device_start()
130{
131   m_write_timer = timer_alloc( &m_machine,  write_finished, this );
132
133   state_save_register_device_item( this, 0, m_a9_12v );
134   state_save_register_device_item( this, 0, m_oe_12v );
135   state_save_register_device_item( this, 0, m_last_write );
136}
137
138
139//-------------------------------------------------
140//  device_reset - device-specific reset
141//-------------------------------------------------
142
143void at28c16_device::device_reset()
144{
145}
146
147
148//-------------------------------------------------
149//  nvram_default - called to initialize NVRAM to
150//  its default state
151//-------------------------------------------------
152
153void at28c16_device::nvram_default()
154{
155   UINT16 default_value = 0xff;
156   for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
51157   {
52//      logerror( "%s: at28c16_write( %d, %04x, %02x ) busy\n", cpuexec_describe_context(machine), chip, offset, data );
158      memory_write_byte( m_addrspace[ 0 ], offs, default_value );
53159   }
54   else if( c->oe_12v )
160
161   /* populate from a memory region if present */
162   if( m_region != NULL )
55163   {
56//      logerror( "%s: at28c16_write( %d, %04x, %02x ) erase\n", cpuexec_describe_context(machine), chip, offset, data );
57      if( c->last_write < 0 )
164      if( m_region->bytes() != AT28C16_DATA_BYTES )
58165      {
59         memset( c->data, 0xff, SIZE_DATA );
60         memset( c->id, 0xff, SIZE_ID );
61         c->last_write = 0xff;
62         timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
166         fatalerror( "at28c16 region '%s' wrong size (expected size = 0x%X)", tag(), AT28C16_DATA_BYTES );
63167      }
64   }
65   else if( offset >= OFFSET_ID && c->a9_12v )
66   {
67//      logerror( "%s: at28c16_write( %d, %04x, %02x ) id\n", cpuexec_describe_context(machine), chip, offset, data );
68      if( c->last_write < 0 && c->id[ offset - OFFSET_ID ] != data )
168
169      if( m_region->width() != 1 )
69170      {
70         c->id[ offset - OFFSET_ID ] = data;
71         c->last_write = data;
72         timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
171         fatalerror( "at28c16 region '%s' needs to be an 8-bit region", tag() );
73172      }
74   }
75   else
76   {
77//      logerror( "%s: at28c16_write( %d, %04x, %02x ) data\n", cpuexec_describe_context(machine), chip, offset, data );
78      if( c->last_write < 0 && c->data[ offset ] != data )
173
174      for( offs_t offs = 0; offs < AT28C16_DATA_BYTES; offs++ )
79175      {
80         c->data[ offset ] = data;
81         c->last_write = data;
82         timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
176         memory_write_byte( m_addrspace[ 0 ], offs, m_region->u8( offs ) );
83177      }
84178   }
85179}
86180
87181
88READ8_DEVICE_HANDLER( at28c16_r )
182//-------------------------------------------------
183//  nvram_read - called to read NVRAM from the
184//  .nv file
185//-------------------------------------------------
186
187void at28c16_device::nvram_read( mame_file &file )
89188{
90   at28c16_state *c = get_safe_token(device);
189   UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );
91190
92   if( c->last_write >= 0 )
191   mame_fread( &file, buffer, AT28C16_TOTAL_BYTES );
192
193   for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
93194   {
94//      logerror( "at28c16_read( %04x ) write status\n", offset );
95      return c->last_write ^ 0x80;
195      memory_write_byte( m_addrspace[ 0 ], offs, buffer[ offs ] );
96196   }
97   else if( offset >= OFFSET_ID && c->a9_12v )
98   {
99//      logerror( "at28c16_read( %04x ) id\n", offset );
100      return c->id[ offset - OFFSET_ID ];
101   }
102   else
103   {
104//      logerror( "%s: at28c16_read( %d, %04x ) %02x data\n", cpuexec_describe_context(machine), chip, offset, c->data[ offset ] );
105      return c->data[ offset ];
106   }
197
198   auto_free( &m_machine, buffer );
107199}
108200
109WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v )
201//-------------------------------------------------
202//  nvram_write - called to write NVRAM to the
203//  .nv file
204//-------------------------------------------------
205
206void at28c16_device::nvram_write( mame_file &file )
110207{
111   at28c16_state *c = get_safe_token(device);
208   UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );
112209
113   c->a9_12v = state & 1;
114}
210   for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
211   {
212      buffer[ offs ] = memory_read_byte( m_addrspace[ 0 ], offs );
213   }
115214
116WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v )
117{
118   at28c16_state *c = get_safe_token(device);
215   mame_fwrite( &file, buffer, AT28C16_TOTAL_BYTES );
119216
120   c->oe_12v = state & 1;
217   auto_free( &m_machine, buffer );
121218}
122219
123/*-------------------------------------------------
124    device start callback
125-------------------------------------------------*/
126220
127static DEVICE_START(at28c16)
221
222//**************************************************************************
223//  READ/WRITE HANDLERS
224//**************************************************************************
225
226WRITE8_DEVICE_HANDLER( at28c16_w )
128227{
129   at28c16_state *c = get_safe_token(device);
130   const at28c16_config *config;
228   downcast<at28c16_device *>( device )->write( offset, data );
229}
131230
132   /* validate some basic stuff */
133   assert(device != NULL);
134//  assert(device->baseconfig().static_config() != NULL);
135//  assert(device->baseconfig().inline_config == NULL);
136   assert(device->machine != NULL);
137   assert(device->machine->config != NULL);
231void at28c16_device::write( offs_t offset, UINT8 data )
232{
233   if( m_last_write >= 0 )
234   {
235//      logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", cpuexec_describe_context(machine), offset, data );
236   }
237   else if( m_oe_12v )
238   {
239//      logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", cpuexec_describe_context(machine), offset, data );
240      if( m_last_write < 0 )
241      {
242         for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
243         {
244            memory_write_byte( m_addrspace[ 0 ], offs, 0xff );
245         }
138246
139   c->data = auto_alloc_array( device->machine, UINT8, SIZE_DATA );
140   c->id = auto_alloc_array( device->machine, UINT8, SIZE_ID );
141   c->a9_12v = 0;
142   c->oe_12v = 0;
143   c->last_write = -1;
144   c->write_timer = timer_alloc(device->machine,  write_finished, c );
145   c->default_data = *device->region();
247         m_last_write = 0xff;
248         timer_adjust_oneshot( m_write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
249      }
250   }
251   else
252   {
253      if( m_a9_12v && offset >= AT28C16_ID_OFFSET )
254      {
255         offset += AT28C16_ID_BYTES;
256      }
146257
147   config = (const at28c16_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
148   if (config->id != NULL)
149      c->default_id = memory_region( device->machine, config->id );
150
151   /* create the name for save states */
152   state_save_register_device_item_pointer( device, 0, c->data, SIZE_DATA );
153   state_save_register_device_item_pointer( device, 0, c->id, SIZE_ID );
154   state_save_register_device_item( device, 0, c->a9_12v );
155   state_save_register_device_item( device, 0, c->oe_12v );
156   state_save_register_device_item( device, 0, c->last_write );
258//      logerror( "%s: AT28C16: write( %04x, %02x )\n", cpuexec_describe_context(machine), offset, data );
259      if( m_last_write < 0 && memory_read_byte( m_addrspace[ 0 ], offset ) != data )
260      {
261         memory_write_byte( m_addrspace[ 0 ], offset, data );
262         m_last_write = data;
263         timer_adjust_oneshot( m_write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
264      }
265   }
157266}
158267
159/*-------------------------------------------------
160    device reset callback
161-------------------------------------------------*/
162268
163static DEVICE_RESET(at28c16)
269READ8_DEVICE_HANDLER( at28c16_r )
164270{
271   return downcast<at28c16_device *>( device )->read( offset );
165272}
166273
167static DEVICE_NVRAM(at28c16)
274UINT8 at28c16_device::read( offs_t offset )
168275{
169   at28c16_state *c = get_safe_token(device);
170
171   if( read_or_write )
276   if( m_last_write >= 0 )
172277   {
173      mame_fwrite( file, c->data, SIZE_DATA );
174      mame_fwrite( file, c->id, SIZE_ID );
278      UINT8 data = m_last_write ^ 0x80;
279//      logerror( "%s: AT28C16: read( %04x ) write status %02x\n", cpuexec_describe_context(machine), offset, data );
280      return data;
175281   }
176282   else
177283   {
178      if( file )
284      if( m_a9_12v && offset >= AT28C16_ID_OFFSET )
179285      {
180         mame_fread( file, c->data, SIZE_DATA );
181         mame_fread( file, c->id, SIZE_ID );
286         offset += AT28C16_ID_BYTES;
182287      }
183      else
184      {
185         if( c->default_data != NULL )
186         {
187            memcpy( c->data, c->default_data, SIZE_DATA );
188         }
189         else
190         {
191            memset( c->data, 0xff, SIZE_DATA );
192         }
193288
194         if( c->default_id != NULL )
195         {
196            memcpy( c->id, c->default_id, SIZE_ID );
197         }
198         else
199         {
200            memset( c->id, 0xff, SIZE_ID );
201         }
202      }
289      UINT8 data = memory_read_byte( m_addrspace[ 0 ], offset );
290//      logerror( "%s: AT28C16: read( %04x ) data %02x\n", cpuexec_describe_context(machine), offset, data );
291      return data;
203292   }
204293}
205294
206/*-------------------------------------------------
207    device get info callback
208-------------------------------------------------*/
209295
210DEVICE_GET_INFO(at28c16)
296WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v )
211297{
212   switch (state)
298   downcast<at28c16_device *>( device )->set_a9_12v( state );
299}
300
301void at28c16_device::set_a9_12v( int state )
302{
303   state &= 1;
304   if( m_a9_12v != state )
213305   {
214      /* --- the following bits of info are returned as 64-bit signed integers --- */
215      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(at28c16_state); break;
216      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = sizeof(at28c16_config); break;
306//      logerror( "%s: AT28C16: set_a9_12v( %d )\n", cpuexec_describe_context(machine), state );
307      m_a9_12v = state;
308   }
309}
217310
218      /* --- the following bits of info are returned as pointers to data or functions --- */
219      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(at28c16); break;
220      case DEVINFO_FCT_STOP:               /* nothing */ break;
221      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(at28c16); break;
222      case DEVINFO_FCT_NVRAM:               info->nvram = DEVICE_NVRAM_NAME(at28c16); break;
223311
224      /* --- the following bits of info are returned as NULL-terminated strings --- */
225      case DEVINFO_STR_NAME:               strcpy(info->s, "AT28C16"); break;
226      case DEVINFO_STR_FAMILY:            strcpy(info->s, "EEPROM"); break;
227      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0"); break;
228      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__); break;
229      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
312WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v )
313{
314   downcast<at28c16_device *>( device )->set_oe_12v( state );
315}
316
317void at28c16_device::set_oe_12v( int state )
318{
319   state &= 1;
320   if( m_oe_12v != state )
321   {
322//      logerror( "%s: AT28C16: set_oe_12v( %d )\n", cpuexec_describe_context(machine), state );
323      m_oe_12v = state;
230324   }
231325}
232326
233327
234DEFINE_LEGACY_NVRAM_DEVICE(AT28C16, at28c16);
328//**************************************************************************
329//  INTERNAL HELPERS
330//**************************************************************************
331
332TIMER_CALLBACK( at28c16_device::write_finished )
333{
334   reinterpret_cast<at28c16_device *>(ptr)->m_last_write = -1;
335}
336
337
338
339const device_type AT28C16 = at28c16_device_config::static_alloc_device_config;
src/emu/machine/at28c16.h
r8581r8582
1/*
2 * ATMEL AT28C16
3 *
4 * 16K ( 2K x 8 ) Parallel EEPROM
5 *
6 */
1/***************************************************************************
72
8#if !defined( AT28C16_H )
9#define AT28C16_H ( 1 )
3    ATMEL AT28C16
104
11#include "devlegcy.h"
5    16K ( 2K x 8 ) Parallel EEPROM
126
13typedef struct _at28c16_config at28c16_config;
14struct _at28c16_config
7***************************************************************************/
8
9#pragma once
10
11#ifndef __AT28C16_H__
12#define __AT28C16_H__
13
14
15//**************************************************************************
16//  INTERFACE CONFIGURATION MACROS
17//**************************************************************************
18
19#define MDRV_AT28C16_ADD( _tag, _interface ) \
20   MDRV_DEVICE_ADD( _tag, AT28C16, 0 )
21
22
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26
27// ======================> at28c16_interface
28
29struct at28c16_interface
1530{
16   const char *id;
1731};
1832
19DECLARE_LEGACY_NVRAM_DEVICE(AT28C16, at28c16);
2033
21#define MDRV_AT28C16_ADD(_tag, _id) \
22   MDRV_DEVICE_ADD(_tag, AT28C16, 0) \
23   MDRV_DEVICE_CONFIG_DATAPTR(at28c16_config, id, _id)
34// ======================> at28c16_device_config
2435
36class at28c16_device_config :
37   public device_config,
38   public device_config_memory_interface,
39   public device_config_nvram_interface,
40   public at28c16_interface
41{
42   friend class at28c16_device;
2543
26WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v );
27WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v );
44   // construction/destruction
45   at28c16_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
2846
29/* memory handlers */
47public:
48   // allocators
49   static device_config *static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
50   virtual device_t *alloc_device( running_machine &machine ) const;
3051
52   // inline configuration indexes
53   enum
54   {
55      INLINE_INTERFACE
56   };
57
58protected:
59   // device_config overrides
60   virtual void device_config_complete();
61   virtual bool device_validity_check( const game_driver &driver ) const;
62
63   // device_config_memory_interface overrides
64   virtual const address_space_config *memory_space_config( int spacenum = 0 ) const;
65
66   // device-specific configuration
67   address_space_config m_space_config;
68};
69
70
71// ======================> at28c16_device
72
73class at28c16_device :
74   public device_t,
75   public device_memory_interface,
76   public device_nvram_interface
77{
78   friend class at28c16_device_config;
79
80   // construction/destruction
81   at28c16_device( running_machine &_machine, const at28c16_device_config &config );
82
83public:
84   // I/O operations
85   void write( offs_t offset, UINT8 data );
86   UINT8 read( offs_t offset );
87   void set_a9_12v( int state );
88   void set_oe_12v( int state );
89
90protected:
91   // device-level overrides
92   virtual void device_start();
93   virtual void device_reset();
94
95   // device_nvram_interface overrides
96   virtual void nvram_default();
97   virtual void nvram_read( mame_file &file );
98   virtual void nvram_write( mame_file &file );
99
100   // internal helpers
101   static TIMER_CALLBACK( write_finished );
102
103   // internal state
104   const at28c16_device_config &m_config;
105   emu_timer *m_write_timer;
106   int m_a9_12v;
107   int m_oe_12v;
108   int m_last_write;
109};
110
111
112// device type definition
113extern const device_type AT28C16;
114
115
116//**************************************************************************
117//  READ/WRITE HANDLERS
118//**************************************************************************
119
31120WRITE8_DEVICE_HANDLER( at28c16_w );
32121READ8_DEVICE_HANDLER( at28c16_r );
122WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v );
123WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v );
33124
34125#endif
src/lib/util/options.c
r8581r8582
496496
497497/*-------------------------------------------------
498498    options_force_option_callback - set option value
499   and execute callback call
499    and execute callback call
500500-------------------------------------------------*/
501501
502502int options_force_option_callback(core_options *opts, const char *optionname, const char *newval, int priority)
r8581r8582
513513      (*data->callback)(opts, newval);
514514
515515   /* allocate a new copy of data for this */
516   update_data(opts, data, newval, priority);   
516   update_data(opts, data, newval, priority);
517517   return 0;
518518}
519519
src/mess/drivers/pasopia.c
r8581r8582
212212   {
213213      res &= p7_vram[offset | 0x8000];
214214      attr_latch = p7_vram[offset | 0xc000];
215      i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), 1,  (attr_latch << 4) | (attr_latch & 0x7));
215      i8255a_w(space->machine->device("ppi8255_0"), 1,  (attr_latch << 4) | (attr_latch & 0x7));
216216   }
217217
218218   return res;
r8581r8582
237237         p7_vram[offset | 0x8000] = (plane_reg & 4) ? data : 0xff;
238238         attr_latch = attr_wrap ? attr_latch : attr_data;
239239         p7_vram[offset | 0xc000] = attr_latch;
240         i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7));
240         i8255a_w(space->machine->device("ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7));
241241      }
242242   }
243243}
r8581r8582
349349   if(offset == 0)
350350   {
351351      addr_latch = data;
352      mc6845_address_w(devtag_get_device(space->machine, "crtc"), 0,data);
352      mc6845_address_w(space->machine->device("crtc"), 0,data);
353353   }
354354   else
355355   {
r8581r8582
361361      else if(addr_latch == 0x0f)
362362         cursor_addr = (cursor_addr & 0x3f00) | (data & 0xff);
363363
364      mc6845_register_w(devtag_get_device(space->machine, "crtc"), 0,data);
364      mc6845_register_w(space->machine->device("crtc"), 0,data);
365365   }
366366}
367367
r8581r8582
380380
381381   io_port = offset & 0xff; //trim down to 8-bit bus
382382
383   if(io_port >= 0x08 && io_port <= 0x0b)       { return i8255a_r(devtag_get_device(space->machine, "ppi8255_0"), (io_port-0x08) & 3); }
384   else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_1"), (io_port-0x0c) & 3); }
383   if(io_port >= 0x08 && io_port <= 0x0b)       { return i8255a_r(space->machine->device("ppi8255_0"), (io_port-0x08) & 3); }
384   else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3); }
385385//   else if(io_port == 0x10 || io_port == 0x11) { M6845 read }
386386   else if(io_port >= 0x18 && io_port <= 0x1b) { return pac2_r(space, io_port-0x1b);  }
387   else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_2"), (io_port-0x20) & 3); }
388   else if(io_port >= 0x28 && io_port <= 0x2b) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), io_port-0x28);  }
389   else if(io_port >= 0x30 && io_port <= 0x33) { return z80pio_cd_ba_r(devtag_get_device(space->machine, "z80pio_0"), (io_port-0x30) & 3); }
387   else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(space->machine->device("ppi8255_2"), (io_port-0x20) & 3); }
388   else if(io_port >= 0x28 && io_port <= 0x2b) { return z80ctc_r(space->machine->device("ctc"), io_port-0x28);  }
389   else if(io_port >= 0x30 && io_port <= 0x33) { return z80pio_cd_ba_r(space->machine->device("z80pio_0"), (io_port-0x30) & 3); }
390390//   else if(io_port == 0x3a)                  { SN1 }
391391//   else if(io_port == 0x3b)                  { SN2 }
392392//   else if(io_port == 0x3c)                  { bankswitch }
r8581r8582
412412
413413   io_port = offset & 0xff; //trim down to 8-bit bus
414414
415   if(io_port >= 0x08 && io_port <= 0x0b)       { i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), (io_port-0x08) & 3, data); }
416   else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(devtag_get_device(space->machine, "ppi8255_1"), (io_port-0x0c) & 3, data); }
415   if(io_port >= 0x08 && io_port <= 0x0b)       { i8255a_w(space->machine->device("ppi8255_0"), (io_port-0x08) & 3, data); }
416   else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3, data); }
417417   else if(io_port >= 0x10 && io_port <= 0x11) { pasopia7_6845_w(space, io_port-0x10, data); }
418418   else if(io_port >= 0x18 && io_port <= 0x1b) { pac2_w(space, io_port-0x1b, data);  }
419   else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(devtag_get_device(space->machine, "ppi8255_2"), (io_port-0x20) & 3, data); }
420   else if(io_port >= 0x28 && io_port <= 0x2b) { z80ctc_w(devtag_get_device(space->machine, "ctc"), io_port-0x28,data);  }
421   else if(io_port >= 0x30 && io_port <= 0x33) { z80pio_cd_ba_w(devtag_get_device(space->machine, "z80pio_0"), (io_port-0x30) & 3, data); }
422   else if(io_port == 0x3a)                  { sn76496_w(devtag_get_device(space->machine, "sn1"), 0, data); }
423   else if(io_port == 0x3b)                  { sn76496_w(devtag_get_device(space->machine, "sn2"), 0, data); }
419   else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(space->machine->device("ppi8255_2"), (io_port-0x20) & 3, data); }
420   else if(io_port >= 0x28 && io_port <= 0x2b) { z80ctc_w(space->machine->device("ctc"), io_port-0x28,data);  }
421   else if(io_port >= 0x30 && io_port <= 0x33) { z80pio_cd_ba_w(space->machine->device("z80pio_0"), (io_port-0x30) & 3, data); }
422   else if(io_port == 0x3a)                  { sn76496_w(space->machine->device("sn1"), 0, data); }
423   else if(io_port == 0x3b)                  { sn76496_w(space->machine->device("sn2"), 0, data); }
424424   else if(io_port == 0x3c)                  { pasopia7_memory_ctrl_w(space,0, data); }
425425//   else if(io_port >= 0xe0 && io_port <= 0xe6) { fdc }
426426   else
docs/messnew.txt
r8581r8582
99- Salora Manager [Curt Coder]
1010
1111
12
1213Systems Promoted from GAME_NOT_WORKING:
1314---------------------------------------
1415- Canon X07 [Sandro Ronco]
r8581r8582
1718- SGCPU aka TI-99/4P [Michael Zapf]
1819
1920
21
2022Skeleton drivers:
2123-----------------
2224- Bandai Gundam RX-78
r8581r8582
4244- NEC TK-80BS
4345- Japan Electronics College MYCOMZ-80A
4446
47
48
4549System Driver Changes:
4650----------------------
4751- [APPLE2] Support for Rich Dreher's Compact Flash/IDE adaptor on the
r8581r8582
9498  mode. [Sandro Ronco]
9599
96100
101
97102Imgtool Changes:
98103----------------
99104(none)
100105
101106
107
102108Source Changes:
103109----------------
104- The core is based on MAME 0.138u3.  This incorporates all features of the
110- The core is based on MAME 0.138u4.  This incorporates all features of the
105111  update to this core.  [MAME team]
106112
107113- Fixed setting of tape flags when reaching end of tape. This prevented
r8581r8582
112118  Micko, Fabio Priuli, Barry Rodewald]
113119
114120
121
1151220.138
116123
117124New System Drivers Supported:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team