Previous 15994 Revisions Next

r1052 Saturday 29th September, 2007 at 22:50:34 UTC by Nathan Woods
Updated to MAME 0.119u2 core
[ROOT]makefile
[docs]messnew.txt
[src/emu]cheat.c cpuintrf.h drawgfx.h driver.h emu.mak info.c inptport.c inptport.h mame.c mame.h memory.c memory.h profiler.c profiler.h romload.c romload.h tilemap.c validity.c video.c
[src/emu/cpu]cpu.mak drcfe.c* drcfe.h* x64drc.h x86drc.c x86emit.h x86log.c* x86log.h*
[src/emu/cpu/h6280]h6280.c h6280ops.h
[src/emu/cpu/i386]i386dasm.c
[src/emu/cpu/m68000]m68kfpu.c
[src/emu/cpu/mips]mdrc64.c mdrcold.c mips3.c mips3com.c mips3com.h mips3drc.c mips3dsm.c mips3fe.c mips3fe.h
[src/emu/cpu/tms32051]tms32051.c
[src/emu/drivers]empty.c
[src/emu/sound]ay8910.c c6280.c discrete.c discrete.h fm.c scsp.c scsplfo.c tms5220.c tms5220.h x1_010.c
[src/lib/util]options.c options.h sha1.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c asteroid.c atarifb.c avalnche.c blockade.c bsktball.c canyon.c circus.c cliffhgr.c cps3.c crbaloon.c dkong.c dragrace.c firetrk.c galaga.c grchamp.c hitme.c llander.c mw8080bw.c nitedrvr.c orbit.c phoenix.c polepos.c poolshrk.c qix.c skydiver.c spiders.c sprint2.c sprint4.c sprint4.h subs.c tank8.c triplhnt.c turbo.c vicdual.c videopin.c
[src/mame/drivers]1942.c 1943.c 1945kiii.c 20pacgal.c 2mindril.c 40love.c 4enraya.c 8080bw.c ace.c acefruit.c acommand.c actfancr.c aeroboto.c aerofgt.c afega.c airbustr.c alpha68k.c ambush.c amidar.c ampoker.c amspdwy.c angelkds.c appoooh.c aquarium.c arcadecl.c arcadia.c argus.c arkanoid.c armedf.c ashnojoe.c asteroid.c asuka.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c ataxx.c atetris.c avalnche.c backfire.c badlands.c bagman.c bankp.c baraduke.c batman.c battlane.c battlera.c battlex.c battlnts.c bbusters.c bestleag.c bfm_sc2.c bigevglf.c bigfghtr.c bigstrkb.c bionicc.c bishjan.c bking2.c bladestl.c blktiger.c blmbycar.c blockade.c bloodbro.c blstroid.c blueprnt.c bogeyman.c bombjack.c boogwing.c boxer.c brkthru.c bsktball.c btime.c bublbobl.c buggychl.c bwing.c cabal.c calorie.c canyon.c cardline.c carjmbre.c carpolo.c carrera.c cave.c cball.c cbasebal.c cbuster.c ccastles.c cclimber.c centiped.c chaknpop.c cham24.c champbas.c champbwl.c cheekyms.c cherrym.c cherrym2.c chinagat.c chinsan.c circus.c circusc.c cischeat.c citycon.c cliffhgr.c cloak.c cloud9.c clshroad.c cninja.c cntsteer.c coinmstr.c combatsc.c commando.c compgolf.c contra.c coolridr.c cop01.c copsnrob.c cosmic.c couple.c cowrace.c cps1.c cps2.c crbaloon.c crgolf.c crospang.c crshrace.c cshooter.c csk.c cultures.c* cvs.c cyberbal.c cybertnk.c dacholer.c dambustr.c darius.c darkhors.c darkmist.c darkseal.c dassault.c dblewing.c dbz.c dcon.c dday.c ddayjlc.c ddealer.c ddenlovr.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_mlc.c decocass.c deniam.c destroyr.c dietgo.c discoboy.c diverboy.c djboy.c djmain.c dkong.c dlair.c dmndrby.c docastle.c dogfgt.c dominob.c* dooyong.c dragrace.c dreamwld.c drgnmst.c drmicro.c drtomy.c dunhuang.c dwarfd.c dynadice.c dynduke.c egghunt.c eprom.c equites.c esd16.c esh.c* espial.c ettrivia.c exctsccr.c exedexes.c exerion.c exidy.c expro02.c exprraid.c exzisus.c f1gp.c fantland.c fastfred.c fastlane.c fcombat.c fcrash.c fgoal.c filetto.c finalizr.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c fortecar.c freekick.c frogger.c fromanc2.c fromance.c funkybee.c funkyjet.c funworld.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaiden.c galaga.c galaxia.c galaxian.c galivan.c galpani2.c galpanic.c galspnbl.c gaplus.c gauntlet.c gberet.c gcpinbal.c gdrawpkr.c gijoe.c ginganin.c gladiatr.c glass.c gng.c go2000.c goal92.c goindol.c goldstar.c gomoku.c good.c gotcha.c gottlieb.c gotya.c grchamp.c groundfx.c gstream.c gstriker.c gsword.c gumbo.c gunbustr.c gundealr.c gunsmoke.c gyruss.c hal21.c hanaawas.c hanaroku.c hcastle.c hexa.c hexion.c higemaru.c hitme.c hng64.c holeland.c homedata.c homerun.c hyperspt.c hyprduel.c igs_blit.c igs_m027.c igs_m68.c ikki.c intrscti.c inufuku.c iqblock.c irobot.c ironhors.c istellar.c jack.c jackal.c jackpool.c jailbrek.c jalmah.c jchan.c jcross.c jedi.c jollyjgr.c jrpacman.c kaneko16.c karnov.c kchamp.c kickgoal.c kingobox.c kinstb.c klax.c kncljoe.c koikoi.c konamigx.c kopunch.c ksayakyu.c ksys573.c kyugo.c labyrunr.c ladybug.c ladyfrog.c laserbat.c lasso.c lastduel.c lazercmd.c legionna.c leland.c lemmings.c lethal.c lgp.c liberate.c limenko.c lkage.c lockon.c looping.c lordgun.c lsasquad.c ltcasino.c lucky8.c lvcards.c lwings.c m107.c m62.c m72.c m90.c m92.c macrossp.c macs.c madalien.c madmotor.c magic10.c magicfly.c magmax.c mainsnk.c malzak.c mappy.c marineb.c marinedt.c mario.c markham.c marvins.c mastboy.c matmania.c mayumi.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c mediagx.c megadriv.c megadriv.h megasys1.c megatech.c megazone.c merit.c mermaid.c metlclsh.c metro.c mexico86.c mgolf.c midas.c midvunit.c mikie.c miniboy7.c mirage.c* mirax.c missb2.c mitchell.c mjkjidai.c mlanding.c mnight.c model2.c model3.c mogura.c mole.c momoko.c mosaic.c mouser.c mpatrol.c mpu4.c mrdo.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c multigam.c munchmo.c murogem.c mustache.c mwarr.c mystston.c mystwarr.c namcofl.c namconb1.c namcond1.c namcos1.c namcos2.c namcos21.c namcos22.c namcos23.c namcos86.c naughtyb.c nemesis.c news.c ninjakd2.c ninjakid.c ninjaw.c nitedrvr.c nmg5.c nmk16.c nova2001.c nss.c nycaptor.c offtwall.c ohmygod.c ojankohs.c olibochu.c omegaf.c oneshot.c onetwo.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c panicr.c paradise.c pass.c pbaction.c pcktgal.c pengo.c pgm.c phoenix.c pingpong.c pipedrm.c pipeline.c pirates.c pitnrun.c pkscram.c pktgaldx.c pkunwar.c playch10.c playmark.c plygonet.c pmpoker.c pokechmp.c polepos.c polyplay.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerbal.c powerins.c ppmast93.c prehisle.c progolf.c psikyo.c psikyo4.c psikyosh.c psychic5.c pturn.c punchout.c pushman.c qix.c quantum.c quasar.c quizdna.c quizpani.c rabbit.c raiden.c raiden2.c raiders5.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c rcasino.c rcorsair.c realbrk.c redalert.c redclash.c relief.c renegade.c retofinv.c rmhaihai.c rockola.c rockrage.c rocnrope.c rohga.c rollrace.c royalmah.c rpunch.c runaway.c rungun.c safarir.c sandscrp.c sauro.c sbasketb.c sbowling.c sbrkout.c sbugger.c scobra.c scotrsht.c scramble.c scregg.c sderby.c seattle.c segae.c segae.h segag80r.c segahang.c segald.c segaorun.c segas16a.c segas16b.c segas18.c segas32.c segaxbd.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c seta2.c sf.c sfkick.c sg1000a.c sgladiat.c shadfrce.c shangha3.c shangkid.c shaolins.c shisen.c shootout.c shuuz.c sidearms.c sidepckt.c silkroad.c simpl156.c skullxbo.c skyarmy.c skychut.c skydiver.c skyfox.c skykid.c skylncr.c skyraid.c slapfght.c slapshot.c snk.c snk68.c snowbros.c solomon.c sonson.c spbactn.c spcforce.c spdodgeb.c speedatk.c speedbal.c speedspn.c speglsht.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c srmp2.c srmp6.c srumbler.c sshangha.c ssingles.c sslam.c ssozumo.c sspeedr.c ssrj.c ssv.c st0016.c stactics.c stadhero.c starcrus.c starshp1.c statriv2.c steaser.c stepstag.c stfight.c stlforce.c strnskil.c stv.c subs.c suna16.c suna8.c supbtime.c supdrapo.c superchs.c superdq.c superqix.c suprgolf.c suprloco.c suprnova.c suprridr.c suprslam.c system1.c system16.c system18.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c taitosj.c taitowlf.c talbot.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c tattack.c taxidrvr.c tbowl.c tceptor.c tcl.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c terracre.c tetrisp2.c tetriunk.c thedeep.c thepit.c thoop2.c thunderj.c tiamc1.c tigeroad.c timelimt.c timeplt.c tmaster.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topspeed.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c troangel.c trucocl.c trvmadns.c tryout.c tsamurai.c tubep.c tugboat.c tumbleb.c tumblep.c tunhunt.c turbo.c twin16.c twincobr.c tx1.c ultratnk.c undrfire.c unico.c usgames.c vamphalf.c vaportra.c vastar.c vball.c videopin.c vigilant.c vindictr.c vmetal.c volfied.c vroulet.c vulgus.c wallc.c wardner.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c williams.c wilytowr.c wink.c wiping.c witch.c wiz.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xain.c xorworld.c xxmissio.c xybots.c xyonix.c yamato.c yard.c yiear.c yumefuda.c yunsun16.c yunsung8.c zac2650.c zaccaria.c zaxxon.c zerozone.c zodiack.c
[src/mame/includes]8080bw.h asteroid.h atarifb.h avalnche.h blockade.h bsktball.h canyon.h circus.h cps1.h crbaloon.h dkong.h dragrace.h firetrk.h galaga.h grchamp.h hitme.h nitedrvr.h orbit.h phoenix.h polepos.h poolshrk.h qix.h skydiver.h sprint2.h subs.h system16.h tank8.h triplhnt.h videopin.h
[src/mame/machine]namcos2.c system16.c
[src/mame/video]alpha68k.c bfm_adr2.c bfm_adr2.h darius.c jack.c lordgun.c model2.c namcos22.c sauro.c suprnova.c
[src/mess/drivers]abc80.c abc80x.c amstrad.c apexc.c apple1.c apple2.c apple2gs.c aquarius.c arcadia.c c128.c cbmb.c cgenie.c comquest.c coupe.c galaxy.c gamecom.c gb.c hp48.c intv.c jupiter.c kaypro.c kim1.c mbee.c mekd2.c microtan.c mz700.c nascom1.c odyssey2.c osi.c p2000t.c pc8801.c pdp1.c pet.c pocketc.c saturn.c snes.c spectrum.c ti99_2.c ti99_4p.c trs80.c tx0.c vc4000.c vtech2.c wswan.c zx.c
[src/mess/includes]jupiter.h
[src/mess/machine]genesis.c
[src/mess/video]733_asr.c 733_asr.h 911_vdt.c 911_vdt.h avigo.c pc_aga.c pc_aga.h pc_cga.c pc_mda.c pc_mda.h pc_t1t.c saa5050.c ted7360.c vic6560.c x68k.c
[src/osd/windows]input.c window.c winfile.c wintime.c

src/mame/audio/skydiver.c
r1051r1052
4141#define SKYDIVER_WHISTLE1_SND   NODE_13
4242#define SKYDIVER_WHISTLE2_SND   NODE_14
4343
44DISCRETE_SOUND_START(skydiver_discrete_interface)
44DISCRETE_SOUND_START(skydiver)
4545   /************************************************/
4646   /* skydiver  Effects Relataive Gain Table       */
4747   /*                                              */
src/mame/audio/qix.c
r1051r1052
4848   {RES_K(22)+250, RES_K(10)+250, RES_K(5.6)+250, RES_K(3.3)+250}
4949};
5050
51DISCRETE_SOUND_START(qix_discrete_interface)
51DISCRETE_SOUND_START(qix)
5252   /*                    NODE                      */
5353   DISCRETE_INPUTX_DATA(QIX_DAC_DATA, 128, -128*128, 128)
5454   DISCRETE_INPUT_DATA (QIX_VOL_DATA)
src/mame/audio/cps3.c
r1051r1052
1818   UINT16 frac;
1919} cps3_voice;
2020
21struct
21static struct
2222{
2323   cps3_voice voice[CPS3_VOICES];
2424   UINT16     key;
src/mame/audio/spiders.c
r1051r1052
104104#define SPIDERS_SW          NODE_13
105105#define SPIDERS_X           NODE_14
106106
107static DISCRETE_SOUND_START(spiders_discrete_interface)
107static DISCRETE_SOUND_START(spiders)
108108
109109   /************************************************/
110110   /* Input register mapping for spiders           */
r1051r1052
202202
203203   MDRV_SPEAKER_STANDARD_MONO("mono")
204204   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
205   MDRV_SOUND_CONFIG(spiders_discrete_interface)
205   MDRV_SOUND_CONFIG_DISCRETE(spiders)
206206   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
207207MACHINE_DRIVER_END
src/mame/audio/phoenix.c
r1051r1052
304304#define PHOENIX_EFFECT_4_SND      0
305305
306306
307DISCRETE_SOUND_START(phoenix_discrete_interface)
307DISCRETE_SOUND_START(phoenix)
308308   /************************************************/
309309   /* Input register mapping for phoenix           */
310310   /************************************************/
src/mame/audio/llander.c
r1051r1052
3838   14         /* Output bit */
3939};
4040
41DISCRETE_SOUND_START(llander_discrete_interface)
41DISCRETE_SOUND_START(llander)
4242   /************************************************/
4343   /* llander Effects Relataive Gain Table         */
4444   /*                                              */
src/mame/audio/grchamp.c
r1051r1052
3434
3535/* Nodes - Sounds */
3636
37DISCRETE_SOUND_START(grchamp_discrete_interface)
37DISCRETE_SOUND_START(grchamp)
3838
3939   /************************************************/
4040   /* Input register mapping for grand champion    */
src/mame/audio/avalnche.c
r1051r1052
8080#define AVALNCHE_AUD2_SND         NODE_12
8181#define AVALNCHE_SOUNDLVL_AUD0_SND   NODE_13
8282
83DISCRETE_SOUND_START(avalnche_discrete_interface)
83DISCRETE_SOUND_START(avalnche)
8484   /************************************************/
8585   /* avalnche  Effects Relataive Gain Table       */
8686   /*                                              */
src/mame/audio/canyon.c
r1051r1052
7272#define CANYON_WHISTLESND2      NODE_14
7373#define CANYON_NOISE         NODE_15
7474
75DISCRETE_SOUND_START(canyon_discrete_interface)
75DISCRETE_SOUND_START(canyon)
7676   /************************************************/
7777   /* Canyon sound system: 5 Sound Sources         */
7878   /*                     Relative Volume          */
src/mame/audio/circus.c
r1051r1052
7070/* Nodes - Sounds */
7171#define CIRCUS_MUSIC_SND   NODE_10
7272
73DISCRETE_SOUND_START(circus_discrete_interface)
73DISCRETE_SOUND_START(circus)
7474   /************************************************/
7575   /* Input register mapping for circus            */
7676   /************************************************/
r1051r1052
117117#define CRASH_MUSIC_SND      NODE_20
118118#define CRASH_BEEPER_SND   NODE_21
119119
120DISCRETE_SOUND_START(crash_discrete_interface)
120DISCRETE_SOUND_START(crash)
121121   /************************************************/
122122   /* Input register mapping for crash             */
123123   /************************************************/
r1051r1052
152152/* Nodes - Sounds */
153153#define ROBOTBWL_MUSIC_SND      NODE_10
154154
155DISCRETE_SOUND_START(robotbwl_discrete_interface)
155DISCRETE_SOUND_START(robotbwl)
156156   /************************************************/
157157   /* Input register mapping for robotbwl          */
158158   /************************************************/
src/mame/audio/turbo.c
r1051r1052
637637   DEFAULT_555_VALUES,
638638};
639639
640DISCRETE_SOUND_START(turbo_sound_interface)
640DISCRETE_SOUND_START(turbo)
641641   /************************************************/
642642   /* Input register mapping for turbo             */
643643   /************************************************/
src/mame/audio/crbaloon.c
r1051r1052
3333   5, RES_K(470), 0, 0
3434};
3535
36DISCRETE_SOUND_START(crbaloon_discrete_interface)
36DISCRETE_SOUND_START(crbaloon)
3737
3838   /************************************************
3939    * Input register mapping
src/mame/audio/hitme.c
r1051r1052
3333#define HITME_FINAL_SND         NODE_90
3434
3535
36DISCRETE_SOUND_START(hitme_discrete_interface)
36DISCRETE_SOUND_START(hitme)
3737
3838   /* These are the inputs; PULSE-type inputs are used for oneshot latching signals */
3939   DISCRETE_INPUT_DATA (HITME_DOWNCOUNT_VAL)
src/mame/audio/asteroid.c
r1051r1052
7070#define ASTEROID_EXPLODE_SND      NODE_26
7171#define ASTEROID_THRUST_SND         NODE_27
7272
73DISCRETE_SOUND_START(asteroid_discrete_interface)
73DISCRETE_SOUND_START(asteroid)
7474   /************************************************/
7575   /* Asteroid Effects Relataive Gain Table        */
7676   /*                                              */
r1051r1052
215215DISCRETE_SOUND_END
216216
217217
218DISCRETE_SOUND_START(astdelux_discrete_interface)
218DISCRETE_SOUND_START(astdelux)
219219   /************************************************/
220220   /* Asteroid delux sound hardware is mostly done */
221221   /* in the Pokey chip except for the thrust and  */
src/mame/audio/cliffhgr.c
r1051r1052
2525   8
2626};
2727
28DISCRETE_SOUND_START(cliffhgr_discrete_interface)
28DISCRETE_SOUND_START(cliffhgr)
2929   DISCRETE_INPUT_LOGIC(CLIFF_ENABLE_SND_1)
3030   DISCRETE_INPUT_LOGIC(CLIFF_ENABLE_SND_2)
3131
src/mame/audio/vicdual.c
r1051r1052
6161   0, RES_K(56), 0, CAP_U(0.1), 0, 10000
6262};
6363
64static DISCRETE_SOUND_START(frogs_discrete_interface)
64static DISCRETE_SOUND_START(frogs)
6565   /************************************************
6666     * Input register mapping for frogs
6767     *
r1051r1052
126126   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
127127
128128   MDRV_SOUND_ADD(DISCRETE, 0)
129   MDRV_SOUND_CONFIG(frogs_discrete_interface)
129   MDRV_SOUND_CONFIG_DISCRETE(frogs)
130130   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
131131MACHINE_DRIVER_END
132132
r1051r1052
304304   16                   /* Output bit */
305305};
306306
307static DISCRETE_SOUND_START(headon_discrete_interface)
307static DISCRETE_SOUND_START(headon)
308308   /************************************************
309309     * Input register mapping for headon
310310     *
r1051r1052
429429MACHINE_DRIVER_START( headon_audio )
430430
431431   MDRV_SOUND_ADD(DISCRETE, 0)
432   MDRV_SOUND_CONFIG(headon_discrete_interface)
432   MDRV_SOUND_CONFIG_DISCRETE(headon)
433433   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
434434MACHINE_DRIVER_END
435435
r1051r1052
488488#define BRDRLINE_WALK_TRG_SND      NODE_97
489489#define BRDRLINE_CRY_TRG_SND      NODE_98
490490
491DISCRETE_SOUND_START(brdrline_discrete_interface)
491DISCRETE_SOUND_START(brdrline)
492492   /************************************************
493493     * Input register mapping
494494     ************************************************/
src/mame/audio/bsktball.c
r1051r1052
8989#define BSKTBALL_NOTE_SND      NODE_12
9090#define BSKTBALL_CROWD_SND      NODE_13
9191
92DISCRETE_SOUND_START(bsktball_discrete_interface)
92DISCRETE_SOUND_START(bsktball)
9393   /************************************************/
9494   /* Input register mapping for bsktball          */
9595   /************************************************/
src/mame/audio/poolshrk.c
r1051r1052
5454#define POOLSHRK_CLICK_SND      NODE_12
5555#define POOLSHRK_SCORE_SND      NODE_13
5656
57DISCRETE_SOUND_START(poolshrk_discrete_interface)
57DISCRETE_SOUND_START(poolshrk)
5858   /************************************************/
5959   /* Input register mapping for poolshrk          */
6060   /************************************************/
src/mame/audio/sprint2.c
r1051r1052
101101#define SPRINT2_1V      SPRINT2_HSYNC/2
102102#define SPRINT2_2V      SPRINT2_1V/2
103103
104DISCRETE_SOUND_START(sprint2_discrete_interface)
104DISCRETE_SOUND_START(sprint2)
105105
106106   /************************************************/
107107   /* Input register mapping for sprint2           */
r1051r1052
226226DISCRETE_SOUND_END
227227
228228
229DISCRETE_SOUND_START(sprint1_discrete_interface)
229DISCRETE_SOUND_START(sprint1)
230230
231231   /************************************************/
232232   /* Input register mapping for sprint1           */
r1051r1052
361361/* Nodes - Adjusters */
362362#define DOMINOS_R23            NODE_15
363363
364DISCRETE_SOUND_START(dominos_discrete_interface)
364DISCRETE_SOUND_START(dominos)
365365   /************************************************/
366366   /* Input register mapping for dominos           */
367367   /************************************************/
src/mame/audio/dkong.c
r1051r1052
233233   DISC_OSC_INVERTER_IS_TYPE2
234234   };
235235
236DISCRETE_SOUND_START(dkong_discrete_interface)
236DISCRETE_SOUND_START(dkong)
237237
238238   /************************************************/
239239   /* Input register mapping for dkong             */
r1051r1052
487487   DISC_OSC_INVERTER_IS_TYPE3
488488   };
489489
490DISCRETE_SOUND_START(radarscp_discrete_interface)
490DISCRETE_SOUND_START(radarscp)
491491
492492   /************************************************/
493493   /* Input register mapping for radarscp          */
src/mame/audio/sprint4.c
r1051r1052
280280
281281
282282
283DISCRETE_SOUND_START(sprint4_discrete_interface)
283DISCRETE_SOUND_START(sprint4)
284284   SPRINT4_ATTRACT
285285   SPRINT4_PLAYER_MOTOR(1)
286286   SPRINT4_PLAYER_MOTOR(2)
r1051r1052
296296DISCRETE_SOUND_END
297297
298298
299DISCRETE_SOUND_START(ultratnk_discrete_interface)
299DISCRETE_SOUND_START(ultratnk)
300300   SPRINT4_ATTRACT
301301   SPRINT4_PLAYER_MOTOR(1)
302302   SPRINT4_PLAYER_MOTOR(2)
src/mame/audio/blockade.c
r1051r1052
1212#define BLOCKADE_NOTE_DATA       NODE_01
1313#define BLOCKADE_NOTE            NODE_02
1414
15DISCRETE_SOUND_START(blockade_discrete_interface)
15DISCRETE_SOUND_START(blockade)
1616   DISCRETE_INPUT_DATA  (BLOCKADE_NOTE_DATA)
1717
1818   /************************************************/
src/mame/audio/firetrk.c
r1051r1052
193193#define FIRETRUCK_BELLSND      NODE_17
194194#define FIRETRUCK_XTNDPLYSND   NODE_18
195195
196DISCRETE_SOUND_START(firetrk_discrete_interface)
196DISCRETE_SOUND_START(firetrk)
197197   /************************************************/
198198   /* Input register mapping for firetruck         */
199199   /************************************************/
r1051r1052
401401#define SUPERBUG_SCREECHSND      NODE_13
402402#define SUPERBUG_ASRSND         NODE_14
403403
404DISCRETE_SOUND_START(superbug_discrete_interface)
404DISCRETE_SOUND_START(superbug)
405405   /************************************************/
406406   /* Input register mapping for superbug          */
407407   /************************************************/
r1051r1052
583583#define MONTECAR_BANGSND         NODE_13
584584#define MONTECAR_SCREECHSND         NODE_14
585585
586DISCRETE_SOUND_START(montecar_discrete_interface)
586DISCRETE_SOUND_START(montecar)
587587   /************************************************/
588588   /* Input register mapping for montecar          */
589589   /************************************************/
src/mame/audio/dragrace.c
r1051r1052
3838#define DRAGRACE_MOTOR1_SND      NODE_18
3939#define DRAGRACE_MOTOR2_SND      NODE_19
4040
41DISCRETE_SOUND_START(dragrace_discrete_interface)
41DISCRETE_SOUND_START(dragrace)
4242   /************************************************/
4343   /* dragrace  Effects Relataive Gain Table       */
4444   /*                                              */
src/mame/audio/sprint4.h
r1051r1052
2727
2828/*----------- defined in audio/sprint4.c -----------*/
2929
30extern discrete_sound_block sprint4_discrete_interface[];
31extern discrete_sound_block ultratnk_discrete_interface[];
30DISCRETE_SOUND_EXTERN( sprint4 );
31DISCRETE_SOUND_EXTERN( ultratnk );
src/mame/audio/orbit.c
r1051r1052
6363#define ORBIT_ANOTE2_SND   NODE_14
6464#define ORBIT_WARNING_SND   NODE_15
6565
66DISCRETE_SOUND_START(orbit_discrete_interface)
66DISCRETE_SOUND_START(orbit)
6767   /************************************************/
6868   /* orbit  Effects Relataive Gain Table          */
6969   /*                                              */
src/mame/audio/triplhnt.c
r1051r1052
111111#define TRIPLHNT_SCREECH_SND   NODE_13
112112#define POOLSHRK_SCORE_SND      NODE_14
113113
114DISCRETE_SOUND_START(triplhnt_discrete_interface)
114DISCRETE_SOUND_START(triplhnt)
115115   /************************************************/
116116   /* Input register mapping for triplhnt          */
117117   /************************************************/
src/mame/audio/atarifb.c
r1051r1052
7777#define ATARIFB_WHISTLE_SND      NODE_12
7878#define ATARIFB_CROWD_SND      NODE_13
7979
80DISCRETE_SOUND_START(atarifb_discrete_interface)
80DISCRETE_SOUND_START(atarifb)
8181   /************************************************/
8282   /* Input register mapping for atarifb           */
8383   /************************************************/
r1051r1052
167167#define ABASEB_WHISTLE_SND      NODE_12
168168#define ABASEB_CROWD_SND      NODE_13
169169
170DISCRETE_SOUND_START(abaseb_discrete_interface)
170DISCRETE_SOUND_START(abaseb)
171171   /************************************************/
172172   /* Input register mapping for abaseb            */
173173   /************************************************/
src/mame/audio/galaga.c
r1051r1052
124124   462000         /* gain */
125125};
126126
127DISCRETE_SOUND_START(bosco_discrete_interface)
127DISCRETE_SOUND_START(bosco)
128128
129129   /************************************************
130130     * Input register mapping
r1051r1052
309309   40800,         /* gain */
310310};
311311
312DISCRETE_SOUND_START(galaga_discrete_interface)
312DISCRETE_SOUND_START(galaga)
313313
314314   /************************************************
315315     * Input register mapping
src/mame/audio/subs.c
r1051r1052
6666#define SUBS_CRASH_SND      NODE_14
6767#define SUBS_EXPLODE_SND   NODE_15
6868
69DISCRETE_SOUND_START(subs_discrete_interface)
69DISCRETE_SOUND_START(subs)
7070   /************************************************/
7171   /* subs  Effects Relataive Gain Table           */
7272   /*                                              */
src/mame/audio/videopin.c
r1051r1052
1818#define VIDEOPIN_BELL_SND   NODE_11
1919#define VIDEOPIN_BONG_SND   NODE_12
2020
21DISCRETE_SOUND_START(videopin_discrete_interface)
21DISCRETE_SOUND_START(videopin)
2222/************************************************/
2323   /* videopin  Effects Relataive Gain Table       */
2424   /*                                              */
src/mame/audio/polepos.c
r1051r1052
233233   0               /* vN */
234234};
235235
236DISCRETE_SOUND_START(polepos_discrete_interface)
236DISCRETE_SOUND_START(polepos)
237237
238238   /************************************************
239239     * Input register mapping
src/mame/audio/tank8.c
r1051r1052
111111#define TANK8_A2_LINE       NODE_26
112112
113113
114DISCRETE_SOUND_START(tank8_discrete_interface)
114DISCRETE_SOUND_START(tank8)
115115   /************************************************/
116116   /* Tank8 sound system: 10 Sound Sources         */
117117   /*    Motor 1-8                                 */
src/mame/audio/8080bw.c
r1051r1052
218218/* Nodes - Sounds */
219219#define INDIANBT_MUSIC         NODE_11
220220
221DISCRETE_SOUND_START(indianbt_discrete_interface)
221DISCRETE_SOUND_START(indianbt)
222222
223223   DISCRETE_INPUT_DATA (INDIANBT_MUSIC_DATA)
224224
r1051r1052
404404#define POLARIS_ADJ_VR2         NODE_24
405405#define POLARIS_ADJ_VR3         NODE_25
406406
407DISCRETE_SOUND_START(polaris_discrete_interface)
407DISCRETE_SOUND_START(polaris)
408408
409409   /************************************************/
410410   /* Polaris sound system: 8 Sound Sources        */
r1051r1052
706706#define SCHASER_EXP_SND      NODE_11
707707#define SCHASER_MUSIC_SND   NODE_12
708708
709DISCRETE_SOUND_START(schaser_discrete_interface)
709DISCRETE_SOUND_START(schaser)
710710   /************************************************/
711711   /* Input register mapping for schaser           */
712712   /************************************************/
src/mame/audio/mw8080bw.c
r1051r1052
270270#define TORNBASE_TONE_SND_FILT      NODE_11
271271
272272
273static DISCRETE_SOUND_START(tornbase_discrete_interface)
273static DISCRETE_SOUND_START(tornbase)
274274
275275   /* the 3 enable lines coming out of the 74175 flip-flop at G5 */
276276   DISCRETE_INPUT_LOGIC(TORNBASE_TONE_240_EN)      /* pin 2 */
r1051r1052
304304MACHINE_DRIVER_START( tornbase_audio )
305305   MDRV_SPEAKER_STANDARD_MONO("mono")
306306   MDRV_SOUND_ADD(DISCRETE, 0)
307   MDRV_SOUND_CONFIG(tornbase_discrete_interface)
307   MDRV_SOUND_CONFIG_DISCRETE(tornbase)
308308   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
309309MACHINE_DRIVER_END
310310
r1051r1052
456456};
457457
458458
459static DISCRETE_SOUND_START(maze_discrete_interface)
459static DISCRETE_SOUND_START(maze)
460460
461461   /************************************************
462462     * Input register mapping
r1051r1052
562562MACHINE_DRIVER_START( maze_audio )
563563   MDRV_SPEAKER_STANDARD_MONO("mono")
564564   MDRV_SOUND_ADD(DISCRETE, 0)
565   MDRV_SOUND_CONFIG(maze_discrete_interface)
565   MDRV_SOUND_CONFIG_DISCRETE(maze)
566566   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
567567MACHINE_DRIVER_END
568568
r1051r1052
735735};
736736
737737
738static DISCRETE_SOUND_START(boothill_discrete_interface)
738static DISCRETE_SOUND_START(boothill)
739739
740740   /************************************************
741741     * Input register mapping
r1051r1052
797797MACHINE_DRIVER_START( boothill_audio )
798798   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
799799   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
800   MDRV_SOUND_CONFIG(boothill_discrete_interface)
800   MDRV_SOUND_CONFIG_DISCRETE(boothill)
801801   MDRV_SOUND_ROUTE(0, "left", 1.0)
802802   MDRV_SOUND_ROUTE(1, "right", 1.0)
803803MACHINE_DRIVER_END
r1051r1052
928928   1               /* gain */
929929};
930930
931static DISCRETE_SOUND_START(checkmat_discrete_interface)
931static DISCRETE_SOUND_START(checkmat)
932932
933933   /************************************************
934934     * Input register mapping
r1051r1052
10341034MACHINE_DRIVER_START( checkmat_audio )
10351035   MDRV_SPEAKER_STANDARD_MONO("mono")
10361036   MDRV_SOUND_ADD(DISCRETE, 0)
1037   MDRV_SOUND_CONFIG(checkmat_discrete_interface)
1037   MDRV_SOUND_CONFIG_DISCRETE(checkmat)
10381038   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10391039MACHINE_DRIVER_END
10401040
r1051r1052
12021202};
12031203
12041204
1205static DISCRETE_SOUND_START(desertgu_discrete_interface)
1205static DISCRETE_SOUND_START(desertgu)
12061206
12071207   /************************************************
12081208     * Input register mapping
r1051r1052
12731273MACHINE_DRIVER_START( desertgu_audio )
12741274   MDRV_SPEAKER_STANDARD_MONO("mono")
12751275   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1276   MDRV_SOUND_CONFIG(desertgu_discrete_interface)
1276   MDRV_SOUND_CONFIG_DISCRETE(desertgu)
12771277   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
12781278MACHINE_DRIVER_END
12791279
r1051r1052
14991499};
15001500
15011501
1502static DISCRETE_SOUND_START(dplay_discrete_interface)
1502static DISCRETE_SOUND_START(dplay)
15031503
15041504   /************************************************
15051505     * Input register mapping
r1051r1052
15671567MACHINE_DRIVER_START( dplay_audio )
15681568   MDRV_SPEAKER_STANDARD_MONO("mono")
15691569   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1570   MDRV_SOUND_CONFIG(dplay_discrete_interface)
1570   MDRV_SOUND_CONFIG_DISCRETE(dplay)
15711571   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
15721572MACHINE_DRIVER_END
15731573
r1051r1052
19281928};
19291929
19301930
1931static DISCRETE_SOUND_START(clowns_discrete_interface)
1931static DISCRETE_SOUND_START(clowns)
19321932
19331933   /************************************************
19341934     * Input register mapping
r1051r1052
20092009   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
20102010
20112011   MDRV_SOUND_ADD(DISCRETE, 0)
2012   MDRV_SOUND_CONFIG(clowns_discrete_interface)
2012   MDRV_SOUND_CONFIG_DISCRETE(clowns)
20132013   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
20142014MACHINE_DRIVER_END
20152015
r1051r1052
21252125};
21262126
21272127
2128static DISCRETE_SOUND_START(dogpatch_discrete_interface)
2128static DISCRETE_SOUND_START(dogpatch)
21292129
21302130   /************************************************
21312131     * Tone generator
r1051r1052
21452145MACHINE_DRIVER_START( dogpatch_audio )
21462146   MDRV_SPEAKER_STANDARD_MONO("mono")
21472147   MDRV_SOUND_ADD(DISCRETE, 0)
2148   MDRV_SOUND_CONFIG(dogpatch_discrete_interface)
2148   MDRV_SOUND_CONFIG_DISCRETE(dogpatch)
21492149   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.3)
21502150MACHINE_DRIVER_END
21512151
r1051r1052
24622462};
24632463
24642464
2465static DISCRETE_SOUND_START(spcenctr_discrete_interface)
2465static DISCRETE_SOUND_START(spcenctr)
24662466
24672467   /************************************************
24682468     * Input register mapping
r1051r1052
26922692   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
26932693
26942694   MDRV_SOUND_ADD(DISCRETE, 0)
2695   MDRV_SOUND_CONFIG(spcenctr_discrete_interface)
2695   MDRV_SOUND_CONFIG_DISCRETE(spcenctr)
26962696   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
26972697MACHINE_DRIVER_END
26982698
r1051r1052
28602860};
28612861
28622862
2863static DISCRETE_SOUND_START(bowler_discrete_interface)
2863static DISCRETE_SOUND_START(bowler)
28642864
28652865   /************************************************
28662866     * Input register mapping
r1051r1052
28992899   MDRV_SPEAKER_STANDARD_MONO("mono")
29002900
29012901   MDRV_SOUND_ADD(DISCRETE, 0)
2902   MDRV_SOUND_CONFIG(bowler_discrete_interface)
2902   MDRV_SOUND_CONFIG_DISCRETE(bowler)
29032903   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
29042904MACHINE_DRIVER_END
29052905
r1051r1052
36133613
36143614/* Schematic M051-00739-A005 and M051-00739-B005 */
36153615/* P.C.      A084-90700-B000 and A084-90700-C000 */
3616static DISCRETE_SOUND_START(invaders_discrete_interface)
3616static DISCRETE_SOUND_START(invaders)
36173617   INVADERS_NOISE_GENERATOR
36183618   INVADERS_SAUCER_HIT(1)
36193619   INVADERS_FLEET(1)
r1051r1052
36333633   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
36343634
36353635   MDRV_SOUND_ADD(DISCRETE, 0)
3636   MDRV_SOUND_CONFIG(invaders_discrete_interface)
3636   MDRV_SOUND_CONFIG_DISCRETE(invaders)
36373637   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
36383638MACHINE_DRIVER_END
36393639
r1051r1052
37343734};
37353735
37363736
3737static DISCRETE_SOUND_START(blueshrk_discrete_interface)
3737static DISCRETE_SOUND_START(blueshrk)
37383738
37393739   /************************************************
37403740     * Input register mapping
r1051r1052
37853785MACHINE_DRIVER_START( blueshrk_audio )
37863786   MDRV_SPEAKER_STANDARD_MONO("mono")
37873787   MDRV_SOUND_ADD(DISCRETE, 0)
3788   MDRV_SOUND_CONFIG(blueshrk_discrete_interface)
3788   MDRV_SOUND_CONFIG_DISCRETE(blueshrk)
37893789   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
37903790MACHINE_DRIVER_END
37913791
r1051r1052
39743974};
39753975
39763976
3977static DISCRETE_SOUND_START(invad2ct_discrete_interface)
3977static DISCRETE_SOUND_START(invad2ct)
39783978   /* sound board 1 */
39793979   /* P.C. A082-90700-A000 */
39803980   /* Schematic M051-00851-A002 */
r1051r1052
40044004   MDRV_SPEAKER_STANDARD_STEREO("#1", "#2")
40054005
40064006   MDRV_SOUND_ADD(DISCRETE, 0)
4007   MDRV_SOUND_CONFIG(invad2ct_discrete_interface)
4007   MDRV_SOUND_CONFIG_DISCRETE(invad2ct)
40084008   MDRV_SOUND_ROUTE(0, "#1", 1.0)
40094009   MDRV_SOUND_ROUTE(1, "#2", 1.0)
40104010
src/mame/audio/nitedrvr.c
r1051r1052
3232#define NITEDRVR_SCREECH1_SND   NODE_13
3333#define NITEDRVR_SCREECH2_SND   NODE_14
3434
35DISCRETE_SOUND_START(nitedrvr_discrete_interface)
35DISCRETE_SOUND_START(nitedrvr)
3636   /************************************************/
3737   /* nitedrvr  Effects Relataive Gain Table       */
3838   /*                                              */
src/mame/machine/namcos2.c
r1051r1052
122122{
123123   if( !namcos2_eeprom )
124124   {
125      if( !namcos2_eeprom )
126      {
127         namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
128      }
125      namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
129126   }
130127   if( read_or_write )
131128   {
src/mame/machine/system16.c
r1051r1052
4646   8*8
4747};
4848
49gfx_decode sys16_gfxdecodeinfo[] = {
50   { REGION_GFX1, 0, &charlayout,   0, 1024 },
51   { -1 }
52};
49GFXDECODE_START( sys16 )
50   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1024 )
51GFXDECODE_END
5352
5453
5554/* sound */
src/mame/mamedriv.c
r1051r1052
39013901   DRIVER( mt_kcham )   /* 60 */
39023902            /* 61 */
39033903   DRIVER( mt_soni2 )   /* 62 */
3904//  DRIVER( mt_comp1 )  /* ?? */
3905//  DRIVER( mt_comp2 )  /* ?? */
39043906
39053907   /* Sega MegaPlay */
39063908   DRIVER( megaplay )
r1051r1052
42424244   DRIVER( fghthist )   /* MBF (c) 1993 Data East Corporation (World) */
42434245   DRIVER( fghthstu )   /* MBF (c) 1993 Data East Corporation (US) */
42444246   DRIVER( fghthsta )   /* MBF (c) 1993 Data East Corporation (US) */
4247   DRIVER( fghthstj )   /* MBF (c) 1993 Data East Corporation (Japan) */
42454248   DRIVER( hvysmsh )   /* MBG */
42464249   DRIVER( hvysmsha )   /* MBG */
42474250   DRIVER( nslasher )   /* MBH (c) 1993 Data East Corporation */
r1051r1052
58695872   DRIVER( gakupara )   /* (c) 1991 NMK */
58705873   DRIVER( quizdna )   /* (c) 1992 Face */
58715874   DRIVER( gekiretu )   /* (c) 1992 Face */
5875   DRIVER( cultures )   /* (c) 1994 Face */
58725876
58735877   /* Williams/Midway TMS games */
58745878   DRIVER( narc )      /* (c) 1988 Williams */
r1051r1052
59915995   DRIVER( tripool )   /* (c) 1981 Noma (Casino Tech license) */
59925996   DRIVER( tripoola )   /* (c) 1981 Noma (Costal Games license) */
59935997   DRIVER( joinem )   /* (c) 1986 Global */
5998   DRIVER( loverboy )   /* (c) 1983 Global */
59945999   DRIVER( striv )      /* (c) 1985 Hara Industries */
59956000   DRIVER( jack )      /* (c) 1982 Cinematronics */
59966001   DRIVER( jack2 )      /* (c) 1982 Cinematronics */
r1051r1052
63216326   DRIVER( welltrij )   /* (c) 1991 Video System Co. (Japan) */
63226327   DRIVER( quiz18k )   /* (c) 1992 EIM (Welltris hardware) */
63236328   DRIVER( f1gp )      /* (c) 1991 Video System Co. */
6329   DRIVER( sf1gp )      /* bootleg */
63246330   DRIVER( f1gp2 )      /* (c) 1992 Video System Co. */
63256331   DRIVER( crshrace )   /* (c) 1993 Video System Co. */
63266332   DRIVER( crshrac2 )   /* (c) 1993 Video System Co. */
r1051r1052
64696475   DRIVER( galpania )   /* (c) 1990 Kaneko */
64706476   DRIVER( galsnew )   /* (c) 1990 Kaneko */
64716477   DRIVER( galsnewa )   /* (c) 1990 Kaneko */
6478   DRIVER( galsnewj )   /* (c) 1990 Kaneko */
64726479   DRIVER( galpani2 )   /* (c) 1993 Kaneko */
64736480   DRIVER( galpan2g )   /* (c) 1993 Kaneko */
64746481   DRIVER( galpan2t )   /* (c) 1993 Kaneko */
r1051r1052
69336940   DRIVER( royalmj )   /* (c) 1982 Nichibutsu */
69346941   DRIVER( openmj )   /* (c) 1982 Nichibutsu */
69356942   DRIVER( royalmah )   /* Falcon bootleg */
6943   DRIVER( janyoup2 )   /* Falcon bootleg */
6944   DRIVER( janoh )      /* (c) 1982 Toaplan */
69366945   DRIVER( suzume )   /*  ??  (c) 1986 Dyna Electronics */
69376946   DRIVER( hnayayoi )   /* "02" (c) 1987 Dyna Electronics */
69386947   DRIVER( dondenmj )   /* "03" (c) 1986 Dyna Electronics */
r1051r1052
69446953   DRIVER( hanamai )   /* "16" (c) 1988 Dynax */
69456954   DRIVER( majs101b )   /* "17" (c) [1988] Dynax */
69466955   DRIVER( mjapinky )   /* 1988 Dynax */
6956   DRIVER( mjdejavu )   /* 1989 Dynax */
69476957   DRIVER( hnkochou )   /* "20" (c) 1989 Dynax */
69486958   DRIVER( mjderngr )   /* "22" (c) 1989 Dynax */
69496959   DRIVER( hnoridur )   /* "23" (c) 1989 Dynax */
r1051r1052
69516961   DRIVER( mjfriday )   /* "26" (c) [1989] Dynax */
69526962   DRIVER( jantouki )   /* "27" Jantouki 1989 Dynax */
69536963   DRIVER( mjifb )      /* "29" 1990 Dynax */
6964   DRIVER( mjvegas )   /* 1991 Dynax */
69546965   DRIVER( cafetime )   /* 1992 Dynax */
69556966   DRIVER( cafedoll )   /* 1993 Dynax */
69566967   DRIVER( janptr96 )   /* 1996 Dynax */
r1051r1052
69967007   DRIVER( ddenlovb )   /* bootleg */
69977008   DRIVER( hanakanz )   /* "507" 1996 Dynax */
69987009   DRIVER( akamaru )   /* "501" 1996 Dynax */
7010   DRIVER( mjflove )   /*       1996 Dynax */
69997011   DRIVER( hkagerou )   /* "510" Hana Kagerou 1996 Nakanihon */
70007012   DRIVER( realbrk )   /* "600" Billiard Academy Real Break 1998 (Europe)*/
70017013   DRIVER( realbrkk )   /* "600" Billiard Academy Real Break 1998 (Korea)*/
r1051r1052
77557767   DRIVER( thayers )   /* (c) 1983 RDI Video Systems */
77567768   DRIVER( thayersa )   /* (c) 1983 RDI Video Systems */
77577769   DRIVER( istellar )   /* (c) 1983 Funai / Gakken */
7770   DRIVER( esh )      /* (c) 1984 Funai / Gakken */
7771   DRIVER( esha )      /* (c) 1984 Funai / Gakken */
7772   DRIVER( eshb )      /* (c) 1984 Funai / Gakken */
77587773   DRIVER( comebaby )   /* (c) 2000 ExPotato */
7774   DRIVER( mirage )   /* (c) 1994 Mitchell */
7775   DRIVER( dominob )   /* (c) 1990 Wonwoo Systems */
77597776
77607777#endif   /* DRIVER_RECURSIVE */
src/mame/includes/nitedrvr.h
r1051r1052
2929
3030/*----------- defined in audio/nitedrvr.c -----------*/
3131
32extern discrete_sound_block nitedrvr_discrete_interface[];
32DISCRETE_SOUND_EXTERN( nitedrvr );
3333
3434
3535/*----------- defined in video/nitedrvr.c -----------*/
src/mame/includes/skydiver.h
r1051r1052
2121
2222/*----------- defined in audio/skydiver.c -----------*/
2323
24extern discrete_sound_block skydiver_discrete_interface[];
24DISCRETE_SOUND_EXTERN( skydiver );
2525
2626
2727/*----------- defined in video/skydiver.c -----------*/
src/mame/includes/cps1.h
r1051r1052
2424WRITE16_HANDLER( cps1_coinctrl_w );
2525INTERRUPT_GEN( cps1_interrupt );
2626
27extern gfx_decode cps1_gfxdecodeinfo[];
27GFXDECODE_EXTERN( cps1 );
2828
2929
3030/*----------- defined in machine/cps2crpt.c -----------*/
src/mame/includes/phoenix.h
r1051r1052
44
55/*----------- defined in audio/phoenix.c -----------*/
66
7extern discrete_sound_block phoenix_discrete_interface[];
7DISCRETE_SOUND_EXTERN( phoenix );
88
99WRITE8_HANDLER( phoenix_sound_control_a_w );
1010WRITE8_HANDLER( phoenix_sound_control_b_w );
src/mame/includes/avalnche.h
r1051r1052
99
1010/*----------- defined in audio/avalnche.c -----------*/
1111
12extern discrete_sound_block avalnche_discrete_interface[];
12DISCRETE_SOUND_EXTERN( avalnche );
1313WRITE8_HANDLER( avalnche_noise_amplitude_w );
1414WRITE8_HANDLER( avalnche_attract_enable_w );
1515WRITE8_HANDLER( avalnche_audio_w );
src/mame/includes/hitme.h
r1051r1052
1515
1616/*----------- defined in audio/hitme.c -----------*/
1717
18extern discrete_sound_block hitme_discrete_interface[];
18DISCRETE_SOUND_EXTERN( hitme );
src/mame/includes/asteroid.h
r1051r1052
3030
3131/*----------- defined in audio/asteroid.c -----------*/
3232
33extern discrete_sound_block asteroid_discrete_interface[];
34extern discrete_sound_block astdelux_discrete_interface[];
33DISCRETE_SOUND_EXTERN( asteroid );
34DISCRETE_SOUND_EXTERN( astdelux );
3535
3636WRITE8_HANDLER( asteroid_explode_w );
3737WRITE8_HANDLER( asteroid_thump_w );
r1051r1052
4242
4343/*----------- defined in audio/llander.c -----------*/
4444
45extern discrete_sound_block llander_discrete_interface[];
45DISCRETE_SOUND_EXTERN( llander );
4646
4747WRITE8_HANDLER( llander_snd_reset_w );
4848WRITE8_HANDLER( llander_sounds_w );
src/mame/includes/poolshrk.h
r1051r1052
1515WRITE8_HANDLER( poolshrk_click_sound_w );
1616WRITE8_HANDLER( poolshrk_bump_sound_w );
1717
18extern discrete_sound_block poolshrk_discrete_interface[];
18DISCRETE_SOUND_EXTERN( poolshrk );
1919
2020
2121/*----------- defined in video/poolshrk.c -----------*/
src/mame/includes/sprint2.h
r1051r1052
2323
2424/*----------- defined in audio/sprint2.c -----------*/
2525
26extern discrete_sound_block sprint2_discrete_interface[];
27extern discrete_sound_block sprint1_discrete_interface[];
28extern discrete_sound_block dominos_discrete_interface[];
26DISCRETE_SOUND_EXTERN( sprint2 );
27DISCRETE_SOUND_EXTERN( sprint1 );
28DISCRETE_SOUND_EXTERN( dominos );
2929
3030
3131/*----------- defined in video/sprint2.c -----------*/
src/mame/includes/blockade.h
r1051r1052
1010/*----------- defined in audio/blockade.c -----------*/
1111
1212extern struct Samplesinterface blockade_samples_interface;
13extern discrete_sound_block blockade_discrete_interface[];
13DISCRETE_SOUND_EXTERN( blockade );
1414
1515WRITE8_HANDLER( blockade_sound_freq_w );
1616WRITE8_HANDLER( blockade_env_on_w );
src/mame/includes/firetrk.h
r1051r1052
4949WRITE8_HANDLER( firetrk_asr_w );
5050WRITE8_HANDLER( firetrk_out2_w );
5151
52extern discrete_sound_block firetrk_discrete_interface[];
53extern discrete_sound_block superbug_discrete_interface[];
54extern discrete_sound_block montecar_discrete_interface[];
52DISCRETE_SOUND_EXTERN( firetrk );
53DISCRETE_SOUND_EXTERN( superbug );
54DISCRETE_SOUND_EXTERN( montecar );
5555
5656
5757/*----------- defined in video/firetrk.c -----------*/
src/mame/includes/dragrace.h
r1051r1052
2424
2525/*----------- defined in audio/dragrace.c -----------*/
2626
27extern discrete_sound_block dragrace_discrete_interface[];
27DISCRETE_SOUND_EXTERN( dragrace );
2828
2929/*----------- defined in video/dragrace.c -----------*/
3030
src/mame/includes/orbit.h
r1051r1052
2323WRITE8_HANDLER( orbit_noise_amp_w );
2424WRITE8_HANDLER( orbit_noise_rst_w );
2525
26extern discrete_sound_block orbit_discrete_interface[];
26DISCRETE_SOUND_EXTERN( orbit );
2727
2828/*----------- defined in video/orbit.c -----------*/
2929
src/mame/includes/galaga.h
r1051r1052
1818
1919/*----------- defined in audio/galaga.c -----------*/
2020
21extern discrete_sound_block bosco_discrete_interface[];
22extern discrete_sound_block galaga_discrete_interface[];
21DISCRETE_SOUND_EXTERN( bosco );
22DISCRETE_SOUND_EXTERN( galaga );
2323
2424
2525/*----------- defined in video/galaga.c -----------*/
src/mame/includes/8080bw.h
r1051r1052
3434WRITE8_HANDLER( indianbt_sh_port_1_w );
3535WRITE8_HANDLER( indianbt_sh_port_2_w );
3636WRITE8_HANDLER( indianbt_sh_port_3_w );
37extern discrete_sound_block indianbt_discrete_interface[];
37DISCRETE_SOUND_EXTERN( indianbt );
3838
3939WRITE8_HANDLER( polaris_sh_port_1_w );
4040WRITE8_HANDLER( polaris_sh_port_2_w );
4141WRITE8_HANDLER( polaris_sh_port_3_w );
42extern discrete_sound_block polaris_discrete_interface[];
42DISCRETE_SOUND_EXTERN( polaris );
4343
4444MACHINE_RESET( schaser );
4545MACHINE_START( schaser );
4646WRITE8_HANDLER( schaser_sh_port_1_w );
4747WRITE8_HANDLER( schaser_sh_port_2_w );
4848extern struct SN76477interface schaser_sn76477_interface;
49extern discrete_sound_block schaser_discrete_interface[];
49DISCRETE_SOUND_EXTERN( schaser );
5050
5151WRITE8_HANDLER( rollingc_sh_port_w );
5252
src/mame/includes/qix.h
r1051r1052
6262
6363/*----------- defined in audio/qix.c -----------*/
6464
65extern discrete_sound_block qix_discrete_interface[];
65DISCRETE_SOUND_EXTERN( qix );
6666
6767WRITE8_HANDLER( qix_dac_w );
6868WRITE8_HANDLER( qix_vol_w );
src/mame/includes/grchamp.h
r1051r1052
5151
5252/*----------- defined in audio/grchamp.c -----------*/
5353
54extern discrete_sound_block grchamp_discrete_interface[];
54DISCRETE_SOUND_EXTERN( grchamp );
5555
5656/*----------- defined in video/grchamp.c -----------*/
5757
src/mame/includes/canyon.h
r1051r1052
2323WRITE8_HANDLER( canyon_attract_w );
2424WRITE8_HANDLER( canyon_whistle_w );
2525
26extern discrete_sound_block canyon_discrete_interface[];
26DISCRETE_SOUND_EXTERN( canyon );
2727
2828
2929/*----------- defined in video/canyon.c -----------*/
src/mame/includes/circus.h
r1051r1052
1010extern int circus_game;
1111extern WRITE8_HANDLER( circus_clown_z_w );
1212
13extern discrete_sound_block circus_discrete_interface[];
14extern discrete_sound_block robotbwl_discrete_interface[];
15extern discrete_sound_block crash_discrete_interface[];
13DISCRETE_SOUND_EXTERN( circus );
14DISCRETE_SOUND_EXTERN( robotbwl );
15DISCRETE_SOUND_EXTERN( crash );
1616extern struct Samplesinterface circus_samples_interface;
1717extern struct Samplesinterface crash_samples_interface;
1818extern struct Samplesinterface ripcord_samples_interface;
src/mame/includes/crbaloon.h
r1051r1052
1313
1414/*----------- defined in audio/crbaloon.c -----------*/
1515
16extern discrete_sound_block crbaloon_discrete_interface[];
16DISCRETE_SOUND_EXTERN( crbaloon );
1717
1818/*----------- defined in video/crbaloon.c -----------*/
1919
src/mame/includes/bsktball.h
r1051r1052
3030WRITE8_HANDLER( bsktball_note_w );
3131WRITE8_HANDLER( bsktball_noise_reset_w );
3232
33extern discrete_sound_block bsktball_discrete_interface[];
33DISCRETE_SOUND_EXTERN( bsktball );
3434
3535/*----------- defined in video/bsktball.c -----------*/
3636
src/mame/includes/dkong.h
r1051r1052
119119SOUND_START( hunchbkd );
120120SOUND_START( radarsc1 );
121121
122extern discrete_sound_block dkong_discrete_interface[];
123extern discrete_sound_block radarscp_discrete_interface[];
122DISCRETE_SOUND_EXTERN( dkong );
123DISCRETE_SOUND_EXTERN( radarscp );
124124
src/mame/includes/system16.h
r1051r1052
131131#define SYS16_MRA16_ROADRAM      MRA16_RAM
132132#define SYS16_MWA16_ROADRAM      MWA16_RAM
133133
134extern gfx_decode sys16_gfxdecodeinfo[];
134GFXDECODE_EXTERN( sys16 );
135135
136136
137137#define SYS16_JOY1 PORT_START_TAG("IN0")\
src/mame/includes/triplhnt.h
r1051r1052
2222
2323/*----------- defined in audio/triplhnt.c -----------*/
2424
25extern discrete_sound_block triplhnt_discrete_interface[];
25DISCRETE_SOUND_EXTERN( triplhnt );
2626extern struct Samplesinterface triplhnt_samples_interface;
2727
2828
src/mame/includes/atarifb.h
r1051r1052
3737
3838/*----------- defined in audio/atarifb.c -----------*/
3939
40extern discrete_sound_block atarifb_discrete_interface[];
41extern discrete_sound_block abaseb_discrete_interface[];
40DISCRETE_SOUND_EXTERN( atarifb );
41DISCRETE_SOUND_EXTERN( abaseb );
4242
4343
4444/*----------- defined in video/atarifb.c -----------*/
src/mame/includes/subs.h
r1051r1052
3636WRITE8_HANDLER( subs_crash_w );
3737WRITE8_HANDLER( subs_explode_w );
3838
39extern discrete_sound_block subs_discrete_interface[];
39DISCRETE_SOUND_EXTERN( subs );
4040
4141
4242/*----------- defined in video/subs.c -----------*/
src/mame/includes/videopin.h
r1051r1052
1717
1818/*----------- defined in audio/videopin.c -----------*/
1919
20extern discrete_sound_block videopin_discrete_interface[];
20DISCRETE_SOUND_EXTERN( videopin );
2121
2222
2323/*----------- defined in video/videopin.c -----------*/
src/mame/includes/polepos.h
r1051r1052
99
1010/*----------- defined in audio/polepos.c -----------*/
1111
12extern discrete_sound_block polepos_discrete_interface[];
12DISCRETE_SOUND_EXTERN( polepos );
src/mame/includes/tank8.h
r1051r1052
2525
2626/*----------- defined in audio/tank8.c -----------*/
2727
28extern discrete_sound_block tank8_discrete_interface[];
28DISCRETE_SOUND_EXTERN( tank8 );
2929
3030
3131/*----------- defined in drivers/tank8.c -----------*/
src/mame/mame.mak
r1051r1052
10861086
10871087$(MAMEOBJ)/nmk.a: \
10881088   $(DRIVERS)/acommand.o \
1089   $(DRIVERS)/cultures.o \
10891090   $(DRIVERS)/ddealer.o \
10901091   $(DRIVERS)/jalmah.o \
10911092   $(DRIVERS)/macrossp.o $(VIDEO)/macrossp.o \
r1051r1052
12501251   $(DRIVERS)/speedatk.o $(VIDEO)/speedatk.o \
12511252   $(DRIVERS)/srmp2.o $(VIDEO)/srmp2.o \
12521253   $(DRIVERS)/srmp5.o \
1253   $(DRIVERS)/srmp6.o $(VIDEO)/srmp6.o \
1254   $(DRIVERS)/srmp6.o \
12541255   $(DRIVERS)/ssv.o $(VIDEO)/ssv.o \
12551256   $(DRIVERS)/st0016.o $(VIDEO)/st0016.o \
12561257
r1051r1052
15521553   $(DRIVERS)/dcheese.o $(VIDEO)/dcheese.o \
15531554   $(DRIVERS)/dgpix.o \
15541555   $(DRIVERS)/discoboy.o \
1556   $(DRIVERS)/dominob.o \
15551557   $(DRIVERS)/dorachan.o \
15561558   $(DRIVERS)/dreamwld.o \
15571559   $(DRIVERS)/dribling.o $(VIDEO)/dribling.o \
r1051r1052
15601562   $(DRIVERS)/epos.o $(VIDEO)/epos.o \
15611563   $(DRIVERS)/ertictac.o \
15621564   $(DRIVERS)/esd16.o $(VIDEO)/esd16.o \
1565   $(DRIVERS)/esh.o \
15631566   $(DRIVERS)/ettrivia.o \
15641567   $(DRIVERS)/filetto.o \
15651568   $(DRIVERS)/flower.o $(AUDIO)/flower.o $(VIDEO)/flower.o \
r1051r1052
15971600   $(DRIVERS)/micro3d.o \
15981601   $(DRIVERS)/midas.o \
15991602   $(DRIVERS)/miniboy7.o \
1603   $(DRIVERS)/mirage.o \
16001604   $(DRIVERS)/mirax.o \
16011605   $(DRIVERS)/mjsiyoub.o \
16021606   $(DRIVERS)/mole.o $(VIDEO)/mole.o \
src/mame/video/sauro.c
r1051r1052
4646   tilemap_set_scrollx(bg_tilemap, 0, data);
4747}
4848
49WRITE8_HANDLER( flip_screen_w )
50{
51   flip_screen_set(data);
52}
53
5449static TILE_GET_INFO( get_tile_info_bg )
5550{
5651   int code = tecfri_videoram[tile_index] + ((tecfri_colorram[tile_index] & 0x07) << 8);
src/mame/video/suprnova.c
r1051r1052
636636
637637                  for (xx = 0; xx<xsize; xx++)
638638                  {
639                     if ( (sx+(xsize-1-xx) < (cliprect->max_x+1)) && (sx+(xsize-1-xx)))
639                     if ( (sx+(xsize-1-xx) < (cliprect->max_x+1)) && (sx+(xsize-1-xx) >= cliprect->min_x))
640640                     {
641641                        for (yy = 0; yy<ysize; yy++)
642642                        {
src/mame/video/model2.c
r1051r1052
721721
722722      // transform and normalize the normal
723723      {
724         float tx =   (nx * matrix[0]) + (ny * matrix[3]) + (nz * matrix[6]) + (matrix[9]);
725         float ty =   (nx * matrix[1]) + (ny * matrix[4]) + (nz * matrix[7]) + (matrix[10]);
726         float tz =   (nx * matrix[2]) + (ny * matrix[5]) + (nz * matrix[8]) + (matrix[11]);
724         float tx =   (nx * matrix[0]) + (ny * matrix[3]) + (nz * matrix[6]);
725         float ty =   (nx * matrix[1]) + (ny * matrix[4]) + (nz * matrix[7]);
726         float tz =   (nx * matrix[2]) + (ny * matrix[5]) + (nz * matrix[8]);
727727         float norm = sqrt( tx*tx + ty*ty + tz*tz );
728728         if ( norm )
729729         {
r1051r1052
811811
812812         previous_zvalue = zvalue;
813813
814         if (polytype == 2)
815            memcpy(&p2, &p1, sizeof(VERTEX));
816
814817         if (linktype != 0)
815818         {
816819            tri1.flags = 0;
src/mame/video/lordgun.c
r1051r1052
4444UINT16 *lordgun_vram_2, *lordgun_scroll_x_2, *lordgun_scroll_y_2;
4545UINT16 *lordgun_vram_3, *lordgun_scroll_x_3, *lordgun_scroll_y_3;
4646UINT16 *lordgun_scrollram;
47UINT16 *lordgun_priority_ram, lordgun_priority;
4847int lordgun_whitescreen;
4948
5049struct
src/mame/video/darius.c
r1051r1052
7474
7575/***************************************************************************/
7676
77void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int primask, int x_offs, int y_offs)
77static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int primask, int x_offs, int y_offs)
7878{
7979   int offs,curx,cury;
8080   UINT16 code,data,sx,sy;
src/mame/video/alpha68k.c
r1051r1052
1111
1212extern void (*alpha68k_video_banking)(int *bank, int data);
1313
14extern int microcontroller_id;
14extern int alpha68k_microcontroller_id;
1515
1616/******************************************************************************/
1717
r1051r1052
274274   fillbitmap(bitmap,machine->pens[4095],cliprect);
275275
276276   /* This appears to be correct priority */
277   if (microcontroller_id == 0x8814) /* Sky Adventure */
277   if (alpha68k_microcontroller_id == 0x8814) /* Sky Adventure */
278278   {
279279      draw_sprites_V(machine, bitmap,cliprect,0,0x07c0,0x0800,0,0x8000,0x7fff);
280280      draw_sprites_V(machine, bitmap,cliprect,1,0x0000,0x0800,0,0x8000,0x7fff);
r1051r1052
350350
351351VIDEO_UPDATE( alpha68k_I )
352352{
353   int yshift = (microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off
353   int yshift = (alpha68k_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off
354354
355355   fillbitmap(bitmap,machine->pens[0],cliprect);
356356
src/mame/video/namcos22.c
r1051r1052
400400                     int tg = (color>>8)&0xff;
401401                     int tb = color&0xff;
402402                     int trans1 = 0x100 - mixer.poly_translucency;
403                     r = (tr*mixer.poly_translucency + r*trans1)/0x100;
404                     g = (tg*mixer.poly_translucency + g*trans1)/0x100;
405                     b = (tb*mixer.poly_translucency + b*trans1)/0x100;
403                     r = (tr*mixer.poly_translucency + r*trans1)>>8;
404                     g = (tg*mixer.poly_translucency + g*trans1)>>8;
405                     b = (tb*mixer.poly_translucency + b*trans1)>>8;
406406                  }
407407                  rgb = (r<<16)|(g<<8)|b;
408408                  pDest[x] = rgb;
src/mame/video/bfm_adr2.c
r1051r1052
503503// characters are grouped by 64 (512 pixels)
504504// there are max 128 of these groups
505505
506gfx_decode adder2_gfxdecodeinfo[] =
507{
508   { REGION_GFX1,  0, &charlayout, 0, 16 },
509   { -1 }
510};
506GFXDECODE_START( adder2 )
507   GFXDECODE_ENTRY( REGION_GFX1,  0, charlayout, 0, 16 )
508GFXDECODE_END
511509
512510///////////////////////////////////////////////////////////////////////////
src/mame/video/bfm_adr2.h
r1051r1052
88
99extern int adder2_acia_triggered;   // flag <>0, ACIA receive IRQ
1010
11extern gfx_decode adder2_gfxdecodeinfo[];
11GFXDECODE_EXTERN( adder2 );
1212extern void adder2_decode_char_roms(void);
1313void adder2_update(mame_bitmap *bitmap);
1414
src/mame/video/jack.c
r1051r1052
128128
129129static TILE_GET_INFO( joinem_get_bg_tile_info )
130130{
131   int code = videoram[tile_index] + ((colorram[tile_index] & 0x01) << 8);
131   int code = videoram[tile_index] + ((colorram[tile_index] & 0x03) << 8);
132132   int color = (colorram[tile_index] & 0x38) >> 3;
133133
134134   SET_TILE_INFO(0, code, color, 0);
src/mame/drivers/rcasino.c
r1051r1052
278278   8*8
279279};
280280
281static const gfx_decode gfxdecodeinfo[] =
282{
283   { REGION_GFX1, 0x0000, &charlayout,  0, 16 },
284   { REGION_GFX2, 0x0000, &charlayout2, 0, 16 },
285   { -1 }
286};
281static GFXDECODE_START( rcasino )
282   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,  0, 16 )
283   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout2, 0, 16 )
284GFXDECODE_END
287285
288286static struct AY8910interface ay8910_interface =
289287{
r1051r1052
309307   MDRV_SCREEN_SIZE(32*8, 32*8)
310308   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
311309
312   MDRV_GFXDECODE(gfxdecodeinfo)
310   MDRV_GFXDECODE(rcasino)
313311   MDRV_PALETTE_LENGTH(64)
314312   MDRV_COLORTABLE_LENGTH(64)
315313
src/mame/drivers/sbugger.c
r1051r1052
155155   16*8
156156};
157157
158static const gfx_decode gfxdecodeinfo[] =
159{
160   { REGION_GFX1, 0, &char16layout,   0, 1  },
161   { -1 }
162};
158static GFXDECODE_START( sbugger )
159   GFXDECODE_ENTRY( REGION_GFX1, 0, char16layout,   0, 1  )
160GFXDECODE_END
163161
164162/* input ports */
165163
r1051r1052
236234   MDRV_SCREEN_REFRESH_RATE(60)
237235   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
238236
239   MDRV_GFXDECODE(gfxdecodeinfo)
237   MDRV_GFXDECODE(sbugger)
240238
241239   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
242240   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/targeth.c
r1051r1052
3333   32*8
3434};
3535
36static const gfx_decode gfxdecodeinfo_0x080000[] =
37{
38   { REGION_GFX1, 0x000000, &tilelayout16_0x080000, 0, 64 },
39   { -1 }
40};
36static GFXDECODE_START( 0x080000 )
37   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout16_0x080000, 0, 64 )
38GFXDECODE_END
4139
4240
4341static INTERRUPT_GEN(targeth_interrupt )
r1051r1052
202200   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
203201   MDRV_SCREEN_SIZE(64*16, 32*16)            /* 1024x512 */
204202   MDRV_SCREEN_VISIBLE_AREA(0, 24*16-1, 16, 16*16-1)   /* 400x240 */
205   MDRV_GFXDECODE(gfxdecodeinfo_0x080000)
203   MDRV_GFXDECODE(0x080000)
206204   MDRV_PALETTE_LENGTH(1024)
207205
208206   MDRV_VIDEO_START(targeth)
src/mame/drivers/intrscti.c
r1051r1052
5555   8*8
5656};
5757
58static const gfx_decode gfxdecodeinfo[] =
59{
60   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
61   { -1 }
62};
58static GFXDECODE_START( intrscti )
59   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
60GFXDECODE_END
6361
6462VIDEO_START(intrscti)
6563{
r1051r1052
103101   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
104102   MDRV_SCREEN_SIZE(256, 512)
105103   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 512-1)
106   MDRV_GFXDECODE(gfxdecodeinfo)
104   MDRV_GFXDECODE(intrscti)
107105   MDRV_PALETTE_LENGTH(0x100)
108106
109107   MDRV_VIDEO_START(intrscti)
src/mame/drivers/nycaptor.c
r1051r1052
788788   64*8
789789};
790790
791static const gfx_decode gfxdecodeinfo[] =
792{
793   { REGION_GFX1, 0, &charlayout,     0, 16 },//16 kolorow
794   { REGION_GFX1, 0, &spritelayout, 256, 16 },//paleta 2, 16 kolorow
795   { -1 }   /* end of array */
796};
791static GFXDECODE_START( nycaptor )
792   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )//16 kolorow
793   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 256, 16 )//paleta 2, 16 kolorow
794GFXDECODE_END
797795
798796
799797
r1051r1052
828826   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
829827   MDRV_SCREEN_SIZE(32*8, 32*8)
830828   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
831   MDRV_GFXDECODE(gfxdecodeinfo)
829   MDRV_GFXDECODE(nycaptor)
832830   MDRV_PALETTE_LENGTH(512)
833831
834832   MDRV_VIDEO_START(nycaptor)
r1051r1052
878876   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
879877   MDRV_SCREEN_SIZE(32*8, 32*8)
880878   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
881   MDRV_GFXDECODE(gfxdecodeinfo)
879   MDRV_GFXDECODE(nycaptor)
882880   MDRV_PALETTE_LENGTH(512)
883881
884882   MDRV_VIDEO_START(nycaptor)
r1051r1052
925923   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
926924   MDRV_SCREEN_SIZE(32*8, 32*8)
927925   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
928   MDRV_GFXDECODE(gfxdecodeinfo)
926   MDRV_GFXDECODE(nycaptor)
929927   MDRV_PALETTE_LENGTH(512)
930928
931929   MDRV_VIDEO_START(nycaptor)
src/mame/drivers/mitchell.c
r1051r1052
11891189   64*8    /* every sprite takes 64 consecutive bytes */
11901190};
11911191
1192static const gfx_decode mgakuen_gfxdecodeinfo[] =
1193{
1194   { REGION_GFX1, 0, &marukin_charlayout, 0,  64 }, /* colors 0-1023 */
1195   { REGION_GFX2, 0, &spritelayout,       0,  16 }, /* colors 0- 255 */
1196   { -1 }
1197};
1192static GFXDECODE_START( mgakuen )
1193   GFXDECODE_ENTRY( REGION_GFX1, 0, marukin_charlayout, 0,  64 ) /* colors 0-1023 */
1194   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       0,  16 ) /* colors 0- 255 */
1195GFXDECODE_END
11981196
1199static const gfx_decode marukin_gfxdecodeinfo[] =
1200{
1201   { REGION_GFX1, 0, &marukin_charlayout, 0, 128 }, /* colors 0-2047 */
1202   { REGION_GFX2, 0, &spritelayout,       0,  16 }, /* colors 0- 255 */
1203   { -1 }
1204};
1197static GFXDECODE_START( marukin )
1198   GFXDECODE_ENTRY( REGION_GFX1, 0, marukin_charlayout, 0, 128 ) /* colors 0-2047 */
1199   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       0,  16 ) /* colors 0- 255 */
1200GFXDECODE_END
12051201
1206static const gfx_decode gfxdecodeinfo[] =
1207{
1208   { REGION_GFX1, 0, &charlayout,     0, 128 }, /* colors 0-2047 */
1209   { REGION_GFX2, 0, &spritelayout,   0,  16 }, /* colors 0- 255 */
1210   { -1 }
1211};
1202static GFXDECODE_START( mitchell )
1203   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 128 ) /* colors 0-2047 */
1204   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   0,  16 ) /* colors 0- 255 */
1205GFXDECODE_END
12121206
12131207static const gfx_layout mstworld_charlayout =
12141208{
r1051r1052
12361230};
12371231
12381232
1239static const gfx_decode mstworld_gfxdecodeinfo[] =
1240{
1241   { REGION_GFX1, 0, &mstworld_charlayout,   0x000, 0x40 },
1242   { REGION_GFX2, 0, &mstworld_spritelayout, 0x000, 0x40 },
1243   { -1 }
1244};
1233static GFXDECODE_START( mstworld )
1234   GFXDECODE_ENTRY( REGION_GFX1, 0, mstworld_charlayout,   0x000, 0x40 )
1235   GFXDECODE_ENTRY( REGION_GFX2, 0, mstworld_spritelayout, 0x000, 0x40 )
1236GFXDECODE_END
12451237
12461238static MACHINE_DRIVER_START( mgakuen )
12471239
r1051r1052
12591251   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12601252   MDRV_SCREEN_SIZE(64*8, 32*8)
12611253   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1262   MDRV_GFXDECODE(mgakuen_gfxdecodeinfo)
1254   MDRV_GFXDECODE(mgakuen)
12631255   MDRV_PALETTE_LENGTH(1024)   /* less colors than the others */
12641256
12651257   MDRV_VIDEO_START(pang)
r1051r1052
12951287   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12961288   MDRV_SCREEN_SIZE(64*8, 32*8)
12971289   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1298   MDRV_GFXDECODE(gfxdecodeinfo)
1290   MDRV_GFXDECODE(mitchell)
12991291   MDRV_PALETTE_LENGTH(2048)
13001292
13011293   MDRV_VIDEO_START(pang)
r1051r1052
13391331   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13401332   MDRV_SCREEN_SIZE(64*8, 32*8)
13411333   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1342   MDRV_GFXDECODE(mstworld_gfxdecodeinfo)
1334   MDRV_GFXDECODE(mstworld)
13431335   MDRV_PALETTE_LENGTH(2048)
13441336
13451337   MDRV_VIDEO_START(pang)
r1051r1052
13721364   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13731365   MDRV_SCREEN_SIZE(64*8, 32*8)
13741366   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1375   MDRV_GFXDECODE(marukin_gfxdecodeinfo)
1367   MDRV_GFXDECODE(marukin)
13761368   MDRV_PALETTE_LENGTH(2048)
13771369
13781370   MDRV_VIDEO_START(pang)
src/mame/drivers/rainbow.c
r1051r1052
556556   128*8   /* every sprite takes 128 consecutive bytes */
557557};
558558
559static const gfx_decode rainbow_gfxdecodeinfo[] =
560{
561   { REGION_GFX2, 0x000000, &spritelayout, 0, 0x80 },   /* OBJ 16x16 */
562   { REGION_GFX1, 0x000000, &tilelayout,   0, 0x80 },   /* SCR 8x8 */
563   { -1 }   /* end of array */
564};
559static GFXDECODE_START( rainbow )
560   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, spritelayout, 0, 0x80 )   /* OBJ 16x16 */
561   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout,   0, 0x80 )   /* SCR 8x8 */
562GFXDECODE_END
565563
566564
567565static const gfx_layout jumping_tilelayout =
r1051r1052
586584   32*8    /* every sprite takes 32 consecutive bytes */
587585};
588586
589static const gfx_decode jumping_gfxdecodeinfo[] =
590{
591   { REGION_GFX2, 0, &jumping_spritelayout, 0, 0x80 },   /* OBJ 16x16 */
592   { REGION_GFX1, 0, &jumping_tilelayout,   0, 0x80 },   /* SCR 8x8 */
593   { -1 }   /* end of array */
594};
587static GFXDECODE_START( jumping )
588   GFXDECODE_ENTRY( REGION_GFX2, 0, jumping_spritelayout, 0, 0x80 )   /* OBJ 16x16 */
589   GFXDECODE_ENTRY( REGION_GFX1, 0, jumping_tilelayout,   0, 0x80 )   /* SCR 8x8 */
590GFXDECODE_END
595591
596592
597593/**************************************************************
r1051r1052
635631   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
636632   MDRV_SCREEN_SIZE(40*8, 32*8)
637633   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
638   MDRV_GFXDECODE(rainbow_gfxdecodeinfo)
634   MDRV_GFXDECODE(rainbow)
639635   MDRV_PALETTE_LENGTH(8192)
640636
641637   MDRV_VIDEO_START(rainbow)
r1051r1052
670666   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
671667   MDRV_SCREEN_SIZE(40*8, 32*8)
672668   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
673   MDRV_GFXDECODE(jumping_gfxdecodeinfo)
669   MDRV_GFXDECODE(jumping)
674670   MDRV_PALETTE_LENGTH(8192)
675671
676672   MDRV_VIDEO_START(jumping)
src/mame/drivers/galspnbl.c
r1051r1052
277277   16*8
278278};
279279
280static const gfx_decode gfxdecodeinfo[] =
281{
282   { REGION_GFX1, 0, &tilelayout,   512, 16 },
283   { REGION_GFX2, 0, &spritelayout,   0, 16 },
284   { -1 }
285};
280static GFXDECODE_START( galspnbl )
281   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   512, 16 )
282   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   0, 16 )
283GFXDECODE_END
286284
287285
288286
r1051r1052
317315   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
318316   MDRV_SCREEN_SIZE(512, 256)
319317   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 16, 240-1)
320   MDRV_GFXDECODE(gfxdecodeinfo)
318   MDRV_GFXDECODE(galspnbl)
321319   MDRV_PALETTE_LENGTH(1024 + 32768)
322320
323321   MDRV_PALETTE_INIT(galspnbl)
src/mame/drivers/blktiger.c
r1051r1052
236236   32*16
237237};
238238
239static const gfx_decode gfxdecodeinfo[] =
240{
241   { REGION_GFX1, 0, &charlayout,   0x300, 32 },   /* colors 0x300-0x37f */
242   { REGION_GFX2, 0, &spritelayout, 0x000, 16 },   /* colors 0x000-0x0ff */
243   { REGION_GFX3, 0, &spritelayout, 0x200,  8 },   /* colors 0x200-0x27f */
244   { -1 }
245};
239static GFXDECODE_START( blktiger )
240   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x300, 32 )   /* colors 0x300-0x37f */
241   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x000, 16 )   /* colors 0x000-0x0ff */
242   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x200,  8 )   /* colors 0x200-0x27f */
243GFXDECODE_END
246244
247245
248246
r1051r1052
288286   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
289287   MDRV_SCREEN_SIZE(32*8, 32*8)
290288   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
291   MDRV_GFXDECODE(gfxdecodeinfo)
289   MDRV_GFXDECODE(blktiger)
292290   MDRV_PALETTE_LENGTH(1024)
293291
294292   MDRV_VIDEO_START(blktiger)
src/mame/drivers/dynduke.c
r1051r1052
247247
248248/* Graphics Decode Information */
249249
250static const gfx_decode gfxdecodeinfo[] =
251{
252   { REGION_GFX1, 0, &charlayout,   1280, 16 },
253   { REGION_GFX2, 0, &bg_layout,    2048, 32 }, // Really 0
254   { REGION_GFX3, 0, &fg_layout,     512, 16 },
255   { REGION_GFX4, 0, &spritelayout,  768, 32 },
256   { -1 }
257};
250static GFXDECODE_START( dynduke )
251   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   1280, 16 )
252   GFXDECODE_ENTRY( REGION_GFX2, 0, bg_layout,    2048, 32 ) // Really 0
253   GFXDECODE_ENTRY( REGION_GFX3, 0, fg_layout,     512, 16 )
254   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,  768, 32 )
255GFXDECODE_END
258256
259257/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
260258
r1051r1052
292290   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
293291   MDRV_SCREEN_SIZE(32*8, 32*8)
294292   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
295   MDRV_GFXDECODE(gfxdecodeinfo)
293   MDRV_GFXDECODE(dynduke)
296294   MDRV_PALETTE_LENGTH(2048+1024)   // 2048 real palette, 1024 for transparency kludge
297295
298296   MDRV_VIDEO_START(dynduke)
src/mame/drivers/mgolf.c
r1051r1052
288288};
289289
290290
291static const gfx_decode gfxdecodeinfo[] =
292{
293   { REGION_GFX1, 0, &tile_layout, 0, 2 },
294   { REGION_GFX2, 0, &sprite_layout, 0, 2 },
295   { -1 }
296};
291static GFXDECODE_START( mgolf )
292   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0, 2 )
293   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 0, 2 )
294GFXDECODE_END
297295
298296
299297static MACHINE_DRIVER_START( mgolf )
r1051r1052
310308   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
311309   MDRV_SCREEN_SIZE(256, 262)
312310   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 223)
313   MDRV_GFXDECODE(gfxdecodeinfo)
311   MDRV_GFXDECODE(mgolf)
314312   MDRV_PALETTE_LENGTH(4)
315313
316314   MDRV_PALETTE_INIT(mgolf)
src/mame/drivers/deco_mlc.c
r1051r1052
406406   16*32
407407};
408408
409static const gfx_decode gfxdecodeinfo[] =
410{
411   { REGION_GFX1, 0, &spritelayout_4bpp,   0, 256 },
412   { -1 }
413};
409static GFXDECODE_START( deco_mlc )
410   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout_4bpp,   0, 256 )
411GFXDECODE_END
414412
415static const gfx_decode gfxdecodeinfo_5bpp[] =
416{
417   { REGION_GFX1, 0, &spritelayout_5bpp,   0, 128 },
418   { -1 }
419};
413static GFXDECODE_START( 5bpp )
414   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout_5bpp,   0, 128 )
415GFXDECODE_END
420416
421static const gfx_decode gfxdecodeinfo_6bpp[] =
422{
423   { REGION_GFX1, 0, &spritelayout_6bpp,   0,  64 },
424   { -1 }
425};
417static GFXDECODE_START( 6bpp )
418   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout_6bpp,   0,  64 )
419GFXDECODE_END
426420
427421/******************************************************************************/
428422
r1051r1052
452446   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
453447   MDRV_SCREEN_SIZE(40*8, 32*8)
454448   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
455   MDRV_GFXDECODE(gfxdecodeinfo)
449   MDRV_GFXDECODE(deco_mlc)
456450   MDRV_PALETTE_LENGTH(2048)
457451
458452   MDRV_VIDEO_START(mlc)
r1051r1052
483477   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
484478   MDRV_SCREEN_SIZE(40*8, 32*8)
485479   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
486   MDRV_GFXDECODE(gfxdecodeinfo)
480   MDRV_GFXDECODE(deco_mlc)
487481   MDRV_PALETTE_LENGTH(2048)
488482
489483   MDRV_VIDEO_START(mlc)
r1051r1052
501495
502496static MACHINE_DRIVER_START( mlc_6bpp )
503497   MDRV_IMPORT_FROM(mlc)
504   MDRV_GFXDECODE(gfxdecodeinfo_6bpp)
498   MDRV_GFXDECODE(6bpp)
505499MACHINE_DRIVER_END
506500
507501static MACHINE_DRIVER_START( mlc_5bpp )
508502   MDRV_IMPORT_FROM(mlc)
509   MDRV_GFXDECODE(gfxdecodeinfo_5bpp)
503   MDRV_GFXDECODE(5bpp)
510504MACHINE_DRIVER_END
511505
512506/***************************************************************************/
src/mame/drivers/tunhunt.c
r1051r1052
282282};
283283
284284
285static const gfx_decode gfxdecodeinfo[] =
286{
287   { REGION_GFX1, 0x000, &alpha_layout, 0, 4 },
288   { REGION_GFX2, 0x200, &obj_layout,    8, 1 },
289   { REGION_GFX2, 0x000, &obj_layout,    8, 1 }, /* second bank, or second bitplane? */
290   { -1 }
291};
285static GFXDECODE_START( tunhunt )
286   GFXDECODE_ENTRY( REGION_GFX1, 0x000, alpha_layout, 0, 4 )
287   GFXDECODE_ENTRY( REGION_GFX2, 0x200, obj_layout,    8, 1 )
288   GFXDECODE_ENTRY( REGION_GFX2, 0x000, obj_layout,    8, 1 ) /* second bank, or second bitplane? */
289GFXDECODE_END
292290
293291
294292
r1051r1052
332330   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
333331   MDRV_SCREEN_SIZE(256, 256-16)
334332   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 255-16)
335   MDRV_GFXDECODE(gfxdecodeinfo)
333   MDRV_GFXDECODE(tunhunt)
336334   MDRV_PALETTE_LENGTH(16)
337335   MDRV_COLORTABLE_LENGTH(16)
338336
src/mame/drivers/tryout.c
r1051r1052
174174   32*8
175175};
176176
177static const gfx_decode gfxdecodeinfo[] =
178{
179   { REGION_GFX1, 0, &charlayout,   0, 0x20 },
180   { REGION_GFX2, 0, &spritelayout, 0, 0x20 },
181   { 0,         0, &vramlayout,   0, 0x20 },
182   { -1 }
183};
177static GFXDECODE_START( tryout )
178   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 0x20 )
179   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 0x20 )
180   GFXDECODE_ENTRY( 0,         0, vramlayout,   0, 0x20 )
181GFXDECODE_END
184182
185183static INTERRUPT_GEN( tryout_interrupt )
186184{
r1051r1052
208206   MDRV_SCREEN_SIZE(256, 256)
209207   MDRV_SCREEN_VISIBLE_AREA(1*8, 32*8-1, 1*8, 31*8-1)
210208
211   MDRV_GFXDECODE(gfxdecodeinfo)
209   MDRV_GFXDECODE(tryout)
212210   MDRV_PALETTE_LENGTH(0x20)
213211   MDRV_PALETTE_INIT(tryout)
214212
src/mame/drivers/rungun.c
r1051r1052
321321   128*8
322322};
323323
324static const gfx_decode gfxdecodeinfo[] =
325{
326   { REGION_GFX1, 0, &bglayout, 0x0000, 64 },
327   { -1 }
328};
324static GFXDECODE_START( rungun )
325   GFXDECODE_ENTRY( REGION_GFX1, 0, bglayout, 0x0000, 64 )
326GFXDECODE_END
329327
330328static MACHINE_DRIVER_START( rng )
331329
r1051r1052
343341   MDRV_SCREEN_REFRESH_RATE(60)
344342   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
345343
346   MDRV_GFXDECODE(gfxdecodeinfo)
344   MDRV_GFXDECODE(rungun)
347345
348346   MDRV_MACHINE_RESET(rng)
349347   MDRV_NVRAM_HANDLER(rungun)
src/mame/drivers/madmotor.c
r1051r1052
262262   16*16
263263};
264264
265static const gfx_decode gfxdecodeinfo[] =
266{
267   { REGION_GFX1, 0, &charlayout,     0, 16 },   /* Characters 8x8 */
268   { REGION_GFX2, 0, &tilelayout,   512, 16 },   /* Tiles 16x16 */
269   { REGION_GFX3, 0, &tilelayout2,  768, 16 },   /* Tiles 16x16 */
270   { REGION_GFX4, 0, &spritelayout, 256, 16 },   /* Sprites 16x16 */
271   { -1 }
272};
265static GFXDECODE_START( madmotor )
266   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )   /* Characters 8x8 */
267   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   512, 16 )   /* Tiles 16x16 */
268   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout2,  768, 16 )   /* Tiles 16x16 */
269   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 256, 16 )   /* Sprites 16x16 */
270GFXDECODE_END
273271
274272/******************************************************************************/
275273
r1051r1052
302300   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
303301   MDRV_SCREEN_SIZE(32*8, 32*8)
304302   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
305   MDRV_GFXDECODE(gfxdecodeinfo)
303   MDRV_GFXDECODE(madmotor)
306304   MDRV_PALETTE_LENGTH(1024)
307305
308306   MDRV_VIDEO_START(madmotor)
src/mame/drivers/eprom.c
r1051r1052
323323};
324324
325325
326static const gfx_decode gfxdecodeinfo[] =
327{
328   { REGION_GFX1, 0, &pfmolayout,  256, 32 },   /* sprites & playfield */
329   { REGION_GFX2, 0, &anlayout,      0, 64 },   /* characters 8x8 */
330   { -1 }
331};
326static GFXDECODE_START( eprom )
327   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  256, 32 )   /* sprites & playfield */
328   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout,      0, 64 )   /* characters 8x8 */
329GFXDECODE_END
332330
333331
334332
r1051r1052
355353
356354   /* video hardware */
357355   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
358   MDRV_GFXDECODE(gfxdecodeinfo)
356   MDRV_GFXDECODE(eprom)
359357   MDRV_PALETTE_LENGTH(2048)
360358
361359   MDRV_SCREEN_ADD("main", 0)
r1051r1052
386384
387385   /* video hardware */
388386   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
389   MDRV_GFXDECODE(gfxdecodeinfo)
387   MDRV_GFXDECODE(eprom)
390388   MDRV_PALETTE_LENGTH(2048)
391389
392390   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/bublbobl.c
r1051r1052
703703   16*8
704704};
705705
706static const gfx_decode gfxdecodeinfo[] =
707{
708   { REGION_GFX1, 0, &charlayout, 0, 16 },
709   { -1 }
710};
706static GFXDECODE_START( bublbobl )
707   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
708GFXDECODE_END
711709
712710
713711
r1051r1052
756754   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
757755   MDRV_SCREEN_SIZE(32*8, 32*8)
758756   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
759   MDRV_GFXDECODE(gfxdecodeinfo)
757   MDRV_GFXDECODE(bublbobl)
760758   MDRV_PALETTE_LENGTH(256)
761759
762760   MDRV_VIDEO_UPDATE(bublbobl)
r1051r1052
799797   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
800798   MDRV_SCREEN_SIZE(32*8, 32*8)
801799   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
802   MDRV_GFXDECODE(gfxdecodeinfo)
800   MDRV_GFXDECODE(bublbobl)
803801   MDRV_PALETTE_LENGTH(256)
804802
805803   MDRV_VIDEO_UPDATE(bublbobl)
src/mame/drivers/chinsan.c
r1051r1052
450450   8*8
451451};
452452
453static const gfx_decode gfxdecodeinfo[] =
454{
455   { REGION_GFX1, 0, &tiles8x8_layout, 0, 32 },
456   { -1 }
457};
453static GFXDECODE_START( chinsan )
454   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 32 )
455GFXDECODE_END
458456
459457
460458static MACHINE_DRIVER_START( chinsan )
r1051r1052
473471   MDRV_SCREEN_REFRESH_RATE(60)
474472   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
475473   MDRV_SCREEN_VISIBLE_AREA(24, 512-24-1, 16, 256-16-1)
476   MDRV_GFXDECODE(gfxdecodeinfo)
474   MDRV_GFXDECODE(chinsan)
477475   MDRV_PALETTE_LENGTH(0x100)
478476
479477   MDRV_VIDEO_START(chinsan)
src/mame/drivers/skyfox.c
r1051r1052
217217                                Sky Fox
218218***************************************************************************/
219219
220static const gfx_decode skyfox_gfxdecodeinfo[] =
221{
222   { REGION_GFX1, 0, &layout_8x8x8,   0, 1 }, // [0] Sprites
223   { -1 }
224};
220static GFXDECODE_START( skyfox )
221   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8,   0, 1 ) // [0] Sprites
222GFXDECODE_END
225223
226224
227225
r1051r1052
272270   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
273271   MDRV_SCREEN_SIZE(512, 256)
274272   MDRV_SCREEN_VISIBLE_AREA(0+0x60, 320-1+0x60, 0+16, 256-1-16)   // from $30*2 to $CC*2+8
275   MDRV_GFXDECODE(skyfox_gfxdecodeinfo)
273   MDRV_GFXDECODE(skyfox)
276274   MDRV_PALETTE_LENGTH(256+256)   /* 256 static colors (+256 for the background??) */
277275
278276   MDRV_PALETTE_INIT(skyfox)
src/mame/drivers/cshooter.c
r1051r1052
469469};
470470
471471
472static const gfx_decode gfxdecodeinfo[] =
473{
474   { REGION_GFX1, 0,     &cshooter_charlayout,   0, 64  },
475   { REGION_GFX1, 128/8, &cshooter_charlayout,   0, 64  },
476   { -1 }
477};
472static GFXDECODE_START( cshooter )
473   GFXDECODE_ENTRY( REGION_GFX1, 0,     cshooter_charlayout,   0, 64  )
474   GFXDECODE_ENTRY( REGION_GFX1, 128/8, cshooter_charlayout,   0, 64  )
475GFXDECODE_END
478476
479477static MACHINE_DRIVER_START( cshooter )
480478   MDRV_CPU_ADD(Z80,6000000)       /* ? MHz */
r1051r1052
496494   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
497495   MDRV_SCREEN_SIZE(256, 256)
498496   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-1-16)
499   MDRV_GFXDECODE(gfxdecodeinfo)
497   MDRV_GFXDECODE(cshooter)
500498   MDRV_PALETTE_LENGTH(0x1000)
501499
502500   MDRV_VIDEO_START(cshooter)
r1051r1052
526524   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
527525   MDRV_SCREEN_SIZE(256, 256)
528526   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-1-16)
529   MDRV_GFXDECODE(gfxdecodeinfo)
527   MDRV_GFXDECODE(cshooter)
530528   MDRV_PALETTE_LENGTH(0x1000)
531529
532530   MDRV_VIDEO_START(cshooter)
src/mame/drivers/aerofgt.c
r1051r1052
13261326   8*32
13271327};
13281328
1329static const gfx_decode pspikes_gfxdecodeinfo[] =
1330{
1331   { REGION_GFX1, 0, &pspikes_charlayout,      0, 64 },   /* colors    0-1023 in 8 banks */
1332   { REGION_GFX2, 0, &pspikes_spritelayout, 1024, 64 },   /* colors 1024-2047 in 4 banks */
1333   { -1 }
1334};
1329static GFXDECODE_START( pspikes )
1330   GFXDECODE_ENTRY( REGION_GFX1, 0, pspikes_charlayout,      0, 64 )   /* colors    0-1023 in 8 banks */
1331   GFXDECODE_ENTRY( REGION_GFX2, 0, pspikes_spritelayout, 1024, 64 )   /* colors 1024-2047 in 4 banks */
1332GFXDECODE_END
13351333
1336static const gfx_decode pspikesb_gfxdecodeinfo[] =
1337{
1338   { REGION_GFX1, 0, &pspikesb_charlayout,      0, 64 },   /* colors    0-1023 in 8 banks */
1339   { REGION_GFX2, 0, &pspikesb_spritelayout, 1024, 64 },   /* colors 1024-2047 in 4 banks */
1340   { -1 }
1341};
1334static GFXDECODE_START( pspikesb )
1335   GFXDECODE_ENTRY( REGION_GFX1, 0, pspikesb_charlayout,      0, 64 )   /* colors    0-1023 in 8 banks */
1336   GFXDECODE_ENTRY( REGION_GFX2, 0, pspikesb_spritelayout, 1024, 64 )   /* colors 1024-2047 in 4 banks */
1337GFXDECODE_END
13421338
1343static const gfx_decode pallavol_gfxdecodeinfo[] =
1344{
1345   { REGION_GFX1, 0, &pspikesb_charlayout,      0, 64 },   /* colors    0-1023 in 8 banks */
1346   { REGION_GFX2, 0, &pallavol_spritelayout, 1024, 64 },   /* colors 1024-2047 in 4 banks */
1347   { -1 }
1348};
1339static GFXDECODE_START( pallavol )
1340   GFXDECODE_ENTRY( REGION_GFX1, 0, pspikesb_charlayout,      0, 64 )   /* colors    0-1023 in 8 banks */
1341   GFXDECODE_ENTRY( REGION_GFX2, 0, pallavol_spritelayout, 1024, 64 )   /* colors 1024-2047 in 4 banks */
1342GFXDECODE_END
13491343
13501344
1351static const gfx_decode turbofrc_gfxdecodeinfo[] =
1352{
1353   { REGION_GFX1, 0, &pspikes_charlayout,     0, 16 },
1354   { REGION_GFX2, 0, &pspikes_charlayout,   256, 16 },
1355   { REGION_GFX3, 0, &pspikes_spritelayout, 512, 16 },
1356   { REGION_GFX4, 0, &pspikes_spritelayout, 768, 16 },
1357   { -1 }
1358};
1345static GFXDECODE_START( turbofrc )
1346   GFXDECODE_ENTRY( REGION_GFX1, 0, pspikes_charlayout,     0, 16 )
1347   GFXDECODE_ENTRY( REGION_GFX2, 0, pspikes_charlayout,   256, 16 )
1348   GFXDECODE_ENTRY( REGION_GFX3, 0, pspikes_spritelayout, 512, 16 )
1349   GFXDECODE_ENTRY( REGION_GFX4, 0, pspikes_spritelayout, 768, 16 )
1350GFXDECODE_END
13591351
1360static const gfx_decode aerofgtb_gfxdecodeinfo[] =
1361{
1362   { REGION_GFX1, 0, &pspikes_charlayout,      0, 16 },
1363   { REGION_GFX2, 0, &pspikes_charlayout,    256, 16 },
1364   { REGION_GFX3, 0, &aerofgtb_spritelayout, 512, 16 },
1365   { REGION_GFX4, 0, &aerofgtb_spritelayout, 768, 16 },
1366   { -1 }
1367};
1352static GFXDECODE_START( aerofgtb )
1353   GFXDECODE_ENTRY( REGION_GFX1, 0, pspikes_charlayout,      0, 16 )
1354   GFXDECODE_ENTRY( REGION_GFX2, 0, pspikes_charlayout,    256, 16 )
1355   GFXDECODE_ENTRY( REGION_GFX3, 0, aerofgtb_spritelayout, 512, 16 )
1356   GFXDECODE_ENTRY( REGION_GFX4, 0, aerofgtb_spritelayout, 768, 16 )
1357GFXDECODE_END
13681358
1369static const gfx_decode aerofgt_gfxdecodeinfo[] =
1370{
1371   { REGION_GFX1, 0, &aerofgt_charlayout,     0, 16 },
1372   { REGION_GFX1, 0, &aerofgt_charlayout,   256, 16 },
1373   { REGION_GFX2, 0, &aerofgt_spritelayout, 512, 16 },
1374   { REGION_GFX3, 0, &aerofgt_spritelayout, 768, 16 },
1375   { -1 }
1376};
1359static GFXDECODE_START( aerofgt )
1360   GFXDECODE_ENTRY( REGION_GFX1, 0, aerofgt_charlayout,     0, 16 )
1361   GFXDECODE_ENTRY( REGION_GFX1, 0, aerofgt_charlayout,   256, 16 )
1362   GFXDECODE_ENTRY( REGION_GFX2, 0, aerofgt_spritelayout, 512, 16 )
1363   GFXDECODE_ENTRY( REGION_GFX3, 0, aerofgt_spritelayout, 768, 16 )
1364GFXDECODE_END
13771365
1378static const gfx_decode aerfboot_gfxdecodeinfo[] =
1379{
1380   { REGION_GFX1, 0,       &aerfboot_charlayout,     0, 16 },
1381   { REGION_GFX1, 0x20000, &aerfboot_charlayout,   256, 16 },
1382   { REGION_GFX2, 0,       &aerfboot_spritelayout, 512, 16 },
1383   { REGION_GFX3, 0,       &aerfboot_spritelayout, 768, 16 },
1384   { -1 }
1385};
1366static GFXDECODE_START( aerfboot )
1367   GFXDECODE_ENTRY( REGION_GFX1, 0,       aerfboot_charlayout,     0, 16 )
1368   GFXDECODE_ENTRY( REGION_GFX1, 0x20000, aerfboot_charlayout,   256, 16 )
1369   GFXDECODE_ENTRY( REGION_GFX2, 0,       aerfboot_spritelayout, 512, 16 )
1370   GFXDECODE_ENTRY( REGION_GFX3, 0,       aerfboot_spritelayout, 768, 16 )
1371GFXDECODE_END
13861372
1387static const gfx_decode wbbc97_gfxdecodeinfo[] =
1388{
1389   { REGION_GFX1, 0, &pspikes_charlayout,      0, 64 },   /* colors    0-1023 in 8 banks */
1390   { REGION_GFX2, 0, &wbbc97_spritelayout, 1024, 64 },   /* colors 1024-2047 in 4 banks */
1391   { -1 }
1392};
1373static GFXDECODE_START( wbbc97 )
1374   GFXDECODE_ENTRY( REGION_GFX1, 0, pspikes_charlayout,      0, 64 )   /* colors    0-1023 in 8 banks */
1375   GFXDECODE_ENTRY( REGION_GFX2, 0, wbbc97_spritelayout, 1024, 64 )   /* colors 1024-2047 in 4 banks */
1376GFXDECODE_END
13931377
13941378static void irqhandler(int irq)
13951379{
r1051r1052
14311415   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14321416   MDRV_SCREEN_SIZE(64*8, 32*8)
14331417   MDRV_SCREEN_VISIBLE_AREA(0*8+4, 44*8+4-1, 0*8, 30*8-1)
1434   MDRV_GFXDECODE(pspikes_gfxdecodeinfo)
1418   MDRV_GFXDECODE(pspikes)
14351419   MDRV_PALETTE_LENGTH(2048)
14361420
14371421   MDRV_VIDEO_START(pspikes)
r1051r1052
14651449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14661450   MDRV_SCREEN_SIZE(64*8, 32*8)
14671451   MDRV_SCREEN_VISIBLE_AREA(0*8+4, 44*8+4-1, 0*8, 30*8-1)
1468   MDRV_GFXDECODE(pallavol_gfxdecodeinfo)
1452   MDRV_GFXDECODE(pallavol)
14691453   MDRV_PALETTE_LENGTH(2048)
14701454
14711455   MDRV_VIDEO_START(pspikes)
r1051r1052
14951479   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14961480   MDRV_SCREEN_SIZE(64*8, 32*8)
14971481   MDRV_SCREEN_VISIBLE_AREA(0*8+4, 44*8+4-1, 0*8, 30*8-1)
1498   MDRV_GFXDECODE(pspikesb_gfxdecodeinfo)
1482   MDRV_GFXDECODE(pspikesb)
14991483   MDRV_PALETTE_LENGTH(2048)
15001484
15011485   MDRV_VIDEO_START(pspikes)
r1051r1052
15241508   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15251509   MDRV_SCREEN_SIZE(64*8, 32*8)
15261510   MDRV_SCREEN_VISIBLE_AREA(0*8+4, 44*8+4-1, 0*8, 30*8-1)
1527   MDRV_GFXDECODE(pspikes_gfxdecodeinfo)
1511   MDRV_GFXDECODE(pspikes)
15281512   MDRV_PALETTE_LENGTH(2048)
15291513
15301514   MDRV_VIDEO_START(pspikes)
r1051r1052
15601544   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15611545   MDRV_SCREEN_SIZE(64*8, 32*8)
15621546   MDRV_SCREEN_VISIBLE_AREA(1*8, 45*8-1, 0*8, 30*8-1)
1563   MDRV_GFXDECODE(turbofrc_gfxdecodeinfo)
1547   MDRV_GFXDECODE(turbofrc)
15641548   MDRV_PALETTE_LENGTH(1024)
15651549
15661550   MDRV_VIDEO_START(karatblz)
r1051r1052
15991583   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16001584   MDRV_SCREEN_SIZE(64*8, 32*8)
16011585   MDRV_SCREEN_VISIBLE_AREA(1*8, 45*8-1, 0*8, 30*8-1)
1602   MDRV_GFXDECODE(turbofrc_gfxdecodeinfo)
1586   MDRV_GFXDECODE(turbofrc)
16031587   MDRV_PALETTE_LENGTH(1024)
16041588
16051589   MDRV_VIDEO_START(spinlbrk)
r1051r1052
16381622   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16391623   MDRV_SCREEN_SIZE(64*8, 32*8)
16401624   MDRV_SCREEN_VISIBLE_AREA(0*8, 44*8-1, 0*8, 30*8-1)
1641   MDRV_GFXDECODE(turbofrc_gfxdecodeinfo)
1625   MDRV_GFXDECODE(turbofrc)
16421626   MDRV_PALETTE_LENGTH(1024)
16431627
16441628   MDRV_VIDEO_START(turbofrc)
r1051r1052
16781662   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16791663   MDRV_SCREEN_SIZE(64*8, 32*8)
16801664   MDRV_SCREEN_VISIBLE_AREA(0*8+12, 40*8-1+12, 0*8, 28*8-1)
1681   MDRV_GFXDECODE(aerofgtb_gfxdecodeinfo)
1665   MDRV_GFXDECODE(aerofgtb)
16821666   MDRV_PALETTE_LENGTH(1024)
16831667
16841668   MDRV_VIDEO_START(turbofrc)
r1051r1052
17181702   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17191703   MDRV_SCREEN_SIZE(64*8, 32*8)
17201704   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1721   MDRV_GFXDECODE(aerofgt_gfxdecodeinfo)
1705   MDRV_GFXDECODE(aerofgt)
17221706   MDRV_PALETTE_LENGTH(1024)
17231707
17241708   MDRV_VIDEO_START(turbofrc)
r1051r1052
17541738   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17551739   MDRV_SCREEN_SIZE(64*8, 32*8)
17561740   MDRV_SCREEN_VISIBLE_AREA(0*8+12, 40*8-1+12, 0*8, 28*8-1)
1757   MDRV_GFXDECODE(aerfboot_gfxdecodeinfo)
1741   MDRV_GFXDECODE(aerfboot)
17581742   MDRV_PALETTE_LENGTH(1024)
17591743
17601744   MDRV_VIDEO_START(turbofrc)
r1051r1052
17871771   MDRV_SCREEN_SIZE(64*8, 64*8)
17881772   MDRV_SCREEN_VISIBLE_AREA(0*8+14, 44*8-1+4, 0*8, 30*8-1)
17891773
1790   MDRV_GFXDECODE(wbbc97_gfxdecodeinfo)
1774   MDRV_GFXDECODE(wbbc97)
17911775   MDRV_PALETTE_LENGTH(2048)
17921776
17931777   MDRV_VIDEO_START(wbbc97)
src/mame/drivers/rocnrope.c
r1051r1052
211211   64*8   /* every sprite takes 64 consecutive bytes */
212212};
213213
214static const gfx_decode gfxdecodeinfo[] =
215{
216   { REGION_GFX1, 0, &charlayout,       0, 16 },
217   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
218   { -1 }
219};
214static GFXDECODE_START( rocnrope )
215   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
216   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
217GFXDECODE_END
220218
221219
222220
r1051r1052
239237   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
240238   MDRV_SCREEN_SIZE(32*8, 32*8)
241239   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
242   MDRV_GFXDECODE(gfxdecodeinfo)
240   MDRV_GFXDECODE(rocnrope)
243241   MDRV_PALETTE_LENGTH(32)
244242   MDRV_COLORTABLE_LENGTH(16*16+16*16)
245243
src/mame/drivers/fgoal.c
r1051r1052
377377};
378378
379379
380static const gfx_decode gfxdecodeinfo[] =
381{
382   { REGION_GFX1, 0, &gfxlayout, 0x00, 8 }, /* foreground */
383   { REGION_GFX1, 0, &gfxlayout, 0x80, 1 }, /* background */
384   { -1 }
385};
380static GFXDECODE_START( fgoal )
381   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout, 0x00, 8 ) /* foreground */
382   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout, 0x80, 1 ) /* background */
383GFXDECODE_END
386384
387385
388386static MACHINE_DRIVER_START( fgoal )
r1051r1052
399397   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
400398   MDRV_SCREEN_SIZE(256, 263)
401399   MDRV_SCREEN_VISIBLE_AREA(0, 255, 16, 255)
402   MDRV_GFXDECODE(gfxdecodeinfo)
400   MDRV_GFXDECODE(fgoal)
403401   MDRV_PALETTE_LENGTH(64 + 2)
404402   MDRV_COLORTABLE_LENGTH(128 + 16)
405403
src/mame/drivers/coinmstr.c
r1051r1052
516516   8*8
517517};
518518
519static const gfx_decode gfxdecodeinfo[] =
520{
521   { REGION_GFX1, 0, &charlayout, 0, 32 },
522   { -1 }
523};
519static GFXDECODE_START( coinmstr )
520   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 )
521GFXDECODE_END
524522
525523static TILE_GET_INFO( get_bg_tile_info )
526524{
r1051r1052
619617   pia_reset();
620618}
621619
622struct AY8910interface ay8912_interface =
620static struct AY8910interface ay8912_interface =
623621{
624622   input_port_4_r
625623};
r1051r1052
637635   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
638636   MDRV_SCREEN_SIZE(64*8, 64*8)
639637   MDRV_SCREEN_VISIBLE_AREA(0*8, 46*8-1, 0*8, 32*8-1)
640   MDRV_GFXDECODE(gfxdecodeinfo)
638   MDRV_GFXDECODE(coinmstr)
641639   MDRV_PALETTE_LENGTH(256)
642640
643641   MDRV_VIDEO_START(coinmstr)
src/mame/drivers/docastle.c
r1051r1052
609609
610610/* Graphics Decode Information */
611611
612static const gfx_decode gfxdecodeinfo[] =
613{
614   { REGION_GFX1, 0, &charlayout,       0, 64 },
615   { REGION_GFX2, 0, &spritelayout,     0, 32*2 },
616   { -1 }
617};
612static GFXDECODE_START( docastle )
613   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 64 )
614   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,     0, 32*2 )
615GFXDECODE_END
618616
619617/* Sound Interfaces */
620618
r1051r1052
650648   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
651649   MDRV_SCREEN_SIZE(32*8, 32*8)
652650   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
653   MDRV_GFXDECODE(gfxdecodeinfo)
651   MDRV_GFXDECODE(docastle)
654652   MDRV_PALETTE_LENGTH(512)
655653
656654   MDRV_PALETTE_INIT(docastle)
src/mame/drivers/omegaf.c
r1051r1052
602602   16*64*4
603603};
604604
605static const gfx_decode omegaf_gfxdecodeinfo[] =
606{
607   { REGION_GFX1, 0, &omegaf_bglayout,         0*16, 16},
608   { REGION_GFX2, 0, &omegaf_bglayout,         0*16, 16},
609   { REGION_GFX3, 0, &omegaf_bglayout,         0*16, 16},
610   { REGION_GFX4, 0, &omegaf_spritelayout,    32*16, 16},
611   { REGION_GFX4, 0, &omegaf_bigspritelayout, 32*16, 16},
612   { REGION_GFX5, 0, &omegaf_charlayout,      48*16, 16},
613   { -1}
614};
605static GFXDECODE_START( omegaf )
606   GFXDECODE_ENTRY( REGION_GFX1, 0, omegaf_bglayout,         0*16, 16)
607   GFXDECODE_ENTRY( REGION_GFX2, 0, omegaf_bglayout,         0*16, 16)
608   GFXDECODE_ENTRY( REGION_GFX3, 0, omegaf_bglayout,         0*16, 16)
609   GFXDECODE_ENTRY( REGION_GFX4, 0, omegaf_spritelayout,    32*16, 16)
610   GFXDECODE_ENTRY( REGION_GFX4, 0, omegaf_bigspritelayout, 32*16, 16)
611   GFXDECODE_ENTRY( REGION_GFX5, 0, omegaf_charlayout,      48*16, 16)
612GFXDECODE_END
615613
616static const gfx_decode robokid_gfxdecodeinfo[] =
617{
618   { REGION_GFX1, 0, &omegaf_bglayout,          0*16, 16},
619   { REGION_GFX2, 0, &omegaf_bglayout,          0*16, 16},
620   { REGION_GFX3, 0, &omegaf_bglayout,          0*16, 16},
621   { REGION_GFX4, 0, &robokid_spritelayout,    32*16, 16},
622   { REGION_GFX4, 0, &robokid_bigspritelayout, 32*16, 16},
623   { REGION_GFX5, 0, &omegaf_charlayout,       48*16, 16},
624   { -1}
625};
614static GFXDECODE_START( robokid )
615   GFXDECODE_ENTRY( REGION_GFX1, 0, omegaf_bglayout,          0*16, 16)
616   GFXDECODE_ENTRY( REGION_GFX2, 0, omegaf_bglayout,          0*16, 16)
617   GFXDECODE_ENTRY( REGION_GFX3, 0, omegaf_bglayout,          0*16, 16)
618   GFXDECODE_ENTRY( REGION_GFX4, 0, robokid_spritelayout,    32*16, 16)
619   GFXDECODE_ENTRY( REGION_GFX4, 0, robokid_bigspritelayout, 32*16, 16)
620   GFXDECODE_ENTRY( REGION_GFX5, 0, omegaf_charlayout,       48*16, 16)
621GFXDECODE_END
626622
627623
628624/**************************************************************************
r1051r1052
651647   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
652648   MDRV_SCREEN_SIZE(128*16, 32*16)
653649   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
654   MDRV_GFXDECODE(omegaf_gfxdecodeinfo)
650   MDRV_GFXDECODE(omegaf)
655651   MDRV_PALETTE_LENGTH(1024)
656652
657653   MDRV_VIDEO_START(omegaf)
r1051r1052
674670   MDRV_CPU_MODIFY("main")
675671   MDRV_CPU_PROGRAM_MAP(robokid_readmem,robokid_writemem)
676672
677   MDRV_GFXDECODE(robokid_gfxdecodeinfo)
673   MDRV_GFXDECODE(robokid)
678674   MDRV_VIDEO_START(robokid)
679675   MDRV_VIDEO_UPDATE(robokid)
680676MACHINE_DRIVER_END
src/mame/drivers/expro02.c
r1051r1052
5757    6264 - 8k x8 SRAM
5858    62256 - 32k x8 SRAM
5959
60**************************************************************************************************
61
62Gals Panic (Japan)
63(C)1990 Kaneko
64
65EXPRO-02 PCB
66M6100575A GALS PANIC (PCB manufactured by Taito)
67
68CPU: MC68000
69Sound: M6295
70OSC: 12.0000MHz, 16.0000MHz
71Custom: VU-002, VIEW2, CACL1
72
73ROMs:
74PM109J.U88 (OKI M271000ZB) - Main programs
75PM110J.U87 (OKI M271000ZB)
76PM004E.U86
77PM005E.U85
78PM-002E.U76
79PM-003E.U75
80PM-000E.U74
81PM-001E.U73
82
83PM006E.U83 - Sprites
84PM206E.U82
85PM018E.U94
86
87PM-013E.U89 (40pin mask)
88PM-014E.U90
89PM-015E.U91
90PM-016E.U92
91
92GP-U41.U41 (40pin mask?)
93GP-U27.U27
94
95
96PAL/GALs:
97U10 (18CV8)
98U11 (18CV8)
99U12 (18CV8)
100U15 (22CV10)
101GP-U28 (16V8)
102U29 (18CV8)
103U32 (18CV8)
104U33 (18CV8)
105U34 (18CV8)
106U35 (18CV8)
107U36 (22CV10)
108U37 (22CV10)
109U38 (18CV8)
110U42 (18CV8)
111GP-U44 (16V8)
112U45 (18CV8)
113U48 (18CV8)
114GP-U57 (16V8)
115GP-U58 (16V8)
116GP-U60 (16V8)
117U77 (22CV10)
118U78 (22CV10)
60119*/
61120
62121#include "driver.h"
r1051r1052
247306};
248307
249308
250static const gfx_decode kaneko16_gfx_1x4bit_1x4bit[] =
251{
252   { REGION_GFX1, 0, &layout_16x16x4, 0x100,       0x40 }, // [0] Sprites
253   { REGION_GFX2, 0, &layout_16x16x4, 0,         0x40 }, // [0] bg tiles
254   { -1 }
255};
309static GFXDECODE_START( 1x4bit_1x4bit )
310   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0x100,       0x40 ) // [0] Sprites
311   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0,         0x40 ) // [0] bg tiles
312GFXDECODE_END
256313
257314static MACHINE_DRIVER_START( galsnew )
258315
r1051r1052
271328   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
272329   MDRV_SCREEN_SIZE(256, 256)
273330   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-32-1)
274   MDRV_GFXDECODE(kaneko16_gfx_1x4bit_1x4bit)
331   MDRV_GFXDECODE(1x4bit_1x4bit)
275332   MDRV_PALETTE_LENGTH(2048 + 32768)
276333   MDRV_MACHINE_RESET( galsnew )
277334
r1051r1052
312369
313370ROM_START( galsnew ) /* EXPRO-02 PCB */
314371   ROM_REGION( 0x40000, REGION_CPU1, 0 )   /* 68000 code */
315   ROM_LOAD16_BYTE( "pm110u_u87-01.u87",  0x000000, 0x20000, CRC(b793a57d) SHA1(12d57b2b4add532f0d0453c25b30d34b3449d717) )
316   ROM_LOAD16_BYTE( "pm109u_u88-01.u88",  0x000001, 0x20000, CRC(35b936f8) SHA1(d272067f10542d511a777802cafa4d72b93fa5e8) )
372   ROM_LOAD16_BYTE( "pm110u_u87-01.u87", 0x000000, 0x20000, CRC(b793a57d) SHA1(12d57b2b4add532f0d0453c25b30d34b3449d717) ) /* US region */
373   ROM_LOAD16_BYTE( "pm109u_u88-01.u88", 0x000001, 0x20000, CRC(35b936f8) SHA1(d272067f10542d511a777802cafa4d72b93fa5e8) )
317374
318375   ROM_REGION16_BE( 0x300000, REGION_USER1, 0 )   /* 68000 data */
319   ROM_LOAD16_BYTE( "pm004e.u86",    0x000001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) )
320   ROM_LOAD16_BYTE( "pm005e.u85",    0x000000, 0x80000, CRC(d7ec650c) SHA1(6c2250c74381497154bf516e0cf1db6bb56bb446) )
321   ROM_LOAD16_BYTE( "pm000e.u74",    0x100001, 0x80000, CRC(5d220f3f) SHA1(7ff373e01027c8832712f7a2d732f8e49b875878) )
322   ROM_LOAD16_BYTE( "pm001e.u73",    0x100000, 0x80000, CRC(90433eb1) SHA1(8688a85747ad9ecac395d782f130baa64fb9d12b) )
323   ROM_LOAD16_BYTE( "pm002e.u76",    0x200001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) )
324   ROM_LOAD16_BYTE( "pm003e.u75",    0x200000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) )
376   ROM_LOAD16_BYTE( "pm004e.u86", 0x000001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) )
377   ROM_LOAD16_BYTE( "pm005e.u85", 0x000000, 0x80000, CRC(d7ec650c) SHA1(6c2250c74381497154bf516e0cf1db6bb56bb446) )
378   ROM_LOAD16_BYTE( "pm000e.u74", 0x100001, 0x80000, CRC(5d220f3f) SHA1(7ff373e01027c8832712f7a2d732f8e49b875878) )
379   ROM_LOAD16_BYTE( "pm001e.u73", 0x100000, 0x80000, CRC(90433eb1) SHA1(8688a85747ad9ecac395d782f130baa64fb9d12b) )
380   ROM_LOAD16_BYTE( "pm002e.u76", 0x200001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) )
381   ROM_LOAD16_BYTE( "pm003e.u75", 0x200000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) )
325382
326383   ROM_REGION16_BE( 0x80000, REGION_USER2, 0 )   /* contains real (non-cartoon) women, used after each 3rd round */
327   ROM_LOAD16_WORD_SWAP( "pm017e.u84",    0x00000, 0x80000, CRC(bc41b6ca) SHA1(0aeaf024dd7c84550e7df27230a1d4f04cc1d61c) )
384   ROM_LOAD16_WORD_SWAP( "pm017e.u84", 0x00000, 0x80000, CRC(bc41b6ca) SHA1(0aeaf024dd7c84550e7df27230a1d4f04cc1d61c) )
328385
329386   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_ERASEFF )   /* sprites */
330387   /* the 06e rom from the other type gals panic board ends up split across 2 roms here */
331   ROM_LOAD( "pm006e.u83",         0x000000, 0x080000, CRC(a7555d9a) SHA1(f95821b3358d9ab03ca9ead38fd358062259d89d) )
332   ROM_LOAD( "pm206e.u82",         0x080000, 0x080000, CRC(cc978baa) SHA1(59a95bcbaeca9d356f61ea42af4da116afbb1491) )
333   ROM_LOAD( "pm018e.u94",         0x100000, 0x080000, CRC(f542d708) SHA1(f515cca9e96401303ed45b4372f6079f29b7a999) )
334   ROM_LOAD( "pm019u_u93-01.u93",  0x180000, 0x010000, CRC(3cb79005) SHA1(05a0b993b9071467265067c3762644f46343d8de) ) // ?? seems to be an extra / replacement enemy?, not sure where it maps, or when it's used, it might load over another rom
388   ROM_LOAD( "pm006e.u83",        0x000000, 0x080000, CRC(a7555d9a) SHA1(f95821b3358d9ab03ca9ead38fd358062259d89d) )
389   ROM_LOAD( "pm206e.u82",        0x080000, 0x080000, CRC(cc978baa) SHA1(59a95bcbaeca9d356f61ea42af4da116afbb1491) )
390   ROM_LOAD( "pm018e.u94",        0x100000, 0x080000, CRC(f542d708) SHA1(f515cca9e96401303ed45b4372f6079f29b7a999) )
391   ROM_LOAD( "pm019u_u93-01.u93", 0x180000, 0x010000, CRC(3cb79005) SHA1(05a0b993b9071467265067c3762644f46343d8de) ) // ?? seems to be an extra / replacement enemy?, not sure where it maps, or when it's used, it might load over another rom
335392
336393   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* sprites */
337394
338395   ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )   /* sprites - encrypted? */
339   ROM_LOAD( "pm013e.u89",    0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
340   ROM_LOAD( "pm014e.u90",    0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
341   ROM_LOAD( "pm015e.u91",    0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
342   ROM_LOAD( "pm016e.u92",    0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
396   ROM_LOAD( "pm013e.u89", 0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
397   ROM_LOAD( "pm014e.u90", 0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
398   ROM_LOAD( "pm015e.u91", 0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
399   ROM_LOAD( "pm016e.u92", 0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
343400
344401
345402   ROM_REGION( 0x140000, REGION_SOUND1, 0 )   /* OKIM6295 samples */
346403   /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */
347   ROM_LOAD( "pm008e.u46",     0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) )
348   ROM_RELOAD(                 0x40000, 0x80000 )
349   ROM_LOAD( "pm007e.u47",     0xc0000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) )
404   ROM_LOAD( "pm008e.u46", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) )
405   ROM_RELOAD(             0x40000, 0x80000 )
406   ROM_LOAD( "pm007e.u47", 0xc0000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) )
350407ROM_END
351408
352409ROM_START( galsnewa ) /* EXPRO-02 PCB */
353410   ROM_REGION( 0x40000, REGION_CPU1, 0 )
354411   /* 68000 code */
355   ROM_LOAD16_BYTE( "pm110e.u87-01",  0x000000, 0x20000, CRC(34e1ee0d) SHA1(567df65b04667a6d35725c4a131fb174acb3ad0a) )
412   ROM_LOAD16_BYTE( "pm110e.u87-01",  0x000000, 0x20000, CRC(34e1ee0d) SHA1(567df65b04667a6d35725c4a131fb174acb3ad0a) ) /* Export region */
356413   ROM_LOAD16_BYTE( "pm109e.u88-01",  0x000001, 0x20000, CRC(c694255a) SHA1(16faf5ea5ff69a0e7a981021ea5fc09a0aefd7cf) )
357414
358415   ROM_REGION16_BE( 0x300000, REGION_USER1, 0 )   /* 68000 data */
359   ROM_LOAD16_BYTE( "pm004e.u86",    0x000001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) )
360   ROM_LOAD16_BYTE( "pm005e.u85",    0x000000, 0x80000, CRC(d7ec650c) SHA1(6c2250c74381497154bf516e0cf1db6bb56bb446) )
361   ROM_LOAD16_BYTE( "pm000e.u74",    0x100001, 0x80000, CRC(5d220f3f) SHA1(7ff373e01027c8832712f7a2d732f8e49b875878) )
362   ROM_LOAD16_BYTE( "pm001e.u73",    0x100000, 0x80000, CRC(90433eb1) SHA1(8688a85747ad9ecac395d782f130baa64fb9d12b) )
363   ROM_LOAD16_BYTE( "pm002e.u76",    0x200001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) )
364   ROM_LOAD16_BYTE( "pm003e.u75",    0x200000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) )
416   ROM_LOAD16_BYTE( "pm004e.u86", 0x000001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) )
417   ROM_LOAD16_BYTE( "pm005e.u85", 0x000000, 0x80000, CRC(d7ec650c) SHA1(6c2250c74381497154bf516e0cf1db6bb56bb446) )
418   ROM_LOAD16_BYTE( "pm000e.u74", 0x100001, 0x80000, CRC(5d220f3f) SHA1(7ff373e01027c8832712f7a2d732f8e49b875878) )
419   ROM_LOAD16_BYTE( "pm001e.u73", 0x100000, 0x80000, CRC(90433eb1) SHA1(8688a85747ad9ecac395d782f130baa64fb9d12b) )
420   ROM_LOAD16_BYTE( "pm002e.u76", 0x200001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) )
421   ROM_LOAD16_BYTE( "pm003e.u75", 0x200000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) )
365422
366423   ROM_REGION16_BE( 0x80000, REGION_USER2, 0 )   /* contains real (non-cartoon) women, used after each 3rd round */
367   ROM_LOAD16_WORD_SWAP( "pm017e.u84",    0x00000, 0x80000, CRC(bc41b6ca) SHA1(0aeaf024dd7c84550e7df27230a1d4f04cc1d61c) )
424   ROM_LOAD16_WORD_SWAP( "pm017e.u84", 0x00000, 0x80000, CRC(bc41b6ca) SHA1(0aeaf024dd7c84550e7df27230a1d4f04cc1d61c) )
368425
426   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_ERASEFF )   /* sprites */
427   /* the 06e rom from the other type gals panic board ends up split across 2 roms here */
428   ROM_LOAD( "pm006e.u83", 0x000000, 0x080000, CRC(a7555d9a) SHA1(f95821b3358d9ab03ca9ead38fd358062259d89d) )
429   ROM_LOAD( "pm206e.u82", 0x080000, 0x080000, CRC(cc978baa) SHA1(59a95bcbaeca9d356f61ea42af4da116afbb1491) )
430   ROM_LOAD( "pm018e.u94", 0x100000, 0x080000, CRC(f542d708) SHA1(f515cca9e96401303ed45b4372f6079f29b7a999) )
431//  ROM_LOAD( "u93",        0x180000, 0x010000  ) // NOT present on this set (empty socket)
369432
433   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* sprites */
434
435   ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )   /* tiles - encrypted? */
436   ROM_LOAD( "pm013e.u89", 0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
437   ROM_LOAD( "pm014e.u90", 0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
438   ROM_LOAD( "pm015e.u91", 0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
439   ROM_LOAD( "pm016e.u92", 0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
440
441   ROM_REGION( 0x140000, REGION_SOUND1, 0 )   /* OKIM6295 samples */
442   /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */
443   ROM_LOAD( "pm008e.u46", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) )
444   ROM_RELOAD(             0x40000, 0x80000 )
445   ROM_LOAD( "pm007e.u47", 0xc0000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) )
446ROM_END
447
448ROM_START( galsnewj ) /* EXPRO-02 PCB */
449   ROM_REGION( 0x40000, REGION_CPU1, 0 )
450   /* 68000 code */
451   ROM_LOAD16_BYTE( "pm110j.u87", 0x000000, 0x20000, CRC(220b6df5) SHA1(d653b67bc66ca341bc660c2bb39b05dcf186fcb7) ) /* Japan region */
452   ROM_LOAD16_BYTE( "pm109j.u88", 0x000001, 0x20000, CRC(17721444) SHA1(9d97fe1ddac99105798fc22375a0b89ab316459a) )
453
454   ROM_REGION16_BE( 0x300000, REGION_USER1, 0 )   /* 68000 data */
455   ROM_LOAD16_BYTE( "pm004e.u86", 0x000001, 0x80000, CRC(d3af52bc) SHA1(46be057106388578defecab1cdd1793ec76ebe92) )
456   ROM_LOAD16_BYTE( "pm005e.u85", 0x000000, 0x80000, CRC(d7ec650c) SHA1(6c2250c74381497154bf516e0cf1db6bb56bb446) )
457   ROM_LOAD16_BYTE( "pm000e.u74", 0x100001, 0x80000, CRC(5d220f3f) SHA1(7ff373e01027c8832712f7a2d732f8e49b875878) )
458   ROM_LOAD16_BYTE( "pm001e.u73", 0x100000, 0x80000, CRC(90433eb1) SHA1(8688a85747ad9ecac395d782f130baa64fb9d12b) )
459   ROM_LOAD16_BYTE( "pm002e.u76", 0x200001, 0x80000, CRC(713ee898) SHA1(c9f608a57fb90e5ee15eb76a74a7afcc406d5b4e) )
460   ROM_LOAD16_BYTE( "pm003e.u75", 0x200000, 0x80000, CRC(6bb060fd) SHA1(4fc3946866c5a55e8340b62b5ad9beae723ce0da) )
461
462   ROM_REGION16_BE( 0x80000, REGION_USER2, 0 )   /* contains real (non-cartoon) women, used after each 3rd round */
463   ROM_LOAD16_WORD_SWAP( "pm017e.u84", 0x00000, 0x80000, CRC(bc41b6ca) SHA1(0aeaf024dd7c84550e7df27230a1d4f04cc1d61c) )
464
370465   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_ERASEFF )   /* sprites */
371466   /* the 06e rom from the other type gals panic board ends up split across 2 roms here */
372   ROM_LOAD( "pm006e.u83",       0x000000, 0x080000, CRC(a7555d9a) SHA1(f95821b3358d9ab03ca9ead38fd358062259d89d) )
373   ROM_LOAD( "pm206e.u82",       0x080000, 0x080000, CRC(cc978baa) SHA1(59a95bcbaeca9d356f61ea42af4da116afbb1491) )
374   ROM_LOAD( "pm018e.u94",       0x100000, 0x080000, CRC(f542d708) SHA1(f515cca9e96401303ed45b4372f6079f29b7a999) )
375//  ROM_LOAD( "u93",    0x180000, 0x010000  ) // NOT present on this set (empty socket)
467   ROM_LOAD( "pm006e.u83", 0x000000, 0x080000, CRC(a7555d9a) SHA1(f95821b3358d9ab03ca9ead38fd358062259d89d) )
468   ROM_LOAD( "pm206e.u82", 0x080000, 0x080000, CRC(cc978baa) SHA1(59a95bcbaeca9d356f61ea42af4da116afbb1491) )
469   ROM_LOAD( "pm018e.u94", 0x100000, 0x080000, CRC(f542d708) SHA1(f515cca9e96401303ed45b4372f6079f29b7a999) )
470//  ROM_LOAD( "u93",        0x180000, 0x010000  ) // NOT present on this set (empty socket)
376471
377472   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )   /* sprites */
378473
379474   ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )   /* tiles - encrypted? */
380   ROM_LOAD( "pm013e.u89",    0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
381   ROM_LOAD( "pm014e.u90",    0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
382   ROM_LOAD( "pm015e.u91",    0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
383   ROM_LOAD( "pm016e.u92",    0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
475   ROM_LOAD( "pm013e.u89", 0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
476   ROM_LOAD( "pm014e.u90", 0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
477   ROM_LOAD( "pm015e.u91", 0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
478   ROM_LOAD( "pm016e.u92", 0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
384479
385
386480   ROM_REGION( 0x140000, REGION_SOUND1, 0 )   /* OKIM6295 samples */
387481   /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */
388   ROM_LOAD( "pm008e.u46",     0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) )
389   ROM_RELOAD(                 0x40000, 0x80000 )
390   ROM_LOAD( "pm007e.u47",     0xc0000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) )
482   ROM_LOAD( "pm008j.u46", 0x00000, 0x80000, CRC(f394670e) SHA1(171f8dc519a13f352e6440aaadebe490c82361f0) )
483   ROM_RELOAD(             0x40000, 0x80000 )
484   ROM_LOAD( "pm007j.u47", 0xc0000, 0x80000, CRC(06780287) SHA1(8b9b57f6604b86d6dff42e5e51cd59a7111e1e79) )
391485ROM_END
392486
393487
394GAME( 1990, galsnew, 0,        galsnew, galsnew, galsnew, ROT90, "Kaneko", "Gals Panic (US, EXPRO-02 PCB)", GAME_NOT_WORKING )
395GAME( 1990, galsnewa,galsnew,  galsnew, galsnew, galsnew, ROT90, "Kaneko", "Gals Panic (Export, EXPRO-02 PCB)", GAME_NOT_WORKING )
488GAME( 1990, galsnew,  0,       galsnew, galsnew, galsnew, ROT90, "Kaneko", "Gals Panic (US, EXPRO-02 PCB)", GAME_NOT_WORKING )
489GAME( 1990, galsnewa, galsnew, galsnew, galsnew, galsnew, ROT90, "Kaneko", "Gals Panic (Export, EXPRO-02 PCB)", GAME_NOT_WORKING )
490GAME( 1990, galsnewj, galsnew, galsnew, galsnew, galsnew, ROT90, "Kaneko (Taito license)", "Gals Panic (Japan, EXPRO-02 PCB)", GAME_NOT_WORKING )
src/mame/drivers/mainsnk.c
r1051r1052
365365};
366366
367367
368static const gfx_decode gfxdecodeinfo[] =
369{
370   { REGION_GFX1, 0x0, &tile_layout,   0,  8 },
371   { REGION_GFX2, 0x0, &sprite_layout,   0, 16 },
372   { -1 }
373};
368static GFXDECODE_START( mainsnk )
369   GFXDECODE_ENTRY( REGION_GFX1, 0x0, tile_layout,   0,  8 )
370   GFXDECODE_ENTRY( REGION_GFX2, 0x0, sprite_layout,   0, 16 )
371GFXDECODE_END
374372
375373static MACHINE_DRIVER_START( mainsnk )
376374   MDRV_CPU_ADD(Z80, 3360000)
r1051r1052
385383
386384   MDRV_SCREEN_REFRESH_RATE(60.606060)
387385   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
388   MDRV_GFXDECODE(gfxdecodeinfo)
386   MDRV_GFXDECODE(mainsnk)
389387   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
390388   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
391389   MDRV_SCREEN_SIZE(34*8, 32*8)
src/mame/drivers/mystston.c
r1051r1052
201201   32*8
202202};
203203
204static const gfx_decode gfxdecodeinfo[] =
205{
206   { REGION_GFX1, 0, &charlayout,   3*8, 4 },
207   { REGION_GFX2, 0, &spritelayout, 2*8, 1 },
208   { REGION_GFX1, 0, &spritelayout, 0*8, 2 },
209   { -1 }
210};
204static GFXDECODE_START( mystston )
205   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   3*8, 4 )
206   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 2*8, 1 )
207   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0*8, 2 )
208GFXDECODE_END
211209
212210
213211static INTERRUPT_GEN( mystston_interrupt )
r1051r1052
257255   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
258256   MDRV_SCREEN_SIZE(32*8, 32*8)
259257   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
260   MDRV_GFXDECODE(gfxdecodeinfo)
258   MDRV_GFXDECODE(mystston)
261259   MDRV_PALETTE_LENGTH(24+32)
262260
263261   MDRV_PALETTE_INIT(mystston)
src/mame/drivers/hitme.c
r1051r1052
266266   8*8
267267};
268268
269static const gfx_decode hitme_gfxdecodeinfo[] =
270{
271   { REGION_GFX1, 0, &hitme_charlayout, 0, 2  },
272   { -1 }
273};
269static GFXDECODE_START( hitme )
270   GFXDECODE_ENTRY( REGION_GFX1, 0, hitme_charlayout, 0, 2  )
271GFXDECODE_END
274272
275273
276274static const gfx_layout barricad_charlayout =
r1051r1052
284282   8*8
285283};
286284
287static const gfx_decode barricad_gfxdecodeinfo[] =
288{
289   { REGION_GFX1, 0, &barricad_charlayout,   0, 1  },
290   { -1 }
291};
285static GFXDECODE_START( barricad )
286   GFXDECODE_ENTRY( REGION_GFX1, 0, barricad_charlayout,   0, 1  )
287GFXDECODE_END
292288
293289
294290
r1051r1052
314310   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
315311   MDRV_SCREEN_SIZE(40*8, 19*10)
316312   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 19*10-1)
317   MDRV_GFXDECODE(hitme_gfxdecodeinfo)
313   MDRV_GFXDECODE(hitme)
318314   MDRV_PALETTE_LENGTH(2)
319315
320316   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
324320   /* sound hardware */
325321   MDRV_SPEAKER_STANDARD_MONO("mono")
326322   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
327   MDRV_SOUND_CONFIG(hitme_discrete_interface)
323   MDRV_SOUND_CONFIG_DISCRETE(hitme)
328324   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
329325MACHINE_DRIVER_END
330326
r1051r1052
343339   /* video hardware */
344340   MDRV_SCREEN_SIZE(32*8, 24*8)
345341   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 24*8-1)
346   MDRV_GFXDECODE(barricad_gfxdecodeinfo)
342   MDRV_GFXDECODE(barricad)
347343
348344   MDRV_VIDEO_START(barricad)
349345   MDRV_VIDEO_UPDATE(barricad)
src/mame/drivers/rampart.c
r1051r1052
364364};
365365
366366
367static const gfx_decode gfxdecodeinfo[] =
368{
369   { REGION_GFX1, 0, &molayout,  256, 16 },
370   { -1 }
371};
367static GFXDECODE_START( rampart )
368   GFXDECODE_ENTRY( REGION_GFX1, 0, molayout,  256, 16 )
369GFXDECODE_END
372370
373371
374372
r1051r1052
390388
391389   /* video hardware */
392390   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
393   MDRV_GFXDECODE(gfxdecodeinfo)
391   MDRV_GFXDECODE(rampart)
394392   MDRV_PALETTE_LENGTH(512)
395393
396394   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/senjyo.c
r1051r1052
628628   128*8   /* every sprite takes 128 consecutive bytes */
629629};
630630
631static const gfx_decode gfxdecodeinfo[] =
632{
633   { REGION_GFX1, 0, &charlayout,       0, 8 },   /*   0- 63 characters */
634   { REGION_GFX2, 0, &tilelayout_256,  64, 8 },   /*  64-127 background #1 */
635   { REGION_GFX3, 0, &tilelayout_256, 128, 8 },   /* 128-191 background #2 */
636   { REGION_GFX4, 0, &tilelayout_128, 192, 8 },   /* 192-255 background #3 */
637   { REGION_GFX5, 0, &spritelayout1,  320, 8 },   /* 320-383 normal sprites */
638   { REGION_GFX5, 0, &spritelayout2,  320, 8 },   /* 320-383 large sprites */
631static GFXDECODE_START( senjyo )
632   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 8 )   /*   0- 63 characters */
633   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_256,  64, 8 )   /*  64-127 background #1 */
634   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout_256, 128, 8 )   /* 128-191 background #2 */
635   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout_128, 192, 8 )   /* 192-255 background #3 */
636   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout1,  320, 8 )   /* 320-383 normal sprites */
637   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout2,  320, 8 )   /* 320-383 large sprites */
639638                                       /* 384-399 is background */
640   { -1 }
641};
639GFXDECODE_END
642640
643641
644642
r1051r1052
683681   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
684682   MDRV_SCREEN_SIZE(32*8, 32*8)
685683   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
686   MDRV_GFXDECODE(gfxdecodeinfo)
684   MDRV_GFXDECODE(senjyo)
687685   MDRV_PALETTE_LENGTH(512+2)   /* 512 real palette + 2 for the radar */
688686
689687   MDRV_VIDEO_START(senjyo)
src/mame/drivers/yiear.c
r1051r1052
241241   64*8
242242};
243243
244static const gfx_decode gfxdecodeinfo[] =
245{
246   { REGION_GFX1, 0, &charlayout,   16, 1 },
247   { REGION_GFX2, 0, &spritelayout,  0, 1 },
248   { -1 }
249};
244static GFXDECODE_START( yiear )
245   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   16, 1 )
246   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  0, 1 )
247GFXDECODE_END
250248
251249
252250
253struct VLM5030interface vlm5030_interface =
251static struct VLM5030interface vlm5030_interface =
254252{
255253   REGION_SOUND1,   /* memory region  */
256254   0           /* memory size of speech rom */
r1051r1052
274272   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
275273   MDRV_SCREEN_SIZE(32*8, 32*8)
276274   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
277   MDRV_GFXDECODE(gfxdecodeinfo)
275   MDRV_GFXDECODE(yiear)
278276   MDRV_PALETTE_LENGTH(32)
279277
280278   MDRV_PALETTE_INIT(yiear)
src/mame/drivers/murogem.c
r1051r1052
157157   8*8
158158};
159159
160static const gfx_decode gfxdecodeinfo[] =
161{
162   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
163   { -1 }
164};
160static GFXDECODE_START( murogem )
161   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
162GFXDECODE_END
165163
166164
167165PALETTE_INIT(murogem)
r1051r1052
211209   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
212210   MDRV_SCREEN_SIZE((39+1)*8, (38+1)*8)           // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1).
213211   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)    // Taken from MC6845 init, registers 01 & 06.
214   MDRV_GFXDECODE(gfxdecodeinfo)
212   MDRV_GFXDECODE(murogem)
215213   MDRV_PALETTE_LENGTH(0x100)
216214
217215   MDRV_PALETTE_INIT(murogem)
src/mame/drivers/snowbros.c
r1051r1052
14301430   32*32
14311431};
14321432
1433static const gfx_decode gfxdecodeinfo[] =
1434{
1435   { REGION_GFX1, 0, &tilelayout,  0, 16 },
1436   { -1 }
1437};
1433static GFXDECODE_START( snowbros )
1434   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,  0, 16 )
1435GFXDECODE_END
14381436
14391437/* Honey Doll */
14401438
r1051r1052
14491447   32*32
14501448};
14511449
1452static const gfx_decode honeydol_gfxdecodeinfo[] =
1453{
1454   { REGION_GFX1, 0, &tilelayout,  0, 64 }, // how does it use 0-15
1455   { REGION_GFX2, 0, &honeydol_tilelayout8bpp,  0, 4 },
1450static GFXDECODE_START( honeydol )
1451   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,  0, 64 ) // how does it use 0-15
1452   GFXDECODE_ENTRY( REGION_GFX2, 0, honeydol_tilelayout8bpp,  0, 4 )
14561453
1457   { -1 }
1458};
1454GFXDECODE_END
14591455
1460static const gfx_decode twinadv_gfxdecodeinfo[] =
1461{
1462   { REGION_GFX1, 0, &tilelayout,  0, 64 },
1463   { -1 }
1464};
1456static GFXDECODE_START( twinadv )
1457   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,  0, 64 )
1458GFXDECODE_END
14651459
14661460/* Winter Bobble */
14671461
r1051r1052
14761470   16*64
14771471};
14781472
1479static const gfx_decode gfxdecodeinfo_wb[] =
1480{
1481   { REGION_GFX1, 0, &tilelayout_wb,  0, 16 },
1482   { -1 }
1483};
1473static GFXDECODE_START( wb )
1474   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_wb,  0, 16 )
1475GFXDECODE_END
14841476
14851477/* SemiCom */
14861478
r1051r1052
15121504};
15131505
15141506
1515static const gfx_decode sb3_gfxdecodeinfo[] =
1516{
1517   { REGION_GFX1, 0, &tilelayout,  0, 16 },
1518   { REGION_GFX2, 0, &sb3_tilebglayout,  0, 2 },
1519   { -1 }
1520};
1507static GFXDECODE_START( sb3 )
1508   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,  0, 16 )
1509   GFXDECODE_ENTRY( REGION_GFX2, 0, sb3_tilebglayout,  0, 2 )
1510GFXDECODE_END
15211511
1522static const gfx_decode hyperpac_gfxdecodeinfo[] =
1523{
1524   { REGION_GFX1, 0, &hyperpac_tilelayout,  0, 16 },
1525   { -1 }
1526};
1512static GFXDECODE_START( hyperpac )
1513   GFXDECODE_ENTRY( REGION_GFX1, 0, hyperpac_tilelayout,  0, 16 )
1514GFXDECODE_END
15271515
15281516/* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */
15291517static void irqhandler(int irq)
r1051r1052
15841572   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15851573   MDRV_SCREEN_SIZE(32*8, 32*8)
15861574   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1587   MDRV_GFXDECODE(gfxdecodeinfo)
1575   MDRV_GFXDECODE(snowbros)
15881576   MDRV_PALETTE_LENGTH(256)
15891577
15901578   MDRV_VIDEO_START(snowbros)
r1051r1052
16071595   MDRV_CPU_PROGRAM_MAP(wintbob_readmem,wintbob_writemem)
16081596
16091597   /* video hardware */
1610   MDRV_GFXDECODE(gfxdecodeinfo_wb)
1598   MDRV_GFXDECODE(wb)
16111599   MDRV_VIDEO_UPDATE(wintbob)
16121600   MDRV_VIDEO_EOF(NULL)
16131601MACHINE_DRIVER_END
r1051r1052
16241612   /* audio CPU */
16251613   MDRV_CPU_PROGRAM_MAP(hyperpac_sound_readmem,hyperpac_sound_writemem)
16261614
1627   MDRV_GFXDECODE(hyperpac_gfxdecodeinfo)
1615   MDRV_GFXDECODE(hyperpac)
16281616
16291617   /* sound hardware */
16301618   MDRV_SOUND_REPLACE("3812", YM2151, 4000000)
r1051r1052
16821670   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16831671   MDRV_SCREEN_SIZE(32*8, 32*8)
16841672   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1685   MDRV_GFXDECODE(honeydol_gfxdecodeinfo)
1673   MDRV_GFXDECODE(honeydol)
16861674   MDRV_PALETTE_LENGTH(0x800/2)
16871675
16881676   MDRV_VIDEO_UPDATE(honeydol)
r1051r1052
17231711   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17241712   MDRV_SCREEN_SIZE(32*8, 32*8)
17251713   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1726   MDRV_GFXDECODE(twinadv_gfxdecodeinfo)
1714   MDRV_GFXDECODE(twinadv)
17271715   MDRV_PALETTE_LENGTH(0x100)
17281716
17291717   MDRV_VIDEO_UPDATE(twinadv)
r1051r1052
17801768static MACHINE_DRIVER_START( _4in1 )
17811769   /* basic machine hardware */
17821770   MDRV_IMPORT_FROM(semicom)
1783   MDRV_GFXDECODE(gfxdecodeinfo)
1771   MDRV_GFXDECODE(snowbros)
17841772MACHINE_DRIVER_END
17851773
17861774static MACHINE_DRIVER_START( snowbro3 )
r1051r1052
17981786   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17991787   MDRV_SCREEN_SIZE(32*8, 32*8)
18001788   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1801   MDRV_GFXDECODE(sb3_gfxdecodeinfo)
1789   MDRV_GFXDECODE(sb3)
18021790   MDRV_PALETTE_LENGTH(512)
18031791
18041792   MDRV_VIDEO_UPDATE(snowbro3)
src/mame/drivers/segaxbd.c
r1051r1052
11121112};
11131113
11141114
1115static const gfx_decode gfxdecodeinfo[] =
1116{
1117   { REGION_GFX1, 0, &charlayout,   0, 1024 },
1118   { -1 }
1119};
1115static GFXDECODE_START( segaxbd )
1116   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1024 )
1117GFXDECODE_END
11201118
11211119
11221120
r1051r1052
11471145
11481146   /* video hardware */
11491147   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1150   MDRV_GFXDECODE(gfxdecodeinfo)
1148   MDRV_GFXDECODE(segaxbd)
11511149   MDRV_PALETTE_LENGTH(8192*3)
11521150
11531151   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/sonson.c
r1051r1052
223223   32*8
224224};
225225
226static const gfx_decode gfxdecodeinfo[] =
227{
228   { REGION_GFX1, 0, &charlayout,      0, 64 },
229   { REGION_GFX2, 0, &spritelayout, 64*4, 32 },
230   { -1 }
231};
226static GFXDECODE_START( sonson )
227   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 64 )
228   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 64*4, 32 )
229GFXDECODE_END
232230
233231
234232
r1051r1052
253251   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
254252   MDRV_SCREEN_SIZE(32*8, 32*8)
255253   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
256   MDRV_GFXDECODE(gfxdecodeinfo)
254   MDRV_GFXDECODE(sonson)
257255   MDRV_PALETTE_LENGTH(32)
258256   MDRV_COLORTABLE_LENGTH(64*4+32*8)
259257
src/mame/drivers/sslam.c
r1051r1052
712712   16*16
713713};
714714
715static const gfx_decode sslam_gfxdecodeinfo[] =
716{
717   { REGION_GFX2, 0, &tiles8x8_layout,   0x300, 16 }, /* spr */
718   { REGION_GFX1, 0, &tiles16x16_layout,     0, 16 }, /* bg */
719   { REGION_GFX1, 0, &tiles16x16_layout, 0x100, 16 }, /* mid */
720   { REGION_GFX1, 0, &tiles8x8_layout,   0x200, 16 }, /* tx */
721   { -1 }
722};
715static GFXDECODE_START( sslam )
716   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout,   0x300, 16 ) /* spr */
717   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16_layout,     0, 16 ) /* bg */
718   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16_layout, 0x100, 16 ) /* mid */
719   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout,   0x200, 16 ) /* tx */
720GFXDECODE_END
723721
724static const gfx_decode powerbls_gfxdecodeinfo[] =
725{
726   { REGION_GFX2, 0, &tiles8x8_layout,   0x100, 16 }, /* spr */
727   { REGION_GFX1, 0, &tiles8x8_layout,       0, 16 }, /* bg */
728   { -1 }
729};
722static GFXDECODE_START( powerbls )
723   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout,   0x100, 16 ) /* spr */
724   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout,       0, 16 ) /* bg */
725GFXDECODE_END
730726
731727
732728/* Machine Driver */
r1051r1052
751747   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
752748   MDRV_SCREEN_SIZE(64*8, 32*8)
753749   MDRV_SCREEN_VISIBLE_AREA(1*8, 39*8-1, 1*8, 31*8-1)
754   MDRV_GFXDECODE(sslam_gfxdecodeinfo)
750   MDRV_GFXDECODE(sslam)
755751   MDRV_PALETTE_LENGTH(0x800)
756752
757753   MDRV_VIDEO_START(sslam)
r1051r1052
784780   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
785781   MDRV_SCREEN_SIZE(64*8, 32*8)
786782   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
787   MDRV_GFXDECODE(powerbls_gfxdecodeinfo)
783   MDRV_GFXDECODE(powerbls)
788784   MDRV_PALETTE_LENGTH(0x200)
789785
790786   MDRV_VIDEO_START(powerbls)
src/mame/drivers/simpl156.c
r1051r1052
448448   32*32
449449};
450450
451static const gfx_decode gfxdecodeinfo[] =
452{
453   { REGION_GFX1, 0, &tile_8x8_layout,     0,     32 },   /* Tiles (8x8) */
454   { REGION_GFX1, 0, &tile_16x16_layout,   0,     32 },   /* Tiles (16x16) */
455   { REGION_GFX2, 0, &spritelayout, 0x200, 32},   /* Sprites (16x16) */
451static GFXDECODE_START( simpl156 )
452   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,     0,     32 )   /* Tiles (8x8) */
453   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_16x16_layout,   0,     32 )   /* Tiles (16x16) */
454   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x200, 32)   /* Sprites (16x16) */
456455
457   { -1 }
458};
456GFXDECODE_END
459457
460458NVRAM_HANDLER( simpl156 )
461459{
r1051r1052
497495   MDRV_SCREEN_SIZE(64*8, 32*8)
498496   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
499497   MDRV_PALETTE_LENGTH(4096)
500   MDRV_GFXDECODE(gfxdecodeinfo)
498   MDRV_GFXDECODE(simpl156)
501499   MDRV_VIDEO_START(simpl156)
502500   MDRV_VIDEO_UPDATE(simpl156)
503501
src/mame/drivers/lgp.c
r1051r1052
7979
8080
8181/* VIDEO GOODS */
82VIDEO_UPDATE( lgp )
82static VIDEO_UPDATE( lgp )
8383{
8484   int charx, chary;
8585
r1051r1052
112112
113113/* MEMORY HANDLERS */
114114/* Main Z80 R/W */
115READ8_HANDLER(ldp_read)
115static READ8_HANDLER(ldp_read)
116116{
117117   return laserdisc_data_r(discinfo);
118118}
119119
120WRITE8_HANDLER(ldp_write)
120static WRITE8_HANDLER(ldp_write)
121121{
122122   laserdisc_data_w(discinfo,data);
123123}
r1051r1052
310310   32*128
311311};
312312
313static const gfx_decode gfxdecodeinfo[] =
314{
315   { REGION_GFX1, 0, &lgp_gfx_layout, 0x0, 0x100 },
316   { REGION_GFX4, 0, &lgp_gfx_layout_16x32, 0x0, 0x100},
317   { -1 }
318};
313static GFXDECODE_START( lgp )
314   GFXDECODE_ENTRY(REGION_GFX1, 0, lgp_gfx_layout, 0x0, 0x100)
315   GFXDECODE_ENTRY(REGION_GFX4, 0, lgp_gfx_layout_16x32, 0x0, 0x100)
316GFXDECODE_END
319317
320318static MACHINE_START( lgp )
321319{
r1051r1052
354352   MDRV_CPU_PROGRAM_MAP(sound_program_map,0)
355353   MDRV_CPU_IO_MAP(sound_io_map,0)
356354
357
358355   MDRV_MACHINE_START(lgp)
359356
360357/*  video */
361358   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
362
363359   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
364360   MDRV_SCREEN_REFRESH_RATE(60)
365361   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
r1051r1052
369365   MDRV_PALETTE_LENGTH(256)
370366   /* MDRV_PALETTE_INIT(lgp) */
371367
372   MDRV_GFXDECODE(gfxdecodeinfo)
368   MDRV_GFXDECODE(lgp)
373369   MDRV_VIDEO_UPDATE(lgp)
374370
375371/*  sound */
src/mame/drivers/hcastle.c
r1051r1052
234234   32*8
235235};
236236
237static const gfx_decode gfxdecodeinfo[] =
238{
239   { REGION_GFX1, 0, &charlayout,       0, 8*16 },   /* 007121 #0 */
240   { REGION_GFX2, 0, &charlayout, 8*16*16, 8*16 },   /* 007121 #1 */
241   { -1 }
242};
237static GFXDECODE_START( hcastle )
238   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 8*16 )   /* 007121 #0 */
239   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 8*16*16, 8*16 )   /* 007121 #1 */
240GFXDECODE_END
243241
244242/*****************************************************************************/
245243
r1051r1052
284282   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
285283   MDRV_SCREEN_SIZE(32*8, 32*8)
286284   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
287   MDRV_GFXDECODE(gfxdecodeinfo)
285   MDRV_GFXDECODE(hcastle)
288286   MDRV_PALETTE_LENGTH(128)
289287   MDRV_COLORTABLE_LENGTH(2*8*16*16)
290288
src/mame/drivers/deadang.c
r1051r1052
235235
236236/* Graphics Decode Information */
237237
238static const gfx_decode gfxdecodeinfo[] =
239{
240   { REGION_GFX1, 0x000000, &charlayout,    512, 16 },
241   { REGION_GFX2, 0x000000, &spritelayout,  768, 16 },
242   { REGION_GFX3, 0x000000, &spritelayout, 1024, 16 },
243   { REGION_GFX4, 0x000000, &spritelayout,  256, 16 },
244   { REGION_GFX5, 0x000000, &spritelayout,    0, 16 },
245   { -1 }
246};
238static GFXDECODE_START( deadang )
239   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, charlayout,    512, 16 )
240   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, spritelayout,  768, 16 )
241   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, spritelayout, 1024, 16 )
242   GFXDECODE_ENTRY( REGION_GFX4, 0x000000, spritelayout,  256, 16 )
243   GFXDECODE_ENTRY( REGION_GFX5, 0x000000, spritelayout,    0, 16 )
244GFXDECODE_END
247245
248246/* Sound Interfaces */
249247
r1051r1052
287285   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
288286   MDRV_SCREEN_SIZE(32*8, 32*8)
289287   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
290   MDRV_GFXDECODE(gfxdecodeinfo)
288   MDRV_GFXDECODE(deadang)
291289   MDRV_PALETTE_LENGTH(2048)
292290
293291   MDRV_VIDEO_START(deadang)
src/mame/drivers/cliffhgr.c
r1051r1052
722722   vdp_interrupt
723723};
724724
725extern discrete_sound_block cliffhgr_discrete_interface[];
725extern const discrete_sound_block cliffhgr_discrete_interface[];
726726
727727
728728
r1051r1052
763763
764764   /* discrete sounds */
765765   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
766   MDRV_SOUND_CONFIG(cliffhgr_discrete_interface)
766   MDRV_SOUND_CONFIG_DISCRETE(cliffhgr)
767767   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
768768MACHINE_DRIVER_END
769769
src/mame/drivers/copsnrob.c
r1051r1052
240240};
241241
242242
243static const gfx_decode gfxdecodeinfo[] =
244{
245   { REGION_GFX1, 0, &charlayout,  0, 1 },
246   { REGION_GFX2, 0, &carlayout,   0, 1 },
247   { REGION_GFX3, 0, &trucklayout, 0, 1 },
248   { -1 }
249};
243static GFXDECODE_START( copsnrob )
244   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 1 )
245   GFXDECODE_ENTRY( REGION_GFX2, 0, carlayout,   0, 1 )
246   GFXDECODE_ENTRY( REGION_GFX3, 0, trucklayout, 0, 1 )
247GFXDECODE_END
250248
251249
252250
r1051r1052
270268   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
271269   MDRV_SCREEN_SIZE(32*8, 32*8)
272270   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 26*8-1)
273   MDRV_GFXDECODE(gfxdecodeinfo)
271   MDRV_GFXDECODE(copsnrob)
274272   MDRV_PALETTE_LENGTH(2)
275273
276274   MDRV_PALETTE_INIT(copsnrob)
src/mame/drivers/cntsteer.c
r1051r1052
691691   8*16
692692};
693693
694static const gfx_decode cntsteer_gfxdecodeinfo[] =
695{
696   { REGION_GFX1, 0x00000, &cntsteer_charlayout, 0, 256 }, /* Only 1 used so far :/ */
697   { REGION_GFX2, 0x00000, &sprites,           0, 256 },
698   { REGION_GFX3, 0x00000, &tilelayout,        0, 256 },
699   { -1 }
700};
694static GFXDECODE_START( cntsteer )
695   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, cntsteer_charlayout, 0, 256 ) /* Only 1 used so far :/ */
696   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, sprites,           0, 256 )
697   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout,        0, 256 )
698GFXDECODE_END
701699
702700
703static const gfx_decode zerotrgt_gfxdecodeinfo[] =
704{
705   { REGION_GFX1, 0x00000, &zerotrgt_charlayout, 0, 256 }, /* Only 1 used so far :/ */
706   { REGION_GFX2, 0x00000, &sprites,           0, 256 },
707      { REGION_GFX3, 0x00000, &tilelayout,        0, 256 },
708   { -1 }
709};
701static GFXDECODE_START( zerotrgt )
702   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, zerotrgt_charlayout, 0, 256 ) /* Only 1 used so far :/ */
703   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, sprites,           0, 256 )
704      GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout,        0, 256 )
705GFXDECODE_END
710706
711707/***************************************************************************/
712708
r1051r1052
740736   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
741737
742738   // interleave 200?
743   MDRV_GFXDECODE(cntsteer_gfxdecodeinfo)
739   MDRV_GFXDECODE(cntsteer)
744740   MDRV_PALETTE_LENGTH(256)
745741//  MDRV_PALETTE_INIT(zerotrgt)
746742
r1051r1052
779775   MDRV_MACHINE_RESET(zerotrgt)
780776
781777   // interleave 200?
782   MDRV_GFXDECODE(zerotrgt_gfxdecodeinfo)
778   MDRV_GFXDECODE(zerotrgt)
783779   MDRV_PALETTE_LENGTH(256)
784780
785781   MDRV_PALETTE_INIT(zerotrgt)
src/mame/drivers/twincobr.c
r1051r1052
623623   32*8         /* every sprite takes 32 consecutive bytes */
624624};
625625
626static const gfx_decode gfxdecodeinfo[] =
627{
628   { REGION_GFX1, 0x00000, &charlayout,   1536, 32 },   /* colors 1536-1791 */
629   { REGION_GFX2, 0x00000, &tilelayout,   1280, 16 },   /* colors 1280-1535 */
630   { REGION_GFX3, 0x00000, &tilelayout,   1024, 16 },   /* colors 1024-1079 */
631   { REGION_GFX4, 0x00000, &spritelayout,      0, 64 },   /* colors    0-1023 */
632   { -1 }
633};
626static GFXDECODE_START( twincobr )
627   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   1536, 32 )   /* colors 1536-1791 */
628   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout,   1280, 16 )   /* colors 1280-1535 */
629   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout,   1024, 16 )   /* colors 1024-1079 */
630   GFXDECODE_ENTRY( REGION_GFX4, 0x00000, spritelayout,      0, 64 )   /* colors    0-1023 */
631GFXDECODE_END
634632
635633
636634
r1051r1052
674672   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
675673   MDRV_SCREEN_SIZE(64*8, 64*8)
676674   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
677   MDRV_GFXDECODE(gfxdecodeinfo)
675   MDRV_GFXDECODE(twincobr)
678676   MDRV_PALETTE_LENGTH(1792)
679677
680678   MDRV_VIDEO_START(toaplan0)
src/mame/drivers/hexion.c
r1051r1052
263263   16*8
264264};
265265
266static const gfx_decode gfxdecodeinfo[] =
267{
268   { REGION_GFX1, 0, &charlayout, 0, 16 },
269   { -1 }
270};
266static GFXDECODE_START( hexion )
267   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
268GFXDECODE_END
271269
272270
273271
r1051r1052
295293   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
296294   MDRV_SCREEN_SIZE(64*8, 32*8)
297295   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
298   MDRV_GFXDECODE(gfxdecodeinfo)
296   MDRV_GFXDECODE(hexion)
299297   MDRV_PALETTE_LENGTH(256)
300298
301299   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/battlnts.c
r1051r1052
319319};
320320
321321
322static const gfx_decode gfxdecodeinfo[] =
323{
324   { REGION_GFX1, 0, &charlayout,      0, 1 }, /* colors  0-15 */
325   { REGION_GFX2, 0, &spritelayout, 4*16, 1 }, /* colors 64-79 */
326   { -1 }
327};
322static GFXDECODE_START( battlnts )
323   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 1 ) /* colors  0-15 */
324   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 4*16, 1 ) /* colors 64-79 */
325GFXDECODE_END
328326
329327/***************************************************************************
330328
r1051r1052
351349   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
352350   MDRV_SCREEN_SIZE(32*8, 32*8)
353351   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
354   MDRV_GFXDECODE(gfxdecodeinfo)
352   MDRV_GFXDECODE(battlnts)
355353   MDRV_PALETTE_LENGTH(128)
356354
357355   MDRV_VIDEO_START(battlnts)
src/mame/drivers/dblewing.c
r1051r1052
387387};
388388
389389
390static const gfx_decode gfxdecodeinfo[] =
391{
392   { REGION_GFX1, 0, &tile_8x8_layout,     0x000, 32 },   /* Tiles (8x8) */
393   { REGION_GFX1, 0, &tile_16x16_layout,   0x000, 32 },   /* Tiles (16x16) */
394   { REGION_GFX2, 0, &spritelayout,        0x200, 32 },   /* Sprites (16x16) */
395   { -1 }
396};
390static GFXDECODE_START( dblewing )
391   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,     0x000, 32 )   /* Tiles (8x8) */
392   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_16x16_layout,   0x000, 32 )   /* Tiles (16x16) */
393   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,        0x200, 32 )   /* Sprites (16x16) */
394GFXDECODE_END
397395
398396INPUT_PORTS_START( dblewing )
399397   PORT_START   /* 16bit */
r1051r1052
559557   MDRV_SCREEN_SIZE(64*8, 32*8)
560558   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
561559   MDRV_PALETTE_LENGTH(4096)
562   MDRV_GFXDECODE(gfxdecodeinfo)
560   MDRV_GFXDECODE(dblewing)
563561
564562   MDRV_VIDEO_START(dblewing)
565563   MDRV_VIDEO_UPDATE(dblewing)
src/mame/drivers/galpani2.c
r1051r1052
445445   16*16*8
446446};
447447
448static const gfx_decode galpani2_gfxdecodeinfo[] =
449{
450   { REGION_GFX1, 0, &layout_16x16x8,   0,   0x40   }, // [0] Sprites
451   { -1 }
452};
448static GFXDECODE_START( galpani2 )
449   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8,   0,   0x40   ) // [0] Sprites
450GFXDECODE_END
453451
454452/***************************************************************************
455453
r1051r1052
508506   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
509507   MDRV_SCREEN_SIZE(320, 256)
510508   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-1-16)
511   MDRV_GFXDECODE(galpani2_gfxdecodeinfo)
509   MDRV_GFXDECODE(galpani2)
512510   MDRV_PALETTE_LENGTH(0x4000 + 0x200 + 0x8000)   // sprites, bg8, bg15
513511
514512   MDRV_PALETTE_INIT(galpani2)
src/mame/drivers/labyrunr.c
r1051r1052
211211   32*8
212212};
213213
214static const gfx_decode gfxdecodeinfo[] =
215{
216   { REGION_GFX1, 0, &gfxlayout, 0, 8*16 },
217   { -1 }
218};
214static GFXDECODE_START( labyrunr )
215   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout, 0, 8*16 )
216GFXDECODE_END
219217
220218/***************************************************************************
221219
r1051r1052
252250   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
253251   MDRV_SCREEN_SIZE(37*8, 32*8)
254252   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
255   MDRV_GFXDECODE(gfxdecodeinfo)
253   MDRV_GFXDECODE(labyrunr)
256254   MDRV_PALETTE_LENGTH(128)
257255   MDRV_COLORTABLE_LENGTH(2*8*16*16)
258256
src/mame/drivers/pipedrm.c
r1051r1052
505505};
506506
507507
508static const gfx_decode gfxdecodeinfo[] =
509{
510   { REGION_GFX1, 0, &bglayout,    0, 64 },
511   { REGION_GFX2, 0, &bglayout,    0, 64 },
512   { REGION_GFX3, 0, &splayout, 1024, 32 },
513   { -1 }
514};
508static GFXDECODE_START( pipedrm )
509   GFXDECODE_ENTRY( REGION_GFX1, 0, bglayout,    0, 64 )
510   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,    0, 64 )
511   GFXDECODE_ENTRY( REGION_GFX3, 0, splayout, 1024, 32 )
512GFXDECODE_END
515513
516514
517static const gfx_decode gfxdecodeinfo_hatris[] =
518{
519   { REGION_GFX1, 0, &bglayout,    0, 128 },
520   { REGION_GFX2, 0, &bglayout,    0, 128 },
521   { -1 }
522};
515static GFXDECODE_START( hatris )
516   GFXDECODE_ENTRY( REGION_GFX1, 0, bglayout,    0, 128 )
517   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,    0, 128 )
518GFXDECODE_END
523519
524520
525521
r1051r1052
580576   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
581577   MDRV_SCREEN_SIZE(44*8, 30*8)
582578   MDRV_SCREEN_VISIBLE_AREA(0*8, 44*8-1, 0*8, 30*8-1)
583   MDRV_GFXDECODE(gfxdecodeinfo)
579   MDRV_GFXDECODE(pipedrm)
584580   MDRV_PALETTE_LENGTH(2048)
585581
586582   MDRV_VIDEO_START(pipedrm)
r1051r1052
620616   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
621617   MDRV_SCREEN_SIZE(44*8, 30*8)
622618   MDRV_SCREEN_VISIBLE_AREA(0*8, 44*8-1, 0*8, 30*8-1)
623   MDRV_GFXDECODE(gfxdecodeinfo_hatris)
619   MDRV_GFXDECODE(hatris)
624620   MDRV_PALETTE_LENGTH(2048)
625621
626622   MDRV_VIDEO_START(hatris)
src/mame/drivers/ccastles.c
r1051r1052
436436};
437437
438438
439static const gfx_decode gfxdecodeinfo[] =
440{
441   { REGION_GFX1, 0x0000, &ccastles_spritelayout,  0, 2 },
442   { -1 }
443};
439static GFXDECODE_START( ccastles )
440   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, ccastles_spritelayout,  0, 2 )
441GFXDECODE_END
444442
445443
446444
r1051r1052
477475
478476   /* video hardware */
479477   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
480   MDRV_GFXDECODE(gfxdecodeinfo)
478   MDRV_GFXDECODE(ccastles)
481479   MDRV_PALETTE_LENGTH(32)
482480
483481   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/ddragon3.c
r1051r1052
468468
469469/* Graphics Decode Info */
470470
471static const gfx_decode gfxdecodeinfo[] =
472{
473   { REGION_GFX1, 0, &tile_layout,   256, 32 },
474   { REGION_GFX2, 0, &sprite_layout,   0, 16 },
475   { -1 }
476};
471static GFXDECODE_START( ddragon3 )
472   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,   256, 32 )
473   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout,   0, 16 )
474GFXDECODE_END
477475
478476/* Sound Interfaces */
479477
r1051r1052
518516   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
519517   MDRV_SCREEN_SIZE(40*8, 32*8)
520518   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
521   MDRV_GFXDECODE(gfxdecodeinfo)
519   MDRV_GFXDECODE(ddragon3)
522520   MDRV_PALETTE_LENGTH(768)
523521
524522   MDRV_VIDEO_START(ddragon3)
src/mame/drivers/sprint2.c
r1051r1052
522522};
523523
524524
525static const gfx_decode gfxdecodeinfo[] =
526{
527   { REGION_GFX1, 0, &tile_layout, 0, 2 },
528   { REGION_GFX2, 0, &car_layout, 4, 4 },
529   { -1 }
530};
525static GFXDECODE_START( sprint2 )
526   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0, 2 )
527   GFXDECODE_ENTRY( REGION_GFX2, 0, car_layout, 4, 4 )
528GFXDECODE_END
531529
532530
533531static MACHINE_DRIVER_START( sprint2 )
r1051r1052
545543   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
546544   MDRV_SCREEN_SIZE(512, 262)
547545   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 223)
548   MDRV_GFXDECODE(gfxdecodeinfo)
546   MDRV_GFXDECODE(sprint2)
549547   MDRV_PALETTE_LENGTH(4)
550548   MDRV_COLORTABLE_LENGTH(12)
551549
r1051r1052
558556   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
559557
560558   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
561   MDRV_SOUND_CONFIG(sprint2_discrete_interface)
559   MDRV_SOUND_CONFIG_DISCRETE(sprint2)
562560   MDRV_SOUND_ROUTE(0, "left", 1.0)
563561   MDRV_SOUND_ROUTE(1, "right", 1.0)
564562MACHINE_DRIVER_END
r1051r1052
574572   MDRV_SPEAKER_STANDARD_MONO("mono")
575573
576574   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
577   MDRV_SOUND_CONFIG(sprint1_discrete_interface)
575   MDRV_SOUND_CONFIG_DISCRETE(sprint1)
578576   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
579577MACHINE_DRIVER_END
580578
r1051r1052
589587   MDRV_SPEAKER_STANDARD_MONO("mono")
590588
591589   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
592   MDRV_SOUND_CONFIG(dominos_discrete_interface)
590   MDRV_SOUND_CONFIG_DISCRETE(dominos)
593591   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
594592MACHINE_DRIVER_END
595593
src/mame/drivers/dragrace.c
r1051r1052
294294};
295295
296296
297static const gfx_decode dragrace_gfx_decode_info[] =
298{
299   { REGION_GFX1, 0, &dragrace_tile_layout1, 0, 4 },
300   { REGION_GFX2, 0, &dragrace_tile_layout2, 8, 2 },
301   { -1 }
302};
297static GFXDECODE_START( dragrace )
298   GFXDECODE_ENTRY( REGION_GFX1, 0, dragrace_tile_layout1, 0, 4 )
299   GFXDECODE_ENTRY( REGION_GFX2, 0, dragrace_tile_layout2, 8, 2 )
300GFXDECODE_END
303301
304302
305303static PALETTE_INIT( dragrace )
r1051r1052
339337   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
340338   MDRV_SCREEN_SIZE(256, 262)
341339   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
342   MDRV_GFXDECODE(dragrace_gfx_decode_info)
340   MDRV_GFXDECODE(dragrace)
343341   MDRV_PALETTE_LENGTH(16)
344342   MDRV_PALETTE_INIT(dragrace)
345343   MDRV_VIDEO_START(dragrace)
r1051r1052
349347   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
350348
351349   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
352   MDRV_SOUND_CONFIG(dragrace_discrete_interface)
350   MDRV_SOUND_CONFIG_DISCRETE(dragrace)
353351   MDRV_SOUND_ROUTE(0, "left", 1.0)
354352   MDRV_SOUND_ROUTE(1, "right", 1.0)
355353MACHINE_DRIVER_END
src/mame/drivers/discoboy.c
r1051r1052
3737
3838#include "driver.h"
3939#include "sound/msm5205.h"
40#include "sound/3812intf.h"
4041
4142UINT8* discoboy_ram_part1;
4243UINT8* discoboy_ram_part2;
r1051r1052
318319   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
319320   AM_RANGE(0x00, 0x00) AM_WRITE(discoboy_port_00_w)
320321   AM_RANGE(0x01, 0x01) AM_WRITE(discoboy_port_01_w)
321
322322   AM_RANGE(0x03, 0x03) AM_WRITE(discoboy_port_03_w)
323323   AM_RANGE(0x06, 0x06) AM_WRITE(discoboy_port_06_w) // ?? unk
324324
r1051r1052
350350static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
351351   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
352352   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM)
353   AM_RANGE(0xec00, 0xec00) AM_WRITE(YM3812_control_port_0_w)
354   AM_RANGE(0xec01, 0xec01) AM_WRITE(YM3812_write_port_0_w)
353355ADDRESS_MAP_END
354356
355357static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
r1051r1052
452454   8*8
453455};
454456
455static const gfx_decode gfxdecodeinfo[] =
456{
457   { REGION_GFX1, 0, &tiles8x8_layout, 0x000, 128 },
458   { REGION_GFX2, 0, &tiles8x8_layout2, 0x000, 128 },
457static GFXDECODE_START( discoboy )
458   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0x000, 128 )
459   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout2, 0x000, 128 )
459460
460   { -1 }
461};
461GFXDECODE_END
462462
463463
464464
r1051r1052
480480   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
481481   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
482482//  MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
483   MDRV_CPU_VBLANK_INT(nmi_line_pulse,4)
483   MDRV_CPU_VBLANK_INT(nmi_line_pulse,32)
484484
485485   /* video hardware */
486486   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
r1051r1052
489489   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
490490   MDRV_SCREEN_SIZE(512, 256)
491491   MDRV_SCREEN_VISIBLE_AREA(8*8, 512-1-8*8, 0+8, 256-1-8)
492   MDRV_GFXDECODE(gfxdecodeinfo)
492   MDRV_GFXDECODE(discoboy)
493493   MDRV_PALETTE_LENGTH(0x1000)
494494
495495   MDRV_VIDEO_START(discoboy)
r1051r1052
498498   /* sound hardware */
499499   MDRV_SPEAKER_STANDARD_MONO("mono")
500500
501   MDRV_SOUND_ADD(YM3812, 2500000)
502   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
503
504
501505   MDRV_SOUND_ADD(MSM5205, 384000) // ???? unknown
502506   MDRV_SOUND_CONFIG(discoboy_msm5205_interface)
503507   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
r1051r1052
560564ROM_END
561565
562566
563GAME( 1993, discoboy,  0,    discoboy, discoboy, discoboy, ROT270, "Soft Art Co.", "Disco Boy", GAME_NO_SOUND )
567GAME( 1993, discoboy,  0,    discoboy, discoboy, discoboy, ROT270, "Soft Art Co.", "Disco Boy", 0 )
src/mame/drivers/mediagx.c
r1051r1052
773773    8*8                     /* every char takes 8 bytes */
774774};
775775
776static const gfx_decode CGA_gfxdecodeinfo[] =
777{
776static GFXDECODE_START( CGA )
778777/* Support up to four CGA fonts */
779   { REGION_GFX1, 0x0000, &CGA_charlayout,              0, 256 },   /* Font 0 */
780   { REGION_GFX1, 0x0800, &CGA_charlayout,              0, 256 },   /* Font 1 */
781   { REGION_GFX1, 0x1000, &CGA_charlayout,              0, 256 },   /* Font 2 */
782   { REGION_GFX1, 0x1800, &CGA_charlayout,              0, 256 },   /* Font 3*/
783    { -1 }
784};
778   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, CGA_charlayout,              0, 256 )   /* Font 0 */
779   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, CGA_charlayout,              0, 256 )   /* Font 1 */
780   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, CGA_charlayout,              0, 256 )   /* Font 2 */
781   GFXDECODE_ENTRY( REGION_GFX1, 0x1800, CGA_charlayout,              0, 256 )   /* Font 3*/
782GFXDECODE_END
785783
786784INPUT_PORTS_START(mediagx)
787785   PORT_START
r1051r1052
887885   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
888886   MDRV_SCREEN_SIZE(640, 480)
889887   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
890   MDRV_GFXDECODE(CGA_gfxdecodeinfo)
888   MDRV_GFXDECODE(CGA)
891889   MDRV_PALETTE_LENGTH(16)
892890
893891   MDRV_VIDEO_START(mediagx)
src/mame/drivers/ambush.c
r1051r1052
163163   32*8     /* every char takes 32 consecutive bytes */
164164};
165165
166static const gfx_decode gfxdecodeinfo[] =
167{
168   { REGION_GFX1, 0x0000, &charlayout,   0, 64 },
169   { REGION_GFX1, 0x0000, &spritelayout, 0, 64 },
170   { -1 }
171};
166static GFXDECODE_START( ambush )
167   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 64 )
168   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 64 )
169GFXDECODE_END
172170
173171
174172static struct AY8910interface ay8910_interface_1 =
r1051r1052
198196   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
199197   MDRV_SCREEN_SIZE(32*8, 32*8)
200198   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-3)  /* The -3 makes the cocktail mode perfect */
201   MDRV_GFXDECODE(gfxdecodeinfo)
199   MDRV_GFXDECODE(ambush)
202200   MDRV_PALETTE_LENGTH(256)
203201
204202   MDRV_PALETTE_INIT(ambush)
src/mame/drivers/orbit.c
r1051r1052
246246};
247247
248248
249static const gfx_decode orbit_gfx_decode_info[] =
250{
251   { REGION_GFX1, 0, &orbit_full_sprite_layout, 0, 1 },
252   { REGION_GFX1, 0, &orbit_upper_sprite_layout, 0, 1 },
253   { REGION_GFX1, 0, &orbit_lower_sprite_layout, 0, 1 },
254   { REGION_GFX2, 0, &orbit_tile_layout, 0, 1 },
255   { -1 }
256};
249static GFXDECODE_START( orbit )
250   GFXDECODE_ENTRY( REGION_GFX1, 0, orbit_full_sprite_layout, 0, 1 )
251   GFXDECODE_ENTRY( REGION_GFX1, 0, orbit_upper_sprite_layout, 0, 1 )
252   GFXDECODE_ENTRY( REGION_GFX1, 0, orbit_lower_sprite_layout, 0, 1 )
253   GFXDECODE_ENTRY( REGION_GFX2, 0, orbit_tile_layout, 0, 1 )
254GFXDECODE_END
257255
258256
259257static PALETTE_INIT( orbit )
r1051r1052
280278   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
281279   MDRV_SCREEN_SIZE(512, 524)
282280   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 479)
283   MDRV_GFXDECODE(orbit_gfx_decode_info)
281   MDRV_GFXDECODE(orbit)
284282   MDRV_PALETTE_LENGTH(2)
285283   MDRV_PALETTE_INIT(orbit)
286284   MDRV_VIDEO_START(orbit)
r1051r1052
290288   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
291289
292290   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
293   MDRV_SOUND_CONFIG(orbit_discrete_interface)
291   MDRV_SOUND_CONFIG_DISCRETE(orbit)
294292   MDRV_SOUND_ROUTE(0, "left", 1.0)
295293   MDRV_SOUND_ROUTE(1, "right", 1.0)
296294MACHINE_DRIVER_END
src/mame/drivers/seibuspi.c
r1051r1052
16281628};
16291629#endif
16301630
1631static const gfx_decode spi_gfxdecodeinfo[] =
1632{
1633   { REGION_GFX1, 0, &spi_charlayout,   5632, 16 },
1634   { REGION_GFX2, 0, &spi_tilelayout,   4096, 24 },
1635   { REGION_GFX3, 0, &spi_spritelayout,    0, 96 },
1631static GFXDECODE_START( spi )
1632   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout,   5632, 16 )
1633   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout,   4096, 24 )
1634   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout,    0, 96 )
16361635#if PLANE_CHAR
1637   { REGION_GFX1, 0, &spi_charlayout0,   0x3ff, 1 },
1638   { REGION_GFX1, 0, &spi_charlayout1,   0x3ff, 1 },
1639   { REGION_GFX1, 0, &spi_charlayout2,   0x3ff, 1 },
1640   { REGION_GFX1, 0, &spi_charlayout3,   0x3ff, 1 },
1641   { REGION_GFX1, 0, &spi_charlayout4,   0x3ff, 1 },
1642   { REGION_GFX1, 0, &spi_charlayout5,   0x3ff, 1 },
1636   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout0,   0x3ff, 1 )
1637   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout1,   0x3ff, 1 )
1638   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout2,   0x3ff, 1 )
1639   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout3,   0x3ff, 1 )
1640   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout4,   0x3ff, 1 )
1641   GFXDECODE_ENTRY( REGION_GFX1, 0, spi_charlayout5,   0x3ff, 1 )
16431642#endif
16441643#if PLANE_TILE
1645   { REGION_GFX2, 0, &spi_tilelayout0,   0x3ff, 1 },
1646   { REGION_GFX2, 0, &spi_tilelayout1,   0x3ff, 1 },
1647   { REGION_GFX2, 0, &spi_tilelayout2,   0x3ff, 1 },
1648   { REGION_GFX2, 0, &spi_tilelayout3,   0x3ff, 1 },
1649   { REGION_GFX2, 0, &spi_tilelayout4,   0x3ff, 1 },
1650   { REGION_GFX2, 0, &spi_tilelayout5,   0x3ff, 1 },
1644   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout0,   0x3ff, 1 )
1645   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout1,   0x3ff, 1 )
1646   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout2,   0x3ff, 1 )
1647   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout3,   0x3ff, 1 )
1648   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout4,   0x3ff, 1 )
1649   GFXDECODE_ENTRY( REGION_GFX2, 0, spi_tilelayout5,   0x3ff, 1 )
16511650#endif
16521651#if PLANE_SPRITE
1653   { REGION_GFX3, 0, &spi_spritelayout0, 0x3ff, 1 },
1654   { REGION_GFX3, 0, &spi_spritelayout1, 0x3ff, 1 },
1655   { REGION_GFX3, 0, &spi_spritelayout2, 0x3ff, 1 },
1656   { REGION_GFX3, 0, &spi_spritelayout3, 0x3ff, 1 },
1657   { REGION_GFX3, 0, &spi_spritelayout4, 0x3ff, 1 },
1658   { REGION_GFX3, 0, &spi_spritelayout5, 0x3ff, 1 },
1652   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout0, 0x3ff, 1 )
1653   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout1, 0x3ff, 1 )
1654   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout2, 0x3ff, 1 )
1655   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout3, 0x3ff, 1 )
1656   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout4, 0x3ff, 1 )
1657   GFXDECODE_ENTRY( REGION_GFX3, 0, spi_spritelayout5, 0x3ff, 1 )
16591658#endif
1660   { -1 }
1661};
1659GFXDECODE_END
16621660
16631661/********************************************************************************/
16641662
r1051r1052
17761774   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
17771775   MDRV_SCREEN_SIZE(64*8, 32*8)
17781776   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
1779   MDRV_GFXDECODE(spi_gfxdecodeinfo)
1777   MDRV_GFXDECODE(spi)
17801778   MDRV_PALETTE_LENGTH(6144)
17811779
17821780   MDRV_VIDEO_START(spi)
r1051r1052
20762074   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
20772075   MDRV_SCREEN_SIZE(64*8, 32*8)
20782076   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
2079   MDRV_GFXDECODE(spi_gfxdecodeinfo)
2077   MDRV_GFXDECODE(spi)
20802078   MDRV_PALETTE_LENGTH(6144)
20812079
20822080   MDRV_VIDEO_START(spi)
src/mame/drivers/mwarr.c
r1051r1052
259259   32*8
260260};
261261
262static const gfx_decode gfxdecodeinfo[] =
263{
264   { REGION_GFX1, 0, &mwarr_6bpp_sprites,  1024, 16 },
265   { REGION_GFX2, 0, &mwarr_tile8_layout,    384,  8 },
266   { REGION_GFX3, 0, &mwarr_tile16_layout,  256,  8 },
267   { REGION_GFX4, 0, &mwarr_tile16_layout,  128,  8 },
268   { REGION_GFX5, 0, &mwarr_tile16_layout,    0,  8 },
269   { -1 }
270};
262static GFXDECODE_START( mwarr )
263   GFXDECODE_ENTRY( REGION_GFX1, 0, mwarr_6bpp_sprites,  1024, 16 )
264   GFXDECODE_ENTRY( REGION_GFX2, 0, mwarr_tile8_layout,    384,  8 )
265   GFXDECODE_ENTRY( REGION_GFX3, 0, mwarr_tile16_layout,  256,  8 )
266   GFXDECODE_ENTRY( REGION_GFX4, 0, mwarr_tile16_layout,  128,  8 )
267   GFXDECODE_ENTRY( REGION_GFX5, 0, mwarr_tile16_layout,    0,  8 )
268GFXDECODE_END
271269
272270static TILE_GET_INFO( get_bg_tile_info )
273271{
r1051r1052
459457   MDRV_SCREEN_REFRESH_RATE(54)
460458   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
461459
462   MDRV_GFXDECODE(gfxdecodeinfo)
460   MDRV_GFXDECODE(mwarr)
463461
464462   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
465463   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/sauro.c
r1051r1052
8787extern WRITE8_HANDLER( tecfri_videoram2_w );
8888extern WRITE8_HANDLER( tecfri_colorram2_w );
8989extern WRITE8_HANDLER( tecfri_scroll_bg_w );
90extern WRITE8_HANDLER( flip_screen_w );
9190extern WRITE8_HANDLER( sauro_scroll_fg_w );
9291extern WRITE8_HANDLER( trckydoc_spriteram_mirror_w );
9392
r1051r1052
123122   coin_counter_w(1, 0); // to get the coin counter working in sauro, as it doesn't write 0
124123}
125124
125static WRITE8_HANDLER( flip_screen_w )
126{
127   flip_screen_set(data);
128}
129
126130static ADDRESS_MAP_START( sauro_readmem, ADDRESS_SPACE_PROGRAM, 8 )
127131   AM_RANGE(0x0000, 0xdfff) AM_READ(MRA8_ROM)
128132   AM_RANGE(0xe000, 0xebff) AM_READ(MRA8_RAM)
r1051r1052
312316    16*16     /* every sprite takes 32 consecutive bytes */
313317};
314318
315static const gfx_decode sauro_gfxdecodeinfo[] =
316{
317   { REGION_GFX1, 0, &charlayout, 0, 64 },
318   { REGION_GFX2, 0, &charlayout, 0, 64 },
319   { REGION_GFX3, 0, &sauro_spritelayout, 0, 64 },
320   { -1 }
321};
319static GFXDECODE_START( sauro )
320   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 )
321   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 64 )
322   GFXDECODE_ENTRY( REGION_GFX3, 0, sauro_spritelayout, 0, 64 )
323GFXDECODE_END
322324
323static const gfx_decode trckydoc_gfxdecodeinfo[] =
324{
325   { REGION_GFX1, 0, &charlayout, 0, 64 },
326   { REGION_GFX2, 0, &trckydoc_spritelayout, 0, 64 },
327   { -1 }
328};
325static GFXDECODE_START( trckydoc )
326   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 )
327   GFXDECODE_ENTRY( REGION_GFX2, 0, trckydoc_spritelayout, 0, 64 )
328GFXDECODE_END
329329
330330static INTERRUPT_GEN( sauro_interrupt )
331331{
r1051r1052
362362   MDRV_CPU_MODIFY("main")
363363   MDRV_CPU_PROGRAM_MAP(trckydoc_readmem, trckydoc_writemem )
364364
365   MDRV_GFXDECODE(trckydoc_gfxdecodeinfo)
365   MDRV_GFXDECODE(trckydoc)
366366
367367   MDRV_VIDEO_START(trckydoc)
368368   MDRV_VIDEO_UPDATE(trckydoc)
r1051r1052
380380   MDRV_CPU_PROGRAM_MAP(sauro_sound_readmem, sauro_sound_writemem)
381381   MDRV_CPU_VBLANK_INT(sauro_interrupt, 8) // ?
382382
383   MDRV_GFXDECODE(sauro_gfxdecodeinfo)
383   MDRV_GFXDECODE(sauro)
384384
385385   MDRV_VIDEO_START(sauro)
386386   MDRV_VIDEO_UPDATE(sauro)
src/mame/drivers/gaplus.c
r1051r1052
726726   64*8
727727};
728728
729static const gfx_decode gfxdecodeinfo[] =
730{
731   { REGION_GFX1, 0x0000, &charlayout,      0, 64 },
732   { REGION_GFX2, 0x0000, &spritelayout, 64*4, 64 },
733   { -1 } /* end of table */
734};
729static GFXDECODE_START( gaplus )
730   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 64 )
731   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 64*4, 64 )
732GFXDECODE_END
735733
736734static struct namco_interface namco_interface =
737735{
r1051r1052
779777   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
780778   MDRV_SCREEN_SIZE(36*8, 28*8)
781779   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
782   MDRV_GFXDECODE(gfxdecodeinfo)
780   MDRV_GFXDECODE(gaplus)
783781   MDRV_PALETTE_LENGTH(64*4+64*8)
784782
785783   MDRV_PALETTE_INIT(gaplus)
src/mame/drivers/carpolo.c
r1051r1052
220220   8*8
221221};
222222
223static const gfx_decode gfxdecodeinfo[] =
224{
225   { REGION_GFX1, 0, &spritelayout, 0,         12 },
226   { REGION_GFX2, 0, &goallayout,   12*2,      2 },
227   { REGION_GFX3, 0, &alphalayout,  12*2+2*16, 4 },
228   { -1 }
229};
223static GFXDECODE_START( carpolo )
224   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0,         12 )
225   GFXDECODE_ENTRY( REGION_GFX2, 0, goallayout,   12*2,      2 )
226   GFXDECODE_ENTRY( REGION_GFX3, 0, alphalayout,  12*2+2*16, 4 )
227GFXDECODE_END
230228
231229
232230/*************************************
r1051r1052
254252   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
255253   MDRV_SCREEN_SIZE(256, 256)
256254   MDRV_SCREEN_VISIBLE_AREA(0, 239, 0, 255)
257   MDRV_GFXDECODE(gfxdecodeinfo)
255   MDRV_GFXDECODE(carpolo)
258256   MDRV_PALETTE_LENGTH(16+1)   /* extra color for score area */
259257   MDRV_COLORTABLE_LENGTH(12*2+2*16+4*2)
260258
src/mame/drivers/drmicro.c
r1051r1052
212212   8*8*1
213213};
214214
215static const gfx_decode gfxdecodeinfo[] =
216{
217   { REGION_GFX1, 0x0000, &charlayout4,     0, 64 }, /* tiles */
218   { REGION_GFX2, 0x0000, &charlayout8,   256, 32 }, /* tiles */
219   { REGION_GFX1, 0x0000, &spritelayout4,   0, 64 }, /* sprites */
220   { REGION_GFX2, 0x0000, &spritelayout8, 256, 32 }, /* sprites */
221   { -1 }
222};
215static GFXDECODE_START( drmicro )
216   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout4,     0, 64 ) /* tiles */
217   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout8,   256, 32 ) /* tiles */
218   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout4,   0, 64 ) /* sprites */
219   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout8, 256, 32 ) /* sprites */
220GFXDECODE_END
223221
224222static struct MSM5205interface msm5205_interface =
225223{
r1051r1052
246244   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
247245   MDRV_SCREEN_SIZE(32*8, 32*8)
248246   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
249   MDRV_GFXDECODE(gfxdecodeinfo)
247   MDRV_GFXDECODE(drmicro)
250248   MDRV_PALETTE_LENGTH(32)
251249   MDRV_COLORTABLE_LENGTH(512)
252250
src/mame/drivers/speedatk.c
r1051r1052
261261};
262262
263263
264static const gfx_decode gfxdecodeinfo[] =
265{
266   { REGION_GFX1, 0, &charlayout_1bpp,   0, 32 },
267   { REGION_GFX2, 0, &charlayout_3bpp,   0, 32 },
268   { -1 }
269};
264static GFXDECODE_START( speedatk )
265   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_1bpp,   0, 32 )
266   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout_3bpp,   0, 32 )
267GFXDECODE_END
270268
271269static MACHINE_DRIVER_START( speedatk )
272270   MDRV_CPU_ADD(Z80,12000000/2)
r1051r1052
283281   MDRV_SCREEN_SIZE(320, 256)
284282   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 29*8-1)
285283
286   MDRV_GFXDECODE(gfxdecodeinfo)
284   MDRV_GFXDECODE(speedatk)
287285   MDRV_PALETTE_LENGTH(16)
288286   MDRV_COLORTABLE_LENGTH(0x100)
289287   MDRV_PALETTE_INIT(speedatk)
src/mame/drivers/vroulet.c
r1051r1052
212212
213213/* Graphics Decode Information */
214214
215static const gfx_decode gfxdecodeinfo[] =
216{
217   { REGION_GFX1, 0x0000, &charlayout,   0, 32 },
218   { -1 }
219};
215static GFXDECODE_START( vroulet )
216   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 32 )
217GFXDECODE_END
220218
221219/* Sound Interface */
222220
r1051r1052
273271   MDRV_SCREEN_SIZE(32*8, 32*8)
274272   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
275273
276   MDRV_GFXDECODE(gfxdecodeinfo)
274   MDRV_GFXDECODE(vroulet)
277275   MDRV_PALETTE_LENGTH(128*4)
278276
279277   MDRV_VIDEO_START(vroulet)
src/mame/drivers/system1.c
r1051r1052
24152415   8*8
24162416};
24172417
2418static const gfx_decode gfxdecodeinfo[] =
2419{
2418static GFXDECODE_START( system1 )
24202419   /* sprites use colors 0-511, but are not defined here */
2421   { REGION_GFX1, 0, &charlayout, 512, 128 },
2422   { -1 }
2423};
2420   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 512, 128 )
2421GFXDECODE_END
24242422
24252423
24262424
r1051r1052
24472445   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24482446   MDRV_SCREEN_SIZE(256, 256)
24492447   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
2450   MDRV_GFXDECODE(gfxdecodeinfo)
2448   MDRV_GFXDECODE(system1)
24512449   MDRV_PALETTE_LENGTH(1536)
24522450
24532451   MDRV_PALETTE_INIT(system1)
src/mame/drivers/tetriunk.c
r1051r1052
167167   8*8
168168};
169169
170static const gfx_decode gfxdecodeinfo[] =
171{
172   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
173   { -1 }
174};
170static GFXDECODE_START( tetriunk )
171   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
172GFXDECODE_END
175173
176174INPUT_PORTS_START( tetriunk )
177175INPUT_PORTS_END
r1051r1052
189187   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
190188   MDRV_SCREEN_SIZE(320,200)
191189   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
192   MDRV_GFXDECODE(gfxdecodeinfo)
190   MDRV_GFXDECODE(tetriunk)
193191   MDRV_PALETTE_LENGTH(256)
194192   MDRV_PALETTE_INIT(tetrisunk)
195193
src/mame/drivers/cultures.c
r0r1052
1/*
2    Jibun wo Migaku cultures School Mahjon Hen
3    (c)1994 Face
4
5    driver by Pierpaolo Prazzoli
6
7    thanks to David Haywood for some precious advice
8
9*/
10
11#include "driver.h"
12#include "sound/okim6295.h"
13
14#define MCLK 16000000
15
16static UINT8 *bg0_videoram;
17static UINT8 *bg0_regs_x, *bg0_regs_y, *bg1_regs_x, *bg1_regs_y, *bg2_regs_x, *bg2_regs_y;
18static tilemap *bg0_tilemap, *bg1_tilemap, *bg2_tilemap;
19
20static int video_enable = 0;
21static int irq_enable = 0;
22static int bg1_bank = 0, bg2_bank = 0;
23
24static TILE_GET_INFO( get_bg1_tile_info )
25{
26   UINT8 *region = memory_region(REGION_GFX3) + 0x200000 + 0x80000 * bg1_bank;
27   int code = region[tile_index*2] + (region[tile_index*2+1] << 8);
28   SET_TILE_INFO(2, code, 0, 0);
29}
30
31static TILE_GET_INFO( get_bg2_tile_info )
32{
33   UINT8 *region = memory_region(REGION_GFX2) + 0x200000 + 0x80000 * bg2_bank;
34   int code = region[tile_index*2] + (region[tile_index*2+1] << 8);
35   SET_TILE_INFO(1, code, 0, 0);
36}
37
38static TILE_GET_INFO( get_bg0_tile_info )
39{
40   int code = bg0_videoram[tile_index*2] + (bg0_videoram[tile_index*2+1] << 8);
41   SET_TILE_INFO(0, code, 0, 0);
42}
43
44VIDEO_START( cultures )
45{
46   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,512,512);
47   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,512,512);
48   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8, 64,128);
49
50   tilemap_set_transparent_pen(bg1_tilemap,0);
51   tilemap_set_transparent_pen(bg0_tilemap,0);
52
53
54   tilemap_set_scrolldx(bg0_tilemap, 502, 10);
55   tilemap_set_scrolldx(bg1_tilemap, 502, 10);
56   tilemap_set_scrolldx(bg2_tilemap, 502, 10);
57
58   tilemap_set_scrolldy(bg0_tilemap, 255, 0);
59   tilemap_set_scrolldy(bg1_tilemap, 255, 0);
60   tilemap_set_scrolldy(bg2_tilemap, 255, 0);
61}
62
63VIDEO_UPDATE( cultures )
64{
65   int attr;
66
67   // tilemaps attributes
68
69   attr = (bg0_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (bg0_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
70   tilemap_set_flip(bg0_tilemap, attr);
71
72   attr = (bg1_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (bg1_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
73   tilemap_set_flip(bg1_tilemap, attr);
74
75   attr = (bg2_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (bg2_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
76   tilemap_set_flip(bg2_tilemap, attr);
77
78   // tilemaps scrolls
79
80   tilemap_set_scrollx(bg0_tilemap, 0, (bg0_regs_x[2] << 8) + bg0_regs_x[0]);
81   tilemap_set_scrollx(bg1_tilemap, 0, (bg1_regs_x[2] << 8) + bg1_regs_x[0]);
82   tilemap_set_scrollx(bg2_tilemap, 0, (bg2_regs_x[2] << 8) + bg2_regs_x[0]);
83   tilemap_set_scrolly(bg0_tilemap, 0, (bg0_regs_y[2] << 8) + bg0_regs_y[0]);
84   tilemap_set_scrolly(bg1_tilemap, 0, (bg1_regs_y[2] << 8) + bg1_regs_y[0]);
85   tilemap_set_scrolly(bg2_tilemap, 0, (bg2_regs_y[2] << 8) + bg2_regs_y[0]);
86
87   if (video_enable)
88   {
89      tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0);
90      tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0);
91      tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
92   }
93   else
94      fillbitmap(bitmap, get_black_pen(machine), cliprect);
95
96   return 0;
97}
98
99static WRITE8_HANDLER( cpu_bankswitch_w )
100{
101   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x4000 * (data & 0xf));
102   video_enable = ~data & 0x20;
103}
104
105static WRITE8_HANDLER( bg0_videoram_w )
106{
107   bg0_videoram[offset] = data;
108   tilemap_mark_tile_dirty(bg0_tilemap, offset >> 1);
109}
110
111static WRITE8_HANDLER( misc_w )
112{
113   static int old_bank = -1;
114   int new_bank = data & 0xf;
115
116   if(old_bank != new_bank)
117   {
118      // oki banking
119      UINT8 *src = memory_region(REGION_SOUND1) + 0x40000 + 0x20000 * new_bank;
120      UINT8 *dst = memory_region(REGION_SOUND1) + 0x20000;
121      memcpy(dst, src, 0x20000);
122
123      old_bank = new_bank;
124   }
125
126   irq_enable = data & 0x80;
127}
128
129static WRITE8_HANDLER( bg_bank_w )
130{
131   if(bg1_bank != (data & 3))
132   {
133      bg1_bank = data & 3;
134      tilemap_mark_all_tiles_dirty(bg1_tilemap);
135   }
136
137   if(bg2_bank != ((data & 0xc) >> 2))
138   {
139      bg2_bank = (data & 0xc) >> 2;
140      tilemap_mark_all_tiles_dirty(bg2_tilemap);
141   }
142
143   coin_counter_w(0,data & 0x10);
144}
145
146static ADDRESS_MAP_START( cultures_map, ADDRESS_SPACE_PROGRAM, 8 )
147   AM_RANGE(0x0000, 0x3fff) AM_ROM
148   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
149   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_WRITE(bg0_videoram_w) AM_BASE(&bg0_videoram)
150   AM_RANGE(0xc000, 0xdfff) AM_RAM
151   AM_RANGE(0xf000, 0xffff) AM_RAM
152ADDRESS_MAP_END
153
154static ADDRESS_MAP_START( cultures_io_map, ADDRESS_SPACE_IO, 8 )
155   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
156   AM_RANGE(0x00, 0x03) AM_RAM //?
157   AM_RANGE(0x10, 0x13) AM_RAM //?
158   AM_RANGE(0x20, 0x23) AM_RAM AM_BASE(&bg0_regs_x)
159   AM_RANGE(0x30, 0x33) AM_RAM AM_BASE(&bg0_regs_y)
160   AM_RANGE(0x40, 0x43) AM_RAM AM_BASE(&bg1_regs_x)
161   AM_RANGE(0x50, 0x53) AM_RAM AM_BASE(&bg1_regs_y)
162   AM_RANGE(0x60, 0x63) AM_RAM AM_BASE(&bg2_regs_x)
163   AM_RANGE(0x70, 0x73) AM_RAM AM_BASE(&bg2_regs_y)
164   AM_RANGE(0x80, 0x80) AM_WRITE(cpu_bankswitch_w)
165   AM_RANGE(0x90, 0x90) AM_WRITE(misc_w)
166   AM_RANGE(0xa0, 0xa0) AM_WRITE(bg_bank_w)
167   AM_RANGE(0xc0, 0xc0) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w)
168   AM_RANGE(0xd0, 0xd0) AM_READ(input_port_0_r)
169   AM_RANGE(0xd1, 0xd1) AM_READ(input_port_1_r)
170   AM_RANGE(0xd2, 0xd2) AM_READ(input_port_2_r)
171   AM_RANGE(0xd3, 0xd3) AM_READ(input_port_3_r)
172   AM_RANGE(0xe0, 0xe0) AM_READ(input_port_4_r)
173   AM_RANGE(0xe1, 0xe1) AM_READ(input_port_5_r)
174   AM_RANGE(0xe2, 0xe2) AM_READ(input_port_6_r)
175   AM_RANGE(0xe3, 0xe3) AM_READ(input_port_7_r)
176   AM_RANGE(0xe4, 0xe4) AM_READ(input_port_8_r)
177   AM_RANGE(0xe5, 0xe5) AM_READ(input_port_9_r)
178   AM_RANGE(0xf0, 0xf0) AM_READ(input_port_10_r)
179   AM_RANGE(0xf1, 0xf1) AM_READ(input_port_11_r)
180   AM_RANGE(0xf2, 0xf2) AM_READ(input_port_12_r)
181   AM_RANGE(0xf3, 0xf3) AM_READ(input_port_13_r)
182   AM_RANGE(0xf7, 0xf7) AM_READ(input_port_14_r)
183ADDRESS_MAP_END
184
185
186INPUT_PORTS_START( cultures )
187   PORT_START
188   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
189   PORT_DIPSETTING(    0x00, "10 Coins / 1 Credit" )
190   PORT_DIPSETTING(    0x01, DEF_STR( 5C_1C ) )
191   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
192   PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
193   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
194   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
195   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
196   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
197   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:4")
198   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
199   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
200   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
201
202   PORT_START
203   PORT_DIPNAME( 0x01, 0x01, "Auto Mode After Reach" ) PORT_DIPLOCATION("SW1:5")
204   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
205   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
206   PORT_DIPNAME( 0x02, 0x02, "Attract Mode" ) PORT_DIPLOCATION("SW1:6")
207   PORT_DIPSETTING(    0x02, "Partial" )
208   PORT_DIPSETTING(    0x00, "Full" )
209   PORT_DIPNAME( 0x04, 0x04, "Open Hands After Noten" ) PORT_DIPLOCATION("SW1:7")
210   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
211   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
212   PORT_DIPNAME( 0x08, 0x08, "Datsui Count After Continue" ) PORT_DIPLOCATION("SW1:8")
213   PORT_DIPSETTING(    0x08, "Not Cleared" )
214   PORT_DIPSETTING(    0x00, "Cleared" )
215   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
216
217   PORT_START
218   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
219   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
220   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
221   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
222   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
223   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
224   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
225   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
226   PORT_DIPNAME( 0x08, 0x08, "Game Background Music" ) PORT_DIPLOCATION("SW2:4")
227   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
228   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
229   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
230
231   PORT_START
232   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
233   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
234   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
235   PORT_DIPNAME( 0x02, 0x02, "Machihai Display" ) PORT_DIPLOCATION("SW2:6")
236   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
237   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
238   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") // "always off"
239   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
240   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
241   PORT_SERVICE_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:8" )
242   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
243
244   PORT_START //5
245   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
246   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B )
247   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C )
248   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D )
249   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
250
251   PORT_START
252   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_E )
253   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
254   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_G )
255   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_H )
256   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
257
258   PORT_START
259   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_I )
260   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_J )
261   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
262   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_L )
263   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
264
265   PORT_START
266   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M )
267   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N )
268   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
269   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
270   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
271
272   PORT_START
273   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
274   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
275   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
276   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
277
278   PORT_START
279   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
280   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
281
282   PORT_START
283   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
284
285   PORT_START
286   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
287
288   PORT_START
289   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
290
291   PORT_START
292   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
293
294   PORT_START
295   PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED )
296   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
297   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 ) // "Test"
298   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
299INPUT_PORTS_END
300
301/*** GFX Decode ***/
302
303
304static const gfx_layout gfxlayout =
305{
306   8,8,
307   RGN_FRAC(1,1),
308   8,
309   { 0,1,2,3,4,5,6,7 },
310   { 1*8, 0*8, 3*8, 2*8, 5*8, 4*8, 7*8, 6*8 },
311   { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
312   8*64,
313};
314
315GFXDECODE_START( culture )
316   GFXDECODE_ENTRY(REGION_GFX1, 0, gfxlayout, 0, 1 )
317   GFXDECODE_ENTRY(REGION_GFX2, 0, gfxlayout, 0, 1 )
318   GFXDECODE_ENTRY(REGION_GFX3, 0, gfxlayout, 0, 1 )
319GFXDECODE_END
320
321//WRONG!
322static PALETTE_INIT( cultures )
323{
324   int c;
325
326   for (c = 0; c < 256; c++)
327   {
328       int r,g,b,i;
329
330       i = c & 0x03;
331       r = ((c & 0x04) >> 0) | ((c & 0x10) >> 1) | i;
332       g = ((c & 0x20) >> 3) | ((c & 0x40) >> 3) | i;
333       b = ((c & 0x08) >> 1) | ((c & 0x80) >> 4) | i;
334
335      /*
336        r = ((c & 0x0c) >> 0)  | i;
337        g = ((c & 0x30) >> 2) | i;
338        b = ((c & 0xc0) >> 4) | i;
339*/
340
341
342       palette_set_color_rgb(machine, c, pal4bit(r), pal4bit(g), pal4bit(b));
343   }
344}
345
346
347static INTERRUPT_GEN( cultures_interrupt )
348{
349   if (irq_enable)
350      cpunum_set_input_line(0, 0, HOLD_LINE);
351}
352
353
354static MACHINE_DRIVER_START( cultures )
355
356   /* basic machine hardware */
357   MDRV_CPU_ADD(Z80, MCLK/2) /* 8.000 MHz */
358   MDRV_CPU_PROGRAM_MAP(cultures_map,0)
359   MDRV_CPU_IO_MAP(cultures_io_map,0)
360   MDRV_CPU_VBLANK_INT(cultures_interrupt,1)
361
362   MDRV_SCREEN_REFRESH_RATE(60)
363   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
364
365   /* video hardware */
366   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
367   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
368   MDRV_SCREEN_SIZE(64*8, 32*8)
369   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 30*8-1)
370   MDRV_GFXDECODE(culture)
371   MDRV_PALETTE_LENGTH(256)
372
373   MDRV_PALETTE_INIT(cultures)
374
375   MDRV_VIDEO_START(cultures)
376   MDRV_VIDEO_UPDATE(cultures)
377
378   /* sound hardware */
379   MDRV_SPEAKER_STANDARD_MONO("mono")
380
381   MDRV_SOUND_ADD(OKIM6295, (MCLK/1024)*132)
382   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
383   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
384MACHINE_DRIVER_END
385
386/*
387
388Jibun wo Migaku cultures School Mahjon Hen
389(c)1994 Face
390
391CPU: Z80
392Sound: M6295
393OSC: 16.000MHz
394EEPROM: 93C46
395Custom: FACE AV44 4HA0G (x3)
396
397ROMs:
398MA01.U12
399PCM.U87
400BG0C.U45
401BG0C2.U46
402BG1C.U80
403BG1T.U67
404BG2C.U68
405BG2T.U79
406
407-----mahjong connector-----
408                      empty
409amp OSC               BG0C
4106295 GAL              BG0C2
411G PCM     SS        S
412A MA01 G  RR        R
413L      A  AA        A
414 Z80   L  MM custom M
415
416D GGG
417I AAA
418P LLL
419D
420I custom BG2C         BG1C
421P custom      custom
42293C46    BG1T         BG2T
423
424*/
425
426ROM_START( cultures )
427   ROM_REGION( 0x40000, REGION_CPU1, 0 )
428   ROM_LOAD( "ma01.u12",     0x000000, 0x040000, CRC(f57417b3) SHA1(9a2a50222f54e5da9bc5c66863b8be16e33b171f) )
429
430   ROM_REGION( 0x300000, REGION_GFX1, 0 )
431   ROM_LOAD( "bg0c.u45",     0x000000, 0x200000, CRC(ad2e1263) SHA1(b28a3d82aaa0421a7b4df837814147b109e7d1a5) )
432   ROM_LOAD( "bg0c2.u46",    0x200000, 0x100000, CRC(97c71c09) SHA1(ffbcee1d9cb39d0824f3aa652c3a24579113cf2e) )
433
434   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_ERASE00 )
435   ROM_LOAD( "bg1c.u80",     0x000000, 0x200000, CRC(9ab99bd9) SHA1(bce41b6f5d83c8262ba8d37b2dfcd5d7a5e7ace7) )
436   ROM_LOAD( "bg2t.u79",     0x200000, 0x100000, CRC(0610a79f) SHA1(9fc6b2e5c573ed682b2f7fa462c8f42ff99da5ba) )
437   /* 0x300000 - 0x3fffff empty */
438
439   ROM_REGION( 0x400000, REGION_GFX3, ROMREGION_ERASE00 )
440   ROM_LOAD( "bg2c.u68",     0x000000, 0x200000, CRC(fa598644) SHA1(532249e456c34f18a787d5a028df82f2170f604d) )
441   ROM_LOAD( "bg1t.u67",     0x200000, 0x100000, CRC(d2e594ee) SHA1(a84b5ab62dec1867d433ccaeb1381e7593958cf0) )
442   /* 0x300000 - 0x3fffff empty */
443
444   ROM_REGION( 0x240000, REGION_SOUND1, 0 )
445   ROM_LOAD( "pcm.u87",      0x040000, 0x200000, CRC(84206475) SHA1(d1423bd5c7425e121fb4e7845cf57801e9afa7b3) )
446   ROM_RELOAD(               0x000000, 0x020000 )
447ROM_END
448
449GAME( 1994, cultures, 0, cultures, cultures, 0, ROT0, "Face", "Jibun wo Migaku cultures School Mahjon Hen", GAME_WRONG_COLORS )
src/mame/drivers/powerins.c
r1051r1052
308308};
309309
310310
311static const gfx_decode powerins_gfxdecodeinfo[] =
312{
313   { REGION_GFX1, 0, &layout_16x16x4,      0x000, 0x20 }, // [0] Tiles
314   { REGION_GFX2, 0, &layout_8x8x4,        0x200, 0x10 }, // [1] Tiles
315   { REGION_GFX3, 0, &layout_16x16x4_swap, 0x400, 0x40 }, // [2] Sprites
316   { -1 }
317};
311static GFXDECODE_START( powerins )
312   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,      0x000, 0x20 ) // [0] Tiles
313   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,        0x200, 0x10 ) // [1] Tiles
314   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x4_swap, 0x400, 0x40 ) // [2] Sprites
315GFXDECODE_END
318316
319317
320318
r1051r1052
366364   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
367365   MDRV_SCREEN_SIZE(320, 256)
368366   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0+16, 256-16-1)
369   MDRV_GFXDECODE(powerins_gfxdecodeinfo)
367   MDRV_GFXDECODE(powerins)
370368   MDRV_PALETTE_LENGTH(2048)
371369
372370   MDRV_VIDEO_START(powerins)
src/mame/drivers/exedexes.c
r1051r1052
210210
211211
212212
213static const gfx_decode gfxdecodeinfo[] =
214{
215   { REGION_GFX1, 0, &charlayout,              0, 64 },
216   { REGION_GFX2, 0, &tilelayout,           64*4, 64 }, /* 32x32 Tiles */
217   { REGION_GFX3, 0, &spritelayout,       2*64*4, 16 }, /* 16x16 Tiles */
218   { REGION_GFX4, 0, &spritelayout, 2*64*4+16*16, 16 }, /* Sprites */
219   { -1 }
220};
213static GFXDECODE_START( exedexes )
214   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,              0, 64 )
215   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,           64*4, 64 ) /* 32x32 Tiles */
216   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,       2*64*4, 16 ) /* 16x16 Tiles */
217   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 2*64*4+16*16, 16 ) /* Sprites */
218GFXDECODE_END
221219
222220
223221
r1051r1052
241239   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
242240   MDRV_SCREEN_SIZE(32*8, 32*8)
243241   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
244   MDRV_GFXDECODE(gfxdecodeinfo)
242   MDRV_GFXDECODE(exedexes)
245243   MDRV_PALETTE_LENGTH(256)
246244   MDRV_COLORTABLE_LENGTH(64*4+64*4+16*16+16*16)
247245
src/mame/drivers/jedi.c
r1051r1052
499499};
500500
501501
502static const gfx_decode gfxdecodeinfo[] =
503{
504   { REGION_GFX1, 0, &charlayout,     0, 1 },
505   { REGION_GFX2, 0, &pflayout,     0, 1 },
506   { REGION_GFX3, 0, &spritelayout,  0, 1 },
507   { -1 }
508};
502static GFXDECODE_START( jedi )
503   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 1 )
504   GFXDECODE_ENTRY( REGION_GFX2, 0, pflayout,     0, 1 )
505   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  0, 1 )
506GFXDECODE_END
509507
510508
511509
r1051r1052
536534   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
537535   MDRV_SCREEN_SIZE(37*8, 262) /* verify vert size */
538536   MDRV_SCREEN_VISIBLE_AREA(0*8, 37*8-1, 0*8, 30*8-1)
539   MDRV_GFXDECODE(gfxdecodeinfo)
537   MDRV_GFXDECODE(jedi)
540538   MDRV_PALETTE_LENGTH(1024+1)
541539
542540   MDRV_VIDEO_START(jedi)
src/mame/drivers/bfm_sc2.c
r1051r1052
30653065   MDRV_PALETTE_LENGTH(16)
30663066   MDRV_COLORTABLE_LENGTH(16)
30673067   MDRV_PALETTE_INIT(adder2)
3068   MDRV_GFXDECODE(adder2_gfxdecodeinfo)
3068   MDRV_GFXDECODE(adder2)
30693069
30703070   MDRV_CPU_ADD_TAG("adder2", M6809, 2000000 )         // adder2 board 6809 CPU at 2 Mhz
30713071   MDRV_CPU_PROGRAM_MAP(adder2_memmap,0)            // setup adder2 board memorymap
src/mame/drivers/suprnova.c
r1051r1052
919919   16*16*4
920920};
921921
922static const gfx_decode skns_bg_decode[] =
923{
922static GFXDECODE_START( skns_bg )
924923   /* REGION_GFX1 is sprites, RLE encoded */
925   { REGION_GFX2, 0, &skns_tilemap_layout, 0x000, 128 },
926   { REGION_GFX3, 0, &skns_tilemap_layout, 0x000, 128 },
927   { REGION_GFX2, 0, &skns_4bpptilemap_layout, 0x000, 128 },
928   { REGION_GFX3, 0, &skns_4bpptilemap_layout, 0x000, 128 },
929   { -1 }
930};
924   GFXDECODE_ENTRY( REGION_GFX2, 0, skns_tilemap_layout, 0x000, 128 )
925   GFXDECODE_ENTRY( REGION_GFX3, 0, skns_tilemap_layout, 0x000, 128 )
926   GFXDECODE_ENTRY( REGION_GFX2, 0, skns_4bpptilemap_layout, 0x000, 128 )
927   GFXDECODE_ENTRY( REGION_GFX3, 0, skns_4bpptilemap_layout, 0x000, 128 )
928GFXDECODE_END
931929
932930/***** MACHINE DRIVER *****/
933931
r1051r1052
953951   MDRV_SCREEN_SIZE(64*16,64*16)
954952   MDRV_SCREEN_VISIBLE_AREA(0,319,0,239)
955953   MDRV_PALETTE_LENGTH(32768)
956   MDRV_GFXDECODE(skns_bg_decode)
954   MDRV_GFXDECODE(skns_bg)
957955
958956   MDRV_VIDEO_START(skns)
959957   MDRV_VIDEO_EOF(skns)
src/mame/drivers/seta2.c
r1051r1052
3030P0-142A + extra parts   2000    Penguin Brothers                        Subsino
3131B0-003B                 2000    Deer Hunting USA                        Sammy
3232B0-003B                 2001    Turkey Hunting USA                      Sammy
33B0-003B?                2001    Wing Shooting Championship              Sammy
34B0-003B?                2002    Trophy Hunting - Bear & Moose           Sammy
33B0-010A                 2001    Wing Shooting Championship              Sammy
34B0-010A                 2002    Trophy Hunting - Bear & Moose           Sammy
3535-------------------------------------------------------------------------------------------
3636
3737TODO:
r1051r1052
181181
182182Sammy USA Outdoor Shooting Series PCB
183183
184Deer Hunting USA (c) 2000 Sammy USA
185Turkey Hunting USA (c) 2001 Sammy USA
184PCB B0-003B:
185   Deer Hunting USA (c) 2000 Sammy USA
186   Turkey Hunting USA (c) 2001 Sammy USA
186187
187Wing Shooting Championship (c) 2001 Sammy USA*
188Trophy Hunting - Bear & Moose (c) 2002 Sammy USA*
188PCB B0-010A:
189   Wing Shooting Championship (c) 2001 Sammy USA
190   Trophy Hunting - Bear & Moose (c) 2002 Sammy USA
189191
190* Slightly different PCB then listed below.  Two Player input / connection ports
191192
192193   CPU: Toshiba TMP68301AF-16 (100 Pin PQFP)
193194 Video: NEC DX-101 (240 Pin PQFP)
r1051r1052
197198   OSC: 50MHz & 28MHz
198199 Other: 8 Position Dipswitch x 2
199200        Lattice ispLSI2032
200        Lattice isp1016E
201        Lattice isp1016E (2 for PCB B0-010A, used for light gun input)
202        BAT1 - CR2032 3Volt
201203
202204PCB Number: B0-003B
203205+-----------------------------------------------------------+
r1051r1052
227229|                               +----------+                |
228230|                                                           |
229231|                             +---+      +---++---++---+    |
230|                             |   |      |   ||   ||   |    |
231|     +---+        28MHz      |   |      |   ||   ||   |    |
232|                  28MHz      |   |      |   ||   ||   |    |
233|     +---+                   |   |      |   ||   ||   |    |
232234+-+   |DX |                   | U |      | U || U || U |    |
233235  |   |102|                   | 4 |      | 4 || 3 || 3 |    |
234236+-+   +---+                   | 0 |      | 1 || 8 || 9 |    |
r1051r1052
237239|                             +---+      +---++---++---+    |
238240+-----------------------------------------------------------+
239241
242PCB Number: B0-010A - This PCB is slightly revised for 2 player play
243+-----------------------------------------------------------+
244|             VOL                          +------+         |
245|                                          |X1-010|     M1  |
246|   +---+ +---+                            |M60016|         |
247|   |   | |   |  M    M                    |CALRUA|  +---+  |
248+-+ | U | | U |  2    1                    +------+  |   |  |
249  | | 0 | | 0 |                                      |   |  |
250+-+ | 7 | | 6 |  M    M                              | U |  |
251|   |   | |   |  2    1                              | 1 |  |
252|   +---+ +---+                                      | 8 |  |
253|                                          Lattice   |   |  |
254|   D +---+  C                            ispLSI2032 |   |  |
255|   S |DX |  N   BAT1           +-------+            +---+  |
256|   W |102|  5                  |Toshiba|  D                |
257|   1 +---+                     |  TMP  |  S EEPROM       C |
258|            C                  | 68301 |  W              N |
259|            N  Lattice         +-------+  2              2 |
260|            6  isp1016E                                    |
261|                               +----------+    50MHz       |
262|     +---+                     |          |                |
263|     |DX |  SW1                |   NEC    |    M   M       |
264|     |102|                     |  DX-101  |    3   3       |
265|     +---+         M  M        |          |                |
266|                   1  1        |          |                |
267|                               +----------+                |
268|                                                           |
269|                             +---+      +---++---++---+    |
270|                  28MHz      |   |      |   ||   ||   |    |
271|     +---+              C    |   |      |   ||   ||   |    |
272+-+   |DX |              N    | U |      | U || U || U |    |
273  |   |102|              7    | 4 |      | 4 || 3 || 3 |    |
274+-+   +---+                   | 0 |      | 1 || 8 || 9 |    |
275|             Lattice    C    |   |      |   ||   ||   |    |
276|             isp1016E   N    |   |      |   ||   ||   |    |
277|                        8    +---+      +---++---++---+    |
278+-----------------------------------------------------------+
279
240280Ram M1 are Toshiba TC55257DFL-70L
241281Ram M2 are NEC D43001GU-70L
242282Ram M3 are ISSI IS62C1024L-70Q
r1051r1052
16611701
16621702/*  Tiles are 8bpp, but the hardware is additionally able to discard
16631703    some bitplanes and use the low 4 bits only, or the high 4 bits only */
1664static const gfx_decode gfxdecodeinfo[] =
1665{
1666   { REGION_GFX1, 0, &layout_4bpp_lo, 0, 0x8000/16 },
1667   { REGION_GFX1, 0, &layout_4bpp_hi, 0, 0x8000/16 },
1668   { REGION_GFX1, 0, &layout_6bpp,    0, 0x8000/16 },   /* 6bpp, but 4bpp granularity */
1669   { REGION_GFX1, 0, &layout_8bpp,    0, 0x8000/16 },   /* 8bpp, but 4bpp granularity */
1670   { REGION_GFX1, 0, &layout_3bpp_lo, 0, 0x8000/16 },   /* 3bpp, but 4bpp granularity */
1671   { REGION_GFX1, 0, &layout_2bpp_hi, 0, 0x8000/16 },   /* ??? */
1672   { -1 }
1673};
1704static GFXDECODE_START( seta2 )
1705   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_4bpp_lo, 0, 0x8000/16 )
1706   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_4bpp_hi, 0, 0x8000/16 )
1707   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_6bpp,    0, 0x8000/16 )   /* 6bpp, but 4bpp granularity */
1708   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8bpp,    0, 0x8000/16 )   /* 8bpp, but 4bpp granularity */
1709   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_3bpp_lo, 0, 0x8000/16 )   /* 3bpp, but 4bpp granularity */
1710   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_2bpp_hi, 0, 0x8000/16 )   /* ??? */
1711GFXDECODE_END
16741712
16751713
16761714/***************************************************************************
r1051r1052
17261764   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17271765   MDRV_SCREEN_SIZE(0x200, 0x200)
17281766   MDRV_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1)
1729   MDRV_GFXDECODE(gfxdecodeinfo)
1767   MDRV_GFXDECODE(seta2)
17301768   MDRV_PALETTE_LENGTH(0x8000)
17311769
17321770   MDRV_VIDEO_START(seta2)
r1051r1052
21132151GAME( 2000, deerhuna, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.2",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
21142152GAME( 2000, deerhunb, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.0",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
21152153GAME( 2001, turkhunt, 0,        samshoot, turkhunt, 0, ROT0, "Sammy USA Corporation", "Turkey Hunting USA V1.0",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2116GAME( 2001, wschamp,  0,        samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V2.0",              GAME_IMPERFECT_GRAPHICS )
2117GAME( 2001, wschampa, wschamp,  samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.01",             GAME_IMPERFECT_GRAPHICS )
2118GAME( 2002, trophyh,  0,        samshoot, trophyh,  0, ROT0, "Sammy USA Corporation", "Trophy Hunting - Bear & Moose V1.0",           0 )
2154GAME( 2001, wschamp,  0,        samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V2.0",              GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2155GAME( 2001, wschampa, wschamp,  samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.01",             GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2156GAME( 2002, trophyh,  0,        samshoot, trophyh,  0, ROT0, "Sammy USA Corporation", "Trophy Hunting - Bear & Moose V1.0",           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/witch.c
r1051r1052
672672   16*8
673673};
674674
675static const gfx_decode gfxdecodeinfo[] =
676{
677   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
678   { REGION_GFX2, 0, &tiles8x8_layout, 0, 16 },
679   { -1 }
680};
675static GFXDECODE_START( witch )
676   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
677   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout, 0, 16 )
678GFXDECODE_END
681679
682680VIDEO_START(witch)
683681{
r1051r1052
788786   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
789787   MDRV_SCREEN_SIZE(256, 256)
790788   MDRV_SCREEN_VISIBLE_AREA(8, 256-1-8, 8*4, 256-8*4-1)
791   MDRV_GFXDECODE(gfxdecodeinfo)
789   MDRV_GFXDECODE(witch)
792790   MDRV_PALETTE_LENGTH(0x800)
793791
794792   MDRV_VIDEO_START(witch)
src/mame/drivers/flkatck.c
r1051r1052
250250   32*8
251251};
252252
253static const gfx_decode gfxdecodeinfo[] =
254{
255   { REGION_GFX1, 0, &gfxlayout, 0, 32 },
256   { -1 }
257};
253static GFXDECODE_START( flkatck )
254   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout, 0, 32 )
255GFXDECODE_END
258256
259257static void volume_callback0(int v)
260258{
r1051r1052
290288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
291289   MDRV_SCREEN_SIZE(37*8, 32*8)
292290   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
293   MDRV_GFXDECODE(gfxdecodeinfo)
291   MDRV_GFXDECODE(flkatck)
294292   MDRV_PALETTE_LENGTH(512)
295293
296294   MDRV_VIDEO_START(flkatck)
src/mame/drivers/namcofl.c
r1051r1052
304304   16*128
305305};
306306
307static const gfx_decode gfxdecodeinfo2[] =
308{
309   { NAMCONB1_TILEGFXREGION,   0, &tile_layout,   0x1000, 0x08 },
310   { NAMCONB1_SPRITEGFXREGION,   0, &obj_layout,      0x0000, 0x10 },
311   { NAMCONB1_ROTGFXREGION,   0, &roz_layout,      0x1800, 0x08 },
312   { -1 }
313};
307static GFXDECODE_START( 2 )
308   GFXDECODE_ENTRY( NAMCONB1_TILEGFXREGION,   0, tile_layout,   0x1000, 0x08 )
309   GFXDECODE_ENTRY( NAMCONB1_SPRITEGFXREGION,   0, obj_layout,      0x0000, 0x10 )
310   GFXDECODE_ENTRY( NAMCONB1_ROTGFXREGION,   0, roz_layout,      0x1800, 0x08 )
311GFXDECODE_END
314312
315313
316314static TIMER_CALLBACK( network_interrupt_callback )
r1051r1052
369367   MDRV_SCREEN_VISIBLE_AREA(0, NAMCONB1_HBSTART-1, 0, NAMCONB1_VBSTART-1)
370368   MDRV_PALETTE_LENGTH(8192)
371369
372   MDRV_GFXDECODE(gfxdecodeinfo2)
370   MDRV_GFXDECODE(2)
373371
374372   MDRV_VIDEO_START(namcofl)
375373   MDRV_VIDEO_UPDATE(namcofl)
src/mame/drivers/shootout.c
r1051r1052
256256   8*8 /* every char takes 8 consecutive bytes */
257257};
258258
259static const gfx_decode gfxdecodeinfo[] =
260{
261   { REGION_GFX1, 0, &char_layout,   16*4+8*8, 16 }, /* characters */
262   { REGION_GFX2, 0, &sprite_layout, 16*4,     8 }, /* sprites */
263   { REGION_GFX3, 0, &tile_layout,   0,      16 }, /* tiles */
264   { -1 }
265};
259static GFXDECODE_START( shootout )
260   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,   16*4+8*8, 16 ) /* characters */
261   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 16*4,     8 ) /* sprites */
262   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,   0,      16 ) /* tiles */
263GFXDECODE_END
266264
267265static void shootout_snd_irq(int linestate)
268266{
r1051r1052
320318   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
321319   MDRV_SCREEN_SIZE(32*8, 32*8)
322320   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
323   MDRV_GFXDECODE(gfxdecodeinfo)
321   MDRV_GFXDECODE(shootout)
324322   MDRV_PALETTE_LENGTH(256)
325323
326324   MDRV_PALETTE_INIT(shootout)
r1051r1052
351349   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
352350   MDRV_SCREEN_SIZE(32*8, 32*8)
353351   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
354   MDRV_GFXDECODE(gfxdecodeinfo)
352   MDRV_GFXDECODE(shootout)
355353   MDRV_PALETTE_LENGTH(256)
356354
357355   MDRV_PALETTE_INIT(shootout)
src/mame/drivers/contra.c
r1051r1052
236236   32*8
237237};
238238
239static const gfx_decode gfxdecodeinfo[] =
240{
241   { REGION_GFX1, 0, &gfxlayout,       0, 8*16 },
242   { REGION_GFX2, 0, &gfxlayout, 8*16*16, 8*16 },
243   { -1 }
244};
239static GFXDECODE_START( contra )
240   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout,       0, 8*16 )
241   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout, 8*16*16, 8*16 )
242GFXDECODE_END
245243
246244
247245
r1051r1052
265263   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
266264   MDRV_SCREEN_SIZE(37*8, 32*8)
267265   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
268   MDRV_GFXDECODE(gfxdecodeinfo)
266   MDRV_GFXDECODE(contra)
269267   MDRV_PALETTE_LENGTH(128)
270268   MDRV_COLORTABLE_LENGTH(2*8*16*16)
271269
src/mame/drivers/paradise.c
r1051r1052
506506   128*8
507507};
508508
509static const gfx_decode paradise_gfxdecodeinfo[] =
510{
511   { REGION_GFX1, 0, &layout_16x16x8,   0x100, 1  }, // [0] Sprites
512   { REGION_GFX2, 0, &layout_8x8x4,   0x400, 16 }, // [1] Background
513   { REGION_GFX3, 0, &layout_8x8x8,   0x300, 1  }, // [2] Midground
514   { REGION_GFX4, 0, &layout_8x8x8,   0x000, 1  }, // [3] Foreground
515   { -1 }
516};
509static GFXDECODE_START( paradise )
510   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8,   0x100, 1  ) // [0] Sprites
511   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x400, 16 ) // [1] Background
512   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x8,   0x300, 1  ) // [2] Midground
513   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,   0x000, 1  ) // [3] Foreground
514GFXDECODE_END
517515
518static const gfx_decode torus_gfxdecodeinfo[] =
519{
520   { REGION_GFX1, 0, &torus_layout_16x16x8, 0x100, 1  }, // [0] Sprites
521   { REGION_GFX2, 0, &layout_8x8x4,        0x400, 16 }, // [1] Background
522   { REGION_GFX3, 0, &layout_8x8x8,        0x300, 1  }, // [2] Midground
523   { REGION_GFX4, 0, &layout_8x8x8,        0x000, 1  }, // [3] Foreground
524   { -1 }
525};
516static GFXDECODE_START( torus )
517   GFXDECODE_ENTRY( REGION_GFX1, 0, torus_layout_16x16x8, 0x100, 1  ) // [0] Sprites
518   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,        0x400, 16 ) // [1] Background
519   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x8,        0x300, 1  ) // [2] Midground
520   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,        0x000, 1  ) // [3] Foreground
521GFXDECODE_END
526522
527static const gfx_decode madball_gfxdecodeinfo[] =
528{
529   { REGION_GFX1, 0, &torus_layout_16x16x8, 0x500, 1  }, // [0] Sprites
530   { REGION_GFX2, 0, &layout_8x8x4,        0x400, 16 }, // [1] Background
531   { REGION_GFX3, 0, &layout_8x8x8,        0x300, 1  }, // [2] Midground
532   { REGION_GFX4, 0, &layout_8x8x8,        0x000, 1  }, // [3] Foreground
533   { -1 }
534};
523static GFXDECODE_START( madball )
524   GFXDECODE_ENTRY( REGION_GFX1, 0, torus_layout_16x16x8, 0x500, 1  ) // [0] Sprites
525   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,        0x400, 16 ) // [1] Background
526   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x8,        0x300, 1  ) // [2] Midground
527   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,        0x000, 1  ) // [3] Foreground
528GFXDECODE_END
535529
536530/***************************************************************************
537531
r1051r1052
555549   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
556550   MDRV_SCREEN_SIZE(256, 256)
557551   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-1-16)
558   MDRV_GFXDECODE(paradise_gfxdecodeinfo)
552   MDRV_GFXDECODE(paradise)
559553   MDRV_PALETTE_LENGTH(0x800 + 16)
560554
561555   MDRV_VIDEO_START(paradise)
r1051r1052
586580   MDRV_CPU_MODIFY("main")
587581   MDRV_CPU_PROGRAM_MAP(torus_map,0)
588582
589   MDRV_GFXDECODE(torus_gfxdecodeinfo)
583   MDRV_GFXDECODE(torus)
590584
591585   MDRV_VIDEO_UPDATE(torus)
592586
r1051r1052
599593   MDRV_CPU_MODIFY("main")
600594   MDRV_CPU_PROGRAM_MAP(torus_map,0)
601595
602   MDRV_GFXDECODE(madball_gfxdecodeinfo)
596   MDRV_GFXDECODE(madball)
603597
604598   MDRV_VIDEO_UPDATE(madball)
605599
src/mame/drivers/volfied.c
r1051r1052
224224   128*8
225225};
226226
227static const gfx_decode gfxdecodeinfo[] =
228{
229   { REGION_GFX1, 0, &tilelayout, 4096, 256 },
230   { -1 }
231};
227static GFXDECODE_START( volfied )
228   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 4096, 256 )
229GFXDECODE_END
232230
233231
234232/**************************************************************
r1051r1052
280278   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
281279   MDRV_SCREEN_SIZE(320, 256)
282280   MDRV_SCREEN_VISIBLE_AREA(0, 319, 8, 247)
283   MDRV_GFXDECODE(gfxdecodeinfo)
281   MDRV_GFXDECODE(volfied)
284282   MDRV_PALETTE_LENGTH(8192)
285283
286284   MDRV_VIDEO_START(volfied)
src/mame/drivers/frogger.c
r1051r1052
3535};
3636
3737
38static gfx_decode frogger_gfxdecodeinfo[] =
39{
40   { REGION_GFX1, 0x0000, &frogger_charlayout,   0, 8 },
41   { REGION_GFX1, 0x0000, &frogger_spritelayout, 0, 8 },
42   { -1 }
43};
38static GFXDECODE_START( frogger )
39   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, frogger_charlayout,   0, 8 )
40   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, frogger_spritelayout, 0, 8 )
41GFXDECODE_END
4442
4543
4644static READ8_HANDLER(frogger_ppi8255_0_r)
r1051r1052
225223   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
226224INPUT_PORTS_END
227225
228struct AY8910interface frogger_ay8910_interface =
226static struct AY8910interface frogger_ay8910_interface =
229227{
230228   soundlatch_r,
231229   frogger_portB_r
r1051r1052
252250   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
253251   MDRV_SCREEN_SIZE(32*8, 32*8)
254252   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
255   MDRV_GFXDECODE(frogger_gfxdecodeinfo)
253   MDRV_GFXDECODE(frogger)
256254   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 1 for background */
257255
258256   MDRV_PALETTE_INIT(frogger)
src/mame/drivers/megadriv.c
r1051r1052
153153   //  logerror("z80 bank set to %08x\n",genz80.z80_bank_addr);
154154
155155   }
156
157156}
158157
159158WRITE16_HANDLER( megadriv_68k_z80_bank_write )
r1051r1052
18511850                ((megadrive_io_ctrl_regs[portnum]&0x01)?(megadrive_io_data_regs[portnum]&0x01):(UP_BUTTON(portnum)<<0));
18521851   }
18531852
1853   return retdata;
1854}
18541855
1856/* used by megatech bios, the test mode accesses the joypad/stick inputs like this */
1857UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl)
1858{
1859   UINT8 retdata;
18551860
1861   if (ctrl==0x55)
1862   {
1863         retdata = (1<<0) |
1864                 (1<<1) |
1865                 (A_BUTTON(1)<<2) |
1866                 (1<<3) |
1867                 (A_BUTTON(0)<<4) |
1868                 (1<<5) |
1869                 (1<<6) |
1870                 (1<<7);
1871   }
1872   else
1873   {
1874      if (offset==0)
1875      {
1876         retdata = (UP_BUTTON(0)<<0) |
1877                 (DOWN_BUTTON(0)<<1) |
1878                 (LEFT_BUTTON(0)<<2) |
1879                 (RIGHT_BUTTON(0)<<3) |
1880                 (B_BUTTON(0)<<4) |
1881                 (C_BUTTON(0)<<5) |
1882                 (UP_BUTTON(1)<<6) |
1883                 (DOWN_BUTTON(1)<<7);
1884      }
1885      else
1886      {
1887         retdata = (LEFT_BUTTON(1)<<0) |
1888                 (RIGHT_BUTTON(1)<<1) |
1889                 (B_BUTTON(1)<<2) |
1890                 (C_BUTTON(1)<<3) |
1891                 (1<<4) |
1892                 (1<<5) |
1893                 (1<<6) |
1894                 (1<<7);
1895      }
1896
1897   }
1898
18561899   return retdata;
18571900}
18581901
1902/* the SMS inputs should be more complex, like the megadrive ones */
1903READ8_HANDLER (megatech_sms_ioport_dc_r)
1904{
1905   return (DOWN_BUTTON(1)  << 7) |
1906         (UP_BUTTON(1)    << 6) |
1907         (B_BUTTON(0)     << 5) | // TR-A
1908         (A_BUTTON(0)     << 4) | // TL-A
1909         (RIGHT_BUTTON(0) << 3) |
1910         (LEFT_BUTTON(0)  << 2) |
1911         (DOWN_BUTTON(0)  << 1) |
1912         (UP_BUTTON(0)    << 0);
1913}
1914
1915READ8_HANDLER (megatech_sms_ioport_dd_r)
1916{
1917   return (0               << 7) | // TH-B
1918         (0               << 6) | // TH-A
1919         (0               << 5) | // unused
1920         (1               << 4) | // RESET button
1921         (B_BUTTON(1)     << 3) | // TR-B
1922         (A_BUTTON(1)     << 2) | // TL-B
1923         (RIGHT_BUTTON(1) << 1) |
1924         (LEFT_BUTTON(1)  << 0);
1925}
1926
18591927UINT8 megadrive_io_read_ctrl_port(int portnum)
18601928{
18611929   UINT8 retdata;
r1051r1052
23732441   return 0xff;
23742442}
23752443
2444static ADDRESS_MAP_START( z80_portmap, ADDRESS_SPACE_IO, 8 )
2445   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
2446   AM_RANGE(0x0000 , 0xff) AM_NOP
2447ADDRESS_MAP_END
2448
23762449static ADDRESS_MAP_START( z80_readmem, ADDRESS_SPACE_PROGRAM, 8 )
23772450
23782451   AM_RANGE(0x0000 , 0x1fff) AM_READ(MRA8_BANK1) AM_MIRROR(0x2000) // RAM can be accessed by the 68k
r1051r1052
43534426
43544427}
43554428
4429void megadriv_stop_scanline_timer(void)
4430{
4431   mame_timer_adjust(scanline_timer,  time_never, 0, time_never);
4432}
4433
43564434/*
43574435 999999999999999960
435844361000000000000000000 subseconds = 1 second
r1051r1052
45484626
45494627   MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK / 15) /* 3.58 MHz */
45504628   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
4629   MDRV_CPU_IO_MAP(z80_portmap,0)
45514630   /* IRQ handled via the timers */
45524631
45534632   MDRV_MACHINE_RESET(megadriv)
r1051r1052
47074786}
47084787
47094788
4789/* used by megatech */
4790static READ8_HANDLER( z80_unmapped_port_r )
4791{
4792//  printf("unmapped z80 port read %04x\n",offset);
4793   return 0;
4794}
4795
4796static WRITE8_HANDLER( z80_unmapped_port_w )
4797{
4798//  printf("unmapped z80 port write %04x\n",offset);
4799}
4800
4801static READ8_HANDLER( z80_unmapped_r )
4802{
4803   printf("unmapped z80 read %04x\n",offset);
4804   return 0;
4805}
4806
4807static WRITE8_HANDLER( z80_unmapped_w )
4808{
4809   printf("unmapped z80 write %04x\n",offset);
4810}
4811
4812
4813/* sets the megadrive z80 to it's normal ports / map */
4814void megatech_set_megadrive_z80_as_megadrive_z80(void)
4815{
4816   /* INIT THE PORTS *********************************************************************************************/
4817   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r);
4818   memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_w);
4819
4820   /* catch any addresses that don't get mapped */
4821   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r);
4822   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w);
4823
4824
4825   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, MRA8_BANK1);
4826   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, MWA8_BANK1);
4827   memory_set_bankptr( 1, genz80.z80_prgram );
4828
4829   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, MRA8_BANK6);
4830   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, MWA8_BANK6);
4831   memory_set_bankptr( 6, genz80.z80_prgram );
4832
4833
4834   // not allowed??
4835//  memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, MRA8_BANK1);
4836//  memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, MWA8_BANK1);
4837
4838   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_read);
4839   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x6100, 0x7eff, 0, 0, megadriv_z80_unmapped_read);
4840   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_read);
4841   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_read_68k_banked_data);
4842
4843   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_write);
4844   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_write);
4845
4846   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, megadriv_z80_z80_bank_w);
4847   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6001, 0x6001, 0, 0, megadriv_z80_z80_bank_w);
4848
4849   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_write_68k_banked_data);
4850}
4851
src/mame/drivers/mexico86.c
r1051r1052
351351   16*8
352352};
353353
354static const gfx_decode gfxdecodeinfo[] =
355{
356   { REGION_GFX1, 0, &charlayout,   0, 16 },
357   { -1 }
358};
354static GFXDECODE_START( mexico86 )
355   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
356GFXDECODE_END
359357
360358
361359
r1051r1052
395393   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
396394   MDRV_SCREEN_SIZE(32*8, 32*8)
397395   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
398   MDRV_GFXDECODE(gfxdecodeinfo)
396   MDRV_GFXDECODE(mexico86)
399397   MDRV_PALETTE_LENGTH(256)
400398
401399   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/megadriv.h
r1051r1052
1515extern UINT16* megadriv_backupram;
1616extern int megadriv_backupram_length;
1717extern UINT16* megadrive_ram;
18extern UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl);
19extern void megadriv_stop_scanline_timer(void);
1820
21void megatech_set_megadrive_z80_as_megadrive_z80(void);
22
23extern READ8_HANDLER (megatech_sms_ioport_dc_r);
24extern READ8_HANDLER (megatech_sms_ioport_dd_r);
25
26
src/mame/drivers/chaknpop.c
r1051r1052
276276   8*8   /* every char takes 8 consecutive bytes */
277277};
278278
279static const gfx_decode gfxdecodeinfo[] =
280{
281   { REGION_GFX1, 0, &spritelayout, 0,  8 },
282   { REGION_GFX2, 0, &charlayout,   32, 8 },
283   { -1 }
284};
279static GFXDECODE_START( chaknpop )
280   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0,  8 )
281   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   32, 8 )
282GFXDECODE_END
285283
286284static MACHINE_DRIVER_START( chaknpop )
287285
r1051r1052
303301   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
304302   MDRV_SCREEN_SIZE(32*8, 32*8)
305303   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
306   MDRV_GFXDECODE(gfxdecodeinfo)
304   MDRV_GFXDECODE(chaknpop)
307305   MDRV_PALETTE_LENGTH(1024)
308306
309307   MDRV_PALETTE_INIT(chaknpop)
src/mame/drivers/fitfight.c
r1051r1052
727727   16*16
728728};
729729
730static const gfx_decode gfxdecodeinfo[] =
731{
732   { REGION_GFX1, 0, &fof_tile_layout,   0x000, 256  }, /* tx tiles */
733   { REGION_GFX1, 0, &fof_tile_layout,   0x200, 256  }, /* mid tiles */
734   { REGION_GFX1, 0, &fof_tile_layout,   0x400, 256  }, /* bg tiles */
735   { REGION_GFX2, 0, &fof_sprite_layout, 0x600, 256  }, /* sprites */
730static GFXDECODE_START( fitfight )
731   GFXDECODE_ENTRY( REGION_GFX1, 0, fof_tile_layout,   0x000, 256  ) /* tx tiles */
732   GFXDECODE_ENTRY( REGION_GFX1, 0, fof_tile_layout,   0x200, 256  ) /* mid tiles */
733   GFXDECODE_ENTRY( REGION_GFX1, 0, fof_tile_layout,   0x400, 256  ) /* bg tiles */
734   GFXDECODE_ENTRY( REGION_GFX2, 0, fof_sprite_layout, 0x600, 256  ) /* sprites */
736735
737   { -1 }
738};
736GFXDECODE_END
739737
740static const gfx_decode prot_gfxdecodeinfo[] =
741{
742   { REGION_GFX1, 0, &fof_tile_layout,     0x0000, 256  }, /* tx tiles */
743   { REGION_GFX1, 0, &fof_tile_layout,     0x0800, 256  }, /* mid tiles */
744   { REGION_GFX1, 0, &fof_tile_layout,     0x1000, 256  }, /* bg tiles */
745   { REGION_GFX2, 0, &bbprot_sprite_layout,0x1800, 256  }, /* sprites */
738static GFXDECODE_START( prot )
739   GFXDECODE_ENTRY( REGION_GFX1, 0, fof_tile_layout,     0x0000, 256  ) /* tx tiles */
740   GFXDECODE_ENTRY( REGION_GFX1, 0, fof_tile_layout,     0x0800, 256  ) /* mid tiles */
741   GFXDECODE_ENTRY( REGION_GFX1, 0, fof_tile_layout,     0x1000, 256  ) /* bg tiles */
742   GFXDECODE_ENTRY( REGION_GFX2, 0, bbprot_sprite_layout,0x1800, 256  ) /* sprites */
746743
747   { -1 }
748};
744GFXDECODE_END
749745
750746
751747static MACHINE_DRIVER_START( fitfight )
r1051r1052
763759   MDRV_SCREEN_REFRESH_RATE(60)
764760   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
765761
766   MDRV_GFXDECODE(gfxdecodeinfo)
762   MDRV_GFXDECODE(fitfight)
767763
768764   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
769765   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
r1051r1052
789785   MDRV_SCREEN_REFRESH_RATE(60)
790786   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
791787
792   MDRV_GFXDECODE(prot_gfxdecodeinfo)
788   MDRV_GFXDECODE(prot)
793789
794790   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
795791   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/sspeedr.c
r1051r1052
210210};
211211
212212
213static const gfx_decode gfxdecodeinfo[] =
214{
215   { REGION_GFX1, 0, &car_layout, 0, 1 },
216   { REGION_GFX2, 0, &car_layout, 0, 1 },
217   { -1 }
218};
213static GFXDECODE_START( sspeedr )
214   GFXDECODE_ENTRY( REGION_GFX1, 0, car_layout, 0, 1 )
215   GFXDECODE_ENTRY( REGION_GFX2, 0, car_layout, 0, 1 )
216GFXDECODE_END
219217
220218
221219static MACHINE_DRIVER_START( sspeedr )
r1051r1052
234232   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
235233   MDRV_SCREEN_SIZE(376, 256)
236234   MDRV_SCREEN_VISIBLE_AREA(0, 375, 0, 247)
237   MDRV_GFXDECODE(gfxdecodeinfo)
235   MDRV_GFXDECODE(sspeedr)
238236   MDRV_PALETTE_LENGTH(16)
239237
240238   MDRV_PALETTE_INIT(sspeedr)
src/mame/drivers/filetto.c
r1051r1052
644644   8*8
645645};
646646
647static const gfx_decode gfxdecodeinfo[] =
648{
649   { REGION_GFX1, 0x0000, &dos_chars,    0, 16 },
650   { REGION_GFX1, 0x1000, &dos_chars2,   0, 16 },
651   { REGION_GFX1, 0x1800, &dos_chars2,   0, 16 },
652   { -1 }
653};
647static GFXDECODE_START( filetto )
648   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dos_chars,    0, 16 )
649   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, dos_chars2,   0, 16 )
650   GFXDECODE_ENTRY( REGION_GFX1, 0x1800, dos_chars2,   0, 16 )
651GFXDECODE_END
654652
655653
656654static MACHINE_RESET(filetto)
r1051r1052
741739   MDRV_CPU_IO_MAP(filetto_io,0)
742740   MDRV_CPU_VBLANK_INT(filetto_irq,200)
743741
744   MDRV_GFXDECODE(gfxdecodeinfo)
742   MDRV_GFXDECODE(filetto)
745743
746744   MDRV_SCREEN_REFRESH_RATE(60)
747745   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
src/mame/drivers/ashnojoe.c
r1051r1052
293293   16*64
294294};
295295
296static const gfx_decode ashnojoe_gfxdecodeinfo[] =
297{
298   { REGION_GFX1, 0, &tiles8x8_layout, 0, 0x100 },
299   { REGION_GFX2, 0, &tiles8x8_layout, 0, 0x100 },
300   { REGION_GFX3, 0, &tiles8x8_layout, 0, 0x100 },
301   { REGION_GFX4, 0, &tiles16x16_layout, 0, 0x100 },
302   { REGION_GFX5, 0, &tiles16x16_layout, 0, 0x100 },
303   { -1 }
304};
296static GFXDECODE_START( ashnojoe )
297   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 0x100 )
298   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout, 0, 0x100 )
299   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles8x8_layout, 0, 0x100 )
300   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles16x16_layout, 0, 0x100 )
301   GFXDECODE_ENTRY( REGION_GFX5, 0, tiles16x16_layout, 0, 0x100 )
302GFXDECODE_END
305303
306304static void irqhandler(int irq)
307305{
r1051r1052
366364   MDRV_SCREEN_SIZE(512, 512)
367365   MDRV_SCREEN_VISIBLE_AREA(14*8, 50*8-1, 3*8, 29*8-1)
368366
369   MDRV_GFXDECODE(ashnojoe_gfxdecodeinfo)
367   MDRV_GFXDECODE(ashnojoe)
370368   MDRV_PALETTE_LENGTH(0x1000/2)
371369
372370   MDRV_VIDEO_START(ashnojoe)
src/mame/drivers/terracre.c
r1051r1052
595595   32*16
596596};
597597
598static const gfx_decode gfxdecodeinfo[] =
599{
600   { REGION_GFX1, 0, &char_layout,            0,   1 },
601   { REGION_GFX2, 0, &tile_layout,         1*16,  16 },
602   { REGION_GFX3, 0, &sprite_layout, 1*16+16*16, 256 },
603   { -1 }
604};
598static GFXDECODE_START( terracre )
599   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,            0,   1 )
600   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,         1*16,  16 )
601   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite_layout, 1*16+16*16, 256 )
602GFXDECODE_END
605603
606604static MACHINE_DRIVER_START( amazon )
607605   MDRV_CPU_ADD(M68000, 8000000 )
r1051r1052
623621   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
624622   MDRV_SCREEN_SIZE(32*8, 32*8)
625623   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
626   MDRV_GFXDECODE(gfxdecodeinfo)
624   MDRV_GFXDECODE(terracre)
627625   MDRV_PALETTE_LENGTH(256)
628626   MDRV_COLORTABLE_LENGTH(1*16+16*16+16*256)
629627
r1051r1052
661659   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
662660   MDRV_SCREEN_SIZE(32*8, 32*8)
663661   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
664   MDRV_GFXDECODE(gfxdecodeinfo)
662   MDRV_GFXDECODE(terracre)
665663   MDRV_PALETTE_LENGTH(256)
666664   MDRV_COLORTABLE_LENGTH(1*16+16*16+16*256)
667665
r1051r1052
699697   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
700698   MDRV_SCREEN_SIZE(32*8, 32*8)
701699   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
702   MDRV_GFXDECODE(gfxdecodeinfo)
700   MDRV_GFXDECODE(terracre)
703701   MDRV_PALETTE_LENGTH(256)
704702   MDRV_COLORTABLE_LENGTH(1*16+16*16+16*256)
705703
src/mame/drivers/mouser.c
r1051r1052
189189};
190190
191191
192static const gfx_decode gfxdecodeinfo[] =
193{
194   { REGION_GFX1, 0x0000, &charlayout,       0, 16 },
195   { REGION_GFX1, 0x1000, &spritelayout,     0, 16 },
196   { REGION_GFX1, 0x1800, &spritelayout,     0, 16 },
197   { -1 }
198};
192static GFXDECODE_START( mouser )
193   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,       0, 16 )
194   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout,     0, 16 )
195   GFXDECODE_ENTRY( REGION_GFX1, 0x1800, spritelayout,     0, 16 )
196GFXDECODE_END
199197
200198
201199static MACHINE_DRIVER_START( mouser )
r1051r1052
219217   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
220218   MDRV_SCREEN_SIZE(32*8, 32*8)
221219   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
222   MDRV_GFXDECODE(gfxdecodeinfo)
220   MDRV_GFXDECODE(mouser)
223221   MDRV_PALETTE_LENGTH(64)
224222
225223   MDRV_PALETTE_INIT(mouser)
src/mame/drivers/undrfire.c
r1051r1052
520520   32*8    /* every sprite takes 32 consecutive bytes */
521521};
522522
523static const gfx_decode undrfire_gfxdecodeinfo[] =
524{
525   { REGION_GFX2, 0x0, &tile16x16_layout,  0, 512 },
526   { REGION_GFX1, 0x0, &charlayout,        0, 512 },
527   { REGION_GFX3, 0x0, &pivlayout,         0, 512 },
528   { -1 }
529};
523static GFXDECODE_START( undrfire )
524   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x16_layout,  0, 512 )
525   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,        0, 512 )
526   GFXDECODE_ENTRY( REGION_GFX3, 0x0, pivlayout,         0, 512 )
527GFXDECODE_END
530528
531529
532530/***********************************************************
r1051r1052
567565   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
568566   MDRV_SCREEN_SIZE(40*8, 32*8)
569567   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 3*8, 32*8-1)
570   MDRV_GFXDECODE(undrfire_gfxdecodeinfo)
568   MDRV_GFXDECODE(undrfire)
571569   MDRV_PALETTE_LENGTH(16384)
572570
573571   MDRV_VIDEO_START(undrfire)
src/mame/drivers/malzak.c
r1051r1052
417417};
418418
419419//add s2636 decodes here (i.e. from zac2650) and maybe re-arrange them
420static const gfx_decode malzak_gfxdecodeinfo[] =
421{
422   { REGION_GFX1, 0, &charlayout,  0, 16 },
423     { REGION_CPU1, 0x0000, &s2636_character10, 0, 8 },   /* s2636 #1  */
424   { REGION_CPU1, 0x0000, &s2636_character10, 0, 8 },   /* s2636 #2  */
425   { REGION_GFX2, 0x0000, &saa5050_charlayout, 0, 128},
426   { REGION_GFX2, 0x0000, &saa5050_hilayout, 0, 128},
427   { REGION_GFX2, 0x0000, &saa5050_lolayout, 0, 128},
428   { -1 }
429};
420static GFXDECODE_START( malzak )
421   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 16 )
422     GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_character10, 0, 8 )   /* s2636 #1  */
423   GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_character10, 0, 8 )   /* s2636 #2  */
424   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_charlayout, 0, 128)
425   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_hilayout, 0, 128)
426   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_lolayout, 0, 128)
427GFXDECODE_END
430428
431429
432430static PALETTE_INIT( malzak )
r1051r1052
479477   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
480478   MDRV_SCREEN_SIZE(240, 256)   /* vert size is a guess */
481479   MDRV_SCREEN_VISIBLE_AREA(0, 239, 0, 239)
482   MDRV_GFXDECODE(malzak_gfxdecodeinfo)
480   MDRV_GFXDECODE(malzak)
483481   MDRV_PALETTE_LENGTH(16)
484482   MDRV_PALETTE_INIT(malzak)
485483   MDRV_COLORTABLE_LENGTH(128)
src/mame/drivers/deco32.c
r1051r1052
17371737   16*16*8
17381738};
17391739
1740static const gfx_decode gfxdecodeinfo_captaven[] =
1741{
1742   { REGION_GFX1, 0, &charlayout,        512, 32 },   /* Characters 8x8 */
1743   { REGION_GFX1, 0, &tilelayout,        512, 32 },   /* Tiles 16x16 */
1744   { REGION_GFX2, 0, &tilelayout2,      1024,  4 },   /* Tiles 16x16 */
1745   { REGION_GFX3, 0, &spritelayout,        0, 32 },   /* Sprites 16x16 */
1746   { -1 }
1747};
1740static GFXDECODE_START( captaven )
1741   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        512, 32 )   /* Characters 8x8 */
1742   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,        512, 32 )   /* Tiles 16x16 */
1743   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout2,      1024,  4 )   /* Tiles 16x16 */
1744   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,        0, 32 )   /* Sprites 16x16 */
1745GFXDECODE_END
17481746
1749static const gfx_decode gfxdecodeinfo_fghthist[] =
1750{
1751   { REGION_GFX1, 0, &charlayout,          0,  16 },   /* Characters 8x8 */
1752   { REGION_GFX1, 0, &tilelayout,        256,  16 },   /* Tiles 16x16 */
1753   { REGION_GFX2, 0, &tilelayout,        512,  32 },   /* Tiles 16x16 */
1754   { REGION_GFX3, 0, &spritelayout,     1024, 128 },   /* Sprites 16x16 */
1755   { -1 }
1756};
1747static GFXDECODE_START( fghthist )
1748   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0,  16 )   /* Characters 8x8 */
1749   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,        256,  16 )   /* Tiles 16x16 */
1750   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,        512,  32 )   /* Tiles 16x16 */
1751   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,     1024, 128 )   /* Sprites 16x16 */
1752GFXDECODE_END
17571753
1758static const gfx_decode gfxdecodeinfo_dragngun[] =
1759{
1760   { REGION_GFX1, 0, &charlayout,        512, 16 },   /* Characters 8x8 */
1761   { REGION_GFX2, 0, &tilelayout,        768, 16 },   /* Tiles 16x16 */
1762   { REGION_GFX3, 0, &tilelayout2,      1024,  4 },   /* Tiles 16x16 */
1763   { REGION_GFX4, 0, &spritelayout4,       0, 32 },   /* Sprites 16x16 */
1764   { REGION_GFX4, 0, &spritelayout5,       0, 32 },   /* Sprites 16x16 */
1765   { -1 }
1766};
1754static GFXDECODE_START( dragngun )
1755   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        512, 16 )   /* Characters 8x8 */
1756   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,        768, 16 )   /* Tiles 16x16 */
1757   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout2,      1024,  4 )   /* Tiles 16x16 */
1758   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout4,       0, 32 )   /* Sprites 16x16 */
1759   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout5,       0, 32 )   /* Sprites 16x16 */
1760GFXDECODE_END
17671761
1768static const gfx_decode gfxdecodeinfo_tattass[] =
1769{
1770   { REGION_GFX1, 0, &charlayout,          0, 32 },   /* Characters 8x8 */
1771   { REGION_GFX1, 0, &tilelayout,          0, 32 },   /* Tiles 16x16 */
1772   { REGION_GFX2, 0, &tilelayout,        512, 32 },   /* Tiles 16x16 */
1773   { REGION_GFX3, 0, &spritelayout2,    1536, 16 },   /* Sprites 16x16 */
1774   { REGION_GFX4, 0, &spritelayout,     1024+256, 32 },   /* Sprites 16x16 */
1775   { -1 }
1776};
1762static GFXDECODE_START( tattass )
1763   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 32 )   /* Characters 8x8 */
1764   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,          0, 32 )   /* Tiles 16x16 */
1765   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,        512, 32 )   /* Tiles 16x16 */
1766   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout2,    1536, 16 )   /* Sprites 16x16 */
1767   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,     1024+256, 32 )   /* Sprites 16x16 */
1768GFXDECODE_END
17771769
1778static const gfx_decode gfxdecodeinfo_nslasher[] =
1779{
1780   { REGION_GFX1, 0, &charlayout,          0, 32 },   /* Characters 8x8 */
1781   { REGION_GFX1, 0, &tilelayout,          0, 32 },   /* Tiles 16x16 */
1782   { REGION_GFX2, 0, &tilelayout,        512, 32 },   /* Tiles 16x16 */
1783   { REGION_GFX3, 0, &spritelayout_5bpp,1024, 16 },   /* Sprites 16x16 */
1784   { REGION_GFX4, 0, &spritelayout,     1536, 32 },   /* Sprites 16x16 */
1785   { -1 }
1786};
1770static GFXDECODE_START( nslasher )
1771   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 32 )   /* Characters 8x8 */
1772   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,          0, 32 )   /* Tiles 16x16 */
1773   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,        512, 32 )   /* Tiles 16x16 */
1774   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_5bpp,1024, 16 )   /* Sprites 16x16 */
1775   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,     1536, 32 )   /* Sprites 16x16 */
1776GFXDECODE_END
17871777
17881778/**********************************************************************************/
17891779
r1051r1052
19011891   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19021892   MDRV_SCREEN_SIZE(42*8, 32*8)
19031893   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
1904   MDRV_GFXDECODE(gfxdecodeinfo_captaven)
1894   MDRV_GFXDECODE(captaven)
19051895   MDRV_PALETTE_LENGTH(2048)
19061896
19071897   MDRV_VIDEO_START(captaven)
r1051r1052
19461936   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
19471937   MDRV_SCREEN_SIZE(42*8, 32*8)
19481938   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
1949   MDRV_GFXDECODE(gfxdecodeinfo_fghthist)
1939   MDRV_GFXDECODE(fghthist)
19501940   MDRV_PALETTE_LENGTH(2048)
19511941
19521942   MDRV_VIDEO_START(fghthist)
r1051r1052
19891979   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
19901980   MDRV_SCREEN_SIZE(42*8, 32*8)
19911981   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
1992   MDRV_GFXDECODE(gfxdecodeinfo_fghthist)
1982   MDRV_GFXDECODE(fghthist)
19931983   MDRV_PALETTE_LENGTH(2048)
19941984
19951985   MDRV_VIDEO_START(fghthist)
r1051r1052
20342024   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
20352025   MDRV_SCREEN_SIZE(42*8, 32*8)
20362026   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2037   MDRV_GFXDECODE(gfxdecodeinfo_dragngun)
2027   MDRV_GFXDECODE(dragngun)
20382028   MDRV_PALETTE_LENGTH(2048)
20392029
20402030   MDRV_VIDEO_START(dragngun)
r1051r1052
20852075   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
20862076   MDRV_SCREEN_SIZE(42*8, 32*8)
20872077   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2088   MDRV_GFXDECODE(gfxdecodeinfo_dragngun)
2078   MDRV_GFXDECODE(dragngun)
20892079   MDRV_PALETTE_LENGTH(2048)
20902080
20912081   MDRV_VIDEO_START(lockload)
r1051r1052
21362126   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
21372127   MDRV_SCREEN_SIZE(42*8, 32*8)
21382128   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2139   MDRV_GFXDECODE(gfxdecodeinfo_tattass)
2129   MDRV_GFXDECODE(tattass)
21402130   MDRV_PALETTE_LENGTH(2048)
21412131
21422132   MDRV_VIDEO_START(nslasher)
r1051r1052
21702160   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
21712161   MDRV_SCREEN_SIZE(42*8, 32*8)
21722162   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2173   MDRV_GFXDECODE(gfxdecodeinfo_nslasher)
2163   MDRV_GFXDECODE(nslasher)
21742164   MDRV_PALETTE_LENGTH(2048)
21752165
21762166   MDRV_VIDEO_START(nslasher)
r1051r1052
26412631   ROM_LOAD( "mar-07.n19", 0x000000, 0x80000,  CRC(40287d62) SHA1(c00cb08bcdae55bcddc14c38e88b0484b1bc9e3e) )
26422632ROM_END
26432633
2644ROM_START( fghthstu )
2634ROM_START( fghthist )
26452635   ROM_REGION(0x100000, REGION_CPU1, 0 ) /* ARM 32 bit code */
2646   ROM_LOAD32_WORD( "kz00-1.1f", 0x000000, 0x80000, CRC(3a3dd15c) SHA1(689b51adf73402b12191a75061b8e709468c91bc) )
2647   ROM_LOAD32_WORD( "kz01-1.2f", 0x000002, 0x80000, CRC(86796cd6) SHA1(c397c07d7a1d03ba96ccb2fe7a0ad25b8331e945) )
2636   ROM_LOAD32_WORD( "kx00-unknown.bin", 0x000000, 0x80000, CRC(fe5eaba1) SHA1(c8a3784af487a1bbd2150abf4b1c8f3ad33da8a4) )
2637   ROM_LOAD32_WORD( "kx01-unknown.bin", 0x000002, 0x80000, CRC(3fb8d738) SHA1(2fca7a3ea483f01c97fb28a0adfa6d7980d8236c) )
26482638
26492639   ROM_REGION(0x10000, REGION_CPU2, 0 ) /* Sound CPU */
26502640   ROM_LOAD( "kz02.18k",  0x00000,  0x10000,  CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) )
26512641
26522642   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2653   ROM_LOAD( "mbf00-8.bin",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
2643   ROM_LOAD( "mbf00-8.8a",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
26542644
26552645   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
2656   ROM_LOAD( "mbf01-8.bin",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
2646   ROM_LOAD( "mbf01-8.9a",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
26572647
26582648   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* Sprites */
2659   ROM_LOAD16_BYTE( "mbf02-16.bin",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2660   ROM_LOAD16_BYTE( "mbf04-16.bin",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2661   ROM_LOAD16_BYTE( "mbf03-16.bin",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2662   ROM_LOAD16_BYTE( "mbf05-16.bin",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
2649   ROM_LOAD16_BYTE( "mbf02-16.16d",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2650   ROM_LOAD16_BYTE( "mbf04-16.18d",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2651   ROM_LOAD16_BYTE( "mbf03-16.17d",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2652   ROM_LOAD16_BYTE( "mbf05-16.19d",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
26632653
26642654   ROM_REGION(0x80000, REGION_SOUND1, 0 )
2665   ROM_LOAD( "mbf06.bin",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
2655   ROM_LOAD( "mbf06.15k",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
26662656
26672657   ROM_REGION(0x80000, REGION_SOUND2, 0 )
2668   ROM_LOAD( "mbf07.bin",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
2658   ROM_LOAD( "mbf07.16k",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
26692659
26702660   ROM_REGION(512, REGION_PROMS, 0 )
2671   ROM_LOAD( "mb7124h.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) )
2661   ROM_LOAD( "kt-00.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) ) /* MB7124H type prom */
26722662
26732663   ROM_REGION( 0x0400, REGION_PLDS, ROMREGION_DISPOSE )
2674   ROM_LOAD( "pal16l8b.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
2675   ROM_LOAD( "pal16l8b.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */
2664   ROM_LOAD( "ve-00.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
2665   ROM_LOAD( "ve-01.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
26762666ROM_END
26772667
2678ROM_START( fghthist )
2668ROM_START( fghthstu )
26792669   ROM_REGION(0x100000, REGION_CPU1, 0 ) /* ARM 32 bit code */
2680   ROM_LOAD32_WORD( "fhist00.bin", 0x000000, 0x80000, CRC(fe5eaba1) SHA1(c8a3784af487a1bbd2150abf4b1c8f3ad33da8a4) ) /* Rom kx */
2681   ROM_LOAD32_WORD( "fhist01.bin", 0x000002, 0x80000, CRC(3fb8d738) SHA1(2fca7a3ea483f01c97fb28a0adfa6d7980d8236c) )
2670   ROM_LOAD32_WORD( "kz00-1.1f", 0x000000, 0x80000, CRC(3a3dd15c) SHA1(689b51adf73402b12191a75061b8e709468c91bc) )
2671   ROM_LOAD32_WORD( "kz01-1.2f", 0x000002, 0x80000, CRC(86796cd6) SHA1(c397c07d7a1d03ba96ccb2fe7a0ad25b8331e945) )
26822672
26832673   ROM_REGION(0x10000, REGION_CPU2, 0 ) /* Sound CPU */
26842674   ROM_LOAD( "kz02.18k",  0x00000,  0x10000,  CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) )
26852675
26862676   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2687   ROM_LOAD( "mbf00-8.bin",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
2677   ROM_LOAD( "mbf00-8.8a",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
26882678
26892679   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
2690   ROM_LOAD( "mbf01-8.bin",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
2680   ROM_LOAD( "mbf01-8.9a",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
26912681
26922682   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* Sprites */
2693   ROM_LOAD16_BYTE( "mbf02-16.bin",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2694   ROM_LOAD16_BYTE( "mbf04-16.bin",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2695   ROM_LOAD16_BYTE( "mbf03-16.bin",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2696   ROM_LOAD16_BYTE( "mbf05-16.bin",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
2683   ROM_LOAD16_BYTE( "mbf02-16.16d",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2684   ROM_LOAD16_BYTE( "mbf04-16.18d",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2685   ROM_LOAD16_BYTE( "mbf03-16.17d",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2686   ROM_LOAD16_BYTE( "mbf05-16.19d",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
26972687
26982688   ROM_REGION(0x80000, REGION_SOUND1, 0 )
2699   ROM_LOAD( "mbf06.bin",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
2689   ROM_LOAD( "mbf06.15k",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
27002690
27012691   ROM_REGION(0x80000, REGION_SOUND2, 0 )
2702   ROM_LOAD( "mbf07.bin",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
2692   ROM_LOAD( "mbf07.16k",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
27032693
27042694   ROM_REGION(512, REGION_PROMS, 0 )
2705   ROM_LOAD( "mb7124h.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) )
2695   ROM_LOAD( "kt-00.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) ) /* MB7124H type prom */
27062696
27072697   ROM_REGION( 0x0400, REGION_PLDS, ROMREGION_DISPOSE )
2708   ROM_LOAD( "pal16l8b.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
2709   ROM_LOAD( "pal16l8b.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */
2698   ROM_LOAD( "ve-00.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
2699   ROM_LOAD( "ve-01.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
27102700ROM_END
27112701
27122702ROM_START( fghthsta )
r1051r1052
27182708   ROM_LOAD( "kz02.18k",  0x00000,  0x10000,  CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) )
27192709
27202710   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2721   ROM_LOAD( "mbf00-8.bin",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
2711   ROM_LOAD( "mbf00-8.8a",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
27222712
27232713   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
2724   ROM_LOAD( "mbf01-8.bin",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
2714   ROM_LOAD( "mbf01-8.9a",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
27252715
27262716   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* Sprites */
2727   ROM_LOAD16_BYTE( "mbf02-16.bin",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2728   ROM_LOAD16_BYTE( "mbf04-16.bin",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2729   ROM_LOAD16_BYTE( "mbf03-16.bin",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2730   ROM_LOAD16_BYTE( "mbf05-16.bin",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
2717   ROM_LOAD16_BYTE( "mbf02-16.16d",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2718   ROM_LOAD16_BYTE( "mbf04-16.18d",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2719   ROM_LOAD16_BYTE( "mbf03-16.17d",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2720   ROM_LOAD16_BYTE( "mbf05-16.19d",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
27312721
27322722   ROM_REGION(0x80000, REGION_SOUND1, 0 )
2733   ROM_LOAD( "mbf06.bin",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
2723   ROM_LOAD( "mbf06.15k",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
27342724
27352725   ROM_REGION(0x80000, REGION_SOUND2, 0 )
2736   ROM_LOAD( "mbf07.bin",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
2726   ROM_LOAD( "mbf07.16k",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
27372727
27382728   ROM_REGION(512, REGION_PROMS, 0 )
2739   ROM_LOAD( "mb7124h.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) )
2729   ROM_LOAD( "kt-00.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) ) /* MB7124H type prom */
27402730
27412731   ROM_REGION( 0x0400, REGION_PLDS, ROMREGION_DISPOSE )
2742   ROM_LOAD( "pal16l8b.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
2743   ROM_LOAD( "pal16l8b.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */
2732   ROM_LOAD( "ve-00.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
2733   ROM_LOAD( "ve-01.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
27442734ROM_END
27452735
2736ROM_START( fghthstj )
2737   ROM_REGION(0x100000, REGION_CPU1, 0 ) /* ARM 32 bit code */
2738   ROM_LOAD32_WORD( "kw00-3.1f", 0x000000, 0x80000, CRC(ade9581a) SHA1(c1302e921f119ff9baeb52f9c338df652e64a9ee) )
2739   ROM_LOAD32_WORD( "kw01-3.2f", 0x000002, 0x80000, CRC(63580acf) SHA1(03372b168fe461542dd1cf64b4021d948d07e15c) )
2740
2741   ROM_REGION(0x10000, REGION_CPU2, 0 ) /* Sound CPU */
2742   ROM_LOAD( "kz02.18k",  0x00000,  0x10000,  CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) ) /* Labeled KW02- but the same as the other sets */
2743
2744   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2745   ROM_LOAD( "mbf00-8.8a",  0x000000,  0x100000,  CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
2746
2747   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
2748   ROM_LOAD( "mbf01-8.9a",  0x000000,  0x100000,  CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
2749
2750   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* Sprites */
2751   ROM_LOAD16_BYTE( "mbf02-16.16d",  0x000001,  0x200000,  CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
2752   ROM_LOAD16_BYTE( "mbf04-16.18d",  0x000000,  0x200000,  CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
2753   ROM_LOAD16_BYTE( "mbf03-16.17d",  0x400001,  0x200000,  CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
2754   ROM_LOAD16_BYTE( "mbf05-16.19d",  0x400000,  0x200000,  CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
2755
2756   ROM_REGION(0x80000, REGION_SOUND1, 0 )
2757   ROM_LOAD( "mbf06.15k",  0x000000,  0x80000,  CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
2758
2759   ROM_REGION(0x80000, REGION_SOUND2, 0 )
2760   ROM_LOAD( "mbf07.16k",  0x000000,  0x80000,  CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
2761
2762   ROM_REGION(512, REGION_PROMS, 0 )
2763   ROM_LOAD( "kt-00.8j",  0,  512,  CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) ) /* MB7124H type prom */
2764
2765   ROM_REGION( 0x0400, REGION_PLDS, ROMREGION_DISPOSE )
2766   ROM_LOAD( "ve-00.3d",  0x0000, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
2767   ROM_LOAD( "ve-01.4d",  0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
2768ROM_END
2769
27462770ROM_START( lockload ) /* Board No. DE-0420-1 + Bottom board DE-0421-0 slightly different hardware, likely a unique PCB and not a Dragongun conversion */
27472771   ROM_REGION(0x400000, REGION_CPU1, 0 ) /* ARM 32 bit code */
27482772   ROM_LOAD32_BYTE( "nl-00-1.b5", 0x000002, 0x80000, CRC(7a39bf8d) SHA1(8b1a6407bab74b3960a243a6c04c0005a82126f1) )
r1051r1052
32543278GAME( 1993, fghthist, 0,        fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07)", 0 )
32553279GAME( 1993, fghthstu, fghthist, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03)", 0 )
32563280GAME( 1993, fghthsta, fghthist, fghthsta, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, alternate hardware )", 0 )
3281GAME( 1993, fghthstj, fghthist, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 42-03)", 0 )
32573282GAME( 1994, lockload, 0,        lockload, lockload, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (World)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
32583283GAME( 1994, locklodu, lockload, lockload, lockload, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (US)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
32593284GAME( 1994, tattass,  0,        tattass,  tattass,  tattass,  ROT0, "Data East Pinball",     "Tattoo Assassins (US Prototype)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/grchamp.c
r1051r1052
497497   16*8
498498};
499499
500static const gfx_decode gfxdecodeinfo[] =
501{
502   { REGION_GFX1, 0x0000, &gfx_8x8x2_planar,   0, 8 },
503   { REGION_GFX2, 0x0000, &tile_layout,      0, 16 },
504   { REGION_GFX3, 0x0000, &tile_layout,      0, 16 },
505   { REGION_GFX4, 0x0000, &tile_layout,      0, 16 },
506   { REGION_GFX1, 0x0000, &sprite_layout,      0, 32 },
507   { -1 }
508};
500static GFXDECODE_START( grchamp )
501   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, gfx_8x8x2_planar,   0, 8 )
502   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, tile_layout,      0, 16 )
503   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, tile_layout,      0, 16 )
504   GFXDECODE_ENTRY( REGION_GFX4, 0x0000, tile_layout,      0, 16 )
505   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sprite_layout,      0, 32 )
506GFXDECODE_END
509507
510508
511509
r1051r1052
697695
698696   /* video hardware */
699697   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
700   MDRV_GFXDECODE(gfxdecodeinfo)
698   MDRV_GFXDECODE(grchamp)
701699
702700   MDRV_SCREEN_ADD("main", 0)
703701   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
r1051r1052
722720   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2)
723721
724722   MDRV_SOUND_ADD(DISCRETE, 0)
725   MDRV_SOUND_CONFIG(grchamp_discrete_interface)
723   MDRV_SOUND_CONFIG_DISCRETE(grchamp)
726724   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
727725MACHINE_DRIVER_END
728726
src/mame/drivers/argus.c
r1051r1052
833833   128*8
834834};
835835
836static const gfx_decode argus_gfxdecodeinfo[] =
837{
838   { REGION_GFX1, 0, &tilelayout_1024, 0*16,   8 },
839   { REGION_GFX2, 0, &tilelayout_1024, 8*16,  16 },
840   { REGION_GFX3, 0, &tilelayout_256,  24*16, 16 },
841   { REGION_GFX4, 0, &charlayout,      40*16, 16 },
842   { -1 }
843};
836static GFXDECODE_START( argus )
837   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_1024, 0*16,   8 )
838   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_1024, 8*16,  16 )
839   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout_256,  24*16, 16 )
840   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout,      40*16, 16 )
841GFXDECODE_END
844842
845static const gfx_decode valtric_gfxdecodeinfo[] =
846{
847   { REGION_GFX1, 0, &tilelayout_1024, 0*16, 16 },
848   { REGION_GFX2, 0, &tilelayout_2048, 16*16, 16 },
849   { REGION_GFX3, 0, &charlayout,      32*16, 16 },
850   { -1 }
851};
843static GFXDECODE_START( valtric )
844   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_1024, 0*16, 16 )
845   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_2048, 16*16, 16 )
846   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,      32*16, 16 )
847GFXDECODE_END
852848
853static const gfx_decode butasan_gfxdecodeinfo[] =
854{
855   { REGION_GFX1, 0, &tilelayout_4096, 0*16,  16 },
856   { REGION_GFX2, 0, &tilelayout_1024, 16*16, 16 },
857   { REGION_GFX3, 0, &tilelayout_512,  12*16, 16 },
858   { REGION_GFX4, 0, &charlayout,      32*16, 16 },
859   { -1 }
860};
849static GFXDECODE_START( butasan )
850   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_4096, 0*16,  16 )
851   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_1024, 16*16, 16 )
852   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout_512,  12*16, 16 )
853   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout,      32*16, 16 )
854GFXDECODE_END
861855
862static const gfx_decode bombsa_gfxdecodeinfo[] =
863{
864   { REGION_GFX1, 0, &tilelayout_1024, 32*16, 16 },
865   { REGION_GFX2, 0, &tilelayout_1024, 0*16, 16 },
866   { REGION_GFX3, 0, &charlayout,      16*16, 16 },
867   { -1 }
868};
856static GFXDECODE_START( bombsa )
857   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_1024, 32*16, 16 )
858   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_1024, 0*16, 16 )
859   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,      16*16, 16 )
860GFXDECODE_END
869861
870862static MACHINE_DRIVER_START( argus )
871863
r1051r1052
888880   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
889881   MDRV_SCREEN_SIZE(32*16, 32*16)
890882   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
891   MDRV_GFXDECODE(argus_gfxdecodeinfo)
883   MDRV_GFXDECODE(argus)
892884   MDRV_PALETTE_LENGTH(896)
893885
894886   MDRV_VIDEO_START(argus)
r1051r1052
926918   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
927919   MDRV_SCREEN_SIZE(32*16, 32*16)
928920   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
929   MDRV_GFXDECODE(valtric_gfxdecodeinfo)
921   MDRV_GFXDECODE(valtric)
930922   MDRV_PALETTE_LENGTH(768)
931923
932924   MDRV_VIDEO_START(valtric)
r1051r1052
970962   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
971963   MDRV_SCREEN_SIZE(32*16, 32*16)
972964   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
973   MDRV_GFXDECODE(butasan_gfxdecodeinfo)
965   MDRV_GFXDECODE(butasan)
974966   MDRV_PALETTE_LENGTH(768)
975967
976968   MDRV_VIDEO_START(butasan)
r1051r1052
10141006   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10151007   MDRV_SCREEN_SIZE(32*16, 32*16)
10161008   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1017   MDRV_GFXDECODE(bombsa_gfxdecodeinfo)
1009   MDRV_GFXDECODE(bombsa)
10181010   MDRV_PALETTE_LENGTH(0x1000/2)
10191011
10201012   MDRV_VIDEO_START(bombsa)
src/mame/drivers/lkage.c
r1051r1052
303303   32*8
304304};
305305
306static const gfx_decode gfxdecodeinfo[] =
307{
308   { REGION_GFX1, 0x0000, &tile_layout,  /*128*/0, 64 },
309   { REGION_GFX1, 0x0000, &sprite_layout,  0, 16 },
310   { -1 }
311};
306static GFXDECODE_START( lkage )
307   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tile_layout,  /*128*/0, 64 )
308   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sprite_layout,  0, 16 )
309GFXDECODE_END
312310
313311static void irqhandler(int irq)
314312{
r1051r1052
345343   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
346344   MDRV_SCREEN_SIZE(32*8, 32*8)
347345   MDRV_SCREEN_VISIBLE_AREA(2*8, 32*8-1, 2*8, 30*8-1)
348   MDRV_GFXDECODE(gfxdecodeinfo)
346   MDRV_GFXDECODE(lkage)
349347   MDRV_PALETTE_LENGTH(1024)
350348
351349   MDRV_VIDEO_START(lkage)
r1051r1052
387385   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
388386   MDRV_SCREEN_SIZE(32*8, 32*8)
389387   MDRV_SCREEN_VISIBLE_AREA(2*8, 31*8-1, 2*8, 30*8-1)
390   MDRV_GFXDECODE(gfxdecodeinfo)
388   MDRV_GFXDECODE(lkage)
391389   MDRV_PALETTE_LENGTH(1024)
392390
393391   MDRV_VIDEO_START(lkage)
src/mame/drivers/superdq.c
r1051r1052
319319};
320320
321321
322static const gfx_decode gfxdecodeinfo[] =
323{
324   { REGION_GFX1, 0, &charlayout, 0, 2 },
325   { -1 }
326};
322static GFXDECODE_START( superdq )
323   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 2 )
324GFXDECODE_END
327325
328326
329327
r1051r1052
351349   MDRV_SCREEN_SIZE(32*8, 32*8)
352350   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
353351
354   MDRV_GFXDECODE(gfxdecodeinfo)
352   MDRV_GFXDECODE(superdq)
355353   MDRV_PALETTE_LENGTH(32)
356354
357355   MDRV_PALETTE_INIT(superdq)
src/mame/drivers/bestleag.c
r1051r1052
306306   16*16
307307};
308308
309static const gfx_decode gfxdecodeinfo[] =
310{
311   { REGION_GFX1, 0, &bestleag_charlayout,     0x200, 16 },
312   { REGION_GFX1, 0, &bestleag_char16layout,   0x000, 32 },
313   { REGION_GFX2, 0, &bestleag_char16layout,   0x300, 16 },
314   { -1 }
315};
309static GFXDECODE_START( bestleag )
310   GFXDECODE_ENTRY( REGION_GFX1, 0, bestleag_charlayout,     0x200, 16 )
311   GFXDECODE_ENTRY( REGION_GFX1, 0, bestleag_char16layout,   0x000, 32 )
312   GFXDECODE_ENTRY( REGION_GFX2, 0, bestleag_char16layout,   0x300, 16 )
313GFXDECODE_END
316314
317315static MACHINE_DRIVER_START( bestleag )
318316   MDRV_CPU_ADD(M68000, 12000000)
r1051r1052
327325   MDRV_SCREEN_SIZE(32*8, 32*8)
328326   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
329327
330   MDRV_GFXDECODE(gfxdecodeinfo)
328   MDRV_GFXDECODE(bestleag)
331329   MDRV_PALETTE_LENGTH(0x800)
332330
333331   MDRV_VIDEO_START(bestleag)
src/mame/drivers/gaiden.c
r1051r1052
912912   16*8   /* offset to next sprite */
913913};
914914
915static const gfx_decode gfxdecodeinfo[] =
916{
917   { REGION_GFX1, 0, &tilelayout,        256, 4096 - 256 },   /* tiles 8x8  */
918   { REGION_GFX2, 0, &tile2layout,       768, 4096 - 768 },   /* tiles 16x16 */
919   { REGION_GFX3, 0, &tile2layout,       512, 4096 - 512 },   /* tiles 16x16 */
920   { REGION_GFX4, 0, &spritelayout,        0, 4096 -   0 },   /* sprites 8x8 */
921   { -1 }
922};
915static GFXDECODE_START( gaiden )
916   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,        256, 4096 - 256 )   /* tiles 8x8  */
917   GFXDECODE_ENTRY( REGION_GFX2, 0, tile2layout,       768, 4096 - 768 )   /* tiles 16x16 */
918   GFXDECODE_ENTRY( REGION_GFX3, 0, tile2layout,       512, 4096 - 512 )   /* tiles 16x16 */
919   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,        0, 4096 -   0 )   /* sprites 8x8 */
920GFXDECODE_END
923921
924922static const gfx_layout drgnbowl_tile2layout =
925923{
r1051r1052
943941   32*8
944942};
945943
946static const gfx_decode drgnbowl_gfxdecodeinfo[] =
947{
948   { REGION_GFX1, 0,       &tilelayout,                0, 16 },   /* tiles 8x8  */
949   { REGION_GFX2, 0x00000, &drgnbowl_tile2layout,  0x300, 16 },   /* tiles 16x16 */
950   { REGION_GFX2, 0x20000, &drgnbowl_tile2layout,  0x200, 16 },   /* tiles 16x16 */
951   { REGION_GFX3, 0,       &drgnbowl_spritelayout, 0x100, 16 },   /* sprites 16x16 */
952   { -1 }
953};
944static GFXDECODE_START( drgnbowl )
945   GFXDECODE_ENTRY( REGION_GFX1, 0,       tilelayout,                0, 16 )   /* tiles 8x8  */
946   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, drgnbowl_tile2layout,  0x300, 16 )   /* tiles 16x16 */
947   GFXDECODE_ENTRY( REGION_GFX2, 0x20000, drgnbowl_tile2layout,  0x200, 16 )   /* tiles 16x16 */
948   GFXDECODE_ENTRY( REGION_GFX3, 0,       drgnbowl_spritelayout, 0x100, 16 )   /* sprites 16x16 */
949GFXDECODE_END
954950
955951/* handler called by the 2203 emulator when the internal timers cause an IRQ */
956952static void irqhandler(int irq)
r1051r1052
984980   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
985981   MDRV_SCREEN_SIZE(32*8, 32*8)
986982   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
987   MDRV_GFXDECODE(gfxdecodeinfo)
983   MDRV_GFXDECODE(gaiden)
988984   MDRV_PALETTE_LENGTH(4096)
989985
990986   MDRV_VIDEO_START(gaiden)
r1051r1052
10401036   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10411037   MDRV_SCREEN_SIZE(32*8, 32*8)
10421038   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1043   MDRV_GFXDECODE(drgnbowl_gfxdecodeinfo)
1039   MDRV_GFXDECODE(drgnbowl)
10441040   MDRV_PALETTE_LENGTH(4096)
10451041
10461042   MDRV_VIDEO_START(drgnbowl)
src/mame/drivers/ninjakid.c
r1051r1052
172172   1024
173173};
174174
175static const gfx_decode ninjakid_gfxdecodeinfo[] =
176{
177   { REGION_GFX1, 0, &tile_layout,      0x000, 0x10 },
178   { REGION_GFX2, 0, &tile_layout,      0x100, 0x10 },
179   { REGION_GFX1, 0, &sprite_layout,   0x200, 0x10 },
180   { -1 }
181};
175static GFXDECODE_START( ninjakid )
176   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,      0x000, 0x10 )
177   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,      0x100, 0x10 )
178   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout,   0x200, 0x10 )
179GFXDECODE_END
182180
183181/*******************************************************************************
184182 Machine Driver Structure(s)
r1051r1052
206204   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
207205   MDRV_SCREEN_SIZE(32*8, 32*8)
208206   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, (32-4)*8-1 )
209   MDRV_GFXDECODE(ninjakid_gfxdecodeinfo)
207   MDRV_GFXDECODE(ninjakid)
210208   MDRV_PALETTE_LENGTH(768)
211209
212210   MDRV_VIDEO_START(ninjakid)
src/mame/drivers/zaxxon.c
r1051r1052
905905};
906906
907907
908static const gfx_decode gfxdecodeinfo[] =
909{
910   { REGION_GFX1, 0, &gfx_8x8x2_planar,    0, 64*2 },   /* characters */
911   { REGION_GFX2, 0, &gfx_8x8x3_planar,    0, 32*2 },   /* background tiles */
912   { REGION_GFX3, 0, &zaxxon_spritelayout,  0, 32*2 },   /* sprites */
913   { -1 }
914};
908static GFXDECODE_START( zaxxon )
909   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x2_planar,    0, 64*2 )   /* characters */
910   GFXDECODE_ENTRY( REGION_GFX2, 0, gfx_8x8x3_planar,    0, 32*2 )   /* background tiles */
911   GFXDECODE_ENTRY( REGION_GFX3, 0, zaxxon_spritelayout,  0, 32*2 )   /* sprites */
912GFXDECODE_END
915913
916914
917915/*************************************
r1051r1052
931929
932930   /* video hardware */
933931   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
934   MDRV_GFXDECODE(gfxdecodeinfo)
932   MDRV_GFXDECODE(zaxxon)
935933   MDRV_PALETTE_LENGTH(256)
936934
937935   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/shangkid.c
r1051r1052
251251   8*0x40
252252};
253253
254static const gfx_decode chinhero_gfxdecodeinfo[] = {
255   { REGION_GFX1, 0, &shangkid_char_layout,   0, 0x40 },
256   { REGION_GFX2, 0, &chinhero_sprite_layout1,   0, 0x20 },
257   { REGION_GFX2, 0, &chinhero_sprite_layout2,   0, 0x20 },
258   { REGION_GFX3, 0, &chinhero_sprite_layout1,   0, 0x20 },
259   { REGION_GFX3, 0, &chinhero_sprite_layout2,   0, 0x20 },
260   { -1 }
261};
254static GFXDECODE_START( chinhero )
255   GFXDECODE_ENTRY( REGION_GFX1, 0, shangkid_char_layout,   0, 0x40 )
256   GFXDECODE_ENTRY( REGION_GFX2, 0, chinhero_sprite_layout1,   0, 0x20 )
257   GFXDECODE_ENTRY( REGION_GFX2, 0, chinhero_sprite_layout2,   0, 0x20 )
258   GFXDECODE_ENTRY( REGION_GFX3, 0, chinhero_sprite_layout1,   0, 0x20 )
259   GFXDECODE_ENTRY( REGION_GFX3, 0, chinhero_sprite_layout2,   0, 0x20 )
260GFXDECODE_END
262261
263static const gfx_decode shangkid_gfxdecodeinfo[] = {
264   { REGION_GFX1, 0, &shangkid_char_layout,   0, 0x40 },
265   { REGION_GFX2, 0, &shangkid_sprite_layout,   0, 0x40 },
266   { -1 }
267};
262static GFXDECODE_START( shangkid )
263   GFXDECODE_ENTRY( REGION_GFX1, 0, shangkid_char_layout,   0, 0x40 )
264   GFXDECODE_ENTRY( REGION_GFX2, 0, shangkid_sprite_layout,   0, 0x40 )
265GFXDECODE_END
268266
269static const gfx_decode dynamski_gfxdecodeinfo[] = {
270   { REGION_GFX1, 0, &shangkid_char_layout,      0, 0x10 },
271   { REGION_GFX2, 0, &shangkid_sprite_layout,   0x40, 0x10 },
272   { -1 }
273};
267static GFXDECODE_START( dynamski )
268   GFXDECODE_ENTRY( REGION_GFX1, 0, shangkid_char_layout,      0, 0x10 )
269   GFXDECODE_ENTRY( REGION_GFX2, 0, shangkid_sprite_layout,   0x40, 0x10 )
270GFXDECODE_END
274271
275272/***************************************************************************************/
276273
r1051r1052
411408   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
412409   MDRV_SCREEN_SIZE(40*8, 28*8)
413410   MDRV_SCREEN_VISIBLE_AREA(16, 319-16, 0, 223)
414   MDRV_GFXDECODE(chinhero_gfxdecodeinfo)
411   MDRV_GFXDECODE(chinhero)
415412   MDRV_PALETTE_LENGTH(256)
416413
417414   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
446443   MDRV_MACHINE_RESET(shangkid)
447444
448445   /* video hardware */
449   MDRV_GFXDECODE(shangkid_gfxdecodeinfo)
446   MDRV_GFXDECODE(shangkid)
450447MACHINE_DRIVER_END
451448
452449
r1051r1052
489486   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
490487   MDRV_SCREEN_SIZE(256+32, 256)
491488   MDRV_SCREEN_VISIBLE_AREA(0, 255+32, 16, 255-16)
492   MDRV_GFXDECODE(dynamski_gfxdecodeinfo)
489   MDRV_GFXDECODE(dynamski)
493490   MDRV_PALETTE_LENGTH(32)
494491   MDRV_COLORTABLE_LENGTH(16*4+16*4)
495492
src/mame/drivers/trackfld.c
r1051r1052
838838   64*8
839839};
840840
841static const gfx_decode gfxdecodeinfo[] =
842{
843   { REGION_GFX1, 0, &charlayout,       0, 16 },
844   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
845   { -1 }
846};
841static GFXDECODE_START( trackfld )
842   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
843   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
844GFXDECODE_END
847845
848846
849847struct VLM5030interface trackfld_vlm5030_interface =
r1051r1052
881879   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
882880   MDRV_SCREEN_SIZE(32*8, 32*8)
883881   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
884   MDRV_GFXDECODE(gfxdecodeinfo)
882   MDRV_GFXDECODE(trackfld)
885883   MDRV_PALETTE_LENGTH(32)
886884   MDRV_COLORTABLE_LENGTH(16*16+16*16)
887885
r1051r1052
926924   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
927925   MDRV_SCREEN_SIZE(32*8, 32*8)
928926   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
929   MDRV_GFXDECODE(gfxdecodeinfo)
927   MDRV_GFXDECODE(trackfld)
930928   MDRV_PALETTE_LENGTH(32)
931929   MDRV_COLORTABLE_LENGTH(16*16+16*16)
932930
src/mame/drivers/fastfred.c
r1051r1052
533533   8*8
534534};
535535
536static const gfx_decode fastfred_gfxdecodeinfo[] =
537{
538   { REGION_GFX1, 0, &charlayout,   0, 32 },
539   { REGION_GFX2, 0, &spritelayout, 0, 32 },
540   { -1 }
541};
536static GFXDECODE_START( fastfred )
537   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 32 )
538   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 32 )
539GFXDECODE_END
542540
543static const gfx_decode jumpcoas_gfxdecodeinfo[] =
544{
545   { REGION_GFX1, 0, &charlayout,   0, 32 },
546   { REGION_GFX1, 0, &spritelayout, 0, 32 },
547   { -1 }
548};
541static GFXDECODE_START( jumpcoas )
542   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 32 )
543   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 32 )
544GFXDECODE_END
549545
550static const gfx_decode imago_gfxdecodeinfo[] =
551{
552   { REGION_GFX1, 0, &charlayout,           0, 32 },
553   { REGION_GFX2, 0, &spritelayout,        0, 32 },
554   { REGION_GFX3, 0, &charlayout,          0, 32 },
555   { REGION_GFX4, 0, &imago_char_1bpp, 0x140,  1 },
556   { -1 }
557};
546static GFXDECODE_START( imago )
547   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0, 32 )
548   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,        0, 32 )
549   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,          0, 32 )
550   GFXDECODE_ENTRY( REGION_GFX4, 0, imago_char_1bpp, 0x140,  1 )
551GFXDECODE_END
558552
559553#define CLOCK 18432000  /* The crystal is 18.432MHz */
560554
r1051r1052
579573   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
580574   MDRV_SCREEN_SIZE(32*8, 32*8)
581575   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
582   MDRV_GFXDECODE(fastfred_gfxdecodeinfo)
576   MDRV_GFXDECODE(fastfred)
583577   MDRV_PALETTE_LENGTH(256)
584578   MDRV_COLORTABLE_LENGTH(32*8)
585579
r1051r1052
607601   MDRV_CPU_REMOVE("audio")
608602
609603   /* video hardware */
610   MDRV_GFXDECODE(jumpcoas_gfxdecodeinfo)
604   MDRV_GFXDECODE(jumpcoas)
611605
612606   /* sound hardware */
613607   MDRV_SOUND_REMOVE("ay8910.2")
r1051r1052
623617   /* video hardware */
624618   MDRV_PALETTE_LENGTH(256+64+2) /* 256 for characters, 64 for the stars and 2 for the web */
625619   MDRV_COLORTABLE_LENGTH(32*8+64+2)
626   MDRV_GFXDECODE(imago_gfxdecodeinfo)
620   MDRV_GFXDECODE(imago)
627621
628622   MDRV_VIDEO_START(imago)
629623   MDRV_VIDEO_UPDATE(imago)
src/mame/drivers/karnov.c
r1051r1052
637637   16*16
638638};
639639
640static const gfx_decode karnov_gfxdecodeinfo[] =
641{
642   { REGION_GFX1, 0, &chars,     0,  4 },   /* colors 0-31 */
643   { REGION_GFX2, 0, &tiles,   512, 16 },   /* colors 512-767 */
644   { REGION_GFX3, 0, &sprites, 256, 16 },   /* colors 256-511 */
645   { -1 }
646};
640static GFXDECODE_START( karnov )
641   GFXDECODE_ENTRY( REGION_GFX1, 0, chars,     0,  4 )   /* colors 0-31 */
642   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles,   512, 16 )   /* colors 512-767 */
643   GFXDECODE_ENTRY( REGION_GFX3, 0, sprites, 256, 16 )   /* colors 256-511 */
644GFXDECODE_END
647645
648646/******************************************************************************/
649647
r1051r1052
705703   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
706704   MDRV_SCREEN_SIZE(32*8, 32*8)
707705   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
708   MDRV_GFXDECODE(karnov_gfxdecodeinfo)
706   MDRV_GFXDECODE(karnov)
709707   MDRV_PALETTE_LENGTH(1024)
710708
711709   MDRV_PALETTE_INIT(karnov)
r1051r1052
744742   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
745743   MDRV_SCREEN_SIZE(32*8, 32*8)
746744   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
747   MDRV_GFXDECODE(karnov_gfxdecodeinfo)
745   MDRV_GFXDECODE(karnov)
748746   MDRV_PALETTE_LENGTH(1024)
749747
750748   MDRV_PALETTE_INIT(karnov)
src/mame/drivers/lwings.c
r1051r1052
831831};
832832
833833
834static const gfx_decode gfxdecodeinfo[] =
835{
836   { REGION_GFX1, 0, &charlayout,     512, 16 }, /* colors 512-575 */
837   { REGION_GFX2, 0, &bg1_tilelayout,   0,  8 }, /* colors   0-127 */
838   { REGION_GFX3, 0, &spritelayout,   384,  8 }, /* colors 384-511 */
839   { -1 }
840};
834static GFXDECODE_START( lwings )
835   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     512, 16 ) /* colors 512-575 */
836   GFXDECODE_ENTRY( REGION_GFX2, 0, bg1_tilelayout,   0,  8 ) /* colors   0-127 */
837   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   384,  8 ) /* colors 384-511 */
838GFXDECODE_END
841839
842static const gfx_decode gfxdecodeinfo_trojan[] =
843{
844   { REGION_GFX1, 0, &charlayout,     768, 16 }, /* colors 768-831 */
845   { REGION_GFX2, 0, &bg1_tilelayout, 256,  8 }, /* colors 256-383 */
846   { REGION_GFX3, 0, &spritelayout,   640,  8 }, /* colors 640-767 */
847   { REGION_GFX4, 0, &bg2_tilelayout,   0,  8 }, /* colors   0-127 */
848   { -1 }
849};
840static GFXDECODE_START( trojan )
841   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     768, 16 ) /* colors 768-831 */
842   GFXDECODE_ENTRY( REGION_GFX2, 0, bg1_tilelayout, 256,  8 ) /* colors 256-383 */
843   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   640,  8 ) /* colors 640-767 */
844   GFXDECODE_ENTRY( REGION_GFX4, 0, bg2_tilelayout,   0,  8 ) /* colors   0-127 */
845GFXDECODE_END
850846
851847static struct MSM5205interface msm5205_interface =
852848{
r1051r1052
874870   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
875871   MDRV_SCREEN_SIZE(32*8, 32*8)
876872   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
877   MDRV_GFXDECODE(gfxdecodeinfo)
873   MDRV_GFXDECODE(lwings)
878874   MDRV_PALETTE_LENGTH(1024)
879875
880876   MDRV_VIDEO_START(lwings)
r1051r1052
924920   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
925921   MDRV_SCREEN_SIZE(32*8, 32*8)
926922   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
927   MDRV_GFXDECODE(gfxdecodeinfo_trojan)
923   MDRV_GFXDECODE(trojan)
928924   MDRV_PALETTE_LENGTH(1024)
929925
930926   MDRV_VIDEO_START(trojan)
r1051r1052
978974   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
979975   MDRV_SCREEN_SIZE(32*8, 32*8)
980976   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
981   MDRV_GFXDECODE(gfxdecodeinfo_trojan)
977   MDRV_GFXDECODE(trojan)
982978   MDRV_PALETTE_LENGTH(1024)
983979
984980   MDRV_VIDEO_START(avengers)
src/mame/drivers/punchout.c
r1051r1052
748748   8*8   /* every char takes 8 consecutive bytes */
749749};
750750
751static const gfx_decode punchout_gfxdecodeinfo[] =
752{
753   { REGION_GFX1, 0, &charlayout,                 0, 128 },
754   { REGION_GFX2, 0, &charlayout,             128*4, 128 },
755   { REGION_GFX3, 0, &charlayout1,      128*4+128*4,  64 },
756   { REGION_GFX4, 0, &charlayout2, 128*4+128*4+64*8, 128 },
757   { -1 }
758};
751static GFXDECODE_START( punchout )
752   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,                 0, 128 )
753   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,             128*4, 128 )
754   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout1,      128*4+128*4,  64 )
755   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout2, 128*4+128*4+64*8, 128 )
756GFXDECODE_END
759757
760static const gfx_decode armwrest_gfxdecodeinfo[] =
761{
762   { REGION_GFX1, 0, &armwrest_charlayout,        0, 256 },
763   { REGION_GFX2, 0, &armwrest_charlayout2,   256*4,  64 },
764   { REGION_GFX3, 0, &charlayout1,       256*4+64*8,  64 },
765   { REGION_GFX4, 0, &charlayout2,  256*4+64*8+64*8, 128 },
766   { -1 }
767};
758static GFXDECODE_START( armwrest )
759   GFXDECODE_ENTRY( REGION_GFX1, 0, armwrest_charlayout,        0, 256 )
760   GFXDECODE_ENTRY( REGION_GFX2, 0, armwrest_charlayout2,   256*4,  64 )
761   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout1,       256*4+64*8,  64 )
762   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout2,  256*4+64*8+64*8, 128 )
763GFXDECODE_END
768764
769765
770766
r1051r1052
799795
800796   /* video hardware */
801797   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
802   MDRV_GFXDECODE(punchout_gfxdecodeinfo)
798   MDRV_GFXDECODE(punchout)
803799   MDRV_PALETTE_LENGTH(1024+1)
804800   MDRV_COLORTABLE_LENGTH(128*4+128*4+64*8+128*4)
805801   MDRV_DEFAULT_LAYOUT(layout_dualhuov)
r1051r1052
844840   MDRV_CPU_PROGRAM_MAP(armwrest_map,0)
845841
846842   /* video hardware */
847   MDRV_GFXDECODE(armwrest_gfxdecodeinfo)
843   MDRV_GFXDECODE(armwrest)
848844   MDRV_COLORTABLE_LENGTH(256*4+64*8+64*8+128*4)
849845
850846   MDRV_PALETTE_INIT(armwrest)
src/mame/drivers/kopunch.c
r1051r1052
155155   8*8
156156};
157157
158static const gfx_decode gfxdecodeinfo[] =
159{
160   { REGION_GFX1, 0, &charlayout, 0, 1 },
161   { REGION_GFX2, 0, &charlayout, 0, 1 },
162   { -1 }
163};
158static GFXDECODE_START( kopunch )
159   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 1 )
160   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 1 )
161GFXDECODE_END
164162
165163
166164static MACHINE_DRIVER_START( kopunch )
r1051r1052
179177   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
180178   MDRV_SCREEN_SIZE(32*8, 32*8)
181179   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
182   MDRV_GFXDECODE(gfxdecodeinfo)
180   MDRV_GFXDECODE(kopunch)
183181   MDRV_PALETTE_LENGTH(8)
184182
185183   MDRV_PALETTE_INIT(kopunch)
src/mame/drivers/tecmo.c
r1051r1052
535535   32*8
536536};
537537
538static const gfx_decode gfxdecodeinfo[] =
539{
540   { REGION_GFX1, 0, &charlayout, 256, 16 },   /* colors 256 - 511 */
541   { REGION_GFX2, 0, &spritelayout, 0, 16 },   /* colors   0 - 255 */
542   { REGION_GFX3, 0, &tilelayout, 512, 16 },   /* colors 512 - 767 */
543   { REGION_GFX4, 0, &tilelayout, 768, 16 },   /* colors 768 - 1023 */
544   { -1 }
545};
538static GFXDECODE_START( tecmo )
539   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 256, 16 )   /* colors 256 - 511 */
540   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 16 )   /* colors   0 - 255 */
541   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 512, 16 )   /* colors 512 - 767 */
542   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 768, 16 )   /* colors 768 - 1023 */
543GFXDECODE_END
546544
547545
548546
r1051r1052
583581   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
584582   MDRV_SCREEN_SIZE(32*8, 32*8)
585583   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
586   MDRV_GFXDECODE(gfxdecodeinfo)
584   MDRV_GFXDECODE(tecmo)
587585   MDRV_PALETTE_LENGTH(1024)
588586
589587   MDRV_VIDEO_START(tecmo)
src/mame/drivers/news.c
r1051r1052
113113   32*8
114114};
115115
116static const gfx_decode gfxdecodeinfo[] =
117{
118   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
119   { -1 }
120};
116static GFXDECODE_START( news )
117   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
118GFXDECODE_END
121119
122120
123121
r1051r1052
135133   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
136134   MDRV_SCREEN_SIZE(256, 256)
137135   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
138   MDRV_GFXDECODE(gfxdecodeinfo)
136   MDRV_GFXDECODE(news)
139137   MDRV_PALETTE_LENGTH(0x100)
140138
141139   MDRV_VIDEO_START(news)
src/mame/drivers/galpanic.c
r1051r1052
920920   128*8
921921};
922922
923static const gfx_decode gfxdecodeinfo[] =
924{
925   { REGION_GFX1, 0, &spritelayout,  256, 16 },
926   { -1 }
927};
923static GFXDECODE_START( galpanic )
924   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,  256, 16 )
925GFXDECODE_END
928926
929927
930928
r1051r1052
943941   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
944942   MDRV_SCREEN_SIZE(256, 256)
945943   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1)
946   MDRV_GFXDECODE(gfxdecodeinfo)
944   MDRV_GFXDECODE(galpanic)
947945   MDRV_PALETTE_LENGTH(1024 + 32768)
948946
949947   MDRV_PALETTE_INIT(galpanic)
src/mame/drivers/finalizr.c
r1051r1052
394394   32*32
395395};
396396
397static const gfx_decode gfxdecodeinfo[] =
398{
399   { REGION_GFX1, 0, &charlayout,        0, 16 },
400   { REGION_GFX1, 0, &spritelayout,  16*16, 16 },
401   { REGION_GFX1, 0, &charlayout,    16*16, 16 },  /* to handle 8x8 sprites */
402   { -1 }
403};
397static GFXDECODE_START( finalizr )
398   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        0, 16 )
399   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,  16*16, 16 )
400   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    16*16, 16 )  /* to handle 8x8 sprites */
401GFXDECODE_END
404402
405403
406404
r1051r1052
424422   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
425423   MDRV_SCREEN_SIZE(36*8, 32*8)
426424   MDRV_SCREEN_VISIBLE_AREA(1*8, 35*8-1, 2*8, 30*8-1)
427   MDRV_GFXDECODE(gfxdecodeinfo)
425   MDRV_GFXDECODE(finalizr)
428426   MDRV_PALETTE_LENGTH(32)
429427   MDRV_COLORTABLE_LENGTH(2*16*16)
430428
src/mame/drivers/shuuz.c
r1051r1052
245245};
246246
247247
248static const gfx_decode gfxdecodeinfo[] =
249{
250   { REGION_GFX1, 0, &pfmolayout,  256, 16 },      /* sprites & playfield */
251   { REGION_GFX2, 0, &pfmolayout,    0, 16 },      /* sprites & playfield */
252   { -1 }
253};
248static GFXDECODE_START( shuuz )
249   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  256, 16 )      /* sprites & playfield */
250   GFXDECODE_ENTRY( REGION_GFX2, 0, pfmolayout,    0, 16 )      /* sprites & playfield */
251GFXDECODE_END
254252
255253
256254
r1051r1052
271269
272270   /* video hardware */
273271   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
274   MDRV_GFXDECODE(gfxdecodeinfo)
272   MDRV_GFXDECODE(shuuz)
275273   MDRV_PALETTE_LENGTH(1024)
276274
277275   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/cclimber.c
r1051r1052
812812   32*8    /* every sprite takes 32 consecutive bytes */
813813};
814814
815static const gfx_decode gfxdecodeinfo[] =
816{
817   { REGION_GFX1, 0x0000, &charlayout,      0, 16 }, /* char set #1 */
818   { REGION_GFX1, 0x2000, &charlayout,      0, 16 }, /* char set #2 */
819   { REGION_GFX2, 0x0000, &bscharlayout, 16*4,  8 }, /* big sprite char set */
820   { REGION_GFX1, 0x0000, &spritelayout,    0, 16 }, /* sprite set #1 */
821   { REGION_GFX1, 0x2000, &spritelayout,    0, 16 }, /* sprite set #2 */
822   { -1 }
823};
815static GFXDECODE_START( cclimber )
816   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 ) /* char set #1 */
817   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout,      0, 16 ) /* char set #2 */
818   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, bscharlayout, 16*4,  8 ) /* big sprite char set */
819   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,    0, 16 ) /* sprite set #1 */
820   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, spritelayout,    0, 16 ) /* sprite set #2 */
821GFXDECODE_END
824822
825static const gfx_decode swimmer_gfxdecodeinfo[] =
826{
827   { REGION_GFX1, 0, &swimmer_charlayout,      0, 64 }, /* characters */
828   { REGION_GFX1, 0, &swimmer_spritelayout,    0, 32 }, /* sprite set #1 */
829   { REGION_GFX2, 0, &swimmer_charlayout,   64*8, 4 },  /* big sprite set */
830   { -1 }
831};
823static GFXDECODE_START( swimmer )
824   GFXDECODE_ENTRY( REGION_GFX1, 0, swimmer_charlayout,      0, 64 ) /* characters */
825   GFXDECODE_ENTRY( REGION_GFX1, 0, swimmer_spritelayout,    0, 32 ) /* sprite set #1 */
826   GFXDECODE_ENTRY( REGION_GFX2, 0, swimmer_charlayout,   64*8, 4 )  /* big sprite set */
827GFXDECODE_END
832828
833829
834830
r1051r1052
849845   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
850846   MDRV_SCREEN_SIZE(32*8, 32*8)
851847   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
852   MDRV_GFXDECODE(gfxdecodeinfo)
848   MDRV_GFXDECODE(cclimber)
853849   MDRV_PALETTE_LENGTH(96)
854850   MDRV_COLORTABLE_LENGTH(16*4+8*4)
855851
r1051r1052
887883   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
888884   MDRV_SCREEN_SIZE(32*8, 32*8)
889885   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
890   MDRV_GFXDECODE(gfxdecodeinfo)
886   MDRV_GFXDECODE(cclimber)
891887   MDRV_PALETTE_LENGTH(96)
892888   MDRV_COLORTABLE_LENGTH(16*4+8*4)
893889
r1051r1052
928924   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
929925   MDRV_SCREEN_SIZE(32*8, 32*8)
930926   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
931   MDRV_GFXDECODE(swimmer_gfxdecodeinfo)
927   MDRV_GFXDECODE(swimmer)
932928   MDRV_PALETTE_LENGTH(256+32+2)
933929   MDRV_COLORTABLE_LENGTH(64*8+4*8)
934930
src/mame/drivers/xorworld.c
r1051r1052
185185};
186186
187187
188static const gfx_decode gfxdecodeinfo[] =
189{
190   { REGION_GFX1, 0x000000, &tilelayout,   0, 64 },
191   { REGION_GFX1, 0x000000, &spritelayout, 0, 64 },
192   { -1 }
193};
188static GFXDECODE_START( xorworld )
189   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout,   0, 64 )
190   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, spritelayout, 0, 64 )
191GFXDECODE_END
194192
195193
196194static INTERRUPT_GEN( xorworld_interrupt )
r1051r1052
223221   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
224222   MDRV_SCREEN_SIZE(32*8, 32*8)
225223   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
226   MDRV_GFXDECODE(gfxdecodeinfo)
224   MDRV_GFXDECODE(xorworld)
227225   MDRV_PALETTE_LENGTH(256)
228226
229227   MDRV_PALETTE_INIT(xorworld)
src/mame/drivers/speedspn.c
r1051r1052
291291};
292292
293293
294static const gfx_decode gfxdecodeinfo[] =
295{
296   { REGION_GFX1, 0, &speedspn_charlayout,   0x000, 0x40 },
297   { REGION_GFX2, 0, &speedspn_spritelayout, 0x000, 0x40 },
298   { -1 }
299};
294static GFXDECODE_START( speedspn )
295   GFXDECODE_ENTRY( REGION_GFX1, 0, speedspn_charlayout,   0x000, 0x40 )
296   GFXDECODE_ENTRY( REGION_GFX2, 0, speedspn_spritelayout, 0x000, 0x40 )
297GFXDECODE_END
300298
301299/*** MACHINE DRIVER **********************************************************/
302300
r1051r1052
321319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
322320   MDRV_SCREEN_SIZE(64*8, 32*8)
323321   MDRV_SCREEN_VISIBLE_AREA(8*8, 56*8-1, 1*8, 31*8-1)
324   MDRV_GFXDECODE(gfxdecodeinfo)
322   MDRV_GFXDECODE(speedspn)
325323   MDRV_PALETTE_LENGTH(0x400)
326324
327325   MDRV_VIDEO_START(speedspn)
src/mame/drivers/cowrace.c
r1051r1052
140140   8*8
141141};
142142
143static const gfx_decode gfxdecodeinfo_cowrace[] =
144{
145   { REGION_GFX1, 0x000000, &layout8x8x4, 0, 0x1 },
146   { REGION_GFX2, 0x000000, &layout8x8x2, 0, 0x1 },
147   { -1 }
148};
143static GFXDECODE_START( cowrace )
144   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, layout8x8x4, 0, 0x1 )
145   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, layout8x8x2, 0, 0x1 )
146GFXDECODE_END
149147
150148INPUT_PORTS_START( cowrace )
151149   PORT_START   // IN0
r1051r1052
180178   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
181179   MDRV_SCREEN_SIZE(256, 256)
182180   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
183   MDRV_GFXDECODE(gfxdecodeinfo_cowrace)
181   MDRV_GFXDECODE(cowrace)
184182   MDRV_PALETTE_LENGTH(0x1000)
185183
186184   MDRV_VIDEO_START(cowrace)
src/mame/drivers/segaorun.c
r1051r1052
798798};
799799
800800
801static const gfx_decode gfxdecodeinfo[] =
802{
803   { REGION_GFX1, 0, &charlayout,   0, 1024 },
804   { -1 }
805};
801static GFXDECODE_START( segaorun )
802   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1024 )
803GFXDECODE_END
806804
807805
808806
r1051r1052
832830
833831   /* video hardware */
834832   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
835   MDRV_GFXDECODE(gfxdecodeinfo)
833   MDRV_GFXDECODE(segaorun)
836834   MDRV_PALETTE_LENGTH(4096*3)
837835
838836   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/koikoi.c
r1051r1052
233233};
234234
235235
236static const gfx_decode gfxdecodeinfo[] =
237{
238   { REGION_GFX1, 0x0000, &tilelayout,      0, 32 },
239   { -1 }
236static GFXDECODE_START( koikoi )
237   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tilelayout,      0, 32 )
238GFXDECODE_END
240239
241};
242240
243241static struct AY8910interface ay8910_interface =
244242{
r1051r1052
264262   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
265263   MDRV_SCREEN_SIZE(32*8, 32*8)
266264   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
267   MDRV_GFXDECODE(gfxdecodeinfo)
265   MDRV_GFXDECODE(koikoi)
268266   MDRV_PALETTE_LENGTH(8*32)
269267   MDRV_PALETTE_INIT(koikoi)
270268
src/mame/drivers/hexa.c
r1051r1052
115115
116116
117117
118static const gfx_decode gfxdecodeinfo[] =
119{
120   { REGION_GFX1, 0x0000, &charlayout,  0 , 32 },
121   { -1 }
122};
118static GFXDECODE_START( hexa )
119   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,  0 , 32 )
120GFXDECODE_END
123121
124122
125123
r1051r1052
146144   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
147145   MDRV_SCREEN_SIZE(32*8, 32*8)
148146   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
149   MDRV_GFXDECODE(gfxdecodeinfo)
147   MDRV_GFXDECODE(hexa)
150148   MDRV_PALETTE_LENGTH(256)
151149
152150   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/cloak.c
r1051r1052
298298   16*16
299299};
300300
301static const gfx_decode gfxdecodeinfo[] =
302{
303   { REGION_GFX1, 0, &charlayout,     0,  1 },
304   { REGION_GFX2, 0, &spritelayout,  32,  1 },
305   { -1 }
306};
301static GFXDECODE_START( cloak )
302   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0,  1 )
303   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  32,  1 )
304GFXDECODE_END
307305
308306
309307
r1051r1052
355353   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
356354   MDRV_SCREEN_SIZE(32*8, 32*8)
357355   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 3*8, 32*8-1)
358   MDRV_GFXDECODE(gfxdecodeinfo)
356   MDRV_GFXDECODE(cloak)
359357   MDRV_PALETTE_LENGTH(64)
360358
361359   MDRV_VIDEO_START(cloak)
src/mame/drivers/foodf.c
r1051r1052
338338};
339339
340340
341static const gfx_decode gfxdecodeinfo[] =
342{
343   { REGION_GFX1, 0, &charlayout,   0, 64 },
344   { REGION_GFX2, 0, &spritelayout, 0, 32 },
345   { -1 }
346};
341static GFXDECODE_START( foodf )
342   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 64 )
343   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 32 )
344GFXDECODE_END
347345
348346
349347
r1051r1052
385383
386384   /* video hardware */
387385   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
388   MDRV_GFXDECODE(gfxdecodeinfo)
386   MDRV_GFXDECODE(foodf)
389387   MDRV_PALETTE_LENGTH(256)
390388
391389   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/bsktball.c
r1051r1052
260260};
261261
262262
263static const gfx_decode gfxdecodeinfo[] =
264{
265   { REGION_GFX1, 0x0600, &charlayout,   0x00, 0x02 },
266   { REGION_GFX1, 0x0000, &motionlayout, 0x08, 0x40 },
267   { -1 }
268};
263static GFXDECODE_START( bsktball )
264   GFXDECODE_ENTRY( REGION_GFX1, 0x0600, charlayout,   0x00, 0x02 )
265   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, motionlayout, 0x08, 0x40 )
266GFXDECODE_END
269267
270268
271269/*************************************
r1051r1052
289287   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
290288   MDRV_SCREEN_SIZE(32*8, 28*8)
291289   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
292   MDRV_GFXDECODE(gfxdecodeinfo)
290   MDRV_GFXDECODE(bsktball)
293291   MDRV_PALETTE_LENGTH(4)
294292   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
295293
r1051r1052
301299   MDRV_SPEAKER_STANDARD_MONO("mono")
302300
303301   MDRV_SOUND_ADD(DISCRETE, 0)
304   MDRV_SOUND_CONFIG(bsktball_discrete_interface)
302   MDRV_SOUND_CONFIG_DISCRETE(bsktball)
305303   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
306304MACHINE_DRIVER_END
307305
src/mame/drivers/armedf.c
r1051r1052
814814   64*8
815815};
816816
817static const gfx_decode gfxdecodeinfo[] =
818{
819   { REGION_GFX1, 0, &char_layout,       0*16,   32 },
820   { REGION_GFX2, 0, &tile_layout,      64*16,   32 },
821   { REGION_GFX3, 0, &tile_layout,      96*16,   32 },
822   { REGION_GFX4, 0, &sprite_layout,   32*16,   32 },
823   { -1 }
824};
817static GFXDECODE_START( armedf )
818   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,       0*16,   32 )
819   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,      64*16,   32 )
820   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,      96*16,   32 )
821   GFXDECODE_ENTRY( REGION_GFX4, 0, sprite_layout,   32*16,   32 )
822GFXDECODE_END
825823
826824
827825
r1051r1052
846844   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
847845   MDRV_SCREEN_SIZE(64*8, 32*8)
848846   MDRV_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 1*8, 31*8-1 )
849   MDRV_GFXDECODE(gfxdecodeinfo)
847   MDRV_GFXDECODE(armedf)
850848   MDRV_PALETTE_LENGTH(2048)
851849
852850   MDRV_VIDEO_EOF(armedf)
r1051r1052
887885   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
888886   MDRV_SCREEN_SIZE(64*8, 32*8)
889887   MDRV_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
890   MDRV_GFXDECODE(gfxdecodeinfo)
888   MDRV_GFXDECODE(armedf)
891889   MDRV_PALETTE_LENGTH(2048)
892890
893891   MDRV_VIDEO_EOF(armedf)
r1051r1052
928926   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
929927   MDRV_SCREEN_SIZE(64*8, 32*8)
930928   MDRV_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 1*8, 31*8-1 )
931   MDRV_GFXDECODE(gfxdecodeinfo)
929   MDRV_GFXDECODE(armedf)
932930   MDRV_PALETTE_LENGTH(2048)
933931
934932   MDRV_VIDEO_EOF(armedf)
r1051r1052
969967   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
970968   MDRV_SCREEN_SIZE(64*8, 32*8)
971969   MDRV_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
972   MDRV_GFXDECODE(gfxdecodeinfo)
970   MDRV_GFXDECODE(armedf)
973971   MDRV_PALETTE_LENGTH(2048)
974972
975973   MDRV_VIDEO_EOF(armedf)
r1051r1052
10101008   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10111009   MDRV_SCREEN_SIZE(64*8, 32*8)
10121010   MDRV_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
1013   MDRV_GFXDECODE(gfxdecodeinfo)
1011   MDRV_GFXDECODE(armedf)
10141012   MDRV_PALETTE_LENGTH(2048)
10151013
10161014   MDRV_VIDEO_EOF(armedf)
r1051r1052
10511049   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10521050   MDRV_SCREEN_SIZE(64*8, 32*8)
10531051   MDRV_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
1054   MDRV_GFXDECODE(gfxdecodeinfo)
1052   MDRV_GFXDECODE(armedf)
10551053   MDRV_PALETTE_LENGTH(2048)
10561054
10571055   MDRV_VIDEO_EOF(armedf)
src/mame/drivers/acefruit.c
r1051r1052
551551   32*32 /* every sprite takes 128 bytes */
552552};
553553
554static gfx_decode acefruit_gfxdecodeinfo[] =
555{
556   { REGION_GFX1, 0x0000, &spritelayout, 0, 1 },
557   { REGION_GFX1, 0x1800, &charlayout, 8, 4 },
558   { -1 }
559};
554static GFXDECODE_START( acefruit )
555   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 1 )
556   GFXDECODE_ENTRY( REGION_GFX1, 0x1800, charlayout, 8, 4 )
557GFXDECODE_END
560558
561559static MACHINE_DRIVER_START( acefruit )
562560
r1051r1052
564562   MDRV_CPU_ADD(Z80, 2500000) /* 2.5MHz */
565563   MDRV_CPU_PROGRAM_MAP(acefruit_map,0)
566564   MDRV_CPU_IO_MAP(acefruit_io,0)
567   MDRV_GFXDECODE(acefruit_gfxdecodeinfo)
565   MDRV_GFXDECODE(acefruit)
568566   MDRV_CPU_VBLANK_INT(acefruit_vblank,1)
569567
570568   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/dkong.c
r1051r1052
15611561   16*8   /* every sprite takes 16 consecutive bytes */
15621562};
15631563
1564static const gfx_decode gfxdecodeinfo[] =
1565{
1566   { REGION_GFX1, 0x0000, &charlayout,   0, 64 },
1567   { REGION_GFX2, 0x0000, &spritelayout, 0, 64 },
1568   { -1 }
1569};
1564static GFXDECODE_START( dkong )
1565   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 64 )
1566   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 0, 64 )
1567GFXDECODE_END
15701568
1571static const gfx_decode pestplce_gfxdecodeinfo[] =
1572{
1573   { REGION_GFX1, 0x0000, &charlayout,            0, 64 },
1574   { REGION_GFX2, 0x0000, &pestplce_spritelayout, 0, 64 },
1575   { -1 }
1576};
1569static GFXDECODE_START( pestplce )
1570   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,            0, 64 )
1571   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, pestplce_spritelayout, 0, 64 )
1572GFXDECODE_END
15771573
15781574/*************************************
15791575 *
r1051r1052
16321628   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
16331629   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16341630   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1635   MDRV_GFXDECODE(gfxdecodeinfo)
1631   MDRV_GFXDECODE(dkong)
16361632   MDRV_PALETTE_LENGTH(256+256+8+1)
16371633
16381634   MDRV_PALETTE_INIT(radarscp)
r1051r1052
16441640
16451641   MDRV_SPEAKER_STANDARD_MONO("mono")
16461642   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1647   MDRV_SOUND_CONFIG(radarscp_discrete_interface)
1643   MDRV_SOUND_CONFIG_DISCRETE(radarscp)
16481644   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16491645
16501646MACHINE_DRIVER_END
r1051r1052
16671663   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
16681664   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16691665   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1670   MDRV_GFXDECODE(gfxdecodeinfo)
1666   MDRV_GFXDECODE(dkong)
16711667   MDRV_PALETTE_LENGTH(256+256+8+1)
16721668
16731669   MDRV_PALETTE_INIT(radarsc1)
r1051r1052
16801676   MDRV_SPEAKER_STANDARD_MONO("mono")
16811677
16821678   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1683   MDRV_SOUND_CONFIG(radarscp_discrete_interface)
1679   MDRV_SOUND_CONFIG_DISCRETE(radarscp)
16841680   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16851681MACHINE_DRIVER_END
16861682
r1051r1052
17021698   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
17031699   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17041700   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1705   MDRV_GFXDECODE(gfxdecodeinfo)
1701   MDRV_GFXDECODE(dkong)
17061702   MDRV_PALETTE_LENGTH(256)
17071703
17081704   MDRV_PALETTE_INIT(dkong)
r1051r1052
17141710
17151711   MDRV_SPEAKER_STANDARD_MONO("mono")
17161712   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1717   MDRV_SOUND_CONFIG(dkong_discrete_interface)
1713   MDRV_SOUND_CONFIG_DISCRETE(dkong)
17181714   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.7)
17191715MACHINE_DRIVER_END
17201716
r1051r1052
17371733   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
17381734   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17391735   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1740   MDRV_GFXDECODE(gfxdecodeinfo)
1736   MDRV_GFXDECODE(dkong)
17411737   MDRV_PALETTE_LENGTH(256)
17421738
17431739   MDRV_PALETTE_INIT(dkong)
r1051r1052
17711767   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
17721768   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17731769   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1774   MDRV_GFXDECODE(gfxdecodeinfo)
1770   MDRV_GFXDECODE(dkong)
17751771   MDRV_PALETTE_LENGTH(256)
17761772
17771773   MDRV_PALETTE_INIT(dkong)
r1051r1052
18091805   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
18101806   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18111807   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1812   MDRV_GFXDECODE(gfxdecodeinfo)
1808   MDRV_GFXDECODE(dkong)
18131809   MDRV_PALETTE_LENGTH(256)
18141810
18151811   MDRV_PALETTE_INIT(dkong3)
r1051r1052
18451841   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
18461842   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18471843   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1848   MDRV_GFXDECODE(gfxdecodeinfo)
1844   MDRV_GFXDECODE(dkong)
18491845   MDRV_PALETTE_LENGTH(256)
18501846
18511847   MDRV_PALETTE_INIT(dkong)
r1051r1052
18821878   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
18831879   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18841880   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1885   MDRV_GFXDECODE(pestplce_gfxdecodeinfo)
1881   MDRV_GFXDECODE(pestplce)
18861882   MDRV_PALETTE_LENGTH(256)
18871883
18881884   MDRV_PALETTE_INIT(dkong)   // wrong!
src/mame/drivers/sprint4.c
r1051r1052
397397};
398398
399399
400static const gfx_decode sprint4_gfxdecodeinfo[] =
401{
402   { REGION_GFX1, 0, &gfx_8x8x1, 0, 5 },
403   { REGION_GFX2, 0, &car_layout, 0, 5 },
404   { -1 }
405};
400static GFXDECODE_START( sprint4 )
401   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x1, 0, 5 )
402   GFXDECODE_ENTRY( REGION_GFX2, 0, car_layout, 0, 5 )
403GFXDECODE_END
406404
407405
408406static MACHINE_DRIVER_START( sprint4 )
r1051r1052
418416   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
419417   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
420418   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, 0, 256, VTOTAL, 0, 224)
421   MDRV_GFXDECODE(sprint4_gfxdecodeinfo)
419   MDRV_GFXDECODE(sprint4)
422420   MDRV_PALETTE_LENGTH(6)
423421   MDRV_COLORTABLE_LENGTH(10)
424422
r1051r1052
431429   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
432430
433431   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
434   MDRV_SOUND_CONFIG(sprint4_discrete_interface)
432   MDRV_SOUND_CONFIG_DISCRETE(sprint4)
435433   MDRV_SOUND_ROUTE(0, "left", 1.0)
436434   MDRV_SOUND_ROUTE(1, "right", 1.0)
437435
src/mame/drivers/appoooh.c
r1051r1052
207207   32*8   /* every char takes 8 consecutive bytes */
208208};
209209
210static const gfx_decode gfxdecodeinfo[] =
211{
212   { REGION_GFX1, 0, &charlayout,        0, 32 },
213   { REGION_GFX2, 0, &charlayout,     32*8, 32 },
214   { REGION_GFX1, 0, &spritelayout,      0, 32 },
215   { REGION_GFX2, 0, &spritelayout,   32*8, 32 },
216   { -1 }
217};
210static GFXDECODE_START( appoooh )
211   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        0, 32 )
212   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,     32*8, 32 )
213   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,      0, 32 )
214   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   32*8, 32 )
215GFXDECODE_END
218216
219217
220218
r1051r1052
242240   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
243241   MDRV_SCREEN_SIZE(32*8, 32*8)
244242   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
245   MDRV_GFXDECODE(gfxdecodeinfo)
243   MDRV_GFXDECODE(appoooh)
246244   MDRV_PALETTE_LENGTH(32)
247245   MDRV_COLORTABLE_LENGTH(32*8+32*8)
248246
r1051r1052
464462};
465463
466464
467static const gfx_decode robowres_gfxdecodeinfo[] =
468{
469   { REGION_GFX1, 0, &robowres_charlayout,        0, 32 },
470   { REGION_GFX2, 0, &robowres_charlayout,         0, 32 },
471   { REGION_GFX1, 0, &robowres_spritelayout,      0, 32 },
472   { REGION_GFX2, 0, &robowres_spritelayout,       0, 32 },
473   { -1 }
474};
465static GFXDECODE_START( robowres )
466   GFXDECODE_ENTRY( REGION_GFX1, 0, robowres_charlayout,        0, 32 )
467   GFXDECODE_ENTRY( REGION_GFX2, 0, robowres_charlayout,         0, 32 )
468   GFXDECODE_ENTRY( REGION_GFX1, 0, robowres_spritelayout,      0, 32 )
469   GFXDECODE_ENTRY( REGION_GFX2, 0, robowres_spritelayout,       0, 32 )
470GFXDECODE_END
475471
476472static MACHINE_DRIVER_START( robowres )
477473
r1051r1052
489485   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
490486   MDRV_SCREEN_SIZE(32*8, 32*8)
491487   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
492   MDRV_GFXDECODE(robowres_gfxdecodeinfo)
488   MDRV_GFXDECODE(robowres)
493489   MDRV_PALETTE_LENGTH(32)
494490   MDRV_COLORTABLE_LENGTH(32*8+32*8)
495491
src/mame/drivers/skyraid.c
r1051r1052
251251};
252252
253253
254static const gfx_decode skyraid_gfxdecodeinfo[] =
255{
256   { REGION_GFX1, 0, &skyraid_text_layout, 18, 1 },
257   { REGION_GFX2, 0, &skyraid_sprite_layout, 8, 2 },
258   { REGION_GFX3, 0, &skyraid_missile_layout, 16, 1 },
259   { -1 }
260};
254static GFXDECODE_START( skyraid )
255   GFXDECODE_ENTRY( REGION_GFX1, 0, skyraid_text_layout, 18, 1 )
256   GFXDECODE_ENTRY( REGION_GFX2, 0, skyraid_sprite_layout, 8, 2 )
257   GFXDECODE_ENTRY( REGION_GFX3, 0, skyraid_missile_layout, 16, 1 )
258GFXDECODE_END
261259
262260
263261static MACHINE_DRIVER_START( skyraid )
r1051r1052
275273   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
276274   MDRV_SCREEN_SIZE(512, 240)
277275   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 239)
278   MDRV_GFXDECODE(skyraid_gfxdecodeinfo)
276   MDRV_GFXDECODE(skyraid)
279277
280278   MDRV_PALETTE_INIT(skyraid)
281279   MDRV_PALETTE_LENGTH(20)
src/mame/drivers/travrusa.c
r1051r1052
317317   32*8
318318};
319319
320static const gfx_decode gfxdecodeinfo[] =
321{
322   { REGION_GFX1, 0, &charlayout,      0, 16 },
323   { REGION_GFX2, 0, &spritelayout, 16*8, 16 },
324   { -1 }
325};
320static GFXDECODE_START( travrusa )
321   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 16 )
322   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*8, 16 )
323GFXDECODE_END
326324
327static const gfx_decode sht_gfxdecodeinfo[] =
328{
329   { REGION_GFX1, 0, &charlayout,          0, 16 },
330   { REGION_GFX2, 0, &sht_spritelayout, 16*8, 16 },
331   { -1 }
332};
325static GFXDECODE_START( sht )
326   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 16 )
327   GFXDECODE_ENTRY( REGION_GFX2, 0, sht_spritelayout, 16*8, 16 )
328GFXDECODE_END
333329
334330
335331
r1051r1052
350346   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
351347   MDRV_SCREEN_SIZE(32*8, 32*8)
352348   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 32*8-1)
353   MDRV_GFXDECODE(gfxdecodeinfo)
349   MDRV_GFXDECODE(travrusa)
354350
355351   MDRV_PALETTE_LENGTH(128+16)
356352   MDRV_COLORTABLE_LENGTH(16*8+16*8)
r1051r1052
368364   MDRV_IMPORT_FROM(travrusa)
369365
370366   /* video hardware */
371   MDRV_GFXDECODE(sht_gfxdecodeinfo)
367   MDRV_GFXDECODE(sht)
372368
373369   MDRV_PALETTE_INIT(shtrider)
374370MACHINE_DRIVER_END
src/mame/drivers/hanaroku.c
r1051r1052
222222
223223
224224
225static const gfx_decode gfxdecodeinfo[] =
226{
227   { REGION_GFX1, 0, &hanaroku_charlayout,   0, 32  },
225static GFXDECODE_START( hanaroku )
226   GFXDECODE_ENTRY( REGION_GFX1, 0, hanaroku_charlayout,   0, 32  )
228227
229   { -1 }
230};
228GFXDECODE_END
231229
232230
233231static struct AY8910interface ay8910_interface =
r1051r1052
250248   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
251249   MDRV_SCREEN_SIZE(64*8, 64*8)
252250   MDRV_SCREEN_VISIBLE_AREA(0, 48*8-1, 2*8, 30*8-1)
253   MDRV_GFXDECODE(gfxdecodeinfo)
251   MDRV_GFXDECODE(hanaroku)
254252   MDRV_PALETTE_LENGTH(0x200)
255253
256254   MDRV_PALETTE_INIT(hanaroku)
src/mame/drivers/metlclsh.c
r1051r1052
273273   8*8
274274};
275275
276static const gfx_decode metlclsh_gfxdecodeinfo[] =
277{
278   { REGION_GFX1, 0, &spritelayout, 0x00, 2 }, // [0] Sprites
279   { REGION_GFX2, 0, &tilelayout16, 0x10, 1 }, // [1] Background
280   { REGION_GFX3, 0, &tilelayout8,  0x20, 4 }, // [2] Foreground
281   { -1 }
282};
276static GFXDECODE_START( metlclsh )
277   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0x00, 2 ) // [0] Sprites
278   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout16, 0x10, 1 ) // [1] Background
279   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout8,  0x20, 4 ) // [2] Foreground
280GFXDECODE_END
283281
284282
285283/***************************************************************************
r1051r1052
334332   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
335333   MDRV_SCREEN_SIZE(32*8, 32*8)
336334   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 30*8-1)
337   MDRV_GFXDECODE(metlclsh_gfxdecodeinfo)
335   MDRV_GFXDECODE(metlclsh)
338336   MDRV_PALETTE_LENGTH(3 * 16)
339337
340338   MDRV_VIDEO_START(metlclsh)
src/mame/drivers/ddenlovr.c
r1051r1052
22
33Some Dynax/Nakanihon games using the third version of their blitter
44
5Driver by Nicola Salmoria based on preliminary work by Luca Elia
5Driver by Nicola Salmoria, Luca Elia
66
7the driver is a complete mess ATM.
8
97Hardware:
108CPU: Z80 or 68000
119Sound: (AY-3-8910) + YM2413 + MSM6295
r1051r1052
262495 Don Den Lover Vol 1 (J)  D1120901L8      68000   YMZ284 + YM2413 + M6295     NAKANIHON NL-005
272596 Don Den Lover Vol 1 (HK) D11309208L1     68000   YMZ284 + YM2413 + M6295     NAKANIHON NL-005
282696 Panel & Variety Akamaru                  68000   YMZ284 + YM2413 + M6295     NAKANIHON NL-005
2796 Mahjong Fantastic Love   NS5000101 + ?   Z80     YMZ284 + YM2413 + M6295     NAKANIHON NL-005
292896 Hana Kanzashi                            Z80              YM2413 + M6295     70C160F011?
302997 Hana Kagerou                             Z80              YM2413 + M6295     70C160F011
313098 Mahjong Chuukanejyo      D11107218L1     Z80     AY8910 + YM2413 + M6295     70C160F009
r1051r1052
4140
4241TODO:
4342
43- NVRAM, RTC
44
4445- verify whether clip_width/height is actually clip_x_end/y_end
4546  (this also applies to rectangles drawing, command 1c):
4647  the girl in hanakanz divided in 3 chunks (during the intro when bet is on)
r1051r1052
8485- ddenlvrj, akamaru: the elapsed time text in the "game information" screen
8586  is all wrong (RTC/interrupts related).
8687
87- NVRAM
88
8988***************************************************************************/
9089
9190#include "driver.h"
r1051r1052
146145static int dynax_transparency_pen[8], dynax_transparency_mask[8];
147146static int dynax_blit_reg;
148147static int dynax_blit_pen_mask = 0xff;   // not implemented
148static int dynax_blit_rom_bits;         // usually 8, 16 in hanakanz
149static const int *dynax_blit_commands;
149150
151enum { BLIT_NEXT = 0, BLIT_LINE, BLIT_COPY, BLIT_SKIP, BLIT_CHANGE_NUM, BLIT_CHANGE_PEN, BLIT_UNKNOWN, BLIT_STOP };
152//                                              0          1                2                   3               4               5                   6                   7
153static const int ddenlovr_blit_commands[8]   = { BLIT_NEXT, BLIT_LINE,      BLIT_COPY,         BLIT_SKIP,      BLIT_UNKNOWN,   BLIT_CHANGE_NUM,   BLIT_CHANGE_PEN,   BLIT_STOP   };
154static const int hanakanz_blit_commands[8]   = { BLIT_NEXT, BLIT_CHANGE_PEN,   BLIT_CHANGE_NUM,   BLIT_UNKNOWN,   BLIT_SKIP,      BLIT_COPY,         BLIT_LINE,         BLIT_STOP   };
155static const int mjflove_blit_commands[8]   = { BLIT_STOP, BLIT_CHANGE_PEN,   BLIT_CHANGE_NUM,   BLIT_UNKNOWN,   BLIT_SKIP,      BLIT_COPY,         BLIT_LINE,         BLIT_NEXT   };
150156
151157VIDEO_START(ddenlovr)
152158{
r1051r1052
161167   // older games do not set these !?
162168   dynax_clip_width = 0x400;
163169   dynax_clip_height = 0x400;
170
171   dynax_blit_rom_bits = 8;
172   dynax_blit_commands = ddenlovr_blit_commands;
164173}
165174
166175VIDEO_START(mmpanic)
r1051r1052
170179   extra_layers = 1;
171180}
172181
182VIDEO_START(hanakanz)
183{
184   video_start_ddenlovr(machine);
173185
186   dynax_blit_rom_bits = 16;
187   dynax_blit_commands = hanakanz_blit_commands;
188}
189
190VIDEO_START(mjflove)
191{
192   video_start_ddenlovr(machine);
193
194   dynax_blit_commands = mjflove_blit_commands;
195}
196
174197static void dynax_flipscreen_w( UINT8 data )
175198{
176199   logerror("flipscreen = %02x (%s)\n",data,(data&1)?"off":"on");
r1051r1052
335358{
336359   UINT8 *src_data = memory_region(REGION_GFX1);
337360   int src_len = memory_region_length(REGION_GFX1);
338   int bit_addr = (src & 0xffffff) * 8;   /* convert to bit address */
361   int bit_addr = (src & 0xffffff) * dynax_blit_rom_bits;   /* convert to bit address */
339362   int pen_size, arg_size, cmd;
340363   int x;
341364   int xinc = (dynax_blit_flip & 1) ? -1 : 1;
r1051r1052
354377   for (;;)
355378   {
356379      cmd = fetch_word(src_data,src_len,&bit_addr,3);
357      switch (cmd)
380      switch ( dynax_blit_commands[cmd] )
358381      {
359         case 0:   // NEXT
382         case BLIT_NEXT:
360383            /* next line */
361384            dynax_blit_y += yinc;
362385            x = sx;
363386            break;
364387
365         case 1:   // LINE
388         case BLIT_LINE:
366389            {
367390               int length = fetch_word(src_data,src_len,&bit_addr,arg_size);
368391               int pen = fetch_word(src_data,src_len,&bit_addr,pen_size);
r1051r1052
376399            }
377400            break;
378401
379         case 2:   // COPY
402         case BLIT_COPY:
380403            {
381404               int length = fetch_word(src_data,src_len,&bit_addr,arg_size);
382405               while (length-- >= 0)
r1051r1052
390413            }
391414            break;
392415
393         case 3:   // SKIP
416         case BLIT_SKIP:
394417            x += xinc * fetch_word(src_data,src_len,&bit_addr,arg_size);
395418            break;
396419
397         case 5:   // CHGA
420         case BLIT_CHANGE_NUM:
398421            arg_size = fetch_word(src_data,src_len,&bit_addr,4) + 1;
399422            break;
400423
401         case 6:   // CHGP
424         case BLIT_CHANGE_PEN:
402425            pen_size = fetch_word(src_data,src_len,&bit_addr,3) + 1;
403426            break;
404427
405428         default:
406429            log_draw_error(src,cmd);
407430         // fall through
408         case 7:   // STOP
409            return ((bit_addr + 7) / 8) & 0xffffff;
431         case BLIT_STOP:
432            return ((bit_addr + dynax_blit_rom_bits - 1) / dynax_blit_rom_bits) & 0xffffff;
410433      }
411434   }
412435}
413436
414437
415static int hanakanz_blit_draw(int src,int sx)
416{
417   UINT8 *src_data = memory_region(REGION_GFX1);
418   int src_len = memory_region_length(REGION_GFX1);
419   int bit_addr = (src & 0xffffff) * 8 * 2;   /* convert to bit address */
420   int pen, pen_size, arg_size, cmd;
421   int x;
422   int xinc = (dynax_blit_flip & 1) ? -1 : 1;
423   int yinc = (dynax_blit_flip & 2) ? -1 : 1;
424438
425   pen_size = fetch_word(src_data,src_len,&bit_addr,4) + 1;
426   arg_size = fetch_word(src_data,src_len,&bit_addr,4) + 1;
427
428#ifdef MAME_DEBUG
429   if (pen_size > 4 || arg_size > 8)
430      popmessage("warning: pen_size %d arg_size %d",pen_size,arg_size);
431#endif
432
433   x = sx;
434
435   for (;;)
436   {
437      cmd = fetch_word(src_data,src_len,&bit_addr,3);
438      switch (cmd)
439      {
440         case 0:   // NEXT
441            /* next line */
442            dynax_blit_y += yinc;
443            x = sx;
444            break;
445
446         case 1:   // CHGP
447            pen_size = fetch_word(src_data,src_len,&bit_addr,3) + 1;
448            break;
449
450         case 2:   // CHGA
451            arg_size = fetch_word(src_data,src_len,&bit_addr,4) + 1;
452            break;
453
454         case 4:   // SKIP
455            x += xinc * fetch_word(src_data,src_len,&bit_addr,arg_size);
456            break;
457
458         case 5:   // COPY
459         {
460            int length = fetch_word(src_data,src_len,&bit_addr,arg_size);
461            while (length-- >= 0)
462            {
463               pen = fetch_word(src_data,src_len,&bit_addr,pen_size);
464               if (dynax_blit_pen_mode) pen = (dynax_blit_pen & 0x0f);
465               pen |= dynax_blit_pen & 0xf0;
466               do_plot(x,dynax_blit_y,pen);
467               x += xinc;
468            }
469         }
470         break;
471
472         case 6:   // LINE
473         {
474            int length = fetch_word(src_data,src_len,&bit_addr,arg_size);
475            pen = fetch_word(src_data,src_len,&bit_addr,pen_size);
476            if (dynax_blit_pen_mode) pen = (dynax_blit_pen & 0x0f);
477            pen |= dynax_blit_pen & 0xf0;
478            while (length-- >= 0)
479            {
480               do_plot(x,dynax_blit_y,pen);
481               x += xinc;
482            }
483         }
484         break;
485
486         default:
487            log_draw_error(src,cmd);
488         // fall through
489         case 7:   // STOP
490            return (bit_addr + 15) / 16;
491      }
492   }
493}
494
495
496
497439/*  Draw a simple rectangle
498440*/
499441static void blit_rect_xywh(void)
r1051r1052
11331075            case 0x14:   blit_fill_xy(dynax_blit_x, dynax_blit_y);
11341076                     break;
11351077
1136            case 0x10:   dynax_blit_address = hanakanz_blit_draw(dynax_blit_address,dynax_blit_x);
1078            case 0x10:   dynax_blit_address = blit_draw(dynax_blit_address,dynax_blit_x);
11371079                     break;
11381080
11391081            case 0x13:   blit_horiz_line();
r1051r1052
12961238   dynax_blit_pen_mode = 0;
12971239   dynax_blit_y = 5;
12981240   dynax_clip_ctrl = 0x0f;
1299//  next = blit_draw(base,0);
1300   next = hanakanz_blit_draw(base,0);
1301if (input_code_pressed(KEYCODE_Z))
1302   popmessage("%06x",base);
1241   next = blit_draw(base,0);
1242   popmessage("GFX %06x",base);
13031243   if (input_code_pressed(KEYCODE_S)) base = next;
13041244   if (input_code_pressed_once(KEYCODE_X)) base = next;
13051245   if (input_code_pressed(KEYCODE_C)) { base--; while ((memory_region(REGION_GFX1)[base] & 0xf0) != 0x30) base--; }
r1051r1052
31133053ADDRESS_MAP_END
31143054
31153055
3056/***************************************************************************
3057                          Mahjong Fantastic Love
3058***************************************************************************/
3059
3060static WRITE8_HANDLER( mjflove_rombank_w )
3061{
3062   UINT8 *rom = memory_region(REGION_CPU1);
3063   memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0xf)]);
3064}
3065
3066static WRITE8_HANDLER( mjflove_okibank_w )
3067{
3068   OKIM6295_set_bank_base(0, (data & 0x07) * 0x40000);
3069//  popmessage("SOUND = %02x",data);
3070}
3071
3072static READ8_HANDLER( mjflove_protection_r )
3073{
3074   return 0x27;
3075}
3076
3077static READ8_HANDLER( mjflove_keyb_r )
3078{
3079   UINT8 val = 0xff;
3080
3081   if      (!(keyb & 0x01))   val = readinputport(offset * 5 + 1);
3082   else if (!(keyb & 0x02))   val = readinputport(offset * 5 + 2);
3083   else if (!(keyb & 0x04))   val = readinputport(offset * 5 + 3);
3084   else if (!(keyb & 0x08))   val = readinputport(offset * 5 + 4);
3085   else if (!(keyb & 0x10))   val = readinputport(offset * 5 + 5);
3086
3087   return val;
3088}
3089
3090UINT8 mjflove_irq_cause;
3091
3092static READ8_HANDLER( mjflove_blitter_r )
3093{
3094   // bit 7 = 1 -> blitter busy
3095   // bit 6 = 0 -> VBLANK?
3096   // bit 5 = 0 -> RTC?
3097   return readinputport(0) | mjflove_irq_cause;
3098}
3099
3100static WRITE8_HANDLER( mjflove_blitter_w )
3101{
3102   blitter_w(0,offset,data,0);
3103}
3104
3105static WRITE8_HANDLER( mjflove_coincounter_w )
3106{
3107   // bit 0 = in counter
3108   coin_counter_w(0, data   & 0x01);
3109
3110   if (data & 0xfe)
3111   {
3112      logerror("%04x: warning, coin counter = %02x\n", activecpu_get_pc(), data);
3113//      popmessage("COIN = %02x",data);
3114   }
3115}
3116
3117static ADDRESS_MAP_START( mjflove_readport, ADDRESS_SPACE_IO, 8 )   // 16 bit I/O
3118   AM_RANGE(0x0010, 0x0010) AM_READ( hanakanz_rand_r         )   AM_MIRROR(0xff00)
3119   AM_RANGE(0x001c, 0x001c) AM_READ( input_port_12_r         )   AM_MIRROR(0xff00)
3120   AM_RANGE(0x0038, 0x0038) AM_READ( MRA8_NOP               )   // ? ack or watchdog
3121   AM_RANGE(0x0043, 0x0043) AM_READ( rongrong_gfxrom_r         )
3122   AM_RANGE(0x0080, 0x0081) AM_READ( mjflove_keyb_r         )
3123   AM_RANGE(0x0082, 0x0082) AM_READ( mjflove_blitter_r         )
3124   AM_RANGE(0x00da, 0x00da) AM_READ( mjflove_protection_r      )   AM_MIRROR(0xff00)
3125   AM_RANGE(0x0100, 0x0100) AM_READ( input_port_11_r         )
3126   AM_RANGE(0x0280, 0x028f) AM_READ( msm6242_r               )   // 6242RTC
3127   AM_RANGE(0x0380, 0x0380) AM_READ( OKIM6295_status_0_r      )
3128ADDRESS_MAP_END
3129
3130static ADDRESS_MAP_START( mjflove_writeport, ADDRESS_SPACE_IO, 8 )   // 16 bit I/O
3131   AM_RANGE(0x001e, 0x001e) AM_WRITE( hanakanz_keyb_w         )   AM_MIRROR(0xff00)
3132   AM_RANGE(0x0020, 0x0023) AM_WRITE( dynax_palette_base_w      )
3133   AM_RANGE(0x0024, 0x0027) AM_WRITE( dynax_palette_mask_w      )
3134   AM_RANGE(0x0028, 0x002b) AM_WRITE( dynax_transparency_pen_w   )
3135   AM_RANGE(0x002c, 0x002f) AM_WRITE( dynax_transparency_mask_w)
3136   AM_RANGE(0x0034, 0x0034) AM_WRITE( dynax_bgcolor_w         )
3137   AM_RANGE(0x0035, 0x0035) AM_WRITE( dynax_priority_w         )
3138   AM_RANGE(0x0036, 0x0036) AM_WRITE( dynax_layer_enable_w      )
3139   AM_RANGE(0x0040, 0x0041) AM_WRITE( mjflove_blitter_w      )   AM_MIRROR(0xff00)
3140   AM_RANGE(0x00f2, 0x00f2) AM_WRITE( mjmyster_rambank_w      )   AM_MIRROR(0xff00)
3141   AM_RANGE(0x00f8, 0x00f8) AM_WRITE( mjflove_rombank_w      )   AM_MIRROR(0xff00)
3142   AM_RANGE(0x00fa, 0x00fa) AM_WRITE( mjflove_okibank_w      )
3143   AM_RANGE(0x0181, 0x0181) AM_WRITE( MWA8_NOP               )   // ? int. enable
3144   AM_RANGE(0x0184, 0x0184) AM_WRITE( mjflove_coincounter_w   )
3145   AM_RANGE(0x0200, 0x0200) AM_WRITE( YM2413_register_port_0_w   )
3146   AM_RANGE(0x0201, 0x0201) AM_WRITE( YM2413_data_port_0_w      )
3147   AM_RANGE(0x0280, 0x028f) AM_WRITE( msm6242_w            )   // 6242RTC
3148   AM_RANGE(0x0300, 0x0300) AM_WRITE( AY8910_control_port_0_w   )
3149   AM_RANGE(0x0301, 0x0301) AM_WRITE( AY8910_write_port_0_w   )
3150   AM_RANGE(0x0380, 0x0380) AM_WRITE( OKIM6295_data_0_w      )
3151ADDRESS_MAP_END
3152
3153
31163154INPUT_PORTS_START( ddenlvrj )
31173155   PORT_START   // IN0 - Player 1
31183156   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r1051r1052
57215759   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
57225760INPUT_PORTS_END
57235761
5762INPUT_PORTS_START( mjflove )
5763   PORT_START   // IN0 - Coins + Service Keys
5764   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1    )
5765   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2    )
5766   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
5767   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE  ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)   PORT_TOGGLE
5768   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
5769   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // RTC
5770   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter irq flag
5771   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter busy flag
57245772
5773   // keyb 1
5774   PORT_START
5775   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A      )   // A
5776   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E      )   // E
5777   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I      )   // I
5778   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M      )   // M
5779   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN      )   // Kan
5780   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1         )   // Start 1
5781
5782   PORT_START
5783   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B      )   // B
5784   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F      )   // F
5785   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J      )   // J
5786   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N      )   // N
5787   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH   )   // Reach
5788   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET      )   // BET
5789
5790   PORT_START
5791   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C      )   // C
5792   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G      )   // G
5793   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K      )   // K
5794   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI      )   // Chi
5795   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON      )   // Ron
5796   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN         )   // nothing
5797
5798   PORT_START
5799   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D      )   // D
5800   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H      )   // H
5801   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L      )   // L
5802   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON      )   // Pon
5803   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN         )   // nothing
5804   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN         )   // nothing
5805
5806   PORT_START
5807   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE   )   // "l"
5808   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE      )   // "t"
5809   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP   )   // "w"
5810   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP   )   // Flip Flop
5811   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG         )   // "b"
5812   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL      )   // "s"
5813
5814   // keyb 2
5815   PORT_START
5816   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A      )   PORT_PLAYER(2)   // A
5817   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E      )   PORT_PLAYER(2)   // E
5818   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I      )   PORT_PLAYER(2)   // I
5819   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M      )   PORT_PLAYER(2)   // M
5820   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN      )   PORT_PLAYER(2)   // Kan
5821   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2         )   // Start 2
5822
5823   PORT_START
5824   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B      )   PORT_PLAYER(2)   // B
5825   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F      )   PORT_PLAYER(2)   // F
5826   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J      )   PORT_PLAYER(2)   // J
5827   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N      )   PORT_PLAYER(2)   // N
5828   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH   )   PORT_PLAYER(2)   // Reach
5829   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET      )   PORT_PLAYER(2)   // BET
5830
5831   PORT_START
5832   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C      )   PORT_PLAYER(2)   // C
5833   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G      )   PORT_PLAYER(2)   // G
5834   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K      )   PORT_PLAYER(2)   // K
5835   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI      )   PORT_PLAYER(2)   // Chi
5836   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON      )   PORT_PLAYER(2)   // Ron
5837   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN         )   // nothing
5838
5839   PORT_START
5840   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D      )   PORT_PLAYER(2)   // D
5841   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H      )   PORT_PLAYER(2)   // H
5842   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L      )   PORT_PLAYER(2)   // L
5843   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON      )   PORT_PLAYER(2)   // Pon
5844   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN         )   // nothing
5845   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN         )   // nothing
5846
5847   PORT_START
5848   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE   )   PORT_PLAYER(2)   // "l"
5849   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE      )   PORT_PLAYER(2)   // "t"
5850   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP   )   PORT_PLAYER(2)   // "w"
5851   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP   )   PORT_PLAYER(2)   // Flip Flop
5852   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG         )   PORT_PLAYER(2)   // "b"
5853   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL      )   PORT_PLAYER(2)   // "s"
5854
5855   PORT_START   // IN11 - DSW1
5856   PORT_DIPNAME( 0x01, 0x01, "Unknown 2-0" )
5857   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5858   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5859   PORT_DIPNAME( 0x02, 0x02, "Unknown 2-1" )
5860   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5861   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5862   PORT_DIPNAME( 0x04, 0x04, "Unknown 2-2" )
5863   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
5864   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5865   PORT_DIPNAME( 0x08, 0x08, "Unknown 2-3" )
5866   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5867   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5868   PORT_DIPNAME( 0x10, 0x10, "Unknown 2-4" )
5869   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
5870   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5871   PORT_DIPNAME( 0x20, 0x20, "Unknown 2-5" )
5872   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5873   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5874   PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
5875   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5876   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5877   PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
5878   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5879   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5880
5881   PORT_START   // IN12 - DSW2
5882   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
5883   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
5884   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
5885   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
5886   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
5887   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Difficulty ) )
5888   PORT_DIPSETTING(    0x18, "0" )
5889   PORT_DIPSETTING(    0x14, "1" )
5890   PORT_DIPSETTING(    0x10, "2" )
5891   PORT_DIPSETTING(    0x1c, "3" )
5892   PORT_DIPSETTING(    0x0c, "4" )
5893   PORT_DIPSETTING(    0x08, "5" )
5894   PORT_DIPSETTING(    0x04, "6" )
5895   PORT_DIPSETTING(    0x00, "7" )
5896   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
5897   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
5898   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
5899   PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6" )
5900   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5901   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5902   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
5903INPUT_PORTS_END
5904
5905
57255906/***************************************************************************
57265907                            Don Den Lover Vol.1
57275908***************************************************************************/
r1051r1052
59996180   MDRV_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-11-1)
60006181   MDRV_PALETTE_LENGTH(0x200)
60016182
6002   MDRV_VIDEO_START(ddenlovr)
6183   MDRV_VIDEO_START(hanakanz)   // blitter commands in the roms are shuffled around
60036184   MDRV_VIDEO_EOF(ddenlovr)
60046185   MDRV_VIDEO_UPDATE(ddenlovr)
60056186
r1051r1052
62216402   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
62226403MACHINE_DRIVER_END
62236404
6405static INTERRUPT_GEN( mjflove_irq )
6406{
6407   mjflove_irq_cause = (1 << 5) | (1 << 6);
62246408
6409   switch (cpu_getiloops())
6410   {
6411      case 0:
6412         mjflove_irq_cause &= 1 << 5;
6413         cpunum_set_input_line(0, 0, HOLD_LINE);
6414         break;
6415      case 1:
6416         mjflove_irq_cause &= 1 << 6;
6417         cpunum_set_input_line(0, 0, HOLD_LINE);
6418         break;
6419   }
6420}
62256421
6422static MACHINE_DRIVER_START( mjflove )
6423   /* basic machine hardware */
6424   MDRV_IMPORT_FROM( quizchq )
6425   MDRV_CPU_MODIFY("main")
6426   MDRV_CPU_PROGRAM_MAP(rongrong_readmem,rongrong_writemem)
6427   MDRV_CPU_IO_MAP(mjflove_readport,mjflove_writeport)
6428   MDRV_CPU_VBLANK_INT(mjflove_irq, 2)
6429
6430   MDRV_VIDEO_START(mjflove)   // blitter commands in the roms are shuffled around
6431
6432   MDRV_SOUND_ADD(AY8910, 28636363/8)
6433   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
6434MACHINE_DRIVER_END
6435
6436
62266437/***************************************************************************
62276438
62286439Monkey Mole Panic
r1051r1052
73037514   ROM_LOAD( "50103.1f", 0x280000, 0x080000, CRC(aff3a753) SHA1(1ee4464107531d90a1decb85c5a0fb937dd6706b) )   // bank 10, 11
73047515ROM_END
73057516
7517/***************************************************************************
73067518
7519Mahjong Fantastic Love
7520Nakanihon, 1996
7521
7522PCB Layout
7523----------
7524no number (scratched off) Looks like Don Den Lover h/w
7525|--------------------------------------------------|
7526|UPC1242H  BATTERY                P1               |
7527|                 M6295      TC55257               |
7528|                                          *       |
7529|                72421B_RTC  TC55257               |
7530|YM2413     YMZ284-D               PAL             |
7531|                                                  |
7532|                                                  |
7533|J                                                 |
7534|A                                           24MHz |
7535|M           28.63636MHz                           |
7536|M                                     M514262     |
7537|A                                                 |
7538|                                      M514262     |
7539|                         |--------|               |
7540|                         |        |   M514262     |
7541|                         | NL-005 |               |
7542|             TC5588      |        |   M514262     |
7543|                         |        |               |
7544|                         |--------|   M514262     |
7545|DSW1(8)                          P2               |
7546|--------------------------------------------------|
7547Notes:
7548      *       - SDIP64 socket, not populated
7549      P1/P2   - Connector joining to ROM daughterboard
7550      TC55257 - 32k x8 SRAM
7551      TC5588  - 8k x8 SRAM
7552      M514262 - OKI M514262-70Z 262144-word x 4-bit Multiport DRAM
7553      YMZ284  - Yamaha YMZ284-D Software Controlled Melody and Effect Sound Generator (DIP16)
7554                Software compatible with YM2149. Clock 3.579545MHz [28.63636/8]
7555      YM2413  - OPLL FM Sound Generator (DIP18). Clock 3.579545MHz [28.63636/8]
7556      M6295   - Clock 1.02272MHz [28.63636/28]. Pin7 HIGH
7557      VSync   - 60Hz
7558      HSync   - 15.28kHz
7559
7560
7561Top Board
7562---------
7563NS5000101
7564|---------------------------------|
7565|                    16MHz        |
7566|       &                *        |
7567|                                 |
7568|                                 |
7569|                                 |
7570|                          DSW1(8)|
7571|                                 |
7572|50001   50003   50005   50007    |
7573|    50002   50004   50006        |
7574|                                 |
7575|                                 |
7576|50008           50010   50012    |
7577|    50009           50011   50013|
7578|                                 |
7579|                                 |
7580|---------------------------------|
7581Notes:
7582      &     - Unknown PLCC68 chip (surface scratched). Maybe CPLD/FPGA or custom? Doesn't
7583              look like 68000 as there is no measurable clock input on any pins.
7584      *     - Unknown QFP100 (surface scratched). Clock input of 16MHz. Possibly TMPZ84C015?
7585
7586***************************************************************************/
7587
7588ROM_START( mjflove )
7589   ROM_REGION( 0x90000+16*0x1000, REGION_CPU1, 0 )   /* Z80 Code */
7590   ROM_LOAD( "50004.2e", 0x00000, 0x80000, CRC(20afcdec) SHA1(b3e7d6083dab812a497b69a501e9d993a8ca86e7) )
7591   ROM_RELOAD(           0x10000, 0x80000 )
7592
7593   ROM_REGION( 0x3c0000, REGION_GFX1, 0 )   /* blitter data */
7594   ROM_LOAD( "50005.2d", 0x000000, 0x80000, CRC(6494d5ad) SHA1(2313ee2f897320715c3de9a0de5c66e06b763a5f) )
7595   ROM_LOAD( "50006.2c", 0x080000, 0x80000, CRC(a1d61eb7) SHA1(4755c3843890f4682d5e5804153baba3d98ac2cc) )
7596   ROM_LOAD( "50007.2b", 0x100000, 0x80000, CRC(d79ea2f5) SHA1(9c783ee8fe1f646ad2402676c3b924678955a964) )
7597   ROM_LOAD( "50009.3h", 0x180000, 0x80000, CRC(cba17351) SHA1(22f901bcd7d1513a4fb56fb95f8568c842a3d42a) )
7598   ROM_LOAD( "50013.3a", 0x200000, 0x80000, CRC(ebb7c8bd) SHA1(16b4584d2a15c092ad7b2538850a39c81a5db753) )
7599   ROM_LOAD( "50010.3d", 0x280000, 0x80000, CRC(62c05df9) SHA1(da60ba77d2bcc560abfba9ca19586f90c07c4411) )
7600   ROM_LOAD( "50011.3c", 0x300000, 0x80000, CRC(7e05f586) SHA1(4dd17da3922365b9a1424f270ad07c5f6848558b) )
7601   ROM_LOAD( "50012.3b", 0x380000, 0x40000, CRC(9853e5e4) SHA1(8596459ab8614dbd2ddd068afb1b4655cbe3bb08) )
7602
7603   ROM_REGION( 0x200000, REGION_SOUND1, 0 )   /* Samples */
7604   ROM_LOAD( "50002.2h", 0x000000, 0x80000, CRC(955034db) SHA1(190f37b77df0331243d52a60ddbd9c1398053f18) )   // 0,1
7605   ROM_LOAD( "50003.2f", 0x080000, 0x80000, CRC(8845734a) SHA1(c44d006cdf41da0187283faa8d060ed5d2d183fd) )   // 2,3
7606   ROM_LOAD( "50001.2j", 0x100000, 0x80000, CRC(6c0a93fd) SHA1(6a4359af79a0c18979ab15c8a2700880ec530192) )   // 4,5
7607   ROM_LOAD( "50008.3j", 0x180000, 0x40000, CRC(4a95b5eb) SHA1(02306cb11c889772c19f1635dbd34c0d03192af1) )   // 6
7608   ROM_RELOAD(           0x1c0000, 0x40000 )
7609ROM_END
7610
7611
73077612GAME( 1992, mmpanic,  0,        mmpanic,  mmpanic,  0,        ROT0, "Nakanihon + East Technology (Taito license)", "Monkey Mole Panic (USA)",                            GAME_NO_COCKTAIL )
73087613GAME( 1993, funkyfig, 0,        funkyfig, funkyfig, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "The First Funky Fighter",                            GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )   // scrolling, priority?
73097614GAME( 1993, quizchq,  0,        quizchq,  quizchq,  0,        ROT0, "Nakanihon",                                   "Quiz Channel Question (Ver 1.00) (Japan)",           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
r1051r1052
73257630GAME( 1996, ddenlovb, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "[Dynax] (bootleg)",                           "Don Den Lover Vol. 1 (Korea, bootleg)",              GAME_NO_COCKTAIL )
73267631GAME( 1996, hanakanz, 0,        hanakanz, hanakanz, 0,        ROT0, "Dynax",                                       "Hana Kanzashi (Japan)",                              GAME_NO_COCKTAIL )
73277632GAME( 1996, akamaru,  0,        akamaru,  akamaru,  0,        ROT0, "Dynax (Nakanihon licence)",                   "Panel & Variety Akamaru Q Jousyou Dont-R",           GAME_NO_COCKTAIL )
7633GAME( 1996, mjflove,  0,        mjflove,  mjflove,  0,        ROT0, "Nakanihon",                                   "Mahjong Fantastic Love (Japan)",                     GAME_NO_COCKTAIL )
73287634GAME( 1997, hkagerou, 0,        hkagerou, hkagerou, 0,        ROT0, "Nakanihon + Dynax",                           "Hana Kagerou [BET] (Japan)",                         GAME_NO_COCKTAIL )
73297635GAME( 1998, mjchuuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong Chuukanejyo (China)",                        GAME_NO_COCKTAIL )
73307636GAME( 1998, mjreach1, 0,        mjreach1, mjreach1, 0,        ROT0, "Nihon System",                                "Mahjong Reach Ippatsu (Japan)",                      GAME_NO_COCKTAIL )
src/mame/drivers/chinagat.c
r1051r1052
450450   64*8 /* every char takes 64 consecutive bytes */
451451};
452452
453static const gfx_decode gfxdecodeinfo[] =
454{
455   { REGION_GFX1, 0, &charlayout,   0,16 },   /*  8x8  chars */
456   { REGION_GFX2, 0, &tilelayout, 128, 8 },   /* 16x16 sprites */
457   { REGION_GFX3, 0, &tilelayout, 256, 8 },   /* 16x16 background tiles */
458   { -1 }
459};
453static GFXDECODE_START( chinagat )
454   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0,16 )   /*  8x8  chars */
455   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 128, 8 )   /* 16x16 sprites */
456   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 256, 8 )   /* 16x16 background tiles */
457GFXDECODE_END
460458
461459static void chinagat_irq_handler(int irq) {
462460   cpunum_set_input_line( 2, 0, irq ? ASSERT_LINE : CLEAR_LINE );
r1051r1052
515513   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
516514   MDRV_SCREEN_SIZE(32*8, 32*8)
517515   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
518   MDRV_GFXDECODE(gfxdecodeinfo)
516   MDRV_GFXDECODE(chinagat)
519517   MDRV_PALETTE_LENGTH(384)
520518
521519   MDRV_VIDEO_START(chinagat)
r1051r1052
562560   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
563561   MDRV_SCREEN_SIZE(32*8, 32*8)
564562   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
565   MDRV_GFXDECODE(gfxdecodeinfo)
563   MDRV_GFXDECODE(chinagat)
566564   MDRV_PALETTE_LENGTH(384)
567565
568566   MDRV_VIDEO_START(chinagat)
r1051r1052
605603   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
606604   MDRV_SCREEN_SIZE(32*8, 32*8)
607605   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
608   MDRV_GFXDECODE(gfxdecodeinfo)
606   MDRV_GFXDECODE(chinagat)
609607   MDRV_PALETTE_LENGTH(384)
610608
611609   MDRV_VIDEO_START(chinagat)
src/mame/drivers/kaneko16.c
r1051r1052
17201720   16*16*8
17211721};
17221722
1723static const gfx_decode kaneko16_gfx_1x4bit_1x4bit[] =
1724{
1725   { REGION_GFX1, 0, &layout_16x16x4, 0,         0x40 }, // [0] Sprites
1726   { REGION_GFX2, 0, &layout_16x16x4, 0x40 * 16,   0x40 }, // [1] Layers
1727   { -1 }
1728};
1729static const gfx_decode kaneko16_gfx_1x4bit_2x4bit[] =
1730{
1731   { REGION_GFX1, 0, &layout_16x16x4, 0,         0x40 }, // [0] Sprites
1732   { REGION_GFX2, 0, &layout_16x16x4, 0x40 * 16,   0x40 }, // [1] Layers
1733   { REGION_GFX3, 0, &layout_16x16x4, 0x40 * 16,   0x40 }, // [2] Layers
1734   { -1 }
1735};
1736static const gfx_decode kaneko16_gfx_1x8bit_2x4bit[] =
1737{
1738   { REGION_GFX1, 0, &layout_16x16x8,   0x40 * 256,   0x40 }, // [0] Sprites
1739   { REGION_GFX2, 0, &layout_16x16x4,   0,         0x40 }, // [1] Layers
1740   { REGION_GFX3, 0, &layout_16x16x4,   0,         0x40 }, // [2] Layers
1741   { -1 }
1742};
1723static GFXDECODE_START( 1x4bit_1x4bit )
1724   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0,         0x40 ) // [0] Sprites
1725   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0x40 * 16,   0x40 ) // [1] Layers
1726GFXDECODE_END
1727static GFXDECODE_START( 1x4bit_2x4bit )
1728   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0,         0x40 ) // [0] Sprites
1729   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0x40 * 16,   0x40 ) // [1] Layers
1730   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x4, 0x40 * 16,   0x40 ) // [2] Layers
1731GFXDECODE_END
1732static GFXDECODE_START( 1x8bit_2x4bit )
1733   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8,   0x40 * 256,   0x40 ) // [0] Sprites
1734   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,   0,         0x40 ) // [1] Layers
1735   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x4,   0,         0x40 ) // [2] Layers
1736GFXDECODE_END
17431737
17441738
17451739
r1051r1052
18071801   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18081802   MDRV_SCREEN_SIZE(256, 256)
18091803   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 240-1)
1810   MDRV_GFXDECODE(kaneko16_gfx_1x4bit_1x4bit)
1804   MDRV_GFXDECODE(1x4bit_1x4bit)
18111805   MDRV_PALETTE_LENGTH(2048 + 32768)   /* 32768 static colors for the bg */
18121806
18131807   MDRV_PALETTE_INIT(berlwall)
r1051r1052
18531847   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18541848   MDRV_SCREEN_SIZE(256, 256)
18551849   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 240-1)
1856   MDRV_GFXDECODE(kaneko16_gfx_1x4bit_2x4bit)
1850   MDRV_GFXDECODE(1x4bit_2x4bit)
18571851   MDRV_PALETTE_LENGTH(2048)
18581852
18591853   MDRV_VIDEO_START(kaneko16_2xVIEW2)
r1051r1052
19101904   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19111905   MDRV_SCREEN_SIZE(320, 240)
19121906   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1 -8)
1913   MDRV_GFXDECODE(kaneko16_gfx_1x4bit_1x4bit)
1907   MDRV_GFXDECODE(1x4bit_1x4bit)
19141908   MDRV_PALETTE_LENGTH(2048)
19151909
19161910   MDRV_VIDEO_START(kaneko16_1xVIEW2)
r1051r1052
19571951   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19581952   MDRV_SCREEN_SIZE(320, 240)
19591953   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
1960   MDRV_GFXDECODE(kaneko16_gfx_1x8bit_2x4bit)
1954   MDRV_GFXDECODE(1x8bit_2x4bit)
19611955   MDRV_PALETTE_LENGTH(32768)
19621956
19631957   MDRV_VIDEO_START(kaneko16_2xVIEW2)
r1051r1052
20482042   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20492043   MDRV_SCREEN_SIZE(256, 256)
20502044   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
2051   MDRV_GFXDECODE(kaneko16_gfx_1x4bit_2x4bit)
2045   MDRV_GFXDECODE(1x4bit_2x4bit)
20522046   MDRV_PALETTE_LENGTH(2048)
20532047
20542048   MDRV_VIDEO_START(kaneko16_2xVIEW2)
r1051r1052
21152109   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21162110   MDRV_SCREEN_SIZE(320, 240)
21172111   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2118   MDRV_GFXDECODE(kaneko16_gfx_1x4bit_1x4bit)
2112   MDRV_GFXDECODE(1x4bit_1x4bit)
21192113   MDRV_PALETTE_LENGTH(2048)
21202114
21212115   MDRV_VIDEO_START(kaneko16_1xVIEW2)
src/mame/drivers/goldstar.c
r1051r1052
262262};
263263
264264
265static const gfx_decode gfxdecodeinfo[] =
266{
267   { REGION_GFX1, 0, &charlayout,   0, 16 },
268   { REGION_GFX2, 0, &tilelayout, 128,  8 },
269   { -1 }
270};
271static const gfx_decode gfxdecodeinfobl[] =
272{
273   { REGION_GFX1, 0, &charlayout,   0, 16 },
274   { REGION_GFX2, 0, &tilelayoutbl, 128,  8 },
275   { -1 }
276};
277static const gfx_decode gfxdecodeinfoml[] =
278{
279   { REGION_GFX1, 0, &charlayout,   0, 16 },
280   { REGION_GFX2, 0x18000, &tilelayout, 128,  8 },
281   { -1 }
282};
265static GFXDECODE_START( goldstar )
266   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
267   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 128,  8 )
268GFXDECODE_END
269static GFXDECODE_START( bl )
270   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
271   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayoutbl, 128,  8 )
272GFXDECODE_END
273static GFXDECODE_START( ml )
274   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
275   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tilelayout, 128,  8 )
276GFXDECODE_END
283277
284278
285279
r1051r1052
307301   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
308302   MDRV_SCREEN_SIZE(64*8, 32*8)
309303   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
310   MDRV_GFXDECODE(gfxdecodeinfo)
304   MDRV_GFXDECODE(goldstar)
311305   MDRV_PALETTE_LENGTH(256)
312306   MDRV_COLORTABLE_LENGTH(256)
313307   MDRV_NVRAM_HANDLER(goldstar)
r1051r1052
344338   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
345339   MDRV_SCREEN_SIZE(64*8, 32*8)
346340   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
347   MDRV_GFXDECODE(gfxdecodeinfobl)
341   MDRV_GFXDECODE(bl)
348342   MDRV_PALETTE_LENGTH(256)
349343   MDRV_COLORTABLE_LENGTH(256)
350344   MDRV_NVRAM_HANDLER(goldstar)
r1051r1052
380374   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
381375   MDRV_SCREEN_SIZE(64*8, 32*8)
382376   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
383   MDRV_GFXDECODE(gfxdecodeinfoml)
377   MDRV_GFXDECODE(ml)
384378   MDRV_PALETTE_LENGTH(256)
385379   MDRV_COLORTABLE_LENGTH(256)
386380   MDRV_NVRAM_HANDLER(goldstar)
src/mame/drivers/dbz.c
r1051r1052
426426   128*8
427427};
428428
429static const gfx_decode gfxdecodeinfo[] =
430{
431   { REGION_GFX3, 0, &bglayout, 0, 512 },
432   { REGION_GFX4, 0, &bglayout, 0, 512 },
433   { -1 }
434};
429static GFXDECODE_START( dbz )
430   GFXDECODE_ENTRY( REGION_GFX3, 0, bglayout, 0, 512 )
431   GFXDECODE_ENTRY( REGION_GFX4, 0, bglayout, 0, 512 )
432GFXDECODE_END
435433
436434/**********************************************************************************/
437435
r1051r1052
450448   MDRV_SCREEN_REFRESH_RATE(55)
451449   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
452450
453   MDRV_GFXDECODE(gfxdecodeinfo)
451   MDRV_GFXDECODE(dbz)
454452
455453   /* video hardware */
456454   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS)
src/mame/drivers/cybertnk.c
r1051r1052
530530    32*8
531531};
532532
533static const gfx_decode gfxdecodeinfo[] =
534{
535   { REGION_GFX1, 0, &tile_8x8x4,     0x1400, 16 }, /*Pal offset???*/
536   { REGION_GFX2, 0, &tile_8x8x4,     0,      0x400 },
537   { REGION_GFX2, 0, &tile_16x16x4,   0,      0x400 },
538   { REGION_GFX3, 0, &tile_8x8x4,     0,      0x400 },
539   { REGION_GFX3, 0, &tile_16x16x4,   0,      0x400 },
540   { -1 }   /* end of array */
541};
533static GFXDECODE_START( cybertnk )
534   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8x4,     0x1400, 16 ) /*Pal offset???*/
535   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_8x8x4,     0,      0x400 )
536   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_16x16x4,   0,      0x400 )
537   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_8x8x4,     0,      0x400 )
538   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_16x16x4,   0,      0x400 )
539GFXDECODE_END
542540
543541static INTERRUPT_GEN( master_irq )
544542{
r1051r1052
585583   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
586584   MDRV_SCREEN_SIZE(64*8, 32*8)
587585   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 32*8-1)
588   MDRV_GFXDECODE(gfxdecodeinfo)
586   MDRV_GFXDECODE(cybertnk)
589587   MDRV_PALETTE_LENGTH(0x4000)
590588
591589   MDRV_VIDEO_START(cybertnk)
src/mame/drivers/wc90.c
r1051r1052
321321   64*8
322322};
323323
324static const gfx_decode gfxdecodeinfo[] =
325{
326   { REGION_GFX1, 0x00000, &charlayout,         1*16*16, 16*16 },
327   { REGION_GFX2, 0x00000, &tilelayout,      2*16*16, 16*16 },
328   { REGION_GFX3, 0x00000, &tilelayout,      3*16*16, 16*16 },
329   { REGION_GFX4, 0x00000, &spritelayout,      0*16*16, 16*16 }, // sprites
330   { -1 }
331};
324static GFXDECODE_START( wc90 )
325   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,         1*16*16, 16*16 )
326   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout,      2*16*16, 16*16 )
327   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout,      3*16*16, 16*16 )
328   GFXDECODE_ENTRY( REGION_GFX4, 0x00000, spritelayout,      0*16*16, 16*16 ) // sprites
329GFXDECODE_END
332330
333331
334332
r1051r1052
367365   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
368366   MDRV_SCREEN_SIZE(32*8, 32*8)
369367   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
370   MDRV_GFXDECODE(gfxdecodeinfo)
368   MDRV_GFXDECODE(wc90)
371369   MDRV_PALETTE_LENGTH(1024)
372370
373371   MDRV_VIDEO_START(wc90)
src/mame/drivers/gauntlet.c
r1051r1052
513513};
514514
515515
516static const gfx_decode gfxdecodeinfo[] =
517{
518   { REGION_GFX2, 0, &pfmolayout,  256, 32 },
519   { REGION_GFX1, 0, &anlayout,      0, 64 },
520   { -1 }
521};
516static GFXDECODE_START( gauntlet )
517   GFXDECODE_ENTRY( REGION_GFX2, 0, pfmolayout,  256, 32 )
518   GFXDECODE_ENTRY( REGION_GFX1, 0, anlayout,      0, 64 )
519GFXDECODE_END
522520
523521
524522
r1051r1052
543541
544542   /* video hardware */
545543   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
546   MDRV_GFXDECODE(gfxdecodeinfo)
544   MDRV_GFXDECODE(gauntlet)
547545   MDRV_PALETTE_LENGTH(1024)
548546
549547   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/ms32.c
r1051r1052
14511451   8*8*8      /* char modulo */
14521452};
14531453
1454static const gfx_decode ms32_gfxdecodeinfo[] =
1455{
1456   { REGION_GFX1, 0, &spritelayout, 0x0000, 0x10 },
1457   { REGION_GFX2, 0, &bglayout,     0x2000, 0x10 },
1458   { REGION_GFX3, 0, &bglayout,     0x1000, 0x10 },
1459   { REGION_GFX4, 0, &txlayout,     0x6000, 0x10 },
1460   { -1 }
1461};
1454static GFXDECODE_START( ms32 )
1455   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0x0000, 0x10 )
1456   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,     0x2000, 0x10 )
1457   GFXDECODE_ENTRY( REGION_GFX3, 0, bglayout,     0x1000, 0x10 )
1458   GFXDECODE_ENTRY( REGION_GFX4, 0, txlayout,     0x6000, 0x10 )
1459GFXDECODE_END
14621460
14631461
14641462
r1051r1052
16121610   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16131611   MDRV_SCREEN_SIZE(40*8, 28*8)
16141612   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1615   MDRV_GFXDECODE(ms32_gfxdecodeinfo)
1613   MDRV_GFXDECODE(ms32)
16161614   MDRV_PALETTE_LENGTH(0x8000)
16171615
16181616   MDRV_VIDEO_START(ms32)
src/mame/drivers/mpu4.c
r1051r1052
26202620   32*8
26212621};
26222622
2623static const gfx_decode dealemgfxdecodeinfo[] =
2624{
2625   { REGION_GFX1, 0x0000, &dealemcharlayout, 0, 32 },
2626   { -1 }
2627};
2623static GFXDECODE_START( dealem )
2624   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dealemcharlayout, 0, 32 )
2625GFXDECODE_END
26282626
26292627UINT8 *dealem_videoram,*dealem_charram;
26302628
r1051r1052
28622860   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 31*8-1)    /* Taken from MC6845 init, registers 01 & 06 */
28632861   MDRV_SCREEN_REFRESH_RATE(50)
28642862   MDRV_VIDEO_START( dealem)
2865   MDRV_GFXDECODE(dealemgfxdecodeinfo)
2863   MDRV_GFXDECODE(dealem)
28662864   MDRV_VIDEO_UPDATE(dealem)
28672865
28682866   MDRV_PALETTE_LENGTH(32)
src/mame/drivers/skylncr.c
r1051r1052
255255   8*32*8/2
256256};
257257
258static const gfx_decode gfxdecodeinfo_skylncr[] =
259{
260   { REGION_GFX1, 0, &layout8x8x8,         0, 2 },
261   { REGION_GFX2, 0, &layout8x32x8_rot,   0, 2 },
262   { REGION_GFX2, 0, &layout8x32x8,      0, 2 },
263   { -1 }
264};
258static GFXDECODE_START( skylncr )
259   GFXDECODE_ENTRY( REGION_GFX1, 0, layout8x8x8,         0, 2 )
260   GFXDECODE_ENTRY( REGION_GFX2, 0, layout8x32x8_rot,   0, 2 )
261   GFXDECODE_ENTRY( REGION_GFX2, 0, layout8x32x8,      0, 2 )
262GFXDECODE_END
265263
266264INPUT_PORTS_START( skylncr )
267265
r1051r1052
440438   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
441439   MDRV_SCREEN_SIZE(512, 256)
442440   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
443   MDRV_GFXDECODE(gfxdecodeinfo_skylncr)
441   MDRV_GFXDECODE(skylncr)
444442   MDRV_PALETTE_LENGTH(0x200)
445443
446444   MDRV_VIDEO_START(skylncr)
src/mame/drivers/darkseal.c
r1051r1052
264264   64*8
265265};
266266
267static const gfx_decode gfxdecodeinfo[] =
268{
269   { REGION_GFX1, 0, &charlayout,    0, 16 },   /* Characters 8x8 */
270   { REGION_GFX2, 0, &seallayout,  768, 16 },   /* Tiles 16x16 */
271   { REGION_GFX3, 0, &seallayout, 1024, 16 },   /* Tiles 16x16 */
272   { REGION_GFX4, 0, &seallayout2, 256, 32 },   /* Sprites 16x16 */
273   { -1 }
274};
267static GFXDECODE_START( darkseal )
268   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 16 )   /* Characters 8x8 */
269   GFXDECODE_ENTRY( REGION_GFX2, 0, seallayout,  768, 16 )   /* Tiles 16x16 */
270   GFXDECODE_ENTRY( REGION_GFX3, 0, seallayout, 1024, 16 )   /* Tiles 16x16 */
271   GFXDECODE_ENTRY( REGION_GFX4, 0, seallayout2, 256, 32 )   /* Sprites 16x16 */
272GFXDECODE_END
275273
276274/******************************************************************************/
277275
r1051r1052
304302   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
305303   MDRV_SCREEN_SIZE(32*8, 32*8)
306304   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
307   MDRV_GFXDECODE(gfxdecodeinfo)
305   MDRV_GFXDECODE(darkseal)
308306   MDRV_PALETTE_LENGTH(2048)
309307
310308   MDRV_VIDEO_START(darkseal)
src/mame/drivers/20pacgal.c
r1051r1052
3131- The timed interrupt is a kludge; it is supposed to be generated internally by
3232  the Z180, but the cpu core doesn't support that yet.
3333
34- Correct CPU speed... Zilog says Z180 comes in 6, 8, 10, 20 & 33MHz.
35  20MHz is used as it "seems" right based on the music in Galaga
3436
3537***************************************************************************/
3638
r1051r1052
218220   16*32
219221};
220222
221static const gfx_decode gfxdecodeinfo[] =
222{
223static GFXDECODE_START( 20pacgal )
223224   /* the game dynamically modifies these */
224   { 0, 0, &charlayout,   0, 64 },
225   { 0, 0, &spritelayout, 0, 64 },
226   { -1 }
227};
225   GFXDECODE_ENTRY( 0, 0, charlayout,   0, 64 )
226   GFXDECODE_ENTRY( 0, 0, spritelayout, 0, 64 )
227GFXDECODE_END
228228
229229static struct namco_interface namco_interface =
230230{
r1051r1052
235235static MACHINE_DRIVER_START( 20pacgal )
236236
237237   /* basic machine hardware */
238   MDRV_CPU_ADD(Z180,32000000)   /* ??? */
238   MDRV_CPU_ADD(Z180,20000000)   /* 20MHz ??? Needs to be verified! */
239239   MDRV_CPU_PROGRAM_MAP(20pacgal_map,0)
240240   MDRV_CPU_IO_MAP(20pacgal_port,0)
241241   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
r1051r1052
250250   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
251251   MDRV_SCREEN_SIZE(36*8, 28*8)
252252   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
253   MDRV_GFXDECODE(gfxdecodeinfo)
253   MDRV_GFXDECODE(20pacgal)
254254   MDRV_PALETTE_LENGTH(0x1000)
255255   MDRV_COLORTABLE_LENGTH(0x100)
256256   MDRV_PALETTE_INIT(20pacgal)
src/mame/drivers/seicross.c
r1051r1052
381381
382382
383383
384static const gfx_decode gfxdecodeinfo[] =
385{
386   { REGION_GFX1, 0, &charlayout,   0, 16 },
387   { REGION_GFX1, 0, &spritelayout, 0, 16 },
388   { -1 }
389};
384static GFXDECODE_START( seicross )
385   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
386   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 16 )
387GFXDECODE_END
390388
391389
392390
r1051r1052
422420   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
423421   MDRV_SCREEN_SIZE(32*8, 32*8)
424422   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
425   MDRV_GFXDECODE(gfxdecodeinfo)
423   MDRV_GFXDECODE(seicross)
426424   MDRV_PALETTE_LENGTH(64)
427425
428426   MDRV_PALETTE_INIT(seicross)
src/mame/drivers/spbactn.c
r1051r1052
335335   16*8
336336};
337337
338static const gfx_decode gfxdecodeinfo[] =
339{
340   { REGION_GFX1, 0, &fgtilelayout,   0x0200, 16384  },
341   { REGION_GFX2, 0, &bgtilelayout,   0x0300, 16384  },
342   { REGION_GFX3, 0, &spritelayout,   0x0000, 16384  },
343   { -1 }
344};
338static GFXDECODE_START( spbactn )
339   GFXDECODE_ENTRY( REGION_GFX1, 0, fgtilelayout,   0x0200, 16384  )
340   GFXDECODE_ENTRY( REGION_GFX2, 0, bgtilelayout,   0x0300, 16384  )
341   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0x0000, 16384  )
342GFXDECODE_END
345343
346344static void irqhandler(int linestate)
347345{
r1051r1052
371369   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
372370   MDRV_SCREEN_SIZE(64*8, 32*8)
373371   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
374   MDRV_GFXDECODE(gfxdecodeinfo)
372   MDRV_GFXDECODE(spbactn)
375373   MDRV_PALETTE_LENGTH(0x2800/2)
376374
377375   MDRV_VIDEO_START(spbactn)
src/mame/drivers/system16.c
r1051r1052
494494   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
495495   MDRV_SCREEN_SIZE(40*8, 28*8)
496496   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
497   MDRV_GFXDECODE(sys16_gfxdecodeinfo)
497   MDRV_GFXDECODE(sys16)
498498   MDRV_PALETTE_LENGTH(2048*ShadowColorsMultiplier)
499499
500500   MDRV_VIDEO_START(system16)
r1051r1052
625625
626626/***************************************************************************/
627627
628INPUT_PORTS_START( aliensyn )
628static INPUT_PORTS_START( aliensyn )
629629   SYS16_JOY1
630630   SYS16_JOY2
631631   SYS16_SERVICE
r1051r1052
719719}
720720/***************************************************************************/
721721
722INPUT_PORTS_START( bayroute )
722static INPUT_PORTS_START( bayroute )
723723   SYS16_JOY1
724724   SYS16_JOY2
725725   SYS16_SERVICE
r1051r1052
879879}
880880/***************************************************************************/
881881
882INPUT_PORTS_START( ddux )
882static INPUT_PORTS_START( ddux )
883883   SYS16_JOY1
884884   SYS16_JOY2
885885   SYS16_SERVICE
r1051r1052
10081008
10091009/***************************************************************************/
10101010
1011INPUT_PORTS_START( eswat )
1011static INPUT_PORTS_START( eswat )
10121012   SYS16_JOY1
10131013   SYS16_JOY2
10141014   SYS16_SERVICE
r1051r1052
11301130}
11311131/***************************************************************************/
11321132
1133INPUT_PORTS_START( fpoint )
1133static INPUT_PORTS_START( fpoint )
11341134   SYS16_SERVICE
11351135
11361136   PORT_START_TAG("IN0")
r1051r1052
13641364
13651365/***************************************************************************/
13661366
1367INPUT_PORTS_START( goldnaxe )
1367static INPUT_PORTS_START( goldnaxe )
13681368   SYS16_JOY1
13691369   SYS16_JOY2
13701370   SYS16_SERVICE
r1051r1052
15821582
15831583/***************************************************************************/
15841584
1585INPUT_PORTS_START( passsht )
1585static INPUT_PORTS_START( passsht )
15861586   PORT_START_TAG("IN0")
15871587   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
15881588   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
r1051r1052
17441744
17451745/***************************************************************************/
17461746
1747INPUT_PORTS_START( shinobi )
1747static INPUT_PORTS_START( shinobi )
17481748   SYS16_JOY1
17491749   SYS16_JOY2
17501750   SYS16_SERVICE
r1051r1052
19221922
19231923/***************************************************************************/
19241924
1925INPUT_PORTS_START( tetris )
1925static INPUT_PORTS_START( tetris )
19261926   SYS16_JOY1
19271927   SYS16_JOY2
19281928   SYS16_SERVICE
r1051r1052
20092009
20102010/***************************************************************************/
20112011
2012INPUT_PORTS_START( tturf )
2012static INPUT_PORTS_START( tturf )
20132013   SYS16_JOY1
20142014   SYS16_JOY2
20152015   SYS16_SERVICE
src/mame/drivers/deniam.c
r1051r1052
298298};
299299
300300
301static const gfx_decode gfxdecodeinfo[] =
302{
303   { REGION_GFX1, 0, &charlayout, 0, 128 },   /* colors 0-1023 */
301static GFXDECODE_START( deniam )
302   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 128 )   /* colors 0-1023 */
304303                                    /* sprites use colors 1024-2047 */
305   { -1 }
306};
304GFXDECODE_END
307305
308306
309307static void irqhandler(int linestate)
r1051r1052
341339   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
342340   MDRV_SCREEN_SIZE(512, 256)
343341   MDRV_SCREEN_VISIBLE_AREA(24*8, 64*8-1, 0*8, 28*8-1)
344   MDRV_GFXDECODE(gfxdecodeinfo)
342   MDRV_GFXDECODE(deniam)
345343   MDRV_PALETTE_LENGTH(2048)
346344
347345   MDRV_VIDEO_START(deniam)
r1051r1052
376374   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
377375   MDRV_SCREEN_SIZE(512, 256)
378376   MDRV_SCREEN_VISIBLE_AREA(24*8, 64*8-1, 0*8, 28*8-1)
379   MDRV_GFXDECODE(gfxdecodeinfo)
377   MDRV_GFXDECODE(deniam)
380378   MDRV_PALETTE_LENGTH(2048)
381379
382380   MDRV_VIDEO_START(deniam)
src/mame/drivers/limenko.c
r1051r1052
464464   64*8,
465465};
466466
467static gfx_decode limenko_gfxdecodeinfo[] =
468{
469   { REGION_GFX1, 0, &tile_layout, 0, 16 }, /* tiles */
470   { -1 }
471};
467static GFXDECODE_START( limenko )
468   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0, 16 ) /* tiles */
469GFXDECODE_END
472470
473471
474472/*****************************************************************************************************
r1051r1052
493491   MDRV_SCREEN_SIZE(384, 240)
494492   MDRV_SCREEN_VISIBLE_AREA(0, 383, 0, 239)
495493
496   MDRV_GFXDECODE(limenko_gfxdecodeinfo)
494   MDRV_GFXDECODE(limenko)
497495   MDRV_PALETTE_LENGTH(0x1000)
498496
499497   MDRV_VIDEO_START(limenko)
r1051r1052
524522   MDRV_SCREEN_SIZE(384, 240)
525523   MDRV_SCREEN_VISIBLE_AREA(0, 383, 0, 239)
526524
527   MDRV_GFXDECODE(limenko_gfxdecodeinfo)
525   MDRV_GFXDECODE(limenko)
528526   MDRV_PALETTE_LENGTH(0x1000)
529527
530528   MDRV_VIDEO_START(limenko)
src/mame/drivers/redalert.c
r1051r1052
285285   8*8 /* every char takes 8 consecutive bytes */
286286};
287287
288static const gfx_decode redalert_gfxdecodeinfo[] =
289{
290   { 0, 0x3000, &backlayout,   0, 8 },    /* the game dynamically modifies this */
291   { 0, 0x4800, &charlayout,   0, 8 },    /* the game dynamically modifies this */
292   { 0, 0x4400, &spritelayout,16, 4 },    /* the game dynamically modifies this */
293   { -1 }
294};
288static GFXDECODE_START( redalert )
289   GFXDECODE_ENTRY( 0, 0x3000, backlayout,   0, 8 )    /* the game dynamically modifies this */
290   GFXDECODE_ENTRY( 0, 0x4800, charlayout,   0, 8 )    /* the game dynamically modifies this */
291   GFXDECODE_ENTRY( 0, 0x4400, spritelayout,16, 4 )    /* the game dynamically modifies this */
292GFXDECODE_END
295293
296static const gfx_decode demoneye_gfxdecodeinfo[] =
297{
298   { 0, 0x3000, &backlayout,   0, 8 },    /* the game dynamically modifies this */
299   { 0, 0x4800, &spritelayout,16, 4 },    /* the game dynamically modifies this */
300   { 0, 0x4400, &spritelayout,16, 4 },    /* the game dynamically modifies this */
301   { 0, 0x5400, &spritelayout,16, 4 },    /* the game dynamically modifies this */
302   { -1 }
303};
294static GFXDECODE_START( demoneye )
295   GFXDECODE_ENTRY( 0, 0x3000, backlayout,   0, 8 )    /* the game dynamically modifies this */
296   GFXDECODE_ENTRY( 0, 0x4800, spritelayout,16, 4 )    /* the game dynamically modifies this */
297   GFXDECODE_ENTRY( 0, 0x4400, spritelayout,16, 4 )    /* the game dynamically modifies this */
298   GFXDECODE_ENTRY( 0, 0x5400, spritelayout,16, 4 )    /* the game dynamically modifies this */
299GFXDECODE_END
304300
305301/* Arbitrary colortable */
306302static UINT16 colortable_source[] =
r1051r1052
381377   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
382378   MDRV_SCREEN_SIZE(32*8, 32*8)
383379   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
384   MDRV_GFXDECODE(redalert_gfxdecodeinfo)
380   MDRV_GFXDECODE(redalert)
385381   MDRV_PALETTE_LENGTH(9)
386382   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
387383
r1051r1052
437433   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
438434   MDRV_SCREEN_SIZE(32*8, 32*8)
439435   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
440   MDRV_GFXDECODE(demoneye_gfxdecodeinfo)
436   MDRV_GFXDECODE(demoneye)
441437   MDRV_PALETTE_LENGTH(9)
442438   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
443439
src/mame/drivers/mcr3.c
r1051r1052
10251025};
10261026
10271027
1028static const gfx_decode gfxdecodeinfo[] =
1029{
1030   { REGION_GFX1, 0, &mcr_bg_layout,     0, 4, 2, 2 },
1031   { REGION_GFX2, 0, &mcr_sprite_layout, 0, 4 },
1032   { -1 }
1033};
1028static GFXDECODE_START( mcr3 )
1029   GFXDECODE_SCALE( REGION_GFX1, 0, mcr_bg_layout,     0, 4, 2, 2 )
1030   GFXDECODE_ENTRY( REGION_GFX2, 0, mcr_sprite_layout, 0, 4 )
1031GFXDECODE_END
10341032
10351033
1036static const gfx_decode spyhunt_gfxdecodeinfo[] =
1037{
1038   { REGION_GFX1, 0, &spyhunt_charlayout,  1*16, 1 },
1039   { REGION_GFX2, 0, &mcr_sprite_layout,   0*16, 4 },
1040   { REGION_GFX3, 0, &spyhunt_alphalayout, 4*16, 1 },
1041   { -1 }
1042};
1034static GFXDECODE_START( spyhunt )
1035   GFXDECODE_ENTRY( REGION_GFX1, 0, spyhunt_charlayout,  1*16, 1 )
1036   GFXDECODE_ENTRY( REGION_GFX2, 0, mcr_sprite_layout,   0*16, 4 )
1037   GFXDECODE_ENTRY( REGION_GFX3, 0, spyhunt_alphalayout, 4*16, 1 )
1038GFXDECODE_END
10431039
10441040
10451041
r1051r1052
10691065   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10701066   MDRV_SCREEN_SIZE(32*16, 30*16)
10711067   MDRV_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 0*16, 30*16-1)
1072   MDRV_GFXDECODE(gfxdecodeinfo)
1068   MDRV_GFXDECODE(mcr3)
10731069   MDRV_PALETTE_LENGTH(64)
10741070
10751071   MDRV_VIDEO_START(mcr)
r1051r1052
11311127   /* video hardware */
11321128   MDRV_SCREEN_SIZE(30*16, 30*16)
11331129   MDRV_SCREEN_VISIBLE_AREA(0, 30*16-1, 0, 30*16-1)
1134   MDRV_GFXDECODE(spyhunt_gfxdecodeinfo)
1130   MDRV_GFXDECODE(spyhunt)
11351131   MDRV_PALETTE_LENGTH(64+4)
11361132
11371133   MDRV_PALETTE_INIT(spyhunt)
src/mame/drivers/pipeline.c
r1051r1052
280280   8*8
281281};
282282
283static const gfx_decode gfxdecodeinfo[] =
284{
285   { REGION_GFX1, 0, &layout_8x8x8, 0x000, 1 }, // 8bpp tiles
286   { REGION_GFX2, 0, &layout_8x8x3, 0x100, 32 }, // 3bpp tiles
287   { -1 }
288};
283static GFXDECODE_START( pipeline )
284   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8, 0x000, 1 ) // 8bpp tiles
285   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x3, 0x100, 32 ) // 3bpp tiles
286GFXDECODE_END
289287
290288static void ctc0_interrupt(int state)
291289{
r1051r1052
376374   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
377375   MDRV_SCREEN_SIZE(512, 512)
378376   MDRV_SCREEN_VISIBLE_AREA(0, 319, 16, 239)
379   MDRV_GFXDECODE(gfxdecodeinfo)
377   MDRV_GFXDECODE(pipeline)
380378
381379   MDRV_MACHINE_RESET(pipeline)
382380
src/mame/drivers/pengo.c
r1051r1052
316316};
317317
318318
319static const gfx_decode gfxdecodeinfo[] =
320{
321   { REGION_GFX1, 0x0000, &tilelayout,   0, 128 },
322   { REGION_GFX1, 0x2000, &spritelayout, 0, 128 },
323   { -1 }
324};
319static GFXDECODE_START( pengo )
320   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tilelayout,   0, 128 )
321   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, spritelayout, 0, 128 )
322GFXDECODE_END
325323
326324
327325
r1051r1052
354352
355353   /* video hardware */
356354   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
357   MDRV_GFXDECODE(gfxdecodeinfo)
355   MDRV_GFXDECODE(pengo)
358356   MDRV_PALETTE_LENGTH(128*4)
359357
360358   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/stadhero.c
r1051r1052
256256   16*16
257257};
258258
259static const gfx_decode gfxdecodeinfo[] =
260{
261   { REGION_GFX1, 0, &charlayout,     0, 16 },   /* Characters 8x8 */
262   { REGION_GFX2, 0, &tile_3bpp,    512, 16 },   /* Tiles 16x16 */
263   { REGION_GFX3, 0, &spritelayout, 256, 16 },   /* Sprites 16x16 */
264   { -1 }
265};
259static GFXDECODE_START( stadhero )
260   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )   /* Characters 8x8 */
261   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_3bpp,    512, 16 )   /* Tiles 16x16 */
262   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 256, 16 )   /* Sprites 16x16 */
263GFXDECODE_END
266264
267265/******************************************************************************/
268266
r1051r1052
297295   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298296   MDRV_SCREEN_SIZE(32*8, 32*8)
299297   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
300   MDRV_GFXDECODE(gfxdecodeinfo)
298   MDRV_GFXDECODE(stadhero)
301299   MDRV_PALETTE_LENGTH(1024)
302300
303301   MDRV_VIDEO_START(stadhero)
src/mame/drivers/prehisle.c
r1051r1052
205205   128*8   /* every sprite takes 64 consecutive bytes */
206206};
207207
208static const gfx_decode gfxdecodeinfo[] =
209{
210   { REGION_GFX1, 0, &charlayout,    0, 16 },
211   { REGION_GFX2, 0, &tilelayout, 768, 16 },
212   { REGION_GFX3, 0, &tilelayout, 512, 16 },
213   { REGION_GFX4, 0, &spritelayout, 256, 16 },
214   { -1 }
215};
208static GFXDECODE_START( prehisle )
209   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 16 )
210   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 768, 16 )
211   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 512, 16 )
212   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 256, 16 )
213GFXDECODE_END
216214
217215/******************************************************************************/
218216
r1051r1052
253251   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
254252   MDRV_SCREEN_SIZE(32*8, 32*8)
255253   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
256   MDRV_GFXDECODE(gfxdecodeinfo)
254   MDRV_GFXDECODE(prehisle)
257255   MDRV_PALETTE_LENGTH(1024)
258256
259257   MDRV_VIDEO_START(prehisle)
src/mame/drivers/marvins.c
r1051r1052
493493   256
494494};
495495
496static const gfx_decode marvins_gfxdecodeinfo[] =
497{
498   { REGION_GFX1, 0, &tile_layout,   0x080, 8  }, /* text layer */
499   { REGION_GFX2, 0, &tile_layout,   0x110, 1  }, /* background */
500   { REGION_GFX3, 0, &tile_layout,   0x100, 1  }, /* foreground */
501   { REGION_GFX4, 0, &sprite_layout,   0x000, 16 }, /* sprites */
502   { -1 }
503};
496static GFXDECODE_START( marvins )
497   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,   0x080, 8  ) /* text layer */
498   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,   0x110, 1  ) /* background */
499   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,   0x100, 1  ) /* foreground */
500   GFXDECODE_ENTRY( REGION_GFX4, 0, sprite_layout,   0x000, 16 ) /* sprites */
501GFXDECODE_END
504502
505503
506504/***************************************************************************
r1051r1052
535533   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
536534   MDRV_SCREEN_SIZE(256+32, 224)
537535   MDRV_SCREEN_VISIBLE_AREA(0, 255+32,0, 223)
538   MDRV_GFXDECODE(marvins_gfxdecodeinfo)
536   MDRV_GFXDECODE(marvins)
539537   MDRV_PALETTE_LENGTH((16+2)*16)
540538
541539   MDRV_VIDEO_START(marvins)
r1051r1052
582580   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
583581   MDRV_SCREEN_SIZE(256+32, 224)
584582   MDRV_SCREEN_VISIBLE_AREA(0, 255+32,0, 223)
585   MDRV_GFXDECODE(marvins_gfxdecodeinfo)
583   MDRV_GFXDECODE(marvins)
586584   MDRV_PALETTE_LENGTH((16+2)*16)
587585
588586   MDRV_VIDEO_START(marvins)
src/mame/drivers/wwfsstar.c
r1051r1052
329329   64*8
330330};
331331
332static const gfx_decode gfxdecodeinfo[] =
333{
334   { REGION_GFX1, 0, &tiles8x8_layout,     0, 16 },   /* colors   0-255 */
335   { REGION_GFX2, 0, &tiles16x16_layout, 128, 16 },   /* colors   128-383 */
336   { REGION_GFX3, 0, &tiles16x16_layout, 256,  8 },   /* colors   256-383 */
337   { -1 }
338};
332static GFXDECODE_START( wwfsstar )
333   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout,     0, 16 )   /* colors   0-255 */
334   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16_layout, 128, 16 )   /* colors   128-383 */
335   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles16x16_layout, 256,  8 )   /* colors   256-383 */
336GFXDECODE_END
339337
340338
341339/*******************************************************************************
r1051r1052
376374   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
377375   MDRV_SCREEN_SIZE(32*8, 32*8)
378376   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
379   MDRV_GFXDECODE(gfxdecodeinfo)
377   MDRV_GFXDECODE(wwfsstar)
380378   MDRV_PALETTE_LENGTH(384)
381379
382380   MDRV_VIDEO_START(wwfsstar)
src/mame/drivers/actfancr.c
r1051r1052
361361   32*8   /* every sprite takes 32 consecutive bytes */
362362};
363363
364static const gfx_decode actfan_gfxdecodeinfo[] =
365{
366   { REGION_GFX1, 0, &chars,       0, 16 },
367   { REGION_GFX2, 0, &sprites,   512, 16 },
368   { REGION_GFX3, 0, &tiles,     256, 16 },
369   { -1 }
370};
364static GFXDECODE_START( actfan )
365   GFXDECODE_ENTRY( REGION_GFX1, 0, chars,       0, 16 )
366   GFXDECODE_ENTRY( REGION_GFX2, 0, sprites,   512, 16 )
367   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles,     256, 16 )
368GFXDECODE_END
371369
372static const gfx_decode triothep_gfxdecodeinfo[] =
373{
374   { REGION_GFX1, 0, &chars,       0, 16 },
375   { REGION_GFX2, 0, &sprites,   256, 16 },
376   { REGION_GFX3, 0, &tiles,     512, 16 },
377   { -1 }
378};
370static GFXDECODE_START( triothep )
371   GFXDECODE_ENTRY( REGION_GFX1, 0, chars,       0, 16 )
372   GFXDECODE_ENTRY( REGION_GFX2, 0, sprites,   256, 16 )
373   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles,     512, 16 )
374GFXDECODE_END
379375
380376/******************************************************************************/
381377
r1051r1052
410406   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
411407   MDRV_SCREEN_SIZE(32*8, 32*8)
412408   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
413   MDRV_GFXDECODE(actfan_gfxdecodeinfo)
409   MDRV_GFXDECODE(actfan)
414410   MDRV_PALETTE_LENGTH(768)
415411
416412   MDRV_VIDEO_START(actfancr)
r1051r1052
453449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
454450   MDRV_SCREEN_SIZE(32*8, 32*8)
455451   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
456   MDRV_GFXDECODE(triothep_gfxdecodeinfo)
452   MDRV_GFXDECODE(triothep)
457453   MDRV_PALETTE_LENGTH(768)
458454
459455   MDRV_VIDEO_START(triothep)
src/mame/drivers/polepos.c
r1051r1052
813813   16*32
814814};
815815
816static const gfx_decode gfxdecodeinfo[] =
817{
818   { REGION_GFX1, 0, &charlayout_2bpp,   0x0000, 128 },
819   { REGION_GFX2, 0, &charlayout_2bpp,   0x0200,  64 },
820   { REGION_GFX3, 0, &smallspritelayout, 0x0300, 128 },
821   { REGION_GFX4, 0, &bigspritelayout,   0x0300, 128 },
822   { -1 }
823};
816static GFXDECODE_START( polepos )
817   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_2bpp,   0x0000, 128 )
818   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout_2bpp,   0x0200,  64 )
819   GFXDECODE_ENTRY( REGION_GFX3, 0, smallspritelayout, 0x0300, 128 )
820   GFXDECODE_ENTRY( REGION_GFX4, 0, bigspritelayout,   0x0300, 128 )
821GFXDECODE_END
824822
825823
826824/*********************************************************************
r1051r1052
911909   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
912910   MDRV_SCREEN_SIZE(32*8, 32*8)
913911   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
914   MDRV_GFXDECODE(gfxdecodeinfo)
912   MDRV_GFXDECODE(polepos)
915913   MDRV_PALETTE_LENGTH(0x0f00)
916914
917915   MDRV_PALETTE_INIT(polepos)
r1051r1052
933931
934932   /* discrete circuit on the 54XX outputs */
935933   MDRV_SOUND_ADD(DISCRETE, 0)
936   MDRV_SOUND_CONFIG(polepos_discrete_interface)
934   MDRV_SOUND_CONFIG_DISCRETE(polepos)
937935   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.90)
938936   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.90)
939937
src/mame/drivers/taito_b.c
r1051r1052
25412541   64*8
25422542};
25432543
2544static const gfx_decode gfxdecodeinfo[] =
2545{
2546   { REGION_GFX1, 0, &charlayout,  0, 256 },  /* text */
2547   { REGION_GFX1, 0, &tilelayout,  0, 256 },  /* sprites & playfield */
2548   { -1 }
2549};
2544static GFXDECODE_START( taito_b )
2545   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )  /* text */
2546   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,  0, 256 )  /* sprites & playfield */
2547GFXDECODE_END
25502548
25512549static const gfx_layout rambo3_charlayout =
25522550{
r1051r1052
25712569   32*8
25722570};
25732571
2574static const gfx_decode rambo3_gfxdecodeinfo[] =
2575{
2576   { REGION_GFX1, 0, &rambo3_charlayout,  0, 256 },  /* text */
2577   { REGION_GFX1, 0, &rambo3_tilelayout,  0, 256 },  /* sprites & playfield */
2578   { -1 }
2579};
2572static GFXDECODE_START( rambo3 )
2573   GFXDECODE_ENTRY( REGION_GFX1, 0, rambo3_charlayout,  0, 256 )  /* text */
2574   GFXDECODE_ENTRY( REGION_GFX1, 0, rambo3_tilelayout,  0, 256 )  /* sprites & playfield */
2575GFXDECODE_END
25802576
25812577
25822578/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
r1051r1052
26692665   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
26702666   MDRV_SCREEN_SIZE(64*8, 32*8)
26712667   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2672   MDRV_GFXDECODE(gfxdecodeinfo)
2668   MDRV_GFXDECODE(taito_b)
26732669   MDRV_PALETTE_LENGTH(4096)
26742670
26752671   MDRV_VIDEO_START(taitob_color_order0)
r1051r1052
27062702   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
27072703   MDRV_SCREEN_SIZE(64*8, 32*8)
27082704   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2709   MDRV_GFXDECODE(gfxdecodeinfo)
2705   MDRV_GFXDECODE(taito_b)
27102706   MDRV_PALETTE_LENGTH(4096)
27112707
27122708   MDRV_VIDEO_START(taitob_color_order0)
r1051r1052
27432739   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
27442740   MDRV_SCREEN_SIZE(64*8, 32*8)
27452741   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2746   MDRV_GFXDECODE(gfxdecodeinfo)
2742   MDRV_GFXDECODE(taito_b)
27472743   MDRV_PALETTE_LENGTH(4096)
27482744
27492745   MDRV_VIDEO_START(taitob_color_order1)
r1051r1052
27802776   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
27812777   MDRV_SCREEN_SIZE(64*8, 32*8)
27822778   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2783   MDRV_GFXDECODE(gfxdecodeinfo)
2779   MDRV_GFXDECODE(taito_b)
27842780   MDRV_PALETTE_LENGTH(4096)
27852781
27862782   MDRV_VIDEO_START(taitob_color_order0)
r1051r1052
28162812   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
28172813   MDRV_SCREEN_SIZE(64*8, 32*8)
28182814   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2819   MDRV_GFXDECODE(gfxdecodeinfo)
2815   MDRV_GFXDECODE(taito_b)
28202816   MDRV_PALETTE_LENGTH(4096)
28212817
28222818   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
28532849   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
28542850   MDRV_SCREEN_SIZE(64*8, 32*8)
28552851   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2856   MDRV_GFXDECODE(gfxdecodeinfo)
2852   MDRV_GFXDECODE(taito_b)
28572853   MDRV_PALETTE_LENGTH(4096)
28582854
28592855   MDRV_VIDEO_START(hitice)
r1051r1052
29002896   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29012897   MDRV_SCREEN_SIZE(64*8, 32*8)
29022898   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2903   MDRV_GFXDECODE(rambo3_gfxdecodeinfo)
2899   MDRV_GFXDECODE(rambo3)
29042900   MDRV_PALETTE_LENGTH(4096)
29052901
29062902   MDRV_VIDEO_START(taitob_color_order0)
r1051r1052
29372933   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29382934   MDRV_SCREEN_SIZE(64*8, 32*8)
29392935   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2940   MDRV_GFXDECODE(gfxdecodeinfo)
2936   MDRV_GFXDECODE(taito_b)
29412937   MDRV_PALETTE_LENGTH(4096)
29422938
29432939   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
29772973   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29782974   MDRV_SCREEN_SIZE(64*8, 32*8)
29792975   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2980   MDRV_GFXDECODE(gfxdecodeinfo)
2976   MDRV_GFXDECODE(taito_b)
29812977   MDRV_PALETTE_LENGTH(4096)
29822978
29832979   MDRV_VIDEO_START(taitob_color_order1)
r1051r1052
30173013   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30183014   MDRV_SCREEN_SIZE(64*8, 32*8)
30193015   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3020   MDRV_GFXDECODE(gfxdecodeinfo)
3016   MDRV_GFXDECODE(taito_b)
30213017   MDRV_PALETTE_LENGTH(4096)
30223018
30233019   MDRV_VIDEO_START(taitob_color_order1)
r1051r1052
30543050   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30553051   MDRV_SCREEN_SIZE(64*8, 32*8)
30563052   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3057   MDRV_GFXDECODE(gfxdecodeinfo)
3053   MDRV_GFXDECODE(taito_b)
30583054   MDRV_PALETTE_LENGTH(4096)
30593055
30603056   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
30943090   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30953091   MDRV_SCREEN_SIZE(64*8, 32*8)
30963092   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3097   MDRV_GFXDECODE(gfxdecodeinfo)
3093   MDRV_GFXDECODE(taito_b)
30983094   MDRV_PALETTE_LENGTH(4096)
30993095
31003096   MDRV_VIDEO_START(taitob_color_order1)
r1051r1052
31313127   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
31323128   MDRV_SCREEN_SIZE(64*8, 32*8)
31333129   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3134   MDRV_GFXDECODE(gfxdecodeinfo)
3130   MDRV_GFXDECODE(taito_b)
31353131   MDRV_PALETTE_LENGTH(4096)
31363132
31373133   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
31723168   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
31733169   MDRV_SCREEN_SIZE(64*8, 32*8)
31743170   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3175   MDRV_GFXDECODE(gfxdecodeinfo)
3171   MDRV_GFXDECODE(taito_b)
31763172   MDRV_PALETTE_LENGTH(4096)
31773173
31783174   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
32103206   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32113207   MDRV_SCREEN_SIZE(64*8, 32*8)
32123208   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3213   MDRV_GFXDECODE(gfxdecodeinfo)
3209   MDRV_GFXDECODE(taito_b)
32143210   MDRV_PALETTE_LENGTH(4096)
32153211
32163212   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
32473243   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32483244   MDRV_SCREEN_SIZE(64*8, 32*8)
32493245   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3250   MDRV_GFXDECODE(gfxdecodeinfo)
3246   MDRV_GFXDECODE(taito_b)
32513247   MDRV_PALETTE_LENGTH(4096)
32523248
32533249   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
32933289   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32943290   MDRV_SCREEN_SIZE(64*8, 32*8)
32953291   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3296   MDRV_GFXDECODE(gfxdecodeinfo)
3292   MDRV_GFXDECODE(taito_b)
32973293   MDRV_PALETTE_LENGTH(4096)
32983294
32993295   MDRV_VIDEO_START(taitob_color_order2)
r1051r1052
33373333   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33383334   MDRV_SCREEN_SIZE(64*8, 32*8)
33393335   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3340   MDRV_GFXDECODE(gfxdecodeinfo)
3336   MDRV_GFXDECODE(taito_b)
33413337   MDRV_PALETTE_LENGTH(4096)
33423338
33433339   MDRV_VIDEO_START(taitob_color_order0)
src/mame/drivers/jackal.c
r1051r1052
233233
234234/* Graphics Decode Information */
235235
236static const gfx_decode gfxdecodeinfo[] =
237{
238   { REGION_GFX1, 0x00000, &charlayout,               0, 16 },   // colors 256-511 with lookup
239   { REGION_GFX1, 0x20000, &spritelayout,        256*16, 16 },   // colors   0- 15 with lookup
240   { REGION_GFX1, 0x20000, &spritelayout8,       256*16, 16 },   // to handle 8x8 sprites
241   { REGION_GFX1, 0x60000, &spritelayout,  256*16+16*16, 16 },   // colors  16- 31 with lookup
242   { REGION_GFX1, 0x60000, &spritelayout8, 256*16+16*16, 16 },   // to handle 8x8 sprites
243   { -1 }
244};
236static GFXDECODE_START( jackal )
237   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,               0, 16 )   // colors 256-511 with lookup
238   GFXDECODE_ENTRY( REGION_GFX1, 0x20000, spritelayout,        256*16, 16 )   // colors   0- 15 with lookup
239   GFXDECODE_ENTRY( REGION_GFX1, 0x20000, spritelayout8,       256*16, 16 )   // to handle 8x8 sprites
240   GFXDECODE_ENTRY( REGION_GFX1, 0x60000, spritelayout,  256*16+16*16, 16 )   // colors  16- 31 with lookup
241   GFXDECODE_ENTRY( REGION_GFX1, 0x60000, spritelayout8, 256*16+16*16, 16 )   // to handle 8x8 sprites
242GFXDECODE_END
245243
246244/* Interrupt Generator */
247245
r1051r1052
273271   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
274272   MDRV_SCREEN_SIZE(32*8, 32*8)
275273   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
276   MDRV_GFXDECODE(gfxdecodeinfo)
274   MDRV_GFXDECODE(jackal)
277275   MDRV_PALETTE_LENGTH(512)
278276   MDRV_COLORTABLE_LENGTH(256*16+16*16+16*16)
279277
src/mame/drivers/tank8.c
r1051r1052
373373};
374374
375375
376static const gfx_decode tank8_gfxdecodeinfo[] =
377{
378   { REGION_GFX1, 0, &tile_layout_1, 0, 10 },
379   { REGION_GFX1, 0, &tile_layout_2, 0, 10 },
380   { REGION_GFX2, 0, &tank_layout, 0, 8 },
381   { REGION_GFX3, 0, &tank_layout, 0, 8 },
382   { -1 }
383};
376static GFXDECODE_START( tank8 )
377   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout_1, 0, 10 )
378   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout_2, 0, 10 )
379   GFXDECODE_ENTRY( REGION_GFX2, 0, tank_layout, 0, 8 )
380   GFXDECODE_ENTRY( REGION_GFX3, 0, tank_layout, 0, 8 )
381GFXDECODE_END
384382
385383
386384static MACHINE_DRIVER_START( tank8 )
r1051r1052
398396   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
399397   MDRV_SCREEN_SIZE(512, 524)
400398   MDRV_SCREEN_VISIBLE_AREA(16, 495, 0, 463)
401   MDRV_GFXDECODE(tank8_gfxdecodeinfo)
399   MDRV_GFXDECODE(tank8)
402400   MDRV_PALETTE_LENGTH(10)
403401   MDRV_COLORTABLE_LENGTH(20)
404402
r1051r1052
411409   MDRV_SPEAKER_STANDARD_MONO("mono")
412410
413411   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
414   MDRV_SOUND_CONFIG(tank8_discrete_interface)
412   MDRV_SOUND_CONFIG_DISCRETE(tank8)
415413   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
416414MACHINE_DRIVER_END
417415
src/mame/drivers/namcos86.c
r1051r1052
10381038   64*64
10391039};
10401040
1041static const gfx_decode gfxdecodeinfo[] =
1042{
1043   { REGION_GFX1, 0, &tilelayout,   2048*0, 256 },
1044   { REGION_GFX2, 0, &tilelayout,   2048*0, 256 },
1045   { REGION_GFX3, 0, &spritelayout, 2048*1, 128 },
1046   { -1 }
1047};
1041static GFXDECODE_START( namcos86 )
1042   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   2048*0, 256 )
1043   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   2048*0, 256 )
1044   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 2048*1, 128 )
1045GFXDECODE_END
10481046
10491047/*******************************************************************/
10501048
r1051r1052
10891087   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10901088   MDRV_SCREEN_SIZE(64*8, 32*8)
10911089   MDRV_SCREEN_VISIBLE_AREA(3 + 8*8, 3 + 44*8-1, 2*8, 30*8-1)
1092   MDRV_GFXDECODE(gfxdecodeinfo)
1090   MDRV_GFXDECODE(namcos86)
10931091   MDRV_PALETTE_LENGTH(512)
10941092   MDRV_COLORTABLE_LENGTH(4096)
10951093
src/mame/drivers/suna8.c
r1051r1052
15031503   8*8*2
15041504};
15051505
1506static const gfx_decode suna8_gfxdecodeinfo[] =
1507{
1508   { REGION_GFX1, 0, &layout_8x8x4, 0, 16 }, // [0] Sprites
1509   { -1 }
1510};
1506static GFXDECODE_START( suna8 )
1507   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4, 0, 16 ) // [0] Sprites
1508GFXDECODE_END
15111509
15121510
15131511
r1051r1052
15701568   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15711569   MDRV_SCREEN_SIZE(256, 256)
15721570   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
1573   MDRV_GFXDECODE(suna8_gfxdecodeinfo)
1571   MDRV_GFXDECODE(suna8)
15741572   MDRV_PALETTE_LENGTH(256)
15751573
15761574   MDRV_VIDEO_START(suna8_textdim12)
r1051r1052
16251623   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16261624   MDRV_SCREEN_SIZE(256, 256)
16271625   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
1628   MDRV_GFXDECODE(suna8_gfxdecodeinfo)
1626   MDRV_GFXDECODE(suna8)
16291627   MDRV_PALETTE_LENGTH(256)
16301628
16311629   MDRV_VIDEO_START(suna8_textdim8)
r1051r1052
16881686   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16891687   MDRV_SCREEN_SIZE(256, 256)
16901688   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
1691   MDRV_GFXDECODE(suna8_gfxdecodeinfo)
1689   MDRV_GFXDECODE(suna8)
16921690   MDRV_PALETTE_LENGTH(512)
16931691
16941692   MDRV_VIDEO_START(suna8_textdim0)
r1051r1052
17871785   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17881786   MDRV_SCREEN_SIZE(256, 256)
17891787   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
1790   MDRV_GFXDECODE(suna8_gfxdecodeinfo)
1788   MDRV_GFXDECODE(suna8)
17911789   MDRV_PALETTE_LENGTH(256)
17921790
17931791   MDRV_VIDEO_START(suna8_textdim0)
r1051r1052
18461844   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18471845   MDRV_SCREEN_SIZE(256, 256)
18481846   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
1849   MDRV_GFXDECODE(suna8_gfxdecodeinfo)
1847   MDRV_GFXDECODE(suna8)
18501848   MDRV_PALETTE_LENGTH(512)
18511849
18521850   MDRV_VIDEO_START(suna8_textdim0)
src/mame/drivers/vaportra.c
r1051r1052
2929   /* Force synchronisation between CPUs with fake timer */
3030   timer_call_after_resynch(0, NULL);
3131   soundlatch_w(0,data & 0xff);
32   cpunum_set_input_line(1,0,PULSE_LINE);
32   cpunum_set_input_line(1,0,ASSERT_LINE);
3333}
3434
3535static READ16_HANDLER( vaportra_control_r )
r1051r1052
9090
9191/******************************************************************************/
9292
93static READ8_HANDLER( vaportra_soundlatch_r )
94{
95   cpunum_set_input_line(1,0,CLEAR_LINE);
96   return soundlatch_r(offset);
97}
98
9399static WRITE8_HANDLER( YM2151_w )
94100{
95101   switch (offset) {
r1051r1052
120126   AM_RANGE(0x110000, 0x110001) AM_READ(YM2151_status_port_0_r)
121127   AM_RANGE(0x120000, 0x120001) AM_READ(OKIM6295_status_0_r)
122128   AM_RANGE(0x130000, 0x130001) AM_READ(OKIM6295_status_1_r)
123   AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r)
129   AM_RANGE(0x140000, 0x140001) AM_READ(vaportra_soundlatch_r)
124130   AM_RANGE(0x1f0000, 0x1f1fff) AM_READ(MRA8_BANK8)
125131ADDRESS_MAP_END
126132
r1051r1052
242248
243249
244250
245static const gfx_decode gfxdecodeinfo[] =
246{
247   { REGION_GFX1, 0x000000, &charlayout,    0x000, 0x500 },   /* Characters 8x8 */
248   { REGION_GFX1, 0x000000, &tilelayout,    0x000, 0x500 },   /* Tiles 16x16 */
249   { REGION_GFX2, 0x000000, &tilelayout,    0x000, 0x500 },   /* Tiles 16x16 */ // ok
250   { REGION_GFX3, 0x000000, &tilelayout,    0x100, 16 },   /* Sprites 16x16 */
251   { -1 }
252};
251static GFXDECODE_START( vaportra )
252   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, charlayout,    0x000, 0x500 )   /* Characters 8x8 */
253   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout,    0x000, 0x500 )   /* Tiles 16x16 */
254   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, tilelayout,    0x000, 0x500 )   /* Tiles 16x16 */ // ok
255   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, tilelayout,    0x100, 16 )   /* Sprites 16x16 */
256GFXDECODE_END
253257
254258/******************************************************************************/
255259
r1051r1052
284288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
285289   MDRV_SCREEN_SIZE(32*8, 32*8)
286290   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
287   MDRV_GFXDECODE(gfxdecodeinfo)
291   MDRV_GFXDECODE(vaportra)
288292   MDRV_PALETTE_LENGTH(1280)
289293
290294   MDRV_VIDEO_START(vaportra)
src/mame/drivers/btime.c
r1051r1052
12541254   64*8    /* every tile takes 64 consecutive bytes */
12551255};
12561256
1257static const gfx_decode btime_gfxdecodeinfo[] =
1258{
1259   { REGION_GFX1, 0, &charlayout,          0, 1 }, /* char set #1 */
1260   { REGION_GFX1, 0, &spritelayout,        0, 1 }, /* sprites */
1261   { REGION_GFX2, 0, &btime_tilelayout,    8, 1 }, /* background tiles */
1262   { -1 }
1263};
1257static GFXDECODE_START( btime )
1258   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 1 ) /* char set #1 */
1259   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,        0, 1 ) /* sprites */
1260   GFXDECODE_ENTRY( REGION_GFX2, 0, btime_tilelayout,    8, 1 ) /* background tiles */
1261GFXDECODE_END
12641262
1265static const gfx_decode cookrace_gfxdecodeinfo[] =
1266{
1267   { REGION_GFX1, 0, &charlayout,          0, 1 }, /* char set #1 */
1268   { REGION_GFX1, 0, &spritelayout,        0, 1 }, /* sprites */
1269   { REGION_GFX2, 0, &cookrace_tilelayout, 8, 1 }, /* background tiles */
1270   { -1 }
1271};
1263static GFXDECODE_START( cookrace )
1264   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 1 ) /* char set #1 */
1265   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,        0, 1 ) /* sprites */
1266   GFXDECODE_ENTRY( REGION_GFX2, 0, cookrace_tilelayout, 8, 1 ) /* background tiles */
1267GFXDECODE_END
12721268
1273static const gfx_decode lnc_gfxdecodeinfo[] =
1274{
1275   { REGION_GFX1, 0, &charlayout,          0, 1 },     /* char set #1 */
1276   { REGION_GFX1, 0, &spritelayout,        0, 1 },     /* sprites */
1277   { -1 }
1278};
1269static GFXDECODE_START( lnc )
1270   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 1 )     /* char set #1 */
1271   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,        0, 1 )     /* sprites */
1272GFXDECODE_END
12791273
1280static const gfx_decode bnj_gfxdecodeinfo[] =
1281{
1282   { REGION_GFX1, 0, &charlayout,          0, 1 }, /* char set #1 */
1283   { REGION_GFX1, 0, &spritelayout,        0, 1 }, /* sprites */
1284   { REGION_GFX2, 0, &bnj_tilelayout,      8, 1 }, /* background tiles */
1285   { -1 }
1286};
1274static GFXDECODE_START( bnj )
1275   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 1 ) /* char set #1 */
1276   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,        0, 1 ) /* sprites */
1277   GFXDECODE_ENTRY( REGION_GFX2, 0, bnj_tilelayout,      8, 1 ) /* background tiles */
1278GFXDECODE_END
12871279
1288static const gfx_decode zoar_gfxdecodeinfo[] =
1289{
1290   { REGION_GFX1, 0, &charlayout,          0, 8 }, /* char set #1 */
1291   { REGION_GFX4, 0, &zoar_spritelayout,   0, 8 }, /* sprites */
1292   { REGION_GFX2, 0, &btime_tilelayout,    0, 8 }, /* background tiles */
1293   { -1 }
1294};
1280static GFXDECODE_START( zoar )
1281   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 8 ) /* char set #1 */
1282   GFXDECODE_ENTRY( REGION_GFX4, 0, zoar_spritelayout,   0, 8 ) /* sprites */
1283   GFXDECODE_ENTRY( REGION_GFX2, 0, btime_tilelayout,    0, 8 ) /* background tiles */
1284GFXDECODE_END
12951285
1296static const gfx_decode disco_gfxdecodeinfo[] =
1297{
1298   { 0, 0x2000, &charlayout,          0, 4 }, /* char set #1 */
1299   { 0, 0x2000, &spritelayout,        0, 4 }, /* sprites */
1300   { -1 }
1301};
1286static GFXDECODE_START( disco )
1287   GFXDECODE_ENTRY( 0, 0x2000, charlayout,          0, 4 ) /* char set #1 */
1288   GFXDECODE_ENTRY( 0, 0x2000, spritelayout,        0, 4 ) /* sprites */
1289GFXDECODE_END
13021290
13031291
13041292
r1051r1052
13221310   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13231311   MDRV_SCREEN_SIZE(32*8, 32*8)
13241312   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1325   MDRV_GFXDECODE(btime_gfxdecodeinfo)
1313   MDRV_GFXDECODE(btime)
13261314   MDRV_PALETTE_LENGTH(16)
13271315
13281316   MDRV_PALETTE_INIT(btime)
r1051r1052
13521340   MDRV_CPU_PROGRAM_MAP(sound_map,0)
13531341
13541342   /* video hardware */
1355   MDRV_GFXDECODE(cookrace_gfxdecodeinfo)
1343   MDRV_GFXDECODE(cookrace)
13561344   MDRV_PALETTE_LENGTH(16)
13571345
13581346   MDRV_VIDEO_UPDATE(cookrace)
r1051r1052
13731361   MDRV_MACHINE_RESET(lnc)
13741362
13751363   /* video hardware */
1376   MDRV_GFXDECODE(lnc_gfxdecodeinfo)
1364   MDRV_GFXDECODE(lnc)
13771365   MDRV_PALETTE_LENGTH(8)
13781366
13791367   MDRV_PALETTE_INIT(lnc)
r1051r1052
14111399   MDRV_CPU_VBLANK_INT(btime_nmi_interrupt,1)
14121400
14131401   /* video hardware */
1414   MDRV_GFXDECODE(bnj_gfxdecodeinfo)
1402   MDRV_GFXDECODE(bnj)
14151403   MDRV_PALETTE_LENGTH(16)
14161404
14171405   MDRV_VIDEO_START(bnj)
r1051r1052
14281416   MDRV_CPU_VBLANK_INT(zoar_irq_interrupt,1)
14291417
14301418   /* video hardware */
1431   MDRV_GFXDECODE(zoar_gfxdecodeinfo)
1419   MDRV_GFXDECODE(zoar)
14321420   MDRV_PALETTE_LENGTH(64)
14331421
14341422   MDRV_VIDEO_UPDATE(zoar)
r1051r1052
14461434   MDRV_CPU_PROGRAM_MAP(disco_sound_readmem,disco_sound_writemem)
14471435
14481436   /* video hardware */
1449   MDRV_GFXDECODE(disco_gfxdecodeinfo)
1437   MDRV_GFXDECODE(disco)
14501438   MDRV_PALETTE_LENGTH(32)
14511439
14521440   MDRV_VIDEO_UPDATE(disco)
src/mame/drivers/cps1.c
r1051r1052
380380*
381381********************************************************************/
382382
383#ifndef MESS
383384static struct EEPROM_interface qsound_eeprom_interface =
384385{
385386   7,      /* address bits */
r1051r1052
423424         EEPROM_load(file);
424425   }
425426}
427#endif
426428
427429READ16_HANDLER( cps1_eeprom_port_r )
428430{
r1051r1052
38833885   512*8      /* char modulo */
38843886};
38853887
3886gfx_decode cps1_gfxdecodeinfo[] =
3887{
3888   { REGION_GFX1, 0, &cps1_layout8x8,   0, 0x100 },
3889   { REGION_GFX1, 0, &cps1_layout8x8_2, 0, 0x100 },
3890   { REGION_GFX1, 0, &cps1_layout16x16, 0, 0x100 },
3891   { REGION_GFX1, 0, &cps1_layout32x32, 0, 0x100 },
3892   { -1 }
3893};
3888GFXDECODE_START( cps1 )
3889   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8,   0, 0x100 )
3890   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8_2, 0, 0x100 )
3891   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout16x16, 0, 0x100 )
3892   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout32x32, 0, 0x100 )
3893GFXDECODE_END
38943894
38953895
38963896
r1051r1052
39343934   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39353935   MDRV_SCREEN_SIZE(64*8, 32*8)
39363936   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
3937   MDRV_GFXDECODE(cps1_gfxdecodeinfo)
3937   MDRV_GFXDECODE(cps1)
39383938   MDRV_PALETTE_LENGTH(4096)
39393939
39403940   MDRV_VIDEO_START(cps1)
r1051r1052
39543954   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
39553955MACHINE_DRIVER_END
39563956
3957
3957#ifndef MESS
39583958static MACHINE_DRIVER_START( sf2 )
39593959
39603960   /* basic machine hardware */
r1051r1052
39623962   MDRV_CPU_REPLACE("main", M68000, 12000000)
39633963MACHINE_DRIVER_END
39643964
3965
39663965static MACHINE_DRIVER_START( pang3 )
39673966
39683967   /* basic machine hardware */
r1051r1052
39703969   MDRV_NVRAM_HANDLER(pang3)
39713970MACHINE_DRIVER_END
39723971
3973
39743972static MACHINE_DRIVER_START( qsound )
39753973
39763974   /* basic machine hardware */
r1051r1052
39953993
39963994   MDRV_SOUND_REMOVE("okim")
39973995MACHINE_DRIVER_END
3996#endif
39983997
39993998
4000
40013999/***************************************************************************
40024000
40034001  Game driver(s)
r1051r1052
77387736ROM_END
77397737
77407738
7741
7739#ifndef MESS
77427740static DRIVER_INIT( wof )
77437741{
77447742   wof_decode();
r1051r1052
77867784
77877785   driver_init_cps1(machine);
77887786}
7787#endif
77897788
77907789
7791
77927790GAME( 1988, forgottn, 0,        cps1,     forgottn, cps1,     ROT0,   "Capcom", "Forgotten Worlds (US)", 0 )
77937791GAME( 1988, lostwrld, forgottn, cps1,     forgottn, cps1,     ROT0,   "Capcom", "Lost Worlds (Japan)", 0 )
77947792GAME( 1988, ghouls,   0,        cps1,     ghouls,   cps1,     ROT0,   "Capcom", "Ghouls'n Ghosts (World)" , 0)                  // Wed.26.10.1988 in the ROMS
src/mame/drivers/nova2001.c
r1051r1052
164164   8*64
165165};
166166
167static const gfx_decode gfxdecodeinfo[] =
168{
169   { REGION_GFX1, 0x0000, &charlayout,       0, 16 },
170   { REGION_GFX2, 0x0000, &charlayout,   16*16, 16 },
171   { REGION_GFX1, 0x0000, &spritelayout,     0, 16 },
172   { REGION_GFX2, 0x0000, &spritelayout,     0, 16 },
173   { -1 }
174};
167static GFXDECODE_START( nova2001 )
168   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,       0, 16 )
169   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   16*16, 16 )
170   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,     0, 16 )
171   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,     0, 16 )
172GFXDECODE_END
175173
176174
177175
r1051r1052
204202   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
205203   MDRV_SCREEN_SIZE(32*8, 32*8)
206204   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
207   MDRV_GFXDECODE(gfxdecodeinfo)
205   MDRV_GFXDECODE(nova2001)
208206   MDRV_PALETTE_LENGTH(32)
209207   MDRV_COLORTABLE_LENGTH(32*16)
210208
src/mame/drivers/starcrus.c
r1051r1052
134134    1 /* every sprite takes 1 consecutive bytes */
135135};
136136
137static const gfx_decode gfxdecodeinfo[] =
138{
139   { REGION_GFX1, 0x0000, &spritelayout1, 0, 1 },
140    { REGION_GFX1, 0x0040, &spritelayout1, 0, 1 },
141    { REGION_GFX1, 0x0080, &spritelayout1, 0, 1 },
142    { REGION_GFX1, 0x00c0, &spritelayout1, 0, 1 },
143    { REGION_GFX2, 0x0000, &spritelayout1, 0, 1 },
144    { REGION_GFX2, 0x0040, &spritelayout1, 0, 1 },
145    { REGION_GFX2, 0x0080, &spritelayout1, 0, 1 },
146    { REGION_GFX2, 0x00c0, &spritelayout1, 0, 1 },
147    { REGION_GFX3, 0x0000, &spritelayout2, 0, 1 },
148    { REGION_GFX3, 0x0100, &spritelayout2, 0, 1 },
149    { REGION_GFX3, 0x0200, &spritelayout2, 0, 1 },
150    { REGION_GFX3, 0x0300, &spritelayout2, 0, 1 },
151   { -1 }
152};
137static GFXDECODE_START( starcrus )
138   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout1, 0, 1 )
139    GFXDECODE_ENTRY( REGION_GFX1, 0x0040, spritelayout1, 0, 1 )
140    GFXDECODE_ENTRY( REGION_GFX1, 0x0080, spritelayout1, 0, 1 )
141    GFXDECODE_ENTRY( REGION_GFX1, 0x00c0, spritelayout1, 0, 1 )
142    GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout1, 0, 1 )
143    GFXDECODE_ENTRY( REGION_GFX2, 0x0040, spritelayout1, 0, 1 )
144    GFXDECODE_ENTRY( REGION_GFX2, 0x0080, spritelayout1, 0, 1 )
145    GFXDECODE_ENTRY( REGION_GFX2, 0x00c0, spritelayout1, 0, 1 )
146    GFXDECODE_ENTRY( REGION_GFX3, 0x0000, spritelayout2, 0, 1 )
147    GFXDECODE_ENTRY( REGION_GFX3, 0x0100, spritelayout2, 0, 1 )
148    GFXDECODE_ENTRY( REGION_GFX3, 0x0200, spritelayout2, 0, 1 )
149    GFXDECODE_ENTRY( REGION_GFX3, 0x0300, spritelayout2, 0, 1 )
150GFXDECODE_END
153151
154152
155153static UINT16 colortable_source[] =
r1051r1052
196194   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
197195   MDRV_SCREEN_SIZE(32*8, 32*8)
198196   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
199   MDRV_GFXDECODE(gfxdecodeinfo)
197   MDRV_GFXDECODE(starcrus)
200198   MDRV_PALETTE_LENGTH(2)
201199   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
202200
src/mame/drivers/yunsun16.c
r1051r1052
496496};
497497
498498
499static const gfx_decode yunsun16_gfxdecodeinfo[] =
500{
501   { REGION_GFX1, 0, &layout_16x16x8, 0x1000, 0x10 }, // [0] Layers
502   { REGION_GFX2, 0, &layout_16x16x4, 0x0000, 0x20 }, // [1] Sprites
503   { -1 }
504};
499static GFXDECODE_START( yunsun16 )
500   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8, 0x1000, 0x10 ) // [0] Layers
501   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0x0000, 0x20 ) // [1] Sprites
502GFXDECODE_END
505503
506504
507505/***************************************************************************
r1051r1052
546544   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
547545   MDRV_SCREEN_SIZE(0x180, 0xe0)
548546   MDRV_SCREEN_VISIBLE_AREA(0+0x20, 0x180-1-0x20, 0, 0xe0-1)
549   MDRV_GFXDECODE(yunsun16_gfxdecodeinfo)
547   MDRV_GFXDECODE(yunsun16)
550548   MDRV_PALETTE_LENGTH(8192)
551549
552550   MDRV_VIDEO_START(yunsun16)
r1051r1052
586584   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
587585   MDRV_SCREEN_SIZE(0x180, 0xe0)
588586   MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1-4, 0, 0xe0-1)
589   MDRV_GFXDECODE(yunsun16_gfxdecodeinfo)
587   MDRV_GFXDECODE(yunsun16)
590588   MDRV_PALETTE_LENGTH(8192)
591589
592590   MDRV_VIDEO_START(yunsun16)
src/mame/drivers/scobra.c
r1051r1052
7575};
7676
7777
78static gfx_decode scobra_gfxdecodeinfo[] =
79{
80   { REGION_GFX1, 0x0000, &scobra_charlayout,   0, 8 },
81   { REGION_GFX1, 0x0000, &scobra_spritelayout, 0, 8 },
82   { -1 }
83};
78static GFXDECODE_START( scobra )
79   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, scobra_charlayout,   0, 8 )
80   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, scobra_spritelayout, 0, 8 )
81GFXDECODE_END
8482
8583
8684
r1051r1052
14031401   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14041402   MDRV_SCREEN_SIZE(32*8, 32*8)
14051403   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1406   MDRV_GFXDECODE(scobra_gfxdecodeinfo)
1404   MDRV_GFXDECODE(scobra)
14071405   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 1 for background */
14081406
14091407   MDRV_PALETTE_INIT(scramble)
r1051r1052
15601558   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15611559   MDRV_SCREEN_SIZE(32*8, 32*8)
15621560   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1563   MDRV_GFXDECODE(scobra_gfxdecodeinfo)
1561   MDRV_GFXDECODE(scobra)
15641562   MDRV_PALETTE_LENGTH(32+64+2)   /* 32 for characters, 64 for stars, 2 for bullets */
15651563
15661564   MDRV_PALETTE_INIT(galaxian)
src/mame/drivers/wiz.c
r1051r1052
609609};
610610
611611
612static const gfx_decode wiz_gfxdecodeinfo[] =
613{
614   { REGION_GFX1, 0x0000, &charlayout,   0, 32 },
615   { REGION_GFX1, 0x0800, &charlayout,   0, 32 },
616   { REGION_GFX2, 0x6000, &charlayout,   0, 32 },
617   { REGION_GFX2, 0x0000, &charlayout,   0, 32 },
618   { REGION_GFX2, 0x0800, &charlayout,   0, 32 },
619   { REGION_GFX2, 0x6800, &charlayout,   0, 32 },
620   { REGION_GFX1, 0x0000, &spritelayout, 0, 32 },
621   { REGION_GFX2, 0x0000, &spritelayout, 0, 32 },
622   { REGION_GFX2, 0x6000, &spritelayout, 0, 32 },
623   { -1 }   /* end of array */
624};
612static GFXDECODE_START( wiz )
613   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 32 )
614   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, charlayout,   0, 32 )
615   GFXDECODE_ENTRY( REGION_GFX2, 0x6000, charlayout,   0, 32 )
616   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   0, 32 )
617   GFXDECODE_ENTRY( REGION_GFX2, 0x0800, charlayout,   0, 32 )
618   GFXDECODE_ENTRY( REGION_GFX2, 0x6800, charlayout,   0, 32 )
619   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 32 )
620   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 0, 32 )
621   GFXDECODE_ENTRY( REGION_GFX2, 0x6000, spritelayout, 0, 32 )
622GFXDECODE_END
625623
626static const gfx_decode stinger_gfxdecodeinfo[] =
627{
628   { REGION_GFX1, 0x0000, &charlayout,   0, 32 },
629   { REGION_GFX1, 0x0800, &charlayout,   0, 32 },
630   { REGION_GFX2, 0x0000, &charlayout,   0, 32 },
631   { REGION_GFX2, 0x0800, &charlayout,   0, 32 },
632   { REGION_GFX1, 0x0000, &spritelayout, 0, 32 },
633   { REGION_GFX2, 0x0000, &spritelayout, 0, 32 },
634   { -1 }   /* end of array */
635};
624static GFXDECODE_START( stinger )
625   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 32 )
626   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, charlayout,   0, 32 )
627   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   0, 32 )
628   GFXDECODE_ENTRY( REGION_GFX2, 0x0800, charlayout,   0, 32 )
629   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 32 )
630   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 0, 32 )
631GFXDECODE_END
636632
637633
638634
r1051r1052
654650   16         /* Output bit is feedback bit */
655651};
656652
657DISCRETE_SOUND_START(stinger_discrete_interface)
653DISCRETE_SOUND_START(stinger)
658654
659655#define STINGER_SHOT_OUT   NODE_90
660656#define STINGER_BOOM_OUT   NODE_91
r1051r1052
726722   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
727723   MDRV_SCREEN_SIZE(32*8, 32*8)
728724   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
729   MDRV_GFXDECODE(wiz_gfxdecodeinfo)
725   MDRV_GFXDECODE(wiz)
730726   MDRV_PALETTE_LENGTH(256)
731727
732728   MDRV_PALETTE_INIT(wiz)
r1051r1052
753749   MDRV_IMPORT_FROM(wiz)
754750
755751   /* video hardware */
756   MDRV_GFXDECODE(stinger_gfxdecodeinfo)
752   MDRV_GFXDECODE(stinger)
757753   MDRV_VIDEO_UPDATE(stinger)
758754
759755   /* sound hardware */
r1051r1052
766762   MDRV_SOUND_REMOVE("8910.3")
767763
768764   MDRV_SOUND_ADD(DISCRETE, 0)
769   MDRV_SOUND_CONFIG(stinger_discrete_interface)
765   MDRV_SOUND_CONFIG_DISCRETE(stinger)
770766   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
771767MACHINE_DRIVER_END
772768
r1051r1052
788784   MDRV_IMPORT_FROM(wiz)
789785
790786   /* video hardware */
791   MDRV_GFXDECODE(stinger_gfxdecodeinfo)
787   MDRV_GFXDECODE(stinger)
792788   MDRV_VIDEO_UPDATE(kungfut)
793789
794790MACHINE_DRIVER_END
src/mame/drivers/stactics.c
r1051r1052
244244    8*9
245245};
246246
247static const gfx_decode gfxdecodeinfo[] =
248{
249    { 0, 0, &gfxlayout,  0,      64*4 },    /* Dynamically decoded from RAM */
250    { 0, 0, &gfxlayout,  1*2*16, 64*4 },    /* Dynamically decoded from RAM */
251    { 0, 0, &gfxlayout,  2*2*16, 64*4 },    /* Dynamically decoded from RAM */
252    { 0, 0, &gfxlayout,  3*2*16, 64*4 },    /* Dynamically decoded from RAM */
253    { 0, 0, &firelayout, 0, 64*4 },         /* LED Fire beam (synthesized gfx) */
254    { 0, 0, &gfxlayout,  0, 64*4 },         /* LED and Misc. Display characters */
255    { -1 }
256};
247static GFXDECODE_START( stactics )
248    GFXDECODE_ENTRY( 0, 0, gfxlayout,  0,      64*4 )    /* Dynamically decoded from RAM */
249    GFXDECODE_ENTRY( 0, 0, gfxlayout,  1*2*16, 64*4 )    /* Dynamically decoded from RAM */
250    GFXDECODE_ENTRY( 0, 0, gfxlayout,  2*2*16, 64*4 )    /* Dynamically decoded from RAM */
251    GFXDECODE_ENTRY( 0, 0, gfxlayout,  3*2*16, 64*4 )    /* Dynamically decoded from RAM */
252    GFXDECODE_ENTRY( 0, 0, firelayout, 0, 64*4 )         /* LED Fire beam (synthesized gfx) */
253    GFXDECODE_ENTRY( 0, 0, gfxlayout,  0, 64*4 )         /* LED and Misc. Display characters */
254GFXDECODE_END
257255
258256static MACHINE_DRIVER_START( stactics )
259257
r1051r1052
270268   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
271269   MDRV_SCREEN_SIZE(32*8, 32*8)
272270   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
273   MDRV_GFXDECODE(gfxdecodeinfo)
271   MDRV_GFXDECODE(stactics)
274272   MDRV_PALETTE_LENGTH(16)
275273   MDRV_COLORTABLE_LENGTH(16*4*4*2)
276274
src/mame/drivers/mermaid.c
r1051r1052
241241
242242/* Graphics Decode Information */
243243
244static const gfx_decode gfxdecodeinfo[] =
245{
246   { REGION_GFX1, 0, &foreground_charlayout,     0, 16 },
247   { REGION_GFX1, 0, &spritelayout,              0, 16 },
248   { REGION_GFX2, 0, &background_charlayout,  4*16, 2  },
249   { -1 }
250};
244static GFXDECODE_START( mermaid )
245   GFXDECODE_ENTRY( REGION_GFX1, 0, foreground_charlayout,     0, 16 )
246   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,              0, 16 )
247   GFXDECODE_ENTRY( REGION_GFX2, 0, background_charlayout,  4*16, 2  )
248GFXDECODE_END
251249
252250/* Sound Interface */
253251
r1051r1052
267265   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
268266   MDRV_SCREEN_SIZE(32*8, 32*8)
269267   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
270   MDRV_GFXDECODE(gfxdecodeinfo)
268   MDRV_GFXDECODE(mermaid)
271269   MDRV_PALETTE_LENGTH(4*16+1)
272270   MDRV_COLORTABLE_LENGTH(4*16+2*2)
273271
src/mame/drivers/calorie.c
r1051r1052
351351   128*8
352352};
353353
354static const gfx_decode gfxdecodeinfo[] =
355{
356   { REGION_GFX2, 0, &tiles8x8_layout,   0, 16 },
357   { REGION_GFX3, 0, &tiles16x16_layout, 0, 16 },
358   { REGION_GFX1, 0, &tiles16x16_layout, 0, 16 },
359   { REGION_GFX1, 0, &tiles32x32_layout, 0, 16 },
360   { -1 }
361};
354static GFXDECODE_START( calorie )
355   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout,   0, 16 )
356   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles16x16_layout, 0, 16 )
357   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16_layout, 0, 16 )
358   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles32x32_layout, 0, 16 )
359GFXDECODE_END
362360
363361static MACHINE_DRIVER_START( calorie )
364362   /* basic machine hardware */
r1051r1052
379377   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
380378   MDRV_SCREEN_SIZE(256, 256)
381379   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
382   MDRV_GFXDECODE(gfxdecodeinfo)
380   MDRV_GFXDECODE(calorie)
383381   MDRV_PALETTE_LENGTH(0x100)
384382
385383   MDRV_VIDEO_START(calorie)
src/mame/drivers/drtomy.c
r1051r1052
167167   32*8
168168};
169169
170static const gfx_decode gfxdecodeinfo[] =
171{
172   { REGION_GFX1, 0, &tilelayout8,  0x100, 16 }, /* Sprites */
173   { REGION_GFX1, 0, &tilelayout16, 0x000, 16 }, /* BG */
174   { REGION_GFX1, 0, &tilelayout16, 0x200, 16 }, /* FG */
175   { -1 }
176};
170static GFXDECODE_START( drtomy )
171   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout8,  0x100, 16 ) /* Sprites */
172   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout16, 0x000, 16 ) /* BG */
173   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout16, 0x200, 16 ) /* FG */
174GFXDECODE_END
177175
178176
179177INPUT_PORTS_START( drtomy )
r1051r1052
264262   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
265263   MDRV_SCREEN_SIZE(32*16, 32*16)
266264   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
267   MDRV_GFXDECODE(gfxdecodeinfo)
265   MDRV_GFXDECODE(drtomy)
268266   MDRV_PALETTE_LENGTH(1024)
269267
270268   MDRV_VIDEO_START(drtomy)
src/mame/drivers/gdrawpkr.c
r1051r1052
451451* Graphics Decode Information *
452452******************************/
453453
454static const gfx_decode gfxdecodeinfo[] =
455{
456   { REGION_GFX1, 0, &charlayout, 0, 16 },
457   { REGION_GFX2, 0, &tilelayout, (8 * 3) + 128, 16 },
458   { -1 }
459};
454static GFXDECODE_START( gdrawpkr )
455   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
456   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, (8 * 3) + 128, 16 )
457GFXDECODE_END
460458
461459
462460/***********************
r1051r1052
579577   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)                  /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
580578   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 31*8-1)    /* Taken from MC6845 init, registers 01 & 06 */
581579
582   MDRV_GFXDECODE(gfxdecodeinfo)
580   MDRV_GFXDECODE(gdrawpkr)
583581   MDRV_PALETTE_LENGTH(256)
584582   MDRV_COLORTABLE_LENGTH(1024)
585583
src/mame/drivers/avalnche.c
r1051r1052
253253   MDRV_SPEAKER_STANDARD_MONO("mono")
254254
255255   MDRV_SOUND_ADD(DISCRETE, 0)
256   MDRV_SOUND_CONFIG(avalnche_discrete_interface)
256   MDRV_SOUND_CONFIG_DISCRETE(avalnche)
257257   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
258258MACHINE_DRIVER_END
259259
src/mame/drivers/dcon.c
r1051r1052
262262   1024
263263};
264264
265static const gfx_decode dcon_gfxdecodeinfo[] =
266{
267   { REGION_GFX1, 0, &dcon_charlayout,    1024+768, 16 },
268   { REGION_GFX2, 0, &dcon_tilelayout,    1024+0,   16 },
269   { REGION_GFX3, 0, &dcon_tilelayout,    1024+512, 16 },
270   { REGION_GFX4, 0, &dcon_tilelayout,    1024+256, 16 },
271   { REGION_GFX5, 0, &dcon_tilelayout,           0, 64 },
272   { -1 }
273};
265static GFXDECODE_START( dcon )
266   GFXDECODE_ENTRY( REGION_GFX1, 0, dcon_charlayout,    1024+768, 16 )
267   GFXDECODE_ENTRY( REGION_GFX2, 0, dcon_tilelayout,    1024+0,   16 )
268   GFXDECODE_ENTRY( REGION_GFX3, 0, dcon_tilelayout,    1024+512, 16 )
269   GFXDECODE_ENTRY( REGION_GFX4, 0, dcon_tilelayout,    1024+256, 16 )
270   GFXDECODE_ENTRY( REGION_GFX5, 0, dcon_tilelayout,           0, 64 )
271GFXDECODE_END
274272
275273/******************************************************************************/
276274
r1051r1052
296294   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
297295   MDRV_SCREEN_SIZE(40*8, 32*8)
298296   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
299   MDRV_GFXDECODE(dcon_gfxdecodeinfo)
297   MDRV_GFXDECODE(dcon)
300298   MDRV_PALETTE_LENGTH(2048)
301299
302300   MDRV_VIDEO_START(dcon)
r1051r1052
324322   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
325323   MDRV_SCREEN_SIZE(40*8, 32*8)
326324   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
327   MDRV_GFXDECODE(dcon_gfxdecodeinfo)
325   MDRV_GFXDECODE(dcon)
328326   MDRV_PALETTE_LENGTH(2048)
329327
330328   MDRV_VIDEO_START(dcon)
src/mame/drivers/kickgoal.c
r1051r1052
617617};
618618
619619
620static const gfx_decode gfxdecodeinfo[] =
621{
622   { REGION_GFX1, 0, &fg816_charlayout,   0x000, 0x40 },
623   { REGION_GFX1, 0, &bg1632_charlayout,  0x000, 0x40 },
624   { REGION_GFX1, 0, &bg3264_charlayout,  0x000, 0x40 },
625   { -1 }
626};
620static GFXDECODE_START( kickgoal )
621   GFXDECODE_ENTRY( REGION_GFX1, 0, fg816_charlayout,   0x000, 0x40 )
622   GFXDECODE_ENTRY( REGION_GFX1, 0, bg1632_charlayout,  0x000, 0x40 )
623   GFXDECODE_ENTRY( REGION_GFX1, 0, bg3264_charlayout,  0x000, 0x40 )
624GFXDECODE_END
627625
628626static const gfx_layout actionhw_fg88_alt_charlayout =
629627{
r1051r1052
651649
652650
653651
654static const gfx_decode actionhw_gfxdecodeinfo[] =
655{
656   { REGION_GFX1, 0, &actionhw_fg88_alt_charlayout,   0x000, 0x40 },
657   { REGION_GFX1, 0, &actionhw_bg1616_charlayout,  0x000, 0x40 },
658   { -1 }
659};
652static GFXDECODE_START( actionhw )
653   GFXDECODE_ENTRY( REGION_GFX1, 0, actionhw_fg88_alt_charlayout,   0x000, 0x40 )
654   GFXDECODE_ENTRY( REGION_GFX1, 0, actionhw_bg1616_charlayout,  0x000, 0x40 )
655GFXDECODE_END
660656
661657/* MACHINE drivers ***********************************************************/
662658
r1051r1052
685681   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
686682   MDRV_SCREEN_SIZE(64*8, 64*8)
687683   MDRV_SCREEN_VISIBLE_AREA(9*8, 55*8-1, 4*8, 60*8-1)
688   MDRV_GFXDECODE(gfxdecodeinfo)
684   MDRV_GFXDECODE(kickgoal)
689685   MDRV_PALETTE_LENGTH(1024)
690686
691687   MDRV_VIDEO_START(kickgoal)
r1051r1052
720716   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
721717   MDRV_SCREEN_SIZE(64*8, 64*8)
722718   MDRV_SCREEN_VISIBLE_AREA(10*8+2, 54*8-1+2, 0*8, 30*8-1)
723   MDRV_GFXDECODE(actionhw_gfxdecodeinfo)
719   MDRV_GFXDECODE(actionhw)
724720   MDRV_PALETTE_LENGTH(1024)
725721
726722   MDRV_VIDEO_START(actionhw)
src/mame/drivers/galaxian.c
r1051r1052
42014201   8*8*2
42024202};
42034203
4204static const gfx_decode rockclim_gfxdecodeinfo[] =
4205{
4206   { REGION_GFX1, 0x0000, &galaxian_charlayout,   32, 8 },
4207   { REGION_GFX1, 0x0000, &galaxian_spritelayout, 32, 8 },
4208   { REGION_GFX2, 0x0000, &rockclim_charlayout, 0, 1 },
4209   { -1 }
4210};
4204static GFXDECODE_START( rockclim )
4205   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_charlayout,   32, 8 )
4206   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_spritelayout, 32, 8 )
4207   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, rockclim_charlayout, 0, 1 )
4208GFXDECODE_END
42114209
42124210
42134211
42144212
4215static gfx_decode galaxian_gfxdecodeinfo[] =
4216{
4217   { REGION_GFX1, 0x0000, &galaxian_charlayout,   0, 8 },
4218   { REGION_GFX1, 0x0000, &galaxian_spritelayout, 0, 8 },
4219   { -1 }
4220};
4213static GFXDECODE_START( galaxian )
4214   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_charlayout,   0, 8 )
4215   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_spritelayout, 0, 8 )
4216GFXDECODE_END
42214217
4222static gfx_decode gmgalax_gfxdecodeinfo[] =
4223{
4224   { REGION_GFX1, 0x0000, &galaxian_charlayout,   0, 16 },
4225   { REGION_GFX1, 0x0000, &galaxian_spritelayout, 0, 16 },
4226   { -1 }
4227};
4218static GFXDECODE_START( gmgalax )
4219   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_charlayout,   0, 16 )
4220   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_spritelayout, 0, 16 )
4221GFXDECODE_END
42284222
42294223/* separate character and sprite ROMs */
4230static const gfx_decode pacmanbl_gfxdecodeinfo[] =
4231{
4232   { REGION_GFX1, 0x0000, &pacmanbl_charlayout,   0, 8 },
4233   { REGION_GFX1, 0x1000, &pacmanbl_spritelayout, 0, 8 },
4234   { -1 }
4235};
4224static GFXDECODE_START( pacmanbl )
4225   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pacmanbl_charlayout,   0, 8 )
4226   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, pacmanbl_spritelayout, 0, 8 )
4227GFXDECODE_END
42364228
4237static const gfx_decode bagmanmc_gfxdecodeinfo[] =
4238{
4239   { REGION_GFX1, 0x0000, &bagmanmc_charlayout,    0, 8 },
4240   { REGION_GFX1, 0x2000, &pacmanbl_spritelayout, 0, 8 },
4241   { -1 }
4242};
4229static GFXDECODE_START( bagmanmc )
4230   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, bagmanmc_charlayout,    0, 8 )
4231   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, pacmanbl_spritelayout, 0, 8 )
4232GFXDECODE_END
42434233
4244static const gfx_decode _4in1_gfxdecodeinfo[] =
4245{
4246   { REGION_GFX1, 0x0000, &_4in1_charlayout,      0, 8 },
4247   { REGION_GFX1, 0x4000, &_4in1_spritelayout,    0, 8 },
4248   { -1 }
4249};
4234static GFXDECODE_START( _4in1 )
4235   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, _4in1_charlayout,      0, 8 )
4236   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, _4in1_spritelayout,    0, 8 )
4237GFXDECODE_END
42504238
42514239static struct AY8910interface checkmaj_ay8910_interface =
42524240{
r1051r1052
42694257
42704258   /* video hardware */
42714259   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
4272   MDRV_GFXDECODE(galaxian_gfxdecodeinfo)
4260   MDRV_GFXDECODE(galaxian)
42734261   MDRV_PALETTE_LENGTH(32+2+64)      /* 32 for the characters, 2 for the bullets, 64 for the stars */
42744262
42754263   MDRV_SCREEN_ADD("main", 0)
r1051r1052
43064294   MDRV_CPU_VBLANK_INT(gmgalax_vh_interrupt,1)
43074295
43084296   /* video hardware */
4309   MDRV_GFXDECODE(gmgalax_gfxdecodeinfo)
4297   MDRV_GFXDECODE(gmgalax)
43104298   MDRV_PALETTE_LENGTH(64+2+64)      /* 64 for the characters, 2 for the bullets, 64 for the stars */
43114299
43124300   MDRV_VIDEO_START(gmgalax)
r1051r1052
43594347   MDRV_IMPORT_FROM(galaxian)
43604348
43614349   /* video hardware */
4362   MDRV_GFXDECODE(pacmanbl_gfxdecodeinfo)
4350   MDRV_GFXDECODE(pacmanbl)
43634351MACHINE_DRIVER_END
43644352
43654353
r1051r1052
43724360   MDRV_MACHINE_RESET(devilfsg)
43734361
43744362   /* video hardware */
4375   MDRV_GFXDECODE(pacmanbl_gfxdecodeinfo)
4363   MDRV_GFXDECODE(pacmanbl)
43764364MACHINE_DRIVER_END
43774365
43784366
r1051r1052
44744462   MDRV_CPU_PROGRAM_MAP(zigzag_readmem,zigzag_writemem)
44754463
44764464   /* video hardware */
4477   MDRV_GFXDECODE(pacmanbl_gfxdecodeinfo)
4465   MDRV_GFXDECODE(pacmanbl)
44784466   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
44794467
44804468
r1051r1052
46444632   MDRV_CPU_PROGRAM_MAP(_4in1_readmem,_4in1_writemem)
46454633
46464634   /* video hardware */
4647   MDRV_GFXDECODE(_4in1_gfxdecodeinfo)
4635   MDRV_GFXDECODE(_4in1)
46484636
46494637   MDRV_VIDEO_START(pisces)
46504638MACHINE_DRIVER_END
r1051r1052
46604648   MDRV_MACHINE_RESET( devilfsg )
46614649
46624650   /* video hardware */
4663   MDRV_GFXDECODE(bagmanmc_gfxdecodeinfo)
4651   MDRV_GFXDECODE(bagmanmc)
46644652
46654653   MDRV_VIDEO_START(pisces)
46664654MACHINE_DRIVER_END
r1051r1052
46824670   MDRV_IMPORT_FROM(galaxian)
46834671   MDRV_CPU_MODIFY("main")
46844672   MDRV_CPU_PROGRAM_MAP(rockclim_readmem,rockclim_writemem)
4685   MDRV_GFXDECODE(rockclim_gfxdecodeinfo)
4673   MDRV_GFXDECODE(rockclim)
46864674   /* video hardware */
46874675   MDRV_VIDEO_START(rockclim)
46884676   MDRV_PALETTE_LENGTH(64+64+2)   /* 64 colors only, but still uses bullets so we need to keep the palette big */
r1051r1052
47264714   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
47274715
47284716   MDRV_PALETTE_LENGTH(64)
4729   MDRV_GFXDECODE(gmgalax_gfxdecodeinfo)
4717   MDRV_GFXDECODE(gmgalax)
47304718
47314719   MDRV_PALETTE_INIT(rockclim)
47324720
r1051r1052
47644752   MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt,1)
47654753
47664754   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
4767   MDRV_GFXDECODE(galaxian_gfxdecodeinfo)
4755   MDRV_GFXDECODE(galaxian)
47684756   MDRV_PALETTE_LENGTH(32+2+64)      /* 32 for the characters, 2 for the bullets, 64 for the stars */
47694757
47704758   MDRV_SCREEN_ADD("main", 0)
r1051r1052
48284816   MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt,1)
48294817
48304818   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
4831   MDRV_GFXDECODE(galaxian_gfxdecodeinfo)
4819   MDRV_GFXDECODE(galaxian)
48324820   MDRV_PALETTE_LENGTH(32)
48334821
48344822   MDRV_SCREEN_ADD("main", 0)
r1051r1052
48584846   MDRV_CPU_MODIFY("main")
48594847   MDRV_CPU_PROGRAM_MAP(ckongg_readmem,ckongg_writemem)
48604848
4861   MDRV_GFXDECODE(gmgalax_gfxdecodeinfo)
4849   MDRV_GFXDECODE(gmgalax)
48624850
48634851   MDRV_VIDEO_START(ckongs)
48644852
r1051r1052
48714859   MDRV_CPU_MODIFY("main")
48724860   MDRV_CPU_PROGRAM_MAP(kkgalax_readmem,kkgalax_writemem)
48734861
4874   MDRV_GFXDECODE(gmgalax_gfxdecodeinfo)
4862   MDRV_GFXDECODE(gmgalax)
48754863
48764864   MDRV_VIDEO_START(ckongs)
48774865
r1051r1052
48874875   MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt,1)
48884876
48894877   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
4890   MDRV_GFXDECODE(galaxian_gfxdecodeinfo)
4878   MDRV_GFXDECODE(galaxian)
48914879   MDRV_PALETTE_LENGTH(32)
48924880
48934881   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/othldrby.c
r1051r1052
230230   16*32
231231};
232232
233static const gfx_decode gfxdecodeinfo[] =
234{
235   { REGION_GFX1, 0, &spritelayout, 0, 0x80 },
236   { REGION_GFX1, 0, &tilelayout,   0, 0x80 },
237   { -1 }
238};
233static GFXDECODE_START( othldrby )
234   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 0x80 )
235   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0, 0x80 )
236GFXDECODE_END
239237
240238
241239
r1051r1052
254252   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
255253   MDRV_SCREEN_SIZE(64*8, 32*8)
256254   MDRV_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 1*8, 31*8-1 )
257   MDRV_GFXDECODE(gfxdecodeinfo)
255   MDRV_GFXDECODE(othldrby)
258256   MDRV_PALETTE_LENGTH(0x800)
259257
260258   MDRV_VIDEO_START(othldrby)
src/mame/drivers/bbusters.c
r1051r1052
619619   128*8
620620};
621621
622static const gfx_decode gfxdecodeinfo[] =
623{
624   { REGION_GFX1, 0, &charlayout,     0, 16 },
625   { REGION_GFX2, 0, &spritelayout, 256, 16 },
626   { REGION_GFX3, 0, &spritelayout, 512, 16 },
627   { REGION_GFX4, 0, &tilelayout,   768, 16 },
628   { REGION_GFX5, 0, &tilelayout,  1024+256, 16 },
629   { -1 }
630};
622static GFXDECODE_START( bbusters )
623   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
624   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 256, 16 )
625   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 512, 16 )
626   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,   768, 16 )
627   GFXDECODE_ENTRY( REGION_GFX5, 0, tilelayout,  1024+256, 16 )
628GFXDECODE_END
631629
632static const gfx_decode gfxdecodeinfo_mechatt[] =
633{
634   { REGION_GFX1, 0, &charlayout,     0, 16 },
635   { REGION_GFX2, 0, &spritelayout, 256, 16 },
636   { REGION_GFX3, 0, &spritelayout, 512, 16 },
637   { REGION_GFX4, 0, &tilelayout,   512, 16 },
638   { REGION_GFX5, 0, &tilelayout,   768, 16 },
639   { -1 }
640};
630static GFXDECODE_START( mechatt )
631   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
632   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 256, 16 )
633   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 512, 16 )
634   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,   512, 16 )
635   GFXDECODE_ENTRY( REGION_GFX5, 0, tilelayout,   768, 16 )
636GFXDECODE_END
641637
642638/******************************************************************************/
643639
r1051r1052
718714   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
719715   MDRV_SCREEN_SIZE(32*8, 32*8)
720716   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
721   MDRV_GFXDECODE(gfxdecodeinfo)
717   MDRV_GFXDECODE(bbusters)
722718   MDRV_PALETTE_LENGTH(2048)
723719
724720   MDRV_VIDEO_START(bbuster)
r1051r1052
759755   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
760756   MDRV_SCREEN_SIZE(32*8, 32*8)
761757   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
762   MDRV_GFXDECODE(gfxdecodeinfo_mechatt)
758   MDRV_GFXDECODE(mechatt)
763759   MDRV_PALETTE_LENGTH(1024)
764760
765761   MDRV_VIDEO_START(mechatt)
src/mame/drivers/gstriker.c
r1051r1052
259259   16*64
260260};
261261
262static const gfx_decode gfxdecodeinfo[] =
263{
264   { REGION_GFX1, 0, &gs_8x8x4_layout,     0, 256 },
265   { REGION_GFX2, 0, &gs_16x16x4_layout,   0, 256 },
266   { REGION_GFX3, 0, &gs_16x16x4_layout,   0, 256 },
262static GFXDECODE_START( gstriker )
263   GFXDECODE_ENTRY( REGION_GFX1, 0, gs_8x8x4_layout,     0, 256 )
264   GFXDECODE_ENTRY( REGION_GFX2, 0, gs_16x16x4_layout,   0, 256 )
265   GFXDECODE_ENTRY( REGION_GFX3, 0, gs_16x16x4_layout,   0, 256 )
267266
268   { -1 },
269};
267GFXDECODE_END
270268
271269/*** MORE SOUND RELATED ******************************************************/
272270
r1051r1052
454452   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
455453   MDRV_SCREEN_SIZE(64*8, 64*8)
456454   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
457   MDRV_GFXDECODE(gfxdecodeinfo)
455   MDRV_GFXDECODE(gstriker)
458456   MDRV_PALETTE_LENGTH(0x800)
459457
460458   MDRV_VIDEO_START(gstriker)
src/mame/drivers/snk.c
r1051r1052
756756
757757/*********************************************************************/
758758
759static const gfx_decode tnk3_gfxdecodeinfo[] =
760{
761   { REGION_GFX1, 0x0, &char512,   128*3,  8 },
762   { REGION_GFX2, 0x0, &char1024,   128*1, 16 },
763   { REGION_GFX3, 0x0, &sprite512,   128*0, 16 },
764   { -1 }
765};
759static GFXDECODE_START( tnk3 )
760   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char512,   128*3,  8 )
761   GFXDECODE_ENTRY( REGION_GFX2, 0x0, char1024,   128*1, 16 )
762   GFXDECODE_ENTRY( REGION_GFX3, 0x0, sprite512,   128*0, 16 )
763GFXDECODE_END
766764
767static const gfx_decode athena_gfxdecodeinfo[] =
768{
765static GFXDECODE_START( athena )
769766   /* colors 512-1023 are currently unused, I think they are a second bank */
770   { REGION_GFX1, 0x0, &char512,   128*3,  8 },   /* colors 384..511 */
771   { REGION_GFX2, 0x0, &char1024,   128*1, 16 },   /* colors 128..383 */
772   { REGION_GFX3, 0x0, &sprite1024,      0, 16 },   /* colors   0..127 */
773   { -1 }
774};
767   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char512,   128*3,  8 )   /* colors 384..511 */
768   GFXDECODE_ENTRY( REGION_GFX2, 0x0, char1024,   128*1, 16 )   /* colors 128..383 */
769   GFXDECODE_ENTRY( REGION_GFX3, 0x0, sprite1024,      0, 16 )   /* colors   0..127 */
770GFXDECODE_END
775771
776static const gfx_decode ikari_gfxdecodeinfo[] =
777{
778   { REGION_GFX1, 0x0, &char512,             256, 16 },
779   { REGION_GFX2, 0x0, &tile1024,            256, 16 },
780   { REGION_GFX3, 0x0, &sprite1024,            0, 16 },
781   { REGION_GFX4, 0x0, &big_sprite512,       128, 16 },
782   { -1 }
783};
772static GFXDECODE_START( ikari )
773   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char512,             256, 16 )
774   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile1024,            256, 16 )
775   GFXDECODE_ENTRY( REGION_GFX3, 0x0, sprite1024,            0, 16 )
776   GFXDECODE_ENTRY( REGION_GFX4, 0x0, big_sprite512,       128, 16 )
777GFXDECODE_END
784778
785static const gfx_decode gwar_gfxdecodeinfo[] =
786{
787   { REGION_GFX1, 0x0, &char1024,             256*0, 16 },
788   { REGION_GFX2, 0x0, &tile2048,             256*3, 16 },
789   { REGION_GFX3, 0x0, &gwar_sprite2048,      256*1, 16 },
790   { REGION_GFX4, 0x0, &gwar_big_sprite1024,  256*2, 16 },
791   { -1 }
792};
779static GFXDECODE_START( gwar )
780   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char1024,             256*0, 16 )
781   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile2048,             256*3, 16 )
782   GFXDECODE_ENTRY( REGION_GFX3, 0x0, gwar_sprite2048,      256*1, 16 )
783   GFXDECODE_ENTRY( REGION_GFX4, 0x0, gwar_big_sprite1024,  256*2, 16 )
784GFXDECODE_END
793785
794static const gfx_decode bermudat_gfxdecodeinfo[] =
795{
796   { REGION_GFX1, 0x0, &char1024,             256*0, 16 },
797   { REGION_GFX2, 0x0, &tile2048,             256*3, 16 },
798   { REGION_GFX3, 0x0, &gwar_sprite1024,      256*1, 16 },
799   { REGION_GFX4, 0x0, &gwar_big_sprite1024,  256*2, 16 },
800   { -1 }
801};
786static GFXDECODE_START( bermudat )
787   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char1024,             256*0, 16 )
788   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile2048,             256*3, 16 )
789   GFXDECODE_ENTRY( REGION_GFX3, 0x0, gwar_sprite1024,      256*1, 16 )
790   GFXDECODE_ENTRY( REGION_GFX4, 0x0, gwar_big_sprite1024,  256*2, 16 )
791GFXDECODE_END
802792
803static const gfx_decode psychos_gfxdecodeinfo[] =
804{
805   { REGION_GFX1, 0x0, &char1024,             256*0, 16 },
806   { REGION_GFX2, 0x0, &tile2048,             256*3, 16 },
807   { REGION_GFX3, 0x0, &gwar_sprite1024,      256*1, 16 },
808   { REGION_GFX4, 0x0, &gwar_big_sprite1024,  256*2, 16 },
809   { -1 }
810};
793static GFXDECODE_START( psychos )
794   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char1024,             256*0, 16 )
795   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile2048,             256*3, 16 )
796   GFXDECODE_ENTRY( REGION_GFX3, 0x0, gwar_sprite1024,      256*1, 16 )
797   GFXDECODE_ENTRY( REGION_GFX4, 0x0, gwar_big_sprite1024,  256*2, 16 )
798GFXDECODE_END
811799
812static const gfx_decode tdfever_gfxdecodeinfo[] =
813{
814   { REGION_GFX1, 0x0, &char1024,               256*0, 16 },
815   { REGION_GFX2, 0x0, &tdfever_tiles,            256*2, 16 },
816   { REGION_GFX3, 0x0, &tdfever_big_sprite1024,   256*1, 16 },
817   { -1 }
818};
800static GFXDECODE_START( tdfever )
801   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char1024,               256*0, 16 )
802   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tdfever_tiles,            256*2, 16 )
803   GFXDECODE_ENTRY( REGION_GFX3, 0x0, tdfever_big_sprite1024,   256*1, 16 )
804GFXDECODE_END
819805
820static const gfx_decode tdfever2_gfxdecodeinfo[] =
821{
822   { REGION_GFX1, 0x0, &char1024,               256*0, 16 },
823   { REGION_GFX2, 0x0, &tdfever2_tiles,            256*2, 16 },
824   { REGION_GFX3, 0x0, &tdfever_big_sprite1024,   256*1, 16 },
825   { -1 }
826};
806static GFXDECODE_START( tdfever2 )
807   GFXDECODE_ENTRY( REGION_GFX1, 0x0, char1024,               256*0, 16 )
808   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tdfever2_tiles,            256*2, 16 )
809   GFXDECODE_ENTRY( REGION_GFX3, 0x0, tdfever_big_sprite1024,   256*1, 16 )
810GFXDECODE_END
827811
828812/**********************************************************************/
829813
r1051r1052
852836   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
853837   MDRV_SCREEN_SIZE(36*8, 28*8)
854838   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
855   MDRV_GFXDECODE(tnk3_gfxdecodeinfo)
839   MDRV_GFXDECODE(tnk3)
856840   MDRV_PALETTE_LENGTH(1024)
857841
858842   MDRV_PALETTE_INIT(aso)
r1051r1052
893877   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
894878   MDRV_SCREEN_SIZE(36*8, 28*8)
895879   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
896   MDRV_GFXDECODE(athena_gfxdecodeinfo)
880   MDRV_GFXDECODE(athena)
897881   MDRV_PALETTE_LENGTH(1024)
898882
899883   MDRV_PALETTE_INIT(aso)
r1051r1052
938922   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
939923   MDRV_SCREEN_SIZE(36*8, 28*8)
940924   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
941   MDRV_GFXDECODE(ikari_gfxdecodeinfo)
925   MDRV_GFXDECODE(ikari)
942926   MDRV_PALETTE_LENGTH(1024)
943927
944928   MDRV_PALETTE_INIT(snk_3bpp_shadow)
r1051r1052
983967   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
984968   MDRV_SCREEN_SIZE(36*8, 28*8)
985969   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
986   MDRV_GFXDECODE(ikari_gfxdecodeinfo)
970   MDRV_GFXDECODE(ikari)
987971   MDRV_PALETTE_LENGTH(1024)
988972
989973   MDRV_PALETTE_INIT(snk_3bpp_shadow)
r1051r1052
10281012   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10291013   MDRV_SCREEN_SIZE(400, 224)
10301014   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
1031   MDRV_GFXDECODE(gwar_gfxdecodeinfo)
1015   MDRV_GFXDECODE(gwar)
10321016   MDRV_PALETTE_LENGTH(1024)
10331017
10341018   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
10741058   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10751059   MDRV_SCREEN_SIZE(400, 224)
10761060   MDRV_SCREEN_VISIBLE_AREA(16, 399, 0, 223)
1077   MDRV_GFXDECODE(bermudat_gfxdecodeinfo)
1061   MDRV_GFXDECODE(bermudat)
10781062   MDRV_PALETTE_LENGTH(1024)
10791063
10801064   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
11191103   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11201104   MDRV_SCREEN_SIZE(400, 224)
11211105   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
1122   MDRV_GFXDECODE(psychos_gfxdecodeinfo)
1106   MDRV_GFXDECODE(psychos)
11231107   MDRV_PALETTE_LENGTH(1024)
11241108
11251109   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
11641148   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11651149   MDRV_SCREEN_SIZE(400, 224)
11661150   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
1167   MDRV_GFXDECODE(psychos_gfxdecodeinfo)
1151   MDRV_GFXDECODE(psychos)
11681152   MDRV_PALETTE_LENGTH(1024)
11691153
11701154   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
12091193   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12101194   MDRV_SCREEN_SIZE(400,224)
12111195   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
1212   MDRV_GFXDECODE(tdfever_gfxdecodeinfo)
1196   MDRV_GFXDECODE(tdfever)
12131197   MDRV_PALETTE_LENGTH(1024)
12141198
12151199   MDRV_PALETTE_INIT(snk_4bpp_shadow)
r1051r1052
12541238   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12551239   MDRV_SCREEN_SIZE(400,224)
12561240   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
1257   MDRV_GFXDECODE(tdfever2_gfxdecodeinfo)
1241   MDRV_GFXDECODE(tdfever2)
12581242   MDRV_PALETTE_LENGTH(1024)
12591243
12601244   MDRV_PALETTE_INIT(snk_4bpp_shadow)
r1051r1052
12991283   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13001284   MDRV_SCREEN_SIZE(400,224)
13011285   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
1302   MDRV_GFXDECODE(tdfever_gfxdecodeinfo)
1286   MDRV_GFXDECODE(tdfever)
13031287   MDRV_PALETTE_LENGTH(1024)
13041288
13051289   MDRV_PALETTE_INIT(snk_4bpp_shadow)
src/mame/drivers/hyprduel.c
r1051r1052
699699   32*8      /* char modulo (half char step) */
700700};
701701
702static const gfx_decode gfxdecodeinfo_14220[] =
703{
704   { REGION_GFX1, 0, &layout_8x8x4,    0x0, 0x200 }, // [0] 4 Bit Tiles
705   { REGION_GFX1, 0, &layout_8x8x8h,   0x0,  0x20 }, // [1] 8 Bit Tiles
706   { -1 }
707};
702static GFXDECODE_START( 14220 )
703   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
704   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8h,   0x0,  0x20 ) // [1] 8 Bit Tiles
705GFXDECODE_END
708706
709707/***************************************************************************
710708                            Sound Communication
r1051r1052
744742   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
745743   MDRV_SCREEN_SIZE(320, 224)
746744   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, FIRST_VISIBLE_LINE, LAST_VISIBLE_LINE)
747   MDRV_GFXDECODE(gfxdecodeinfo_14220)
745   MDRV_GFXDECODE(14220)
748746   MDRV_PALETTE_LENGTH(8192)
749747
750748   MDRV_VIDEO_START(hyprduel_14220)
r1051r1052
785783   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
786784   MDRV_SCREEN_SIZE(320, 224)
787785   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, FIRST_VISIBLE_LINE, LAST_VISIBLE_LINE)
788   MDRV_GFXDECODE(gfxdecodeinfo_14220)
786   MDRV_GFXDECODE(14220)
789787   MDRV_PALETTE_LENGTH(8192)
790788
791789   MDRV_VIDEO_START(hyprduel_14220)
src/mame/drivers/arcadecl.c
r1051r1052
326326};
327327
328328
329static const gfx_decode gfxdecodeinfo[] =
330{
331   { REGION_GFX1, 0, &molayout,  256, 16 },
332   { -1 }
333};
329static GFXDECODE_START( arcadecl )
330   GFXDECODE_ENTRY( REGION_GFX1, 0, molayout,  256, 16 )
331GFXDECODE_END
334332
335333
336334
r1051r1052
352350
353351   /* video hardware */
354352   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
355   MDRV_GFXDECODE(gfxdecodeinfo)
353   MDRV_GFXDECODE(arcadecl)
356354   MDRV_PALETTE_LENGTH(512)
357355
358356   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/namconb1.c
r1051r1052
647647   16*128
648648}; /* roz_layout */
649649
650static const gfx_decode gfxdecodeinfo[] =
651{
652   { NAMCONB1_TILEGFXREGION,   0, &tile_layout,   0x1000, 0x10 },
653   { NAMCONB1_SPRITEGFXREGION,   0, &obj_layout,      0x0000, 0x10 },
654   { -1 }
655}; /* gfxdecodeinfo */
650static GFXDECODE_START( namconb1 )
651   GFXDECODE_ENTRY( NAMCONB1_TILEGFXREGION,   0, tile_layout,   0x1000, 0x10 )
652   GFXDECODE_ENTRY( NAMCONB1_SPRITEGFXREGION,   0, obj_layout,      0x0000, 0x10 )
653GFXDECODE_END /* gfxdecodeinfo */
656654
657static const gfx_decode gfxdecodeinfo2[] =
658{
659   { NAMCONB1_TILEGFXREGION,   0, &tile_layout,   0x1000, 0x08 },
660   { NAMCONB1_SPRITEGFXREGION,   0, &obj_layout,      0x0000, 0x10 },
661   { NAMCONB1_ROTGFXREGION,   0, &roz_layout,      0x1800, 0x08 },
662   { -1 }
663}; /* gfxdecodeinfo2 */
655static GFXDECODE_START( 2 )
656   GFXDECODE_ENTRY( NAMCONB1_TILEGFXREGION,   0, tile_layout,   0x1000, 0x08 )
657   GFXDECODE_ENTRY( NAMCONB1_SPRITEGFXREGION,   0, obj_layout,      0x0000, 0x10 )
658   GFXDECODE_ENTRY( NAMCONB1_ROTGFXREGION,   0, roz_layout,      0x1800, 0x08 )
659GFXDECODE_END /* gfxdecodeinfo2 */
664660
665661/***************************************************************/
666662
r1051r1052
766762   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
767763   MDRV_SCREEN_SIZE(NAMCONB1_HTOTAL, NAMCONB1_VTOTAL)
768764   MDRV_SCREEN_VISIBLE_AREA(0, NAMCONB1_HBSTART-1, 0, NAMCONB1_VBSTART-1)
769   MDRV_GFXDECODE(gfxdecodeinfo)
765   MDRV_GFXDECODE(namconb1)
770766   MDRV_PALETTE_LENGTH(0x2000)
771767   MDRV_VIDEO_START(namconb1)
772768   MDRV_VIDEO_UPDATE(namconb1)
r1051r1052
787783   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
788784   MDRV_SCREEN_SIZE(NAMCONB1_HTOTAL, NAMCONB1_VTOTAL)
789785   MDRV_SCREEN_VISIBLE_AREA(0, NAMCONB1_HBSTART-1, 0, NAMCONB1_VBSTART-1)
790   MDRV_GFXDECODE(gfxdecodeinfo2)
786   MDRV_GFXDECODE(2)
791787   MDRV_PALETTE_LENGTH(0x2000)
792788   MDRV_VIDEO_START(namconb2)
793789   MDRV_VIDEO_UPDATE(namconb2)
src/mame/drivers/flstory.c
r1051r1052
710710   64*8
711711};
712712
713static const gfx_decode gfxdecodeinfo[] =
714{
715   { REGION_GFX1, 0, &charlayout,     0, 16 },
716   { REGION_GFX1, 0, &spritelayout, 256, 16 },
717   { -1 }   /* end of array */
718};
713static GFXDECODE_START( flstory )
714   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
715   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 256, 16 )
716GFXDECODE_END
719717
720718
721719static struct AY8910interface ay8910_interface =
r1051r1052
759757   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
760758   MDRV_SCREEN_SIZE(32*8, 32*8)
761759   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
762   MDRV_GFXDECODE(gfxdecodeinfo)
760   MDRV_GFXDECODE(flstory)
763761   MDRV_PALETTE_LENGTH(512)
764762
765763   MDRV_VIDEO_START(flstory)
r1051r1052
806804   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
807805   MDRV_SCREEN_SIZE(32*8, 32*8)
808806   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
809   MDRV_GFXDECODE(gfxdecodeinfo)
807   MDRV_GFXDECODE(flstory)
810808   MDRV_PALETTE_LENGTH(512)
811809
812810   MDRV_VIDEO_START(flstory)
r1051r1052
853851   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
854852   MDRV_SCREEN_SIZE(32*8, 32*8)
855853   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
856   MDRV_GFXDECODE(gfxdecodeinfo)
854   MDRV_GFXDECODE(flstory)
857855   MDRV_PALETTE_LENGTH(512)
858856
859857   MDRV_VIDEO_START(victnine)
src/mame/drivers/fcrash.c
r1051r1052
338338   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
339339   MDRV_SCREEN_SIZE(64*8, 32*8)
340340   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
341   MDRV_GFXDECODE(cps1_gfxdecodeinfo)
341   MDRV_GFXDECODE(cps1)
342342   MDRV_PALETTE_LENGTH(4096)
343343
344344   MDRV_VIDEO_START(cps1)
src/mame/drivers/suprslam.c
r1051r1052
303303   16*64
304304};
305305
306static const gfx_decode gfxdecodeinfo[] =
307{
308   { REGION_GFX1, 0, &suprslam_8x8x4_layout,   0x000, 16 },
309   { REGION_GFX2, 0, &suprslam_16x16x4_layout, 0x200, 16 },
310   { REGION_GFX3, 0, &suprslam_16x16x4_layout, 0x100, 16 },
311   { -1 }
312};
306static GFXDECODE_START( suprslam )
307   GFXDECODE_ENTRY( REGION_GFX1, 0, suprslam_8x8x4_layout,   0x000, 16 )
308   GFXDECODE_ENTRY( REGION_GFX2, 0, suprslam_16x16x4_layout, 0x200, 16 )
309   GFXDECODE_ENTRY( REGION_GFX3, 0, suprslam_16x16x4_layout, 0x100, 16 )
310GFXDECODE_END
313311
314312/*** MORE SOUND **************************************************************/
315313
r1051r1052
340338   MDRV_SCREEN_REFRESH_RATE(60)
341339   MDRV_SCREEN_VBLANK_TIME(USEC_TO_SUBSECONDS(2300) /* hand-tuned */)
342340
343   MDRV_GFXDECODE(gfxdecodeinfo)
341   MDRV_GFXDECODE(suprslam)
344342
345343   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK)
346344   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/strnskil.c
r1051r1052
334334   8*8*4
335335};
336336
337static const gfx_decode gfxdecodeinfo[] =
338{
339   { REGION_GFX2, 0x0000, &charlayout,   512, 64 },
340   { REGION_GFX1, 0x0000, &spritelayout, 0,   64 },
341   { -1 }
342};
337static GFXDECODE_START( strnskil )
338   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   512, 64 )
339   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0,   64 )
340GFXDECODE_END
343341
344342
345343static MACHINE_DRIVER_START( strnskil )
r1051r1052
362360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
363361   MDRV_SCREEN_SIZE(32*8, 32*8)
364362   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
365   MDRV_GFXDECODE(gfxdecodeinfo)
363   MDRV_GFXDECODE(strnskil)
366364   MDRV_PALETTE_LENGTH(256)
367365   MDRV_COLORTABLE_LENGTH(1024)
368366
src/mame/drivers/sfkick.c
r1051r1052
9595   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
9696   MDRV_SCREEN_SIZE(256, 256)
9797   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
98   //MDRV_GFXDECODE(gfxdecodeinfo) // GFX don't seem to be tile based
98   //MDRV_GFXDECODE(sfkick) // GFX don't seem to be tile based
9999   MDRV_PALETTE_LENGTH(0x100)
100100
101101   MDRV_VIDEO_START(sfkick)
src/mame/drivers/atetris.c
r1051r1052
294294};
295295
296296
297static const gfx_decode gfxdecodeinfo[] =
298{
299   { REGION_GFX1, 0, &charlayout, 0, 16 },
300   { -1 }
301};
297static GFXDECODE_START( atetris )
298   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
299GFXDECODE_END
302300
303301
304302
r1051r1052
340338
341339   /* video hardware */
342340   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
343   MDRV_GFXDECODE(gfxdecodeinfo)
341   MDRV_GFXDECODE(atetris)
344342   MDRV_PALETTE_LENGTH(256)
345343
346344   MDRV_SCREEN_ADD("main", 0)
r1051r1052
378376
379377   /* video hardware */
380378   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
381   MDRV_GFXDECODE(gfxdecodeinfo)
379   MDRV_GFXDECODE(atetris)
382380   MDRV_PALETTE_LENGTH(256)
383381
384382   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/troangel.c
r1051r1052
187187   32*8   /* character offset */
188188};
189189
190static const gfx_decode troangel_gfxdecodeinfo[] =
191{
192   { REGION_GFX1, 0x0000, &charlayout,      0, 32 },
193   { REGION_GFX2, 0x0000, &spritelayout, 32*8, 32 },
194   { REGION_GFX2, 0x1000, &spritelayout, 32*8, 32 },
195   { REGION_GFX2, 0x2000, &spritelayout, 32*8, 32 },
196   { REGION_GFX2, 0x3000, &spritelayout, 32*8, 32 },
197   { -1 }
198};
190static GFXDECODE_START( troangel )
191   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 32 )
192   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 32*8, 32 )
193   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, spritelayout, 32*8, 32 )
194   GFXDECODE_ENTRY( REGION_GFX2, 0x2000, spritelayout, 32*8, 32 )
195   GFXDECODE_ENTRY( REGION_GFX2, 0x3000, spritelayout, 32*8, 32 )
196GFXDECODE_END
199197
200198
201199
r1051r1052
216214   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
217215   MDRV_SCREEN_SIZE(32*8, 32*8)
218216   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
219   MDRV_GFXDECODE(troangel_gfxdecodeinfo)
217   MDRV_GFXDECODE(troangel)
220218   MDRV_PALETTE_LENGTH(32*8+16)
221219   MDRV_COLORTABLE_LENGTH(32*8+32*8)
222220
src/mame/drivers/cosmic.c
r1051r1052
933933};
934934
935935
936static const gfx_decode panic_gfxdecodeinfo[] =
937{
938   { REGION_GFX1, 0, &cosmic_spritelayout16,  0, 8 },
939   { REGION_GFX1, 0, &cosmic_spritelayout32,  0, 8 },
940   { -1 }
941};
936static GFXDECODE_START( panic )
937   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout16,  0, 8 )
938   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout32,  0, 8 )
939GFXDECODE_END
942940
943static const gfx_decode cosmica_gfxdecodeinfo[] =
944{
945   { REGION_GFX1, 0, &cosmic_spritelayout16,  0, 16 },
946   { REGION_GFX1, 0, &cosmic_spritelayout32,  0, 16 },
947   { -1 }
948};
941static GFXDECODE_START( cosmica )
942   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout16,  0, 16 )
943   GFXDECODE_ENTRY( REGION_GFX1, 0, cosmic_spritelayout32,  0, 16 )
944GFXDECODE_END
949945
950946
951947static const char *panic_sample_names[] =
r1051r1052
10241020   MDRV_CPU_VBLANK_INT(panic_interrupt,2)
10251021
10261022   /* video hardware */
1027   MDRV_GFXDECODE(panic_gfxdecodeinfo)
1023   MDRV_GFXDECODE(panic)
10281024   MDRV_PALETTE_LENGTH(16)
10291025   MDRV_COLORTABLE_LENGTH(8*4)
10301026
r1051r1052
10531049   MDRV_CPU_VBLANK_INT(cosmica_interrupt,32)
10541050
10551051   /* video hardware */
1056   MDRV_GFXDECODE(cosmica_gfxdecodeinfo)
1052   MDRV_GFXDECODE(cosmica)
10571053   MDRV_PALETTE_LENGTH(8)
10581054   MDRV_COLORTABLE_LENGTH(16*4)
10591055
r1051r1052
11081104   MDRV_CPU_VBLANK_INT(magspot2_interrupt,1)
11091105
11101106   /* video hardware */
1111   MDRV_GFXDECODE(panic_gfxdecodeinfo)
1107   MDRV_GFXDECODE(panic)
11121108   MDRV_PALETTE_LENGTH(16)
11131109   MDRV_COLORTABLE_LENGTH(8*4)
11141110
r1051r1052
11431139   MDRV_CPU_VBLANK_INT(nomnlnd_interrupt,1)
11441140
11451141   /* video hardware */
1146   MDRV_GFXDECODE(panic_gfxdecodeinfo)
1142   MDRV_GFXDECODE(panic)
11471143   MDRV_PALETTE_LENGTH(8)
11481144   MDRV_COLORTABLE_LENGTH(8*4)
11491145
src/mame/drivers/shaolins.c
r1051r1052
207207   64*8   /* every sprite takes 64 consecutive bytes */
208208};
209209
210static const gfx_decode shaolins_gfxdecodeinfo[] =
211{
212   { REGION_GFX1, 0, &shaolins_charlayout,         0, 16*8 },
213   { REGION_GFX2, 0, &shaolins_spritelayout, 16*8*16, 16*8 },
214   { -1 }
215};
210static GFXDECODE_START( shaolins )
211   GFXDECODE_ENTRY( REGION_GFX1, 0, shaolins_charlayout,         0, 16*8 )
212   GFXDECODE_ENTRY( REGION_GFX2, 0, shaolins_spritelayout, 16*8*16, 16*8 )
213GFXDECODE_END
216214
217215
218216
r1051r1052
231229   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
232230   MDRV_SCREEN_SIZE(32*8, 32*8)
233231   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
234   MDRV_GFXDECODE(shaolins_gfxdecodeinfo)
232   MDRV_GFXDECODE(shaolins)
235233   MDRV_PALETTE_LENGTH(256)
236234   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
237235
src/mame/drivers/model2.c
r1051r1052
3838    overrev: bad network test like sgt24h.
3939    vstriker: shows some attract mode, then hangs
4040    manxtt: no escape from "active motion slider" tutorial (needs analog inputs)
41    doaa: shows parade of 'ANIME' errors
4241
4342
4443    TODO
r1051r1052
4645    Controls are pretty basic right now
4746    Sound doesn't work properly in all games
4847    System 24 tilemaps need more advanced linescroll support (see fvipers, daytona)
49    DSP cores + hookups
48    2C needs DSP still
5049*/
5150
5251#include "driver.h"
r1051r1052
6867static UINT32 model2_intreq;
6968static UINT32 model2_intena;
7069static UINT32 model2_coproctl, model2_coprocnt, model2_geoctl, model2_geocnt;
70static UINT16 *model2_soundram = NULL;
7171
7272static UINT32 model2_timervals[4], model2_timerorig[4];
7373static int      model2_timerrun[4];
r1051r1052
322322static TIMER_CALLBACK( model2_timer_2_cb ) { model2_timer_exp(2, 4); }
323323static TIMER_CALLBACK( model2_timer_3_cb ) { model2_timer_exp(3, 5); }
324324
325static MACHINE_RESET(model2o)
325static MACHINE_RESET(model2_common)
326326{
327327   model2_intreq = 0;
328328   model2_intena = 0;
r1051r1052
348348   mame_timer_adjust(model2_timers[1], time_never, 0, time_never);
349349   mame_timer_adjust(model2_timers[2], time_never, 0, time_never);
350350   mame_timer_adjust(model2_timers[3], time_never, 0, time_never);
351}
351352
353static MACHINE_RESET(model2o)
354{
355   machine_reset_model2_common(machine);
356
352357   // hold TGP in halt until we have code
353358   cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE);
354359
355360   dsp_type = DSP_TYPE_TGP;
356361}
357362
358static MACHINE_RESET(model2)
363static MACHINE_RESET(model2_scsp)
359364{
360   machine_reset_model2o(machine);
361
362365   memory_set_bankptr(4, memory_region(REGION_SOUND1) + 0x200000);
363366   memory_set_bankptr(5, memory_region(REGION_SOUND1) + 0x600000);
364367
365368   // copy the 68k vector table into RAM
366   memcpy(memory_region(REGION_CPU2), memory_region(REGION_CPU2)+0x80000, 16);
369   memcpy(model2_soundram, memory_region(REGION_CPU2)+0x80000, 16);
370}
367371
372static MACHINE_RESET(model2)
373{
374   machine_reset_model2_common(machine);
375   machine_reset_model2_scsp(machine);
376
377   // hold TGP in halt until we have code
378   cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE);
379
368380   dsp_type = DSP_TYPE_TGP;
369381}
370382
371383static MACHINE_RESET(model2b)
372384{
373   machine_reset_model2(machine);
385   machine_reset_model2_common(machine);
386   machine_reset_model2_scsp(machine);
374387
375388   cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE);
376   //cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE);
377389
378390   // set FIFOIN empty flag on SHARC
379391   cpunum_set_input_line(2, SHARC_INPUT_FLAG0, ASSERT_LINE);
r1051r1052
385397
386398static MACHINE_RESET(model2c)
387399{
388   machine_reset_model2(machine);
400   machine_reset_model2_common(machine);
401   machine_reset_model2_scsp(machine);
389402
390403   dsp_type = DSP_TYPE_TGPX4;
391404}
r1051r1052
511524      else
512525      {
513526         logerror("Boot copro, %d dwords\n", model2_coprocnt);
527         if (dsp_type != DSP_TYPE_TGPX4)
528         {
514529         cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
515530      }
516531   }
532   }
517533
518534   model2_coproctl = data;
519535}
r1051r1052
922938
923939static WRITE32_HANDLER( model2_serial_w )
924940{
925   if (mem_mask == 0xffff0000)
941   if (((mem_mask & 0xff) == 0) && (offset == 0))
926942   {
927943      SCSP_MidiIn(0, data&0xff, 0);
928944
r1051r1052
16501666}
16511667
16521668static ADDRESS_MAP_START( model2_snd, ADDRESS_SPACE_PROGRAM, 16 )
1653   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_REGION(REGION_CPU2, 0)
1669   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_REGION(REGION_CPU2, 0) AM_BASE(&model2_soundram)
16541670   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(SCSP_0_r, SCSP_0_w)
16551671   AM_RANGE(0x400000, 0x400001) AM_WRITE(model2snd_ctrl)
16561672   AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION(REGION_CPU2, 0x80000)
r1051r1052
16661682   if (irq > 0)
16671683   {
16681684      scsp_last_line = irq;
1669      cpunum_set_input_line(1, irq, ASSERT_LINE);
1685      cpunum_set_input_line(1, irq, PULSE_LINE);
16701686   }
1671   else if ( irq < 0)
1672   {
1673      cpunum_set_input_line(1, irq, CLEAR_LINE);
1674   }
1675   else
1676   {
1677      cpunum_set_input_line(1, scsp_last_line, CLEAR_LINE);
1678   }
16791687}
16801688
16811689static struct SCSPinterface scsp_interface =
r1051r1052
18441852
18451853   MDRV_SOUND_ADD(SCSP, 0)
18461854   MDRV_SOUND_CONFIG(scsp_interface)
1847   MDRV_SOUND_ROUTE(0, "left", 1.0)
1848   MDRV_SOUND_ROUTE(0, "right", 1.0)
1855   MDRV_SOUND_ROUTE(0, "left", 2.0)
1856   MDRV_SOUND_ROUTE(0, "right", 2.0)
18491857MACHINE_DRIVER_END
18501858
18511859
r1051r1052
18921900
18931901   MDRV_SOUND_ADD(SCSP, 0)
18941902   MDRV_SOUND_CONFIG(scsp_interface)
1895   MDRV_SOUND_ROUTE(0, "left", 1.0)
1896   MDRV_SOUND_ROUTE(0, "right", 1.0)
1903   MDRV_SOUND_ROUTE(0, "left", 2.0)
1904   MDRV_SOUND_ROUTE(0, "right", 2.0)
18971905MACHINE_DRIVER_END
18981906
18991907/* 2C-CRX */
r1051r1052
19251933
19261934   MDRV_SOUND_ADD(SCSP, 0)
19271935   MDRV_SOUND_CONFIG(scsp_interface)
1928   MDRV_SOUND_ROUTE(0, "left", 1.0)
1929   MDRV_SOUND_ROUTE(0, "right", 1.0)
1936   MDRV_SOUND_ROUTE(0, "left", 2.0)
1937   MDRV_SOUND_ROUTE(0, "right", 2.0)
19301938MACHINE_DRIVER_END
19311939
19321940/* ROM definitions */
src/mame/drivers/ataxx.c
r1051r1052
298298   8*8
299299};
300300
301static const gfx_decode gfxdecodeinfo[] =
302{
303   { REGION_GFX1, 0, &bklayout, 0, 1 },
304   { -1 }
305};
301static GFXDECODE_START( ataxx )
302   GFXDECODE_ENTRY( REGION_GFX1, 0, bklayout, 0, 1 )
303GFXDECODE_END
306304
307305
308306
r1051r1052
352350   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
353351   MDRV_SCREEN_SIZE(40*8, 32*8)
354352   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
355   MDRV_GFXDECODE(gfxdecodeinfo)
353   MDRV_GFXDECODE(ataxx)
356354   MDRV_PALETTE_LENGTH(1024)
357355
358356   MDRV_VIDEO_START(ataxx)
src/mame/drivers/sshangha.c
r1051r1052
318318   64*8
319319};
320320
321static const gfx_decode gfxdecodeinfo[] =
322{
323   { REGION_GFX1, 0, &charlayout,  256, 64 }, /* Characters 8x8 */
324   { REGION_GFX1, 0, &tilelayout,  256, 64 }, /* Tiles 16x16 */
325   { REGION_GFX2, 0, &tilelayout,    0, 32 }, /* Sprites 16x16 */
326   { -1 }
327};
321static GFXDECODE_START( sshangha )
322   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  256, 64 ) /* Characters 8x8 */
323   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,  256, 64 ) /* Tiles 16x16 */
324   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    0, 32 ) /* Sprites 16x16 */
325GFXDECODE_END
328326
329327/******************************************************************************/
330328
r1051r1052
358356   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
359357   MDRV_SCREEN_SIZE(40*8, 32*8)
360358   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
361   MDRV_GFXDECODE(gfxdecodeinfo)
359   MDRV_GFXDECODE(sshangha)
362360   MDRV_PALETTE_LENGTH(4096)
363361
364362   MDRV_VIDEO_START(sshangha)
src/mame/drivers/wiping.c
r1051r1052
290290   64*8   /* every sprite takes 64 consecutive bytes */
291291};
292292
293static const gfx_decode gfxdecodeinfo[] =
294{
295   { REGION_GFX1, 0, &charlayout,      0, 64 },
296   { REGION_GFX2, 0, &spritelayout, 64*4, 64 },
297   { -1 }
298};
293static GFXDECODE_START( wiping )
294   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 64 )
295   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 64*4, 64 )
296GFXDECODE_END
299297
300298
301299
r1051r1052
326324   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
327325   MDRV_SCREEN_SIZE(36*8, 28*8)
328326   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
329   MDRV_GFXDECODE(gfxdecodeinfo)
327   MDRV_GFXDECODE(wiping)
330328   MDRV_PALETTE_LENGTH(32)
331329   MDRV_COLORTABLE_LENGTH(64*4+64*4)
332330
src/mame/drivers/kyugo.c
r1051r1052
463463   16*16
464464};
465465
466static const gfx_decode gfxdecodeinfo[] =
467{
468   { REGION_GFX1, 0, &fg_tilelayout, 0, 64 },
469   { REGION_GFX2, 0, &bg_tilelayout, 0, 32 },
470   { REGION_GFX3, 0, &spritelayout,  0, 32 },
471   { -1 }
472};
466static GFXDECODE_START( kyugo )
467   GFXDECODE_ENTRY( REGION_GFX1, 0, fg_tilelayout, 0, 64 )
468   GFXDECODE_ENTRY( REGION_GFX2, 0, bg_tilelayout, 0, 32 )
469   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  0, 32 )
470GFXDECODE_END
473471
474472
475473/*************************************
r1051r1052
515513   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
516514   MDRV_SCREEN_SIZE(64*8, 32*8)
517515   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
518   MDRV_GFXDECODE(gfxdecodeinfo)
516   MDRV_GFXDECODE(kyugo)
519517   MDRV_PALETTE_LENGTH(256)
520518
521519   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/leland.c
r1051r1052
676676   8*8
677677};
678678
679static const gfx_decode gfxdecodeinfo[] =
680{
681   { REGION_GFX1, 0, &bklayout, 0, 8 },
682   { -1 }
683};
679static GFXDECODE_START( leland )
680   GFXDECODE_ENTRY( REGION_GFX1, 0, bklayout, 0, 8 )
681GFXDECODE_END
684682
685683
686684
r1051r1052
755753   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
756754   MDRV_SCREEN_SIZE(40*8, 32*8)
757755   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
758   MDRV_GFXDECODE(gfxdecodeinfo)
756   MDRV_GFXDECODE(leland)
759757   MDRV_PALETTE_LENGTH(1024)
760758
761759   MDRV_VIDEO_START(leland)
src/mame/drivers/lazercmd.c
r1051r1052
595595   10*8               /* every char takes 10 bytes */
596596};
597597
598static const gfx_decode gfxdecodeinfo[] =
599{
600   { REGION_GFX1, 0, &charlayout, 0, 2 },
601   { -1 }
602};
598static GFXDECODE_START( lazercmd )
599   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 2 )
600GFXDECODE_END
603601
604602static UINT16 colortable_source[] =
605603{
r1051r1052
635633   MDRV_SCREEN_SIZE(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR)
636634   MDRV_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1,
637635                  0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1)
638   MDRV_GFXDECODE(gfxdecodeinfo)
636   MDRV_GFXDECODE(lazercmd)
639637   MDRV_PALETTE_LENGTH(3)
640638   MDRV_COLORTABLE_LENGTH(2*2)
641639
r1051r1052
671669   MDRV_SCREEN_SIZE(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR)
672670   MDRV_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1,
673671                   0 * VERT_CHR, VERT_RES * VERT_CHR - 1)
674   MDRV_GFXDECODE(gfxdecodeinfo)
672   MDRV_GFXDECODE(lazercmd)
675673   MDRV_PALETTE_LENGTH(3)
676674   MDRV_COLORTABLE_LENGTH(2*2)
677675
r1051r1052
707705   MDRV_SCREEN_SIZE(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR)
708706   MDRV_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1,
709707                  0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1)
710   MDRV_GFXDECODE(gfxdecodeinfo)
708   MDRV_GFXDECODE(lazercmd)
711709   MDRV_PALETTE_LENGTH(3)
712710   MDRV_COLORTABLE_LENGTH(2*2)
713711
src/mame/drivers/popeye.c
r1051r1052
440440   16*8
441441};
442442
443static const gfx_decode gfxdecodeinfo[] =
444{
445   { REGION_GFX1, 0, &charlayout,      0, 16 },   /* chars */
446   { REGION_GFX2, 0, &spritelayout, 16*2, 64 },   /* sprites */
447   { -1 }
448};
443static GFXDECODE_START( popeye )
444   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 16 )   /* chars */
445   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*2, 64 )   /* sprites */
446GFXDECODE_END
449447
450448
451449
r1051r1052
496494   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
497495   MDRV_SCREEN_SIZE(32*16, 32*16)
498496   MDRV_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 2*16, 30*16-1)
499   MDRV_GFXDECODE(gfxdecodeinfo)
497   MDRV_GFXDECODE(popeye)
500498   MDRV_PALETTE_LENGTH(16+16+256)
501499   MDRV_COLORTABLE_LENGTH(16*2+64*4)
502500
src/mame/drivers/gstream.c
r1051r1052
498498   32*256,
499499};
500500
501static const gfx_decode gfxdecodeinfo[] =
502{
503   { REGION_GFX2, 0, &sprites32_layout, 0, 0x80 },
504   { REGION_GFX1, 0, &sprites_layout, 0, 0x80 },
505   { -1 }
506};
501static GFXDECODE_START( gstream )
502   GFXDECODE_ENTRY( REGION_GFX2, 0, sprites32_layout, 0, 0x80 )
503   GFXDECODE_ENTRY( REGION_GFX1, 0, sprites_layout, 0, 0x80 )
504GFXDECODE_END
507505
508506
509507static TILE_GET_INFO( get_gs1_tile_info )
r1051r1052
656654   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
657655
658656   MDRV_PALETTE_LENGTH(0x1000 + 0x400 + 0x400 + 0x400) // sprites + 3 bg layers
659   MDRV_GFXDECODE(gfxdecodeinfo)
657   MDRV_GFXDECODE(gstream)
660658
661659   MDRV_NVRAM_HANDLER(gstream)
662660
src/mame/drivers/4enraya.c
r1051r1052
160160   8*8   /* every char takes 8 consecutive bytes */
161161};
162162
163static const gfx_decode gfxdecodeinfo[] =
164{
165   { REGION_GFX1, 0, &charlayout,     0, 8 },
166   { -1 }   /* end of array */
167};
163static GFXDECODE_START( 4enraya )
164   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 8 )
165GFXDECODE_END
168166
169167
170168static MACHINE_DRIVER_START( 4enraya )
r1051r1052
183181   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
184182   MDRV_SCREEN_SIZE(32*8, 32*8)
185183   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
186   MDRV_GFXDECODE(gfxdecodeinfo)
184   MDRV_GFXDECODE(4enraya)
187185   MDRV_PALETTE_LENGTH(512)
188186
189187   MDRV_VIDEO_START(4enraya)
src/mame/drivers/taxidrvr.c
r1051r1052
332332};
333333
334334
335static const gfx_decode gfxdecodeinfo[] =
336{
337   { REGION_GFX1, 0, &charlayout, 0, 1 },
338   { REGION_GFX2, 0, &charlayout, 0, 1 },
339   { REGION_GFX3, 0, &charlayout, 0, 1 },
340   { REGION_GFX4, 0, &charlayout, 0, 1 },
341   { REGION_GFX5, 0, &charlayout2, 0, 1 },
342   { -1 }
343};
335static GFXDECODE_START( taxidrvr )
336   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 1 )
337   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 1 )
338   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout, 0, 1 )
339   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout, 0, 1 )
340   GFXDECODE_ENTRY( REGION_GFX5, 0, charlayout2, 0, 1 )
341GFXDECODE_END
344342
345343
346344
r1051r1052
386384   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
387385   MDRV_SCREEN_SIZE(32*8, 32*8)
388386   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 27*8-1)
389   MDRV_GFXDECODE(gfxdecodeinfo)
387   MDRV_GFXDECODE(taxidrvr)
390388   MDRV_PALETTE_LENGTH(16)
391389
392390   MDRV_VIDEO_UPDATE(taxidrvr)
src/mame/drivers/blockade.c
r1051r1052
425425   8*8 /* every char takes 8 consecutive bytes */
426426};
427427
428static const gfx_decode gfxdecodeinfo[] =
429{
430   { REGION_GFX1, 0x0000, &blockade_layout, 0, 1 },
431   { -1 }
432};
428static GFXDECODE_START( blockade )
429   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, blockade_layout, 0, 1 )
430GFXDECODE_END
433431
434static const gfx_decode blasto_gfxdecodeinfo[] =
435{
436   { REGION_GFX1, 0x0000, &blasto_layout,   0, 1 },
437   { -1 }
438};
432static GFXDECODE_START( blasto )
433   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, blasto_layout,   0, 1 )
434GFXDECODE_END
439435
440436
441437static PALETTE_INIT( green )
r1051r1052
472468   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
473469   MDRV_SCREEN_SIZE(32*8, 28*8)
474470   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
475   MDRV_GFXDECODE(gfxdecodeinfo)
471   MDRV_GFXDECODE(blockade)
476472   MDRV_PALETTE_LENGTH(2)
477473
478474   MDRV_PALETTE_INIT(green)
r1051r1052
487483   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
488484
489485   MDRV_SOUND_ADD(DISCRETE, 0)
490   MDRV_SOUND_CONFIG(blockade_discrete_interface)
486   MDRV_SOUND_CONFIG_DISCRETE(blockade)
491487   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
492488MACHINE_DRIVER_END
493489
r1051r1052
498494
499495static MACHINE_DRIVER_START( blasto )
500496   MDRV_IMPORT_FROM(blockade)
501   MDRV_GFXDECODE(blasto_gfxdecodeinfo)
497   MDRV_GFXDECODE(blasto)
502498   MDRV_PALETTE_INIT(bw)
503499MACHINE_DRIVER_END
504500
505501static MACHINE_DRIVER_START( hustle )
506502   MDRV_IMPORT_FROM(blockade)
507   MDRV_GFXDECODE(blasto_gfxdecodeinfo)
503   MDRV_GFXDECODE(blasto)
508504   MDRV_PALETTE_INIT(yellow)
509505MACHINE_DRIVER_END
510506
src/mame/drivers/compgolf.c
r1051r1052
185185   16*8
186186};
187187
188static const gfx_decode gfxdecodeinfo[] =
189{
190   { REGION_GFX1, 0, &spritelayout, 0, 0x10 },
191   { REGION_GFX2, 0, &tilelayoutbg, 0, 0x20 },
192   { REGION_GFX3, 0, &tilelayout8,  0, 0x10 },
193   { -1 }
194};
188static GFXDECODE_START( compgolf )
189   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 0x10 )
190   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayoutbg, 0, 0x20 )
191   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout8,  0, 0x10 )
192GFXDECODE_END
195193
196194/***************************************************************************/
197195
r1051r1052
224222   MDRV_SCREEN_VISIBLE_AREA(1*8, 32*8-1, 1*8, 31*8-1)
225223   MDRV_PALETTE_LENGTH(0x100)
226224   MDRV_PALETTE_INIT(compgolf)
227   MDRV_GFXDECODE(gfxdecodeinfo)
225   MDRV_GFXDECODE(compgolf)
228226
229227   MDRV_VIDEO_START(compgolf)
230228   MDRV_VIDEO_UPDATE(compgolf)
src/mame/drivers/cps2.c
r1051r1052
13311331   512*8      /* char modulo */
13321332};
13331333
1334static const gfx_decode gfxdecodeinfo[] =
1335{
1336   { REGION_GFX1, 0, &cps1_layout8x8,   0, 0x100 },
1337   { REGION_GFX1, 0, &cps1_layout8x8_2, 0, 0x100 },
1338   { REGION_GFX1, 0, &layout16x16, 0, 0x100 },
1339   { REGION_GFX1, 0, &layout32x32, 0, 0x100 },
1340   { -1 }
1341};
1334static GFXDECODE_START( cps2 )
1335   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8,   0, 0x100 )
1336   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8_2, 0, 0x100 )
1337   GFXDECODE_ENTRY( REGION_GFX1, 0, layout16x16, 0, 0x100 )
1338   GFXDECODE_ENTRY( REGION_GFX1, 0, layout32x32, 0, 0x100 )
1339GFXDECODE_END
13421340
13431341
13441342
r1051r1052
13711369   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13721370   MDRV_SCREEN_SIZE(64*8, 32*8)
13731371   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
1374   MDRV_GFXDECODE(gfxdecodeinfo)
1372   MDRV_GFXDECODE(cps2)
13751373   MDRV_PALETTE_LENGTH(4096)
13761374
13771375   MDRV_VIDEO_START(cps2)
src/mame/drivers/lordgun.c
r1051r1052
314314   32*32*2
315315};
316316
317static const gfx_decode lordgun_gfxdecodeinfo[] =
318{
319   { REGION_GFX1, 0, &lordgun_16x16x6_layout,  0x000, 0x400/0x40  },   // [0] Sprites
320   { REGION_GFX2, 0, &lordgun_8x8x6_layout,    0x500, 0x100/0x40  },   // [1] Tilemap 0
321   { REGION_GFX3, 0, &lordgun_16x16x6_layout,  0x600, 0x200/0x40  },   // [2] Tilemap 1
322   { REGION_GFX3, 0, &lordgun_32x32x6_layout,  0x700, 0x100/0x40  },   // [3] Tilemap 2
323   { REGION_GFX2, 0, &lordgun_8x8x6_layout,    0x400, 0x400/0x40  },   // [4] Tilemap 3
324   { -1 }
325};
317static GFXDECODE_START( lordgun )
318   GFXDECODE_ENTRY( REGION_GFX1, 0, lordgun_16x16x6_layout,  0x000, 0x400/0x40  )   // [0] Sprites
319   GFXDECODE_ENTRY( REGION_GFX2, 0, lordgun_8x8x6_layout,    0x500, 0x100/0x40  )   // [1] Tilemap 0
320   GFXDECODE_ENTRY( REGION_GFX3, 0, lordgun_16x16x6_layout,  0x600, 0x200/0x40  )   // [2] Tilemap 1
321   GFXDECODE_ENTRY( REGION_GFX3, 0, lordgun_32x32x6_layout,  0x700, 0x100/0x40  )   // [3] Tilemap 2
322   GFXDECODE_ENTRY( REGION_GFX2, 0, lordgun_8x8x6_layout,    0x400, 0x400/0x40  )   // [4] Tilemap 3
323GFXDECODE_END
326324
327325
328326/***************************************************************************
r1051r1052
452450
453451   MDRV_NVRAM_HANDLER(93C46)
454452
455   MDRV_GFXDECODE(lordgun_gfxdecodeinfo)
453   MDRV_GFXDECODE(lordgun)
456454
457455   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
458456   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/lemmings.c
r1051r1052
251251   32*8
252252};
253253
254static const gfx_decode gfxdecodeinfo[] =
255{
256   { REGION_GFX1, 0, &sprite_layout,  32*16, 16 },   /* Sprites 16x16 */
257   { REGION_GFX2, 0, &sprite_layout,  48*16, 16 },   /* Sprites 16x16 */
258   { 0,           0, &charlayout,         0, 16 }, /* Dynamically modified */
259   { -1 }
260};
254static GFXDECODE_START( lemmings )
255   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout,  32*16, 16 )   /* Sprites 16x16 */
256   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout,  48*16, 16 )   /* Sprites 16x16 */
257   GFXDECODE_ENTRY( 0,           0, charlayout,         0, 16 ) /* Dynamically modified */
258GFXDECODE_END
261259
262260/******************************************************************************/
263261
r1051r1052
290288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
291289   MDRV_SCREEN_SIZE(40*8, 32*8)
292290   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
293   MDRV_GFXDECODE(gfxdecodeinfo)
291   MDRV_GFXDECODE(lemmings)
294292   MDRV_PALETTE_LENGTH(1024)
295293
296294   MDRV_VIDEO_EOF(lemmings)
src/mame/drivers/pushman.c
r1051r1052
410410   256*8
411411};
412412
413static const gfx_decode pushman_gfxdecodeinfo[] =
414{
415   { REGION_GFX1, 0x000000, &charlayout,   0x300, 16 },   /* colors 0x300-0x33f */
416   { REGION_GFX2, 0x000000, &spritelayout, 0x200, 16 },   /* colors 0x200-0x2ff */
417   { REGION_GFX3, 0x000000, &tilelayout,   0x100, 16 },   /* colors 0x100-0x1ff */
418   { -1 }
419};
413static GFXDECODE_START( pushman )
414   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, charlayout,   0x300, 16 )   /* colors 0x300-0x33f */
415   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, spritelayout, 0x200, 16 )   /* colors 0x200-0x2ff */
416   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, tilelayout,   0x100, 16 )   /* colors 0x100-0x1ff */
417GFXDECODE_END
420418
421419/******************************************************************************/
422420
r1051r1052
456454   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
457455   MDRV_SCREEN_SIZE(32*8, 32*8)
458456   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
459   MDRV_GFXDECODE(pushman_gfxdecodeinfo)
457   MDRV_GFXDECODE(pushman)
460458   MDRV_PALETTE_LENGTH(1024)
461459
462460   MDRV_VIDEO_START(pushman)
r1051r1052
496494   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
497495   MDRV_SCREEN_SIZE(32*8, 32*8)
498496   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
499   MDRV_GFXDECODE(pushman_gfxdecodeinfo)
497   MDRV_GFXDECODE(pushman)
500498   MDRV_PALETTE_LENGTH(1024)
501499
502500   MDRV_VIDEO_START(pushman)
src/mame/drivers/zerozone.c
r1051r1052
182182};
183183
184184
185static const gfx_decode gfxdecodeinfo[] =
186{
187   { REGION_GFX1, 0, &charlayout, 0, 256 },         /* sprites & playfield */
188   { -1 }
189};
185static GFXDECODE_START( zerozone )
186   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 256 )         /* sprites & playfield */
187GFXDECODE_END
190188
191189
192190static MACHINE_DRIVER_START( zerozone )
r1051r1052
209207   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
210208   MDRV_SCREEN_SIZE(64*8, 32*8)
211209   MDRV_SCREEN_VISIBLE_AREA(1*8, 47*8-1, 2*8, 30*8-1)
212   MDRV_GFXDECODE(gfxdecodeinfo)
210   MDRV_GFXDECODE(zerozone)
213211   MDRV_PALETTE_LENGTH(256)
214212
215213   MDRV_VIDEO_START(zerozone)
src/mame/drivers/espial.c
r1051r1052
301301};
302302
303303
304static const gfx_decode gfxdecodeinfo[] =
305{
306   { REGION_GFX1, 0, &charlayout,    0, 64 },
307   { REGION_GFX2, 0, &spritelayout,  0, 64 },
308   { -1 }
309};
304static GFXDECODE_START( espial )
305   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 64 )
306   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  0, 64 )
307GFXDECODE_END
310308
311309
312310
r1051r1052
333331   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
334332   MDRV_SCREEN_SIZE(32*8, 32*8)
335333   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
336   MDRV_GFXDECODE(gfxdecodeinfo)
334   MDRV_GFXDECODE(espial)
337335   MDRV_PALETTE_LENGTH(256)
338336
339337   MDRV_PALETTE_INIT(espial)
src/mame/drivers/hyperspt.c
r1051r1052
413413   64*8   /* every sprite takes 64 consecutive bytes */
414414};
415415
416static const gfx_decode hyperspt_gfxdecodeinfo[] =
417{
418   { REGION_GFX1, 0, &hyperspt_charlayout,      0, 16 },
419   { REGION_GFX2, 0, &hyperspt_spritelayout, 16*16, 16 },
420   { -1 }
421};
416static GFXDECODE_START( hyperspt )
417   GFXDECODE_ENTRY( REGION_GFX1, 0, hyperspt_charlayout,      0, 16 )
418   GFXDECODE_ENTRY( REGION_GFX2, 0, hyperspt_spritelayout, 16*16, 16 )
419GFXDECODE_END
422420
423421
424422static const gfx_layout roadf_charlayout =
r1051r1052
445443   64*8   /* every sprite takes 64 consecutive bytes */
446444};
447445
448static const gfx_decode roadf_gfxdecodeinfo[] =
449{
450   { REGION_GFX1, 0, &roadf_charlayout,      0, 16 },
451   { REGION_GFX2, 0, &roadf_spritelayout, 16*16, 16 },
452   { -1 }
453};
446static GFXDECODE_START( roadf )
447   GFXDECODE_ENTRY( REGION_GFX1, 0, roadf_charlayout,      0, 16 )
448   GFXDECODE_ENTRY( REGION_GFX2, 0, roadf_spritelayout, 16*16, 16 )
449GFXDECODE_END
454450
455451
456452
r1051r1052
482478   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
483479   MDRV_SCREEN_SIZE(32*8, 32*8)
484480   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
485   MDRV_GFXDECODE(hyperspt_gfxdecodeinfo)
481   MDRV_GFXDECODE(hyperspt)
486482   MDRV_PALETTE_LENGTH(32)
487483   MDRV_COLORTABLE_LENGTH(16*16+16*16)
488484
r1051r1052
508504static MACHINE_DRIVER_START( roadf )
509505   MDRV_IMPORT_FROM(hyperspt)
510506   MDRV_CPU_PROGRAM_MAP(roadf_readmem, writemem)
511   MDRV_GFXDECODE(roadf_gfxdecodeinfo)
507   MDRV_GFXDECODE(roadf)
512508   MDRV_VIDEO_START(roadf)
513509MACHINE_DRIVER_END
514510
src/mame/drivers/tiamc1.c
r1051r1052
141141extern WRITE8_HANDLER( tiamc1_timer1_w );
142142extern WRITE8_HANDLER( tiamc1_timer1_gate_w );
143143
144UINT8 *video_ram;
144static UINT8 *video_ram;
145145
146146DRIVER_INIT( tiamc1 )
147147{
r1051r1052
262262   8*8
263263};
264264
265static const gfx_decode gfxdecodeinfo[] =
266{
267   { 0, 0x0000, &char_layout, 0, 16 },
268   { REGION_GFX1, 0x0000, &sprites16x16_layout, 0, 16 },
269   { -1 }
270};
265static GFXDECODE_START( tiamc1 )
266   GFXDECODE_ENTRY( 0, 0x0000, char_layout, 0, 16 )
267   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sprites16x16_layout, 0, 16 )
268GFXDECODE_END
271269
272270static struct CustomSound_interface tiamc1_custom_interface =
273271{
r1051r1052
292290   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
293291   MDRV_SCREEN_SIZE(256, 256)
294292   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
295   MDRV_GFXDECODE(gfxdecodeinfo)
293   MDRV_GFXDECODE(tiamc1)
296294   MDRV_PALETTE_LENGTH(16)
297295
298296   MDRV_PALETTE_INIT(tiamc1)
src/mame/drivers/toaplan1.c
r1051r1052
15461546};
15471547
15481548
1549static const gfx_decode gfxdecodeinfo[] =
1550{
1551   { REGION_GFX1, 0x00000, &tilelayout,      0, 64 },
1552   { REGION_GFX2, 0x00000, &tilelayout,   64*16, 64 },
1553   { -1 }
1554};
1549static GFXDECODE_START( toaplan1 )
1550   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, tilelayout,      0, 64 )
1551   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout,   64*16, 64 )
1552GFXDECODE_END
15551553
1556static const gfx_decode rallybik_gfxdecodeinfo[] =
1557{
1558   { REGION_GFX1, 0x00000, &tilelayout,           0, 64 },
1559   { REGION_GFX2, 0x00000, &rallybik_spr_layout, 64*16, 64 },
1560   { -1 }
1561};
1554static GFXDECODE_START( rallybik )
1555   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, tilelayout,           0, 64 )
1556   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, rallybik_spr_layout, 64*16, 64 )
1557GFXDECODE_END
15621558
1563static const gfx_decode outzone_gfxdecodeinfo[] =
1564{
1565   { REGION_GFX1, 0x00000, &vm_tilelayout,    0, 64 },
1566   { REGION_GFX2, 0x00000, &tilelayout,   64*16, 64 },
1567   { -1 }
1568};
1559static GFXDECODE_START( outzone )
1560   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, vm_tilelayout,    0, 64 )
1561   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout,   64*16, 64 )
1562GFXDECODE_END
15691563
1570static const gfx_decode vm_gfxdecodeinfo[] =
1571{
1572   { REGION_GFX1, 0x00000, &tilelayout,      0, 64 },
1573   { REGION_GFX2, 0x00000, &vm_tilelayout, 64*16, 64 },
1574   { -1 }
1575};
1564static GFXDECODE_START( vm )
1565   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, tilelayout,      0, 64 )
1566   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, vm_tilelayout, 64*16, 64 )
1567GFXDECODE_END
15761568
15771569
15781570static void irqhandler(int linestate)
r1051r1052
16081600   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16091601   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
16101602   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1611   MDRV_GFXDECODE(rallybik_gfxdecodeinfo)
1603   MDRV_GFXDECODE(rallybik)
16121604   MDRV_PALETTE_LENGTH((64*16)+(64*16))
16131605
16141606   MDRV_VIDEO_START(rallybik)
r1051r1052
16451637   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16461638   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
16471639   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1648   MDRV_GFXDECODE(gfxdecodeinfo)
1640   MDRV_GFXDECODE(toaplan1)
16491641   MDRV_PALETTE_LENGTH((64*16)+(64*16))
16501642
16511643   MDRV_VIDEO_START(toaplan1)
r1051r1052
16821674   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16831675   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
16841676   MDRV_SCREEN_VISIBLE_AREA(0, 319, 16, 255)
1685   MDRV_GFXDECODE(gfxdecodeinfo)
1677   MDRV_GFXDECODE(toaplan1)
16861678   MDRV_PALETTE_LENGTH((64*16)+(64*16))
16871679
16881680   MDRV_VIDEO_START(toaplan1)
r1051r1052
17191711   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17201712   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
17211713   MDRV_SCREEN_VISIBLE_AREA(0, 319, 16, 255)
1722   MDRV_GFXDECODE(gfxdecodeinfo)
1714   MDRV_GFXDECODE(toaplan1)
17231715   MDRV_PALETTE_LENGTH((64*16)+(64*16))
17241716
17251717   MDRV_VIDEO_START(toaplan1)
r1051r1052
17601752   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17611753   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
17621754   MDRV_SCREEN_VISIBLE_AREA(0, 319, 16, 255)
1763   MDRV_GFXDECODE(gfxdecodeinfo)
1755   MDRV_GFXDECODE(toaplan1)
17641756   MDRV_PALETTE_LENGTH((64*16)+(64*16))
17651757
17661758   MDRV_VIDEO_START(toaplan1)
r1051r1052
17921784   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17931785   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
17941786   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1795   MDRV_GFXDECODE(gfxdecodeinfo)
1787   MDRV_GFXDECODE(toaplan1)
17961788   MDRV_PALETTE_LENGTH((64*16)+(64*16))
17971789
17981790   MDRV_VIDEO_START(toaplan1)
r1051r1052
18291821   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18301822   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
18311823   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1832   MDRV_GFXDECODE(outzone_gfxdecodeinfo)
1824   MDRV_GFXDECODE(outzone)
18331825   MDRV_PALETTE_LENGTH((64*16)+(64*16))
18341826
18351827   MDRV_VIDEO_START(toaplan1)
r1051r1052
18611853   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18621854   MDRV_SCREEN_SIZE(432, 262)   /* copied these from toaplan2, to be verified */
18631855   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1864   MDRV_GFXDECODE(vm_gfxdecodeinfo)
1856   MDRV_GFXDECODE(vm)
18651857   MDRV_PALETTE_LENGTH((64*16)+(64*16))
18661858
18671859   MDRV_VIDEO_START(toaplan1)
src/mame/drivers/segag80r.c
r1051r1052
821821};
822822
823823
824static const gfx_decode gfxdecodeinfo[] =
825{
826   { 0, 0x0000, &charlayout, 0, 16 },
827   { -1 }
828};
824static GFXDECODE_START( segag80r )
825   GFXDECODE_ENTRY( 0, 0x0000, charlayout, 0, 16 )
826GFXDECODE_END
829827
830828
831static const gfx_decode spaceod_gfxdecodeinfo[] =
832{
833   { 0,           0x0000, &charlayout,        0, 16 },
834   { REGION_GFX1, 0x0000, &gfx_8x8x6_planar, 64, 1 },
835   { -1 }
836};
829static GFXDECODE_START( spaceod )
830   GFXDECODE_ENTRY( 0,           0x0000, charlayout,        0, 16 )
831   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, gfx_8x8x6_planar, 64, 1 )
832GFXDECODE_END
837833
838834
839static const gfx_decode monsterb_gfxdecodeinfo[] =
840{
841   { 0,           0x0000, &charlayout,        0, 16 },
842   { REGION_GFX1, 0x0000, &gfx_8x8x2_planar, 64, 16 },
843   { -1 }
844};
835static GFXDECODE_START( monsterb )
836   GFXDECODE_ENTRY( 0,           0x0000, charlayout,        0, 16 )
837   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, gfx_8x8x2_planar, 64, 16 )
838GFXDECODE_END
845839
846840
847841
r1051r1052
866860
867861   /* video hardware */
868862   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
869   MDRV_GFXDECODE(gfxdecodeinfo)
863   MDRV_GFXDECODE(segag80r)
870864   MDRV_PALETTE_LENGTH(64)
871865
872866   MDRV_SCREEN_ADD("main", 0)
r1051r1052
910904   /* background board changes */
911905   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
912906   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
913   MDRV_GFXDECODE(spaceod_gfxdecodeinfo)
907   MDRV_GFXDECODE(spaceod)
914908   MDRV_PALETTE_LENGTH(64+64)
915909
916910   /* sound boards */
r1051r1052
924918   MDRV_IMPORT_FROM(g80r_base)
925919
926920   /* background board changes */
927   MDRV_GFXDECODE(monsterb_gfxdecodeinfo)
921   MDRV_GFXDECODE(monsterb)
928922   MDRV_PALETTE_LENGTH(64+64)
929923
930924   /* sound boards */
r1051r1052
938932   MDRV_IMPORT_FROM(g80r_base)
939933
940934   /* background board changes */
941   MDRV_GFXDECODE(monsterb_gfxdecodeinfo)
935   MDRV_GFXDECODE(monsterb)
942936   MDRV_PALETTE_LENGTH(64+64)
943937
944938   /* sound boards */
r1051r1052
956950   MDRV_CPU_VBLANK_INT(sindbadm_vblank_start,1)
957951
958952   /* video hardware */
959   MDRV_GFXDECODE(monsterb_gfxdecodeinfo)
953   MDRV_GFXDECODE(monsterb)
960954   MDRV_PALETTE_LENGTH(64+64)
961955
962956   /* sound boards */
src/mame/drivers/magic10.c
r1051r1052
337337   32*8
338338};
339339
340static const gfx_decode gfxdecodeinfo[] =
341{
342   { REGION_GFX1, 0, &tiles8x8_layout,   0, 16 },
343   { REGION_GFX1, 0, &tiles16x16_layout, 0, 16 },
344   { -1 }
345};
340static GFXDECODE_START( magic10 )
341   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout,   0, 16 )
342   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16_layout, 0, 16 )
343GFXDECODE_END
346344
347345static MACHINE_DRIVER_START( magic10 )
348346   MDRV_CPU_ADD_TAG("cpu", M68000, 10000000) // ?
r1051r1052
359357   MDRV_SCREEN_SIZE(64*8, 64*8)
360358   MDRV_SCREEN_VISIBLE_AREA(0*8, 44*8-1, 2*8, 32*8-1)
361359   MDRV_PALETTE_LENGTH(0x100)
362   MDRV_GFXDECODE(gfxdecodeinfo)
360   MDRV_GFXDECODE(magic10)
363361
364362   MDRV_VIDEO_START(magic10)
365363   MDRV_VIDEO_UPDATE(magic10)
src/mame/drivers/tmnt.c
r1051r1052
27392739         8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
27402740   16*64
27412741};
2742static const gfx_decode glfgreat_gfxdecodeinfo[] =
2743{
2744   { REGION_GFX3, 0, &zoomlayout, 0x400, 16 },
2745   { -1 }
2746};
2742static GFXDECODE_START( glfgreat )
2743   GFXDECODE_ENTRY( REGION_GFX3, 0, zoomlayout, 0x400, 16 )
2744GFXDECODE_END
27472745
27482746static MACHINE_DRIVER_START( glfgreat )
27492747
r1051r1052
27642762   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
27652763   MDRV_SCREEN_SIZE(64*8, 32*8)
27662764   MDRV_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
2767   MDRV_GFXDECODE(glfgreat_gfxdecodeinfo)
2765   MDRV_GFXDECODE(glfgreat)
27682766   MDRV_PALETTE_LENGTH(2048)
27692767
27702768   MDRV_VIDEO_START(glfgreat)
r1051r1052
28132811   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
28142812   MDRV_SCREEN_SIZE(64*8, 32*8)
28152813   MDRV_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
2816   MDRV_GFXDECODE(glfgreat_gfxdecodeinfo)
2814   MDRV_GFXDECODE(glfgreat)
28172815   MDRV_PALETTE_LENGTH(2048)
28182816
28192817   MDRV_VIDEO_START(prmrsocr)
src/mame/drivers/raiden2.c
r1051r1052
11841184   16*16*4
11851185};
11861186
1187static const gfx_decode raiden2_gfxdecodeinfo[] =
1188{
1189   { REGION_GFX1, 0x00000, &raiden2_charlayout,   0x700, 128 },
1190   { REGION_GFX2, 0x00000, &raiden2_tilelayout,   0x400, 128 },
1191   { REGION_GFX3, 0x00000, &raiden2_spritelayout, 0x000, 128 },
1192   { -1 }
1193};
1187static GFXDECODE_START( raiden2 )
1188   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, raiden2_charlayout,   0x700, 128 )
1189   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, raiden2_tilelayout,   0x400, 128 )
1190   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, raiden2_spritelayout, 0x000, 128 )
1191GFXDECODE_END
11941192
11951193
11961194/* MACHINE DRIVERS */
r1051r1052
12171215   MDRV_SCREEN_SIZE(512, 512)
12181216   MDRV_SCREEN_VISIBLE_AREA(0,511,0,511)
12191217#endif
1220   MDRV_GFXDECODE(raiden2_gfxdecodeinfo)
1218   MDRV_GFXDECODE(raiden2)
12211219   MDRV_PALETTE_LENGTH(2048)
12221220
12231221   MDRV_VIDEO_START(raiden2)
src/mame/drivers/zodiack.c
r1051r1052
463463   0   /* no use */
464464};
465465
466static const gfx_decode gfxdecodeinfo[] =
467{
468   { REGION_GFX1, 0x0000, &charlayout,   8*4    , 8 },
469   { REGION_GFX1, 0x0800, &spritelayout, 0      , 8 },
470   { REGION_GFX1, 0x0000, &bulletlayout, 8*4+8*2, 1 },
471   { REGION_GFX1, 0x1000, &charlayout_2, 0      , 8 },
472   { -1 }
473};
466static GFXDECODE_START( zodiack )
467   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   8*4    , 8 )
468   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, spritelayout, 0      , 8 )
469   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, bulletlayout, 8*4+8*2, 1 )
470   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, charlayout_2, 0      , 8 )
471GFXDECODE_END
474472
475473
476474static MACHINE_DRIVER_START( zodiack )
r1051r1052
495493   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
496494   MDRV_SCREEN_SIZE(32*8, 32*8)
497495   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
498   MDRV_GFXDECODE(gfxdecodeinfo)
496   MDRV_GFXDECODE(zodiack)
499497   MDRV_PALETTE_LENGTH(49)
500498   MDRV_COLORTABLE_LENGTH(4*8+2*8+2*1)
501499
src/mame/drivers/scramble.c
r1051r1052
19051905};
19061906
19071907
1908static const gfx_decode devilfsh_gfxdecodeinfo[] =
1909{
1910   { REGION_GFX1, 0x0000, &devilfsh_charlayout,   0, 8 },
1911   { REGION_GFX1, 0x0800, &devilfsh_spritelayout, 0, 8 },
1912   { -1 }
1913};
1908static GFXDECODE_START( devilfsh )
1909   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, devilfsh_charlayout,   0, 8 )
1910   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, devilfsh_spritelayout, 0, 8 )
1911GFXDECODE_END
19141912
1915static const gfx_decode newsin7_gfxdecodeinfo[] =
1916{
1917   { REGION_GFX1, 0x0000, &newsin7_charlayout,   0, 4 },
1918   { REGION_GFX1, 0x0800, &newsin7_spritelayout, 0, 4 },
1919   { -1 }
1920};
1913static GFXDECODE_START( newsin7 )
1914   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, newsin7_charlayout,   0, 4 )
1915   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, newsin7_spritelayout, 0, 4 )
1916GFXDECODE_END
19211917
1922static const gfx_decode mrkougar_gfxdecodeinfo[] =
1923{
1924   { REGION_GFX1, 0x0000, &mrkougar_charlayout,   0, 8 },
1925   { REGION_GFX1, 0x0000, &mrkougar_spritelayout, 0, 8 },
1926   { -1 }
1927};
1918static GFXDECODE_START( mrkougar )
1919   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, mrkougar_charlayout,   0, 8 )
1920   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, mrkougar_spritelayout, 0, 8 )
1921GFXDECODE_END
19281922
1929gfx_decode sfx_gfxdecodeinfo[] =
1930{
1931   { REGION_GFX1, 0x0800, &sfx_charlayout,    0, 8 },
1932   { REGION_GFX1, 0x0000, &sfx_spritelayout,  0, 8 },
1933   { -1 }
1934};
1923static GFXDECODE_START( sfx )
1924   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, sfx_charlayout,    0, 8 )
1925   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sfx_spritelayout,  0, 8 )
1926GFXDECODE_END
19351927
1936gfx_decode ad2083_gfxdecodeinfo[] =
1937{
1938   { REGION_GFX1, 0x0000, &ad2083_charlayout,    0, 8 },
1939   { REGION_GFX1, 0x0000, &ad2083_spritelayout,  0, 8 },
1940   { -1 }
1941};
1928static GFXDECODE_START( ad2083 )
1929   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, ad2083_charlayout,    0, 8 )
1930   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, ad2083_spritelayout,  0, 8 )
1931GFXDECODE_END
19421932
19431933static struct AY8910interface scramble_ay8910_interface_2 =
19441934{
r1051r1052
20122002   32*8
20132003};
20142004
2015static gfx_decode scramble_gfxdecodeinfo[] =
2016{
2017   { REGION_GFX1, 0x0000, &scramble_charlayout,   0, 8 },
2018   { REGION_GFX1, 0x0000, &scramble_spritelayout, 0, 8 },
2019   { -1 }
2020};
2005static GFXDECODE_START( scramble )
2006   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, scramble_charlayout,   0, 8 )
2007   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, scramble_spritelayout, 0, 8 )
2008GFXDECODE_END
20212009
20222010
20232011static UINT8 *scramble_soundram;
r1051r1052
20802068   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20812069   MDRV_SCREEN_SIZE(32*8, 32*8)
20822070   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2083   MDRV_GFXDECODE(scramble_gfxdecodeinfo)
2071   MDRV_GFXDECODE(scramble)
20842072   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20852073
20862074   MDRV_PALETTE_INIT(scramble)
r1051r1052
22532241   MDRV_CPU_PROGRAM_MAP(mars_readmem,mars_writemem)
22542242
22552243   /* video hardware */
2256   MDRV_GFXDECODE(devilfsh_gfxdecodeinfo)
2244   MDRV_GFXDECODE(devilfsh)
22572245   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
22582246   MDRV_PALETTE_INIT(galaxian)
22592247MACHINE_DRIVER_END
r1051r1052
22662254   MDRV_CPU_PROGRAM_MAP(newsin7_readmem,newsin7_writemem)
22672255
22682256   /* video hardware */
2269   MDRV_GFXDECODE(newsin7_gfxdecodeinfo)
2257   MDRV_GFXDECODE(newsin7)
22702258   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
22712259   MDRV_PALETTE_INIT(galaxian)
22722260   MDRV_VIDEO_START(newsin7)
r1051r1052
22802268   MDRV_CPU_PROGRAM_MAP(mars_readmem,mrkougar_writemem)
22812269
22822270   /* video hardware */
2283   MDRV_GFXDECODE(mrkougar_gfxdecodeinfo)
2271   MDRV_GFXDECODE(mrkougar)
22842272   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
22852273   MDRV_PALETTE_INIT(galaxian)
22862274MACHINE_DRIVER_END
r1051r1052
23632351   /* video hardware */
23642352   MDRV_SCREEN_VISIBLE_AREA(2*8, 30*8-1, 2*8, 30*8-1)
23652353   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
2366   MDRV_GFXDECODE(sfx_gfxdecodeinfo)
2354   MDRV_GFXDECODE(sfx)
23672355   MDRV_PALETTE_INIT(turtles)
23682356   MDRV_VIDEO_START(sfx)
23692357
r1051r1052
24062394   /* video hardware */
24072395   MDRV_SCREEN_VISIBLE_AREA(2*8, 30*8-1, 2*8, 30*8-1)
24082396   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
2409   MDRV_GFXDECODE(sfx_gfxdecodeinfo)
2397   MDRV_GFXDECODE(sfx)
24102398   MDRV_PALETTE_INIT(turtles)
24112399   MDRV_VIDEO_START(sfx)
24122400
r1051r1052
25402528   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
25412529   MDRV_SCREEN_SIZE(32*8, 32*8)
25422530   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2543   MDRV_GFXDECODE(ad2083_gfxdecodeinfo)
2531   MDRV_GFXDECODE(ad2083)
25442532   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
25452533
25462534   MDRV_PALETTE_INIT(turtles)
src/mame/drivers/mogura.c
r1051r1052
205205   16*8
206206};
207207
208static const gfx_decode gfxdecodeinfo[] =
209{
210   { 0, 0, &tiles8x8_layout, 0, 8 },
211   { -1 }
212};
208static GFXDECODE_START( mogura )
209   GFXDECODE_ENTRY( 0, 0, tiles8x8_layout, 0, 8 )
210GFXDECODE_END
213211
214212static MACHINE_DRIVER_START( mogura )
215213   /* basic machine hardware */
r1051r1052
221219   MDRV_SCREEN_REFRESH_RATE(60) // ?
222220   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
223221
224   MDRV_GFXDECODE(gfxdecodeinfo)
222   MDRV_GFXDECODE(mogura)
225223
226224   /* video hardware */
227225   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/mole.c
r1051r1052
187187};
188188
189189
190static const gfx_decode gfxdecode[] = {
191   { REGION_GFX1, 0x0000, &tile_layout, 0x00, 1 },
192   { REGION_GFX1, 0x3000, &tile_layout, 0x00, 1 },
193   { -1 }
194};
190static GFXDECODE_START( mole )
191   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tile_layout, 0x00, 1 )
192   GFXDECODE_ENTRY( REGION_GFX1, 0x3000, tile_layout, 0x00, 1 )
193GFXDECODE_END
195194
196195
197196static MACHINE_DRIVER_START( mole )
r1051r1052
208207   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
209208   MDRV_SCREEN_SIZE(40*8, 25*8)
210209   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 25*8-1)
211   MDRV_GFXDECODE(gfxdecode)
210   MDRV_GFXDECODE(mole)
212211   MDRV_PALETTE_LENGTH(8)
213212   MDRV_COLORTABLE_LENGTH(8)
214213
src/mame/drivers/system18.c
r1051r1052
11331133   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11341134   MDRV_SCREEN_SIZE(40*8, 28*8)
11351135   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1136   MDRV_GFXDECODE(sys16_gfxdecodeinfo)
1136   MDRV_GFXDECODE(sys16)
11371137   MDRV_PALETTE_LENGTH((2048+2048)*ShadowColorsMultiplier) // 64 extra colours for vdp (but we use 2048 so shadow mask works)
11381138
11391139   MDRV_VIDEO_START(system18old)
src/mame/drivers/missb2.c
r1051r1052
332332
333333/* Graphics Decode Information */
334334
335static const gfx_decode gfxdecodeinfo[] =
336{
337   { REGION_GFX1, 0x00000, &charlayout, 0, 1 },
338   { REGION_GFX2, 0x00000, &bglayout,   0, 2 },
339   { -1 }
340};
335static GFXDECODE_START( missb2 )
336   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout, 0, 1 )
337   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, bglayout,   0, 2 )
338GFXDECODE_END
341339
342340
343341#define MAIN_XTAL 24000000   // not sure about this
r1051r1052
390388   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
391389   MDRV_SCREEN_SIZE(32*8, 32*8)
392390   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
393   MDRV_GFXDECODE(gfxdecodeinfo)
391   MDRV_GFXDECODE(missb2)
394392   MDRV_PALETTE_LENGTH(512)
395393
396394   MDRV_VIDEO_UPDATE(missb2)
src/mame/drivers/pitnrun.c
r1051r1052
277277   soundlatch_r
278278};
279279
280static const gfx_decode gfxdecodeinfo[] =
281{
282   { REGION_GFX3, 0, &charlayout,   64, 2 },
283   { REGION_GFX2, 0, &charlayout,   32, 2 },
284   { REGION_GFX1, 0, &spritelayout,  0, 4 },
285   { -1 }
286};
280static GFXDECODE_START( pitnrun )
281   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,   64, 2 )
282   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   32, 2 )
283   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,  0, 4 )
284GFXDECODE_END
287285
288286static MACHINE_DRIVER_START( pitnrun )
289287   MDRV_CPU_ADD(Z80,8000000/2)       /* ? MHz */
r1051r1052
313311   MDRV_SCREEN_SIZE(256, 256)
314312   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
315313
316   MDRV_GFXDECODE(gfxdecodeinfo)
314   MDRV_GFXDECODE(pitnrun)
317315   MDRV_PALETTE_LENGTH(32*3)
318316   MDRV_PALETTE_INIT(pitnrun)
319317   MDRV_VIDEO_START(pitnrun)
src/mame/drivers/ddealer.c
r1051r1052
168168   32*8
169169};
170170
171static const gfx_decode jalmah_gfxdecodeinfo[] =
172{
173   { REGION_GFX1, 0, &charlayout, 0, 16 },
174   { -1 }
175};
171static GFXDECODE_START( jalmah )
172   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
173GFXDECODE_END
176174
177175static MACHINE_RESET (ddealer)
178176{
r1051r1052
196194   MDRV_SCREEN_REFRESH_RATE(60)
197195   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
198196
199   MDRV_GFXDECODE(jalmah_gfxdecodeinfo)
197   MDRV_GFXDECODE(jalmah)
200198
201199   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
202200   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/tehkanwc.c
r1051r1052
764764   64*8   /* every char takes 64 consecutive bytes */
765765};
766766
767static const gfx_decode gfxdecodeinfo[] =
768{
769   { REGION_GFX1, 0, &charlayout,     0, 16 }, /* Colors 0 - 255 */
770   { REGION_GFX2, 0, &spritelayout, 256,  8 }, /* Colors 256 - 383 */
771   { REGION_GFX3, 0, &tilelayout,   512, 16 }, /* Colors 512 - 767 */
772   { -1 }
773};
767static GFXDECODE_START( tehkanwc )
768   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 ) /* Colors 0 - 255 */
769   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 256,  8 ) /* Colors 256 - 383 */
770   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,   512, 16 ) /* Colors 512 - 767 */
771GFXDECODE_END
774772
775773
776774
r1051r1052
819817   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
820818   MDRV_SCREEN_SIZE(32*8, 32*8)
821819   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
822   MDRV_GFXDECODE(gfxdecodeinfo)
820   MDRV_GFXDECODE(tehkanwc)
823821   MDRV_PALETTE_LENGTH(768)
824822
825823   MDRV_VIDEO_START(tehkanwc)
src/mame/drivers/bionicc.c
r1051r1052
334334   512   /* each tile takes 512 consecutive bytes */
335335};
336336
337static const gfx_decode gfxdecodeinfo_bionicc[] =
338{
339   { REGION_GFX1, 0, &vramlayout_bionicc,    768, 64 },   /* colors 768-1023 */
340   { REGION_GFX2, 0, &scroll2layout_bionicc,   0,  4 },   /* colors   0-  63 */
341   { REGION_GFX3, 0, &scroll1layout_bionicc, 256,  4 },   /* colors 256- 319 */
342   { REGION_GFX4, 0, &spritelayout_bionicc,  512, 16 },   /* colors 512- 767 */
343   { -1 }
344};
337static GFXDECODE_START( bionicc )
338   GFXDECODE_ENTRY( REGION_GFX1, 0, vramlayout_bionicc,    768, 64 )   /* colors 768-1023 */
339   GFXDECODE_ENTRY( REGION_GFX2, 0, scroll2layout_bionicc,   0,  4 )   /* colors   0-  63 */
340   GFXDECODE_ENTRY( REGION_GFX3, 0, scroll1layout_bionicc, 256,  4 )   /* colors 256- 319 */
341   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout_bionicc,  512, 16 )   /* colors 512- 767 */
342GFXDECODE_END
345343
346344
347345static MACHINE_DRIVER_START( bionicc )
r1051r1052
364362   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
365363   MDRV_SCREEN_SIZE(32*8, 32*8)
366364   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
367   MDRV_GFXDECODE(gfxdecodeinfo_bionicc)
365   MDRV_GFXDECODE(bionicc)
368366   MDRV_PALETTE_LENGTH(1024)
369367
370368   MDRV_VIDEO_START(bionicc)
src/mame/drivers/citycon.c
r1051r1052
175175};
176176
177177
178static const gfx_decode gfxdecodeinfo[] =
179{
180//  { REGION_GFX1, 0x00000, &charlayout, 512, 32 }, /* colors 512-639 */
181   { REGION_GFX1, 0x00000, &charlayout, 640, 32 },   /* colors 512-639 */
182   { REGION_GFX2, 0x00000, &spritelayout, 0, 16 },   /* colors 0-255 */
183   { REGION_GFX2, 0x01000, &spritelayout, 0, 16 },
184   { REGION_GFX3, 0x00000, &tilelayout, 256, 16 },   /* colors 256-511 */
185   { REGION_GFX3, 0x01000, &tilelayout, 256, 16 },
186   { REGION_GFX3, 0x02000, &tilelayout, 256, 16 },
187   { REGION_GFX3, 0x03000, &tilelayout, 256, 16 },
188   { REGION_GFX3, 0x04000, &tilelayout, 256, 16 },
189   { REGION_GFX3, 0x05000, &tilelayout, 256, 16 },
190   { REGION_GFX3, 0x06000, &tilelayout, 256, 16 },
191   { REGION_GFX3, 0x07000, &tilelayout, 256, 16 },
192   { REGION_GFX3, 0x08000, &tilelayout, 256, 16 },
193   { REGION_GFX3, 0x09000, &tilelayout, 256, 16 },
194   { REGION_GFX3, 0x0a000, &tilelayout, 256, 16 },
195   { REGION_GFX3, 0x0b000, &tilelayout, 256, 16 },
196   { -1 }
197};
178static GFXDECODE_START( citycon )
179//  GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout, 512, 32 ) /* colors 512-639 */
180   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout, 640, 32 )   /* colors 512-639 */
181   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, spritelayout, 0, 16 )   /* colors 0-255 */
182   GFXDECODE_ENTRY( REGION_GFX2, 0x01000, spritelayout, 0, 16 )
183   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout, 256, 16 )   /* colors 256-511 */
184   GFXDECODE_ENTRY( REGION_GFX3, 0x01000, tilelayout, 256, 16 )
185   GFXDECODE_ENTRY( REGION_GFX3, 0x02000, tilelayout, 256, 16 )
186   GFXDECODE_ENTRY( REGION_GFX3, 0x03000, tilelayout, 256, 16 )
187   GFXDECODE_ENTRY( REGION_GFX3, 0x04000, tilelayout, 256, 16 )
188   GFXDECODE_ENTRY( REGION_GFX3, 0x05000, tilelayout, 256, 16 )
189   GFXDECODE_ENTRY( REGION_GFX3, 0x06000, tilelayout, 256, 16 )
190   GFXDECODE_ENTRY( REGION_GFX3, 0x07000, tilelayout, 256, 16 )
191   GFXDECODE_ENTRY( REGION_GFX3, 0x08000, tilelayout, 256, 16 )
192   GFXDECODE_ENTRY( REGION_GFX3, 0x09000, tilelayout, 256, 16 )
193   GFXDECODE_ENTRY( REGION_GFX3, 0x0a000, tilelayout, 256, 16 )
194   GFXDECODE_ENTRY( REGION_GFX3, 0x0b000, tilelayout, 256, 16 )
195GFXDECODE_END
198196
199197
200198
r1051r1052
226224   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
227225   MDRV_SCREEN_SIZE(32*8, 32*8)
228226   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
229   MDRV_GFXDECODE(gfxdecodeinfo)
227   MDRV_GFXDECODE(citycon)
230228   MDRV_PALETTE_LENGTH(640+1024)   /* 640 real palette + 1024 virtual palette */
231229
232230   MDRV_VIDEO_START(citycon)
src/mame/drivers/suprridr.c
r1051r1052
293293};
294294
295295
296static const gfx_decode gfxdecodeinfo[] =
297{
298   { REGION_GFX1, 0, &charlayout,    0, 2 },
299   { REGION_GFX2, 0, &charlayout,   32, 2 },
300   { REGION_GFX3, 0, &spritelayout, 64, 2 },
301   { -1 }
302};
296static GFXDECODE_START( suprridr )
297   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 2 )
298   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   32, 2 )
299   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 64, 2 )
300GFXDECODE_END
303301
304302
305303
r1051r1052
343341   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
344342   MDRV_SCREEN_SIZE(32*8, 32*8)
345343   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
346   MDRV_GFXDECODE(gfxdecodeinfo)
344   MDRV_GFXDECODE(suprridr)
347345   MDRV_PALETTE_LENGTH(96)
348346
349347   MDRV_PALETTE_INIT(suprridr)
src/mame/drivers/psikyo.c
r1051r1052
15321532   16*16*4
15331533};
15341534
1535static const gfx_decode psikyo_gfxdecodeinfo[] =
1536{
1537   { REGION_GFX1, 0, &layout_16x16x4, 0x000, 0x20 }, // [0] Sprites
1538   { REGION_GFX2, 0, &layout_16x16x4, 0x800, 0x48 }, // [1] Layer 0 + 1
1539   { -1 }
1540};
1535static GFXDECODE_START( psikyo )
1536   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0x000, 0x20 ) // [0] Sprites
1537   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0x800, 0x48 ) // [1] Layer 0 + 1
1538GFXDECODE_END
15411539
15421540
15431541
r1051r1052
15831581   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15841582   MDRV_SCREEN_SIZE(320, 256)
15851583   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1)
1586   MDRV_GFXDECODE(psikyo_gfxdecodeinfo)
1584   MDRV_GFXDECODE(psikyo)
15871585   MDRV_PALETTE_LENGTH(0x1000)
15881586
15891587   MDRV_VIDEO_START(psikyo)
r1051r1052
16371635   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16381636   MDRV_SCREEN_SIZE(320, 256)
16391637   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1)
1640   MDRV_GFXDECODE(psikyo_gfxdecodeinfo)
1638   MDRV_GFXDECODE(psikyo)
16411639   MDRV_PALETTE_LENGTH(0x1000)
16421640
16431641   MDRV_VIDEO_START(psikyo)
r1051r1052
17011699   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17021700   MDRV_SCREEN_SIZE(320, 256)
17031701   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1)
1704   MDRV_GFXDECODE(psikyo_gfxdecodeinfo)
1702   MDRV_GFXDECODE(psikyo)
17051703   MDRV_PALETTE_LENGTH(0x1000)
17061704
17071705   MDRV_VIDEO_START(psikyo)
src/mame/drivers/dynadice.c
r1051r1052
160160};
161161
162162
163static const gfx_decode gfxdecodeinfo[] =
164{
165   { REGION_GFX1, 0, &charlayout,   0, 1 }, /* 1bpp */
166   { REGION_GFX2, 0, &charlayout2,  0, 1 }, /* 3bpp */
167   { -1 }
168};
163static GFXDECODE_START( dynadice )
164   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1 ) /* 1bpp */
165   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout2,  0, 1 ) /* 3bpp */
166GFXDECODE_END
169167
170168static TILE_GET_INFO( get_tile_info )
171169{
r1051r1052
218216   MDRV_SCREEN_SIZE(256+16, 256)
219217   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 3*8, 28*8-1)
220218
221   MDRV_GFXDECODE(gfxdecodeinfo)
219   MDRV_GFXDECODE(dynadice)
222220   MDRV_PALETTE_LENGTH(8)
223221   MDRV_PALETTE_INIT(dynadice)
224222
src/mame/drivers/playmark.c
r1051r1052
875875   128*8
876876};
877877
878static const gfx_decode gfxdecodeinfo[] =
879{
880   { REGION_GFX2, 0, &spritelayout, 0x200, 16 },   /* colors 0x200-0x2ff */
881   { REGION_GFX1, 0, &tilelayout,   0x000,  8 },   /* colors 0x000-0x07f */
882   { REGION_GFX1, 0, &charlayout,   0x080,  8 },   /* colors 0x080-0x0ff */
878static GFXDECODE_START( playmark )
879   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x200, 16 )   /* colors 0x200-0x2ff */
880   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0x000,  8 )   /* colors 0x000-0x07f */
881   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x080,  8 )   /* colors 0x080-0x0ff */
883882   /* background bitmap uses colors 0x100-0x1ff */
884   { -1 }
885};
883GFXDECODE_END
886884
887885
888886static const gfx_layout wcharlayout =
r1051r1052
923921   32*8
924922};
925923
926static const gfx_decode wbeachvl_gfxdecodeinfo[] =
927{
928   { REGION_GFX1, 0, &wspritelayout, 0x600, 16 },   /* colors 0x600-0x7ff */
929   { REGION_GFX1, 0, &wtilelayout,   0x000, 16 },   /* colors 0x000-0x3ff */
930   { REGION_GFX1, 0, &wcharlayout,   0x400,  8 },   /* colors 0x400-0x5ff */
931   { -1 }
932};
924static GFXDECODE_START( wbeachvl )
925   GFXDECODE_ENTRY( REGION_GFX1, 0, wspritelayout, 0x600, 16 )   /* colors 0x600-0x7ff */
926   GFXDECODE_ENTRY( REGION_GFX1, 0, wtilelayout,   0x000, 16 )   /* colors 0x000-0x3ff */
927   GFXDECODE_ENTRY( REGION_GFX1, 0, wcharlayout,   0x400,  8 )   /* colors 0x400-0x5ff */
928GFXDECODE_END
933929
934static const gfx_decode excelsr_gfxdecodeinfo[] =
935{
936   { REGION_GFX2, 0, &tilelayout, 0x200, 16 },   /* colors 0x200-0x2ff */
937   { REGION_GFX1, 0, &tilelayout, 0x000,  8 },   /* colors 0x000-0x07f */
938   { REGION_GFX1, 0, &tilelayout, 0x080,  8 },   /* colors 0x080-0x0ff */
930static GFXDECODE_START( excelsr )
931   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x200, 16 )   /* colors 0x200-0x2ff */
932   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0x000,  8 )   /* colors 0x000-0x07f */
933   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0x080,  8 )   /* colors 0x080-0x0ff */
939934   /* background bitmap uses colors 0x100-0x1ff */
940   { -1 }
941};
935GFXDECODE_END
942936
943937static const gfx_layout hrdtimes_tilelayout =
944938{
r1051r1052
965959};
966960
967961
968static const gfx_decode hrdtimes_gfxdecodeinfo[] =
969{
970   { REGION_GFX2, 0, &hrdtimes_tilelayout,         0x200, 32 },   /* colors 0x200-0x2ff */
971   { REGION_GFX1, 0, &hrdtimes_tilelayout,         0x000, 16 },   /* colors 0x000-0x0ff */
972   { REGION_GFX1, 0, &hrdtimes_charlayout, 0x100,  8 },   /* colors 0x100-0x17f */
973   { -1 }
974};
962static GFXDECODE_START( hrdtimes )
963   GFXDECODE_ENTRY( REGION_GFX2, 0, hrdtimes_tilelayout,         0x200, 32 )   /* colors 0x200-0x2ff */
964   GFXDECODE_ENTRY( REGION_GFX1, 0, hrdtimes_tilelayout,         0x000, 16 )   /* colors 0x000-0x0ff */
965   GFXDECODE_ENTRY( REGION_GFX1, 0, hrdtimes_charlayout, 0x100,  8 )   /* colors 0x100-0x17f */
966GFXDECODE_END
975967
976968static MACHINE_DRIVER_START( bigtwin )
977969
r1051r1052
992984   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
993985   MDRV_SCREEN_SIZE(64*8, 64*8)
994986   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
995   MDRV_GFXDECODE(gfxdecodeinfo)
987   MDRV_GFXDECODE(playmark)
996988   MDRV_PALETTE_LENGTH(1024)
997989
998990   MDRV_VIDEO_START(bigtwin)
r1051r1052
10281020   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10291021   MDRV_SCREEN_SIZE(64*8, 64*8)
10301022   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1031   MDRV_GFXDECODE(wbeachvl_gfxdecodeinfo)
1023   MDRV_GFXDECODE(wbeachvl)
10321024   MDRV_PALETTE_LENGTH(2048)
10331025
10341026   MDRV_VIDEO_START(wbeachvl)
r1051r1052
10611053   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10621054   MDRV_SCREEN_SIZE(64*8, 64*8)
10631055   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1064   MDRV_GFXDECODE(excelsr_gfxdecodeinfo)
1056   MDRV_GFXDECODE(excelsr)
10651057   MDRV_PALETTE_LENGTH(1024)
10661058
10671059   MDRV_VIDEO_START(excelsr)
r1051r1052
10961088   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10971089   MDRV_SCREEN_SIZE(64*8, 64*8)
10981090   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
1099   MDRV_GFXDECODE(hrdtimes_gfxdecodeinfo)
1091   MDRV_GFXDECODE(hrdtimes)
11001092   MDRV_PALETTE_LENGTH(1024)
11011093
11021094   MDRV_VIDEO_START(hotmind)
r1051r1052
11291121   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11301122   MDRV_SCREEN_SIZE(64*8, 64*8)
11311123   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
1132   MDRV_GFXDECODE(hrdtimes_gfxdecodeinfo)
1124   MDRV_GFXDECODE(hrdtimes)
11331125   MDRV_PALETTE_LENGTH(1024)
11341126
11351127   MDRV_VIDEO_START(hrdtimes)
src/mame/drivers/dacholer.c
r1051r1052
323323   16*16*4
324324};
325325
326static const gfx_decode gfxdecodeinfo[] =
327{
328   { REGION_GFX1, 0, &charlayout,   0, 16 },
329   { REGION_GFX2, 0, &charlayout,   0, 16 },
330   { REGION_GFX3, 0, &spritelayout, 0, 16 },
331   { -1 }
332};
326static GFXDECODE_START( dacholer )
327   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
328   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   0, 16 )
329   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0, 16 )
330GFXDECODE_END
333331
334332
335333static MACHINE_DRIVER_START( dacholer )
r1051r1052
354352   MDRV_SCREEN_SIZE(256, 256)
355353   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-1-16)
356354   MDRV_PALETTE_LENGTH(16)
357   MDRV_GFXDECODE(gfxdecodeinfo)
355   MDRV_GFXDECODE(dacholer)
358356
359357   MDRV_VIDEO_START(dacholer)
360358   MDRV_VIDEO_UPDATE(dacholer)
src/mame/drivers/esd16.c
r1051r1052
458458   8*8*2,
459459};
460460
461static const gfx_decode esd16_gfxdecodeinfo[] =
462{
463   { REGION_GFX1, 0, &layout_16x16x5, 0x200, 8 }, // [0] Sprites
464   { REGION_GFX2, 0, &layout_8x8x8,   0x000, 2 }, // [1] Layers
465   { REGION_GFX1, 0, &layout_16x16x5, 0x200, 8 }, // [0] Sprites
466   { -1 }
467};
461static GFXDECODE_START( esd16 )
462   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x5, 0x200, 8 ) // [0] Sprites
463   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x8,   0x000, 2 ) // [1] Layers
464   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x5, 0x200, 8 ) // [0] Sprites
465GFXDECODE_END
468466
469467static const gfx_layout hedpanic_layout_8x8x8 =
470468{
r1051r1052
504502};
505503
506504
507static const gfx_decode hedpanic_gfxdecodeinfo[] =
508{
509   { REGION_GFX1, 0, &hedpanic_sprite_16x16x5, 0x200, 8 }, // [0] Sprites
510   { REGION_GFX2, 0, &hedpanic_layout_8x8x8,   0x000, 4 }, // [1] Layers
511   { REGION_GFX2, 0, &hedpanic_layout_16x16x8, 0x000, 4 }, // [2] Layers
512   { -1 }
513};
505static GFXDECODE_START( hedpanic )
506   GFXDECODE_ENTRY( REGION_GFX1, 0, hedpanic_sprite_16x16x5, 0x200, 8 ) // [0] Sprites
507   GFXDECODE_ENTRY( REGION_GFX2, 0, hedpanic_layout_8x8x8,   0x000, 4 ) // [1] Layers
508   GFXDECODE_ENTRY( REGION_GFX2, 0, hedpanic_layout_16x16x8, 0x000, 4 ) // [2] Layers
509GFXDECODE_END
514510
515static const gfx_decode tangtang_gfxdecodeinfo[] =
516{
517   { REGION_GFX1, 0, &layout_16x16x5, 0x200, 8 }, // [0] Sprites
518   { REGION_GFX2, 0, &hedpanic_layout_8x8x8,   0x000, 4 }, // [1] Layers
519   { REGION_GFX2, 0, &hedpanic_layout_16x16x8, 0x000, 4 }, // [2] Layers
520   { -1 }
521};
511static GFXDECODE_START( tangtang )
512   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x5, 0x200, 8 ) // [0] Sprites
513   GFXDECODE_ENTRY( REGION_GFX2, 0, hedpanic_layout_8x8x8,   0x000, 4 ) // [1] Layers
514   GFXDECODE_ENTRY( REGION_GFX2, 0, hedpanic_layout_16x16x8, 0x000, 4 ) // [2] Layers
515GFXDECODE_END
522516
523517/***************************************************************************
524518
r1051r1052
549543   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
550544   MDRV_SCREEN_SIZE(0x140, 0x100)
551545   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 0+8, 0x100-8-1)
552   MDRV_GFXDECODE(esd16_gfxdecodeinfo)
546   MDRV_GFXDECODE(esd16)
553547   MDRV_PALETTE_LENGTH(768)
554548
555549   MDRV_VIDEO_START(esd16)
r1051r1052
578572
579573   MDRV_PALETTE_LENGTH(0x1000/2)
580574
581   MDRV_GFXDECODE(hedpanic_gfxdecodeinfo)
575   MDRV_GFXDECODE(hedpanic)
582576   MDRV_VIDEO_UPDATE(hedpanic)
583577
584578MACHINE_DRIVER_END
r1051r1052
600594   MDRV_CPU_MODIFY("main")
601595   MDRV_CPU_PROGRAM_MAP(tangtang_readmem,tangtang_writemem)
602596
603   MDRV_GFXDECODE(tangtang_gfxdecodeinfo)
597   MDRV_GFXDECODE(tangtang)
604598MACHINE_DRIVER_END
605599
606600/***************************************************************************
src/mame/drivers/model3.c
r1051r1052
362362#include "cpu/powerpc/ppc.h"
363363#include "machine/eeprom.h"
364364#include "machine/53c810.h"
365#include "sound/scsp.h"
365366
366367int model3_irq_enable;
367368int model3_irq_state;
r1051r1052
408409
409410static void real3d_dma_callback(UINT32 src, UINT32 dst, int length, int byteswap);
410411
412static UINT16 *model3_soundram;
413
411414#define BYTE_REVERSE32(x)      (((x >> 24) & 0xff) | \
412415                        ((x >> 8) & 0xff00) | \
413416                        ((x << 8) & 0xff0000) | \
r1051r1052
985988   model3_step = step;
986989   memory_set_bankptr( 1, memory_region( REGION_USER1 ) + 0x800000 ); /* banked CROM */
987990
991   memory_set_bankptr(4, memory_region(REGION_SOUND1) + 0x200000);
992   memory_set_bankptr(5, memory_region(REGION_SOUND1) + 0x600000);
993
994   // copy the 68k vector table into RAM
995   memcpy(model3_soundram, memory_region(REGION_CPU2)+0x80000, 16);
996
988997   model3_machine_init(step);   // step 1.5
989998   model3_tap_reset();
990999
r1051r1052
12961305static WRITE64_HANDLER(model3_sound_w)
12971306{
12981307   model3_irq_state &= ~0x40;
1308
1309   // serial configuration writes
1310   if ((mem_mask == U64(0x00ffffffffffffff)) && (offset == 0))
1311   {
1312      SCSP_MidiIn(0, (data>>56)&0xff, 0);
1313
1314      // give the 68k time to notice
1315      cpu_spinuntil_time(MAME_TIME_IN_USEC(40));
1316   }
12991317}
13001318
13011319
r1051r1052
18091827        ROM_LOAD_VROM( "mpr-19885.40", 0x00000e, 0x200000, CRC(d1ae5473) SHA1(c225ad47175247b4cc0d3db57d2ecb68242639d5) )
18101828        ROM_LOAD_VROM( "mpr-19886.41", 0x00000c, 0x200000, CRC(278aae0b) SHA1(471a74ca21d0394742d0275029642c712a6bc924) )
18111829
1812   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
1813        ROM_LOAD16_WORD_SWAP( "epr-19891.21", 0x080000, 0x080000, CRC(c3ecd448) SHA1(875ee429872f3a851fa0239e5c781870fa3f4323) )
1830   ROM_REGION( 0x180000, REGION_CPU2, 0 )   /* 68000 code */
1831        ROM_LOAD16_WORD_SWAP( "epr-19891.21", 0x80000, 0x080000, CRC(c3ecd448) SHA1(875ee429872f3a851fa0239e5c781870fa3f4323) )
18141832
18151833   // Samples
18161834   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
1817        ROM_LOAD32_WORD( "mpr-19869.22", 0x000000, 0x400000, CRC(ea1ef1cc) SHA1(399c43659d83673f83b551b30b3b1410a75d8f8c) )
1818        ROM_LOAD32_WORD( "mpr-19870.24", 0x000002, 0x400000, CRC(49c70296) SHA1(9bf88a63c38d318006a9c6c6b7b4452439df876c) )
1835        ROM_LOAD( "mpr-19869.22", 0x000000, 0x400000, CRC(ea1ef1cc) SHA1(399c43659d83673f83b551b30b3b1410a75d8f8c) )
1836        ROM_LOAD( "mpr-19870.24", 0x400000, 0x400000, CRC(49c70296) SHA1(9bf88a63c38d318006a9c6c6b7b4452439df876c) )
18191837
18201838   ROM_REGION( 0x20000, REGION_CPU3, 0 )   /* Z80 code */
18211839      ROM_FILL( 0x000000, 0x20000, 0 )
18221840
18231841   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
18241842      ROM_FILL( 0x000000, 0x800000, 0 )
1843
1844   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
1845      ROM_FILL( 0x000000, 0x80000, 0 )
18251846ROM_END
18261847
18271848ROM_START( scud )   /* step 1.5 */
r1051r1052
18891910        ROM_LOAD( "mpr-19604.58",  0x200000, 0x200000, CRC(6ac85b49) SHA1(3e74ae6e9ac7b208e2cd5ebdf80bb3cee19d436d) )
18901911        ROM_LOAD( "mpr-19605.59",  0x400000, 0x200000, CRC(bec891eb) SHA1(357849d2842ac77f9945eb4a0ca89253e474f617) )
18911912        ROM_LOAD( "mpr-19606.60",  0x600000, 0x200000, CRC(adad46b2) SHA1(360b23870f1d15ab527fae1bb731da6e7a8b19c1) )
1913
1914   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
1915      ROM_FILL( 0x000000, 0x80000, 0 )
18921916ROM_END
18931917
18941918ROM_START( scuda )   /* step 1.5 */
r1051r1052
19561980        ROM_LOAD( "mpr-19604.58",  0x200000, 0x200000, CRC(6ac85b49) SHA1(3e74ae6e9ac7b208e2cd5ebdf80bb3cee19d436d) )
19571981        ROM_LOAD( "mpr-19605.59",  0x400000, 0x200000, CRC(bec891eb) SHA1(357849d2842ac77f9945eb4a0ca89253e474f617) )
19581982        ROM_LOAD( "mpr-19606.60",  0x600000, 0x200000, CRC(adad46b2) SHA1(360b23870f1d15ab527fae1bb731da6e7a8b19c1) )
1983
1984   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
1985      ROM_FILL( 0x000000, 0x80000, 0 )
19591986ROM_END
19601987
19611988ROM_START( scudp )   /* step 1.5 */
r1051r1052
20302057        ROM_LOAD( "mpr-19604.58",  0x200000, 0x200000, CRC(6ac85b49) SHA1(3e74ae6e9ac7b208e2cd5ebdf80bb3cee19d436d) )
20312058        ROM_LOAD( "mpr-19605.59",  0x400000, 0x200000, CRC(bec891eb) SHA1(357849d2842ac77f9945eb4a0ca89253e474f617) )
20322059        ROM_LOAD( "mpr-19606.60",  0x600000, 0x200000, CRC(adad46b2) SHA1(360b23870f1d15ab527fae1bb731da6e7a8b19c1) )
2060
2061   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2062      ROM_FILL( 0x000000, 0x80000, 0 )
20332063ROM_END
20342064
20352065ROM_START( vf3 )   /* step 1.0 */
r1051r1052
20872117        ROM_LOAD_VROM( "mpr-19225.40",   0x00000e, 0x200000, CRC(91a985eb) SHA1(5a842a260e4a78f5463222db44f13b068fa70b23) )
20882118        ROM_LOAD_VROM( "mpr-19226.41",   0x00000c, 0x200000, CRC(00091722) SHA1(ef86db36b4b91a66b3e401c3c91735b9d28da2e2) )
20892119
2090   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2091        ROM_LOAD16_WORD_SWAP( "epr-19231.21",   0x000000, 0x020000, CRC(f2ae2558) SHA1(7ab5fc508ffd1b0c9f3e70f4d3edeae44e3a0dc4) )
2120   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2121        ROM_LOAD16_WORD_SWAP( "epr-19231.21",   0x080000, 0x020000, CRC(f2ae2558) SHA1(7ab5fc508ffd1b0c9f3e70f4d3edeae44e3a0dc4) )
20922122
20932123   // Samples
20942124   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
21002130
21012131   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
21022132      ROM_FILL( 0x000000, 0x800000, 0 )
2133
2134   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2135      ROM_FILL( 0x000000, 0x80000, 0 )
21032136ROM_END
21042137
21052138ROM_START( vf3tb )   /* step 1.0? */
r1051r1052
21572190        ROM_LOAD_VROM( "mpr-19225.40",   0x00000e, 0x200000, CRC(91a985eb) SHA1(5a842a260e4a78f5463222db44f13b068fa70b23) )
21582191        ROM_LOAD_VROM( "mpr-19226.41",   0x00000c, 0x200000, CRC(00091722) SHA1(ef86db36b4b91a66b3e401c3c91735b9d28da2e2) )
21592192
2160   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2161        ROM_LOAD16_WORD_SWAP( "epr-19231.21",   0x000000, 0x020000, CRC(f2ae2558) SHA1(7ab5fc508ffd1b0c9f3e70f4d3edeae44e3a0dc4) )
2193   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2194        ROM_LOAD16_WORD_SWAP( "epr-19231.21",   0x080000, 0x020000, CRC(f2ae2558) SHA1(7ab5fc508ffd1b0c9f3e70f4d3edeae44e3a0dc4) )
21622195
21632196   // Samples
21642197   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
21702203
21712204   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
21722205      ROM_FILL( 0x000000, 0x800000, 0 )
2206
2207   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2208      ROM_FILL( 0x000000, 0x80000, 0 )
21732209ROM_END
21742210
21752211ROM_START( bass )   /* step 1.0 */
r1051r1052
22212257        ROM_LOAD_VROM( "mpr-20284.40",  0x00000e, 0x200000, CRC(5c7f3a6f) SHA1(d242bc7ad213a79203cd6a060229c356ec0867e7) )
22222258        ROM_LOAD_VROM( "mpr-20285.41",  0x00000c, 0x200000, CRC(4aadc573) SHA1(65aef06c8c48196a0c1f630529ae2248323c5747) )
22232259
2224   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2225        ROM_LOAD16_WORD_SWAP( "epr-20313.21",  0x000000, 0x080000, CRC(863a7857) SHA1(72384dc6d7613806ab6bb84d935a3b0497e9e9d2) )
2260   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2261        ROM_LOAD16_WORD_SWAP( "epr-20313.21",  0x080000, 0x080000, CRC(863a7857) SHA1(72384dc6d7613806ab6bb84d935a3b0497e9e9d2) )
22262262
22272263   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
22282264        ROM_LOAD( "mpr-20268.22",  0x000000, 0x400000, CRC(3631e93e) SHA1(3991d6cf03e4f39733d467c483857eac874505d1) )
r1051r1052
22332269
22342270   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
22352271      ROM_FILL( 0x000000, 0x800000, 0 )
2272
2273   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2274      ROM_FILL( 0x000000, 0x80000, 0 )
22362275ROM_END
22372276
22382277ROM_START( getbass )   /* step 1.0 */
r1051r1052
22842323        ROM_LOAD_VROM( "mpr-20284.40",  0x00000e, 0x200000, CRC(5c7f3a6f) SHA1(d242bc7ad213a79203cd6a060229c356ec0867e7) )
22852324        ROM_LOAD_VROM( "mpr-20285.41",  0x00000c, 0x200000, CRC(4aadc573) SHA1(65aef06c8c48196a0c1f630529ae2248323c5747) )
22862325
2287   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2288        ROM_LOAD16_WORD_SWAP( "epr-20313.21",  0x000000, 0x080000, CRC(863a7857) SHA1(72384dc6d7613806ab6bb84d935a3b0497e9e9d2) )
2326   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2327        ROM_LOAD16_WORD_SWAP( "epr-20313.21",  0x080000, 0x080000, CRC(863a7857) SHA1(72384dc6d7613806ab6bb84d935a3b0497e9e9d2) )
22892328
22902329   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
22912330        ROM_LOAD( "mpr-20268.22",  0x000000, 0x400000, CRC(3631e93e) SHA1(3991d6cf03e4f39733d467c483857eac874505d1) )
r1051r1052
22962335
22972336   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
22982337      ROM_FILL( 0x000000, 0x800000, 0 )
2338
2339   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2340      ROM_FILL( 0x000000, 0x80000, 0 )
22992341ROM_END
23002342
23012343ROM_START( lostwsga )   /* Step 1.5 */
r1051r1052
23692411
23702412   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
23712413      ROM_FILL( 0x000000, 0x800000, 0 )
2414
2415   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2416      ROM_FILL( 0x000000, 0x80000, 0 )
23722417ROM_END
23732418
23742419ROM_START( vs2 )   /* Step 2.0 */
r1051r1052
24262471        ROM_LOAD_VROM( "mpr-19801.40", 0x00000e, 0x200000, CRC(beb79a00) SHA1(63385ff70bf9ae223e6acfa1b6cb2d641afa2790) )
24272472        ROM_LOAD_VROM( "mpr-19802.41", 0x00000c, 0x200000, CRC(f2c3a7b7) SHA1(d72fafe75baa3542ee27fed05230cd5da99aa459) )
24282473
2429   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2430        ROM_LOAD16_WORD_SWAP( "epr-19807.21", 0x000000, 0x080000, CRC(9641cbaf) SHA1(aaffde7678b40bc940be04fb107efc4d0d416ea1) )
2474   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2475        ROM_LOAD16_WORD_SWAP( "epr-19807.21", 0x080000, 0x080000, CRC(9641cbaf) SHA1(aaffde7678b40bc940be04fb107efc4d0d416ea1) )
24312476
24322477   // Samples
24332478   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
24392484
24402485   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
24412486      ROM_FILL( 0x000000, 0x800000, 0 )
2487
2488   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2489      ROM_FILL( 0x000000, 0x80000, 0 )
24422490ROM_END
24432491
24442492ROM_START( vs215 )   /* Step 1.5 */
r1051r1052
24962544        ROM_LOAD_VROM( "mpr-19801.40", 0x00000e, 0x200000, CRC(beb79a00) SHA1(63385ff70bf9ae223e6acfa1b6cb2d641afa2790) )
24972545        ROM_LOAD_VROM( "mpr-19802.41", 0x00000c, 0x200000, CRC(f2c3a7b7) SHA1(d72fafe75baa3542ee27fed05230cd5da99aa459) )
24982546
2499   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2500        ROM_LOAD16_WORD_SWAP( "epr-19807.21", 0x000000, 0x080000, CRC(9641cbaf) SHA1(aaffde7678b40bc940be04fb107efc4d0d416ea1) )
2547   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2548        ROM_LOAD16_WORD_SWAP( "epr-19807.21", 0x080000, 0x080000, CRC(9641cbaf) SHA1(aaffde7678b40bc940be04fb107efc4d0d416ea1) )
25012549
25022550   // Samples
25032551   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
25092557
25102558   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
25112559      ROM_FILL( 0x000000, 0x800000, 0 )
2560
2561   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2562      ROM_FILL( 0x000000, 0x80000, 0 )
25122563ROM_END
25132564
25142565ROM_START( vs298 )   /* Step 2.0 */
r1051r1052
25662617        ROM_LOAD_VROM( "mpr-19801.40", 0x00000e, 0x200000, CRC(beb79a00) SHA1(63385ff70bf9ae223e6acfa1b6cb2d641afa2790) )
25672618        ROM_LOAD_VROM( "mpr-19802.41", 0x00000c, 0x200000, CRC(f2c3a7b7) SHA1(d72fafe75baa3542ee27fed05230cd5da99aa459) )
25682619
2569   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2570        ROM_LOAD16_WORD_SWAP( "epr-20921.21", 0x000000, 0x080000, CRC(30f032a7) SHA1(d29c9631bd50fabe3d86343f44c37ee535db14a0) )
2620   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2621        ROM_LOAD16_WORD_SWAP( "epr-20921.21", 0x080000, 0x080000, CRC(30f032a7) SHA1(d29c9631bd50fabe3d86343f44c37ee535db14a0) )
25712622
25722623   // Samples
25732624   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
25792630
25802631   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
25812632      ROM_FILL( 0x000000, 0x800000, 0 )
2633
2634   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2635      ROM_FILL( 0x000000, 0x80000, 0 )
25822636ROM_END
25832637
25842638ROM_START( vs29815 )   /* Step 1.5 */
r1051r1052
26362690        ROM_LOAD_VROM( "mpr-19801.40", 0x00000e, 0x200000, CRC(beb79a00) SHA1(63385ff70bf9ae223e6acfa1b6cb2d641afa2790) )
26372691        ROM_LOAD_VROM( "mpr-19802.41", 0x00000c, 0x200000, CRC(f2c3a7b7) SHA1(d72fafe75baa3542ee27fed05230cd5da99aa459) )
26382692
2639   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2640        ROM_LOAD16_WORD_SWAP( "epr-20921.21", 0x000000, 0x080000, CRC(30f032a7) SHA1(d29c9631bd50fabe3d86343f44c37ee535db14a0) )
2693   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2694        ROM_LOAD16_WORD_SWAP( "epr-20921.21", 0x080000, 0x080000, CRC(30f032a7) SHA1(d29c9631bd50fabe3d86343f44c37ee535db14a0) )
26412695
26422696   // Samples
26432697   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
26492703
26502704   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
26512705      ROM_FILL( 0x000000, 0x800000, 0 )
2706
2707   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2708      ROM_FILL( 0x000000, 0x80000, 0 )
26522709ROM_END
26532710
26542711ROM_START( vs2v991 )   /* Step 2.0 */
r1051r1052
27062763        ROM_LOAD_VROM( "mpr-21529.40",     0x00000e, 0x200000, CRC(9a731a00) SHA1(eca98b142acc02fb28387675e1cb1bc7e4e59b86) )
27072764        ROM_LOAD_VROM( "mpr-21530.41",     0x00000c, 0x200000, CRC(78400d5e) SHA1(9b4546848dbe213f33b02e8ea42743e60a0f763f) )
27082765
2709   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2710        ROM_LOAD16_WORD_SWAP( "epr-21539.21",    0x000000, 0x080000, CRC(a1d3e00e) SHA1(e03bb31967929a12de9ae21923914e0e3bd96aaa) )
2766   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2767        ROM_LOAD16_WORD_SWAP( "epr-21539.21",    0x080000, 0x080000, CRC(a1d3e00e) SHA1(e03bb31967929a12de9ae21923914e0e3bd96aaa) )
27112768
27122769   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
27132770        ROM_LOAD( "mpr-21513.22", 0x000000, 0x400000, CRC(cca1cc00) SHA1(ba1fa3b8ef3bff7e116901a0a4bd80d2ae4018bf) )
r1051r1052
27182775
27192776   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
27202777      ROM_FILL( 0x000000, 0x800000, 0 )
2778
2779   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2780      ROM_FILL( 0x000000, 0x80000, 0 )
27212781ROM_END
27222782
27232783ROM_START( vs299 )   /* Step 2.0 */
r1051r1052
27752835        ROM_LOAD_VROM( "mpr-21529.40",     0x00000e, 0x200000, CRC(9a731a00) SHA1(eca98b142acc02fb28387675e1cb1bc7e4e59b86) )
27762836        ROM_LOAD_VROM( "mpr-21530.41",     0x00000c, 0x200000, CRC(78400d5e) SHA1(9b4546848dbe213f33b02e8ea42743e60a0f763f) )
27772837
2778   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2779        ROM_LOAD16_WORD_SWAP( "epr-21539.21", 0x000000, 0x080000, CRC(a1d3e00e) SHA1(e03bb31967929a12de9ae21923914e0e3bd96aaa) )
2838   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2839        ROM_LOAD16_WORD_SWAP( "epr-21539.21", 0x080000, 0x080000, CRC(a1d3e00e) SHA1(e03bb31967929a12de9ae21923914e0e3bd96aaa) )
27802840
27812841   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
27822842        ROM_LOAD( "mpr-21513.22", 0x000000, 0x400000, CRC(cca1cc00) SHA1(ba1fa3b8ef3bff7e116901a0a4bd80d2ae4018bf) )
r1051r1052
27872847
27882848   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
27892849      ROM_FILL( 0x000000, 0x800000, 0 )
2850
2851   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2852      ROM_FILL( 0x000000, 0x80000, 0 )
27902853ROM_END
27912854
27922855ROM_START( von2 )   /* Step 2.0 */
r1051r1052
28412904        ROM_LOAD_VROM( "mpr-20681.40",   0x00000e, 0x400000, CRC(d517873b) SHA1(8e50dd149716ae6b0b8d7ac99cd425a17b3c0a46) )
28422905        ROM_LOAD_VROM( "mpr-20682.41",   0x00000c, 0x400000, CRC(5b43250c) SHA1(fccb40cd03c096360ca3c565e8621d4110b273ab) )
28432906
2844   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2845        ROM_LOAD16_WORD_SWAP( "epr-20687.21", 0x000000, 0x080000, CRC(fa084de5) SHA1(8a760b76bc12d60d4727f93106830f19179c9046) )
2907   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2908        ROM_LOAD16_WORD_SWAP( "epr-20687.21", 0x080000, 0x080000, CRC(fa084de5) SHA1(8a760b76bc12d60d4727f93106830f19179c9046) )
28462909
28472910   // Samples
28482911   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
28582921
28592922   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
28602923      ROM_FILL( 0x000000, 0x800000, 0 )
2924
2925   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
2926      ROM_FILL( 0x000000, 0x80000, 0 )
28612927ROM_END
28622928
28632929ROM_START( von254g )   /* Step 2.0 */
r1051r1052
29122978        ROM_LOAD_VROM( "mpr-20681.40",   0x00000e, 0x400000, CRC(d517873b) SHA1(8e50dd149716ae6b0b8d7ac99cd425a17b3c0a46) )
29132979        ROM_LOAD_VROM( "mpr-20682.41",   0x00000c, 0x400000, CRC(5b43250c) SHA1(fccb40cd03c096360ca3c565e8621d4110b273ab) )
29142980
2915   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2916        ROM_LOAD16_WORD_SWAP( "epr-20687.21", 0x000000, 0x080000, CRC(fa084de5) SHA1(8a760b76bc12d60d4727f93106830f19179c9046) )
2981   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
2982        ROM_LOAD16_WORD_SWAP( "epr-20687.21", 0x080000, 0x080000, CRC(fa084de5) SHA1(8a760b76bc12d60d4727f93106830f19179c9046) )
29172983
29182984   // Samples
29192985   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
29292995
29302996   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
29312997      ROM_FILL( 0x000000, 0x800000, 0 )
2998
2999   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3000      ROM_FILL( 0x000000, 0x80000, 0 )
29323001ROM_END
29333002
29343003ROM_START( skichamp )   /* Step 2.0 */
r1051r1052
29833052        ROM_LOAD_VROM( "mpr20350.40",  0x00000e, 0x400000, CRC(c48f9ace) SHA1(7e5110e0f8c4878bdb60758f21be5968bf54fe21) )
29843053        ROM_LOAD_VROM( "mpr20351.41",  0x00000c, 0x400000, CRC(1fbd3e10) SHA1(bd37940375000461323a954000113a2c1a373af5) )
29853054
2986   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
2987        ROM_LOAD16_WORD_SWAP( "epr20356.21",  0x000000, 0x080000, CRC(4e4015d0) SHA1(3c28551ac0e93483b3db5be99f2b3cbafa9a739a) )
3055   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3056        ROM_LOAD16_WORD_SWAP( "epr20356.21",  0x080000, 0x080000, CRC(4e4015d0) SHA1(3c28551ac0e93483b3db5be99f2b3cbafa9a739a) )
29883057
29893058   // Samples
29903059   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
29963065
29973066   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
29983067      ROM_FILL( 0x000000, 0x800000, 0 )
3068
3069   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3070      ROM_FILL( 0x000000, 0x80000, 0 )
29993071ROM_END
30003072
30013073ROM_START( swtrilgy )   /* Step 2.1 */
r1051r1052
30443116        ROM_LOAD_VROM( "mpr-21373.40",  0x00000e, 0x400000, CRC(b76ad261) SHA1(de5a39a23ac6b12b17f16f2b3e82d1f5470ae600) )
30453117        ROM_LOAD_VROM( "mpr-21374.41",  0x00000c, 0x400000, CRC(ae6c4d28) SHA1(b57733cfaa63ba018b0c3c9c935c12c48cc7f184) )
30463118
3047   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3048        ROM_LOAD16_WORD_SWAP( "epr-21383.21",  0x000000, 0x080000, CRC(544d1e28) SHA1(8b4c99cf9ad0cf15d2d3da578bbc08705bafb829) )
3119   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3120        ROM_LOAD16_WORD_SWAP( "epr-21383.21",  0x080000, 0x080000, CRC(544d1e28) SHA1(8b4c99cf9ad0cf15d2d3da578bbc08705bafb829) )
30493121
30503122   // Samples
30513123   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
30603132   ROM_LOAD( "mp21376.20", 0x400000, 0x400000, CRC(e635f81e) SHA1(3eb4243fd275946ce0e85d074abd59b5ed31bbcd) )
30613133   ROM_LOAD( "mp21377.22", 0x800000, 0x400000, CRC(720621f8) SHA1(191bd8159010c172a82159d0ebfa56637c2a8462) )
30623134   ROM_LOAD( "mp21378.24", 0xc00000, 0x400000, CRC(1fcf715e) SHA1(9706f36e7a61d885d34a6974311a2410fe3d6760) )
3135
3136   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3137      ROM_FILL( 0x000000, 0x80000, 0 )
30633138ROM_END
30643139
30653140ROM_START( swtrilga )   /* Step 2.1 */
r1051r1052
31083183        ROM_LOAD_VROM( "mpr-21373.40",  0x00000e, 0x400000, CRC(b76ad261) SHA1(de5a39a23ac6b12b17f16f2b3e82d1f5470ae600) )
31093184        ROM_LOAD_VROM( "mpr-21374.41",  0x00000c, 0x400000, CRC(ae6c4d28) SHA1(b57733cfaa63ba018b0c3c9c935c12c48cc7f184) )
31103185
3111   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3112        ROM_LOAD16_WORD_SWAP( "epr-21383.21",  0x000000, 0x080000, CRC(544d1e28) SHA1(8b4c99cf9ad0cf15d2d3da578bbc08705bafb829) )
3186   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3187        ROM_LOAD16_WORD_SWAP( "epr-21383.21",  0x080000, 0x080000, CRC(544d1e28) SHA1(8b4c99cf9ad0cf15d2d3da578bbc08705bafb829) )
31133188
31143189   // Samples
31153190   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
31243199   ROM_LOAD( "mp21376.20", 0x400000, 0x400000, CRC(e635f81e) SHA1(3eb4243fd275946ce0e85d074abd59b5ed31bbcd) )
31253200   ROM_LOAD( "mp21377.22", 0x800000, 0x400000, CRC(720621f8) SHA1(191bd8159010c172a82159d0ebfa56637c2a8462) )
31263201   ROM_LOAD( "mp21378.24", 0xc00000, 0x400000, CRC(1fcf715e) SHA1(9706f36e7a61d885d34a6974311a2410fe3d6760) )
3202
3203   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3204      ROM_FILL( 0x000000, 0x80000, 0 )
31273205ROM_END
31283206
31293207ROM_START( dirtdvls )   /* Step 2.1 */
r1051r1052
31663244        ROM_LOAD_VROM( "mpr-21048.40",  0x00000e, 0x400000, CRC(96849974) SHA1(347e2216ea1225eda92693dcd80eb97df88caabf) )
31673245        ROM_LOAD_VROM( "mpr-21049.41",  0x00000c, 0x400000, CRC(91e8161a) SHA1(1edc0bc856e5d72f714bd0544814727f4ff12e7a) )
31683246
3169   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3170        ROM_LOAD16_WORD_SWAP( "epr-21066.21",  0x000000, 0x080000, CRC(f7ed2582) SHA1(a4f80d5f82c86f0bdb74bcda5dc69b83b475c542) )
3247   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3248        ROM_LOAD16_WORD_SWAP( "epr-21066.21",  0x080000, 0x080000, CRC(f7ed2582) SHA1(a4f80d5f82c86f0bdb74bcda5dc69b83b475c542) )
31713249
31723250   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
31733251        ROM_LOAD( "mpr-21031.22",  0x000000, 0x400000, CRC(32f6b23a) SHA1(8cd092733b85aecf607c2f4b683c42e388a70906) )
r1051r1052
31793257
31803258   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
31813259      ROM_FILL( 0x000000, 0x800000, 0 )
3260
3261   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3262      ROM_FILL( 0x000000, 0x80000, 0 )
31823263ROM_END
31833264
31843265ROM_START( dirtdvla )   /* Step 2.1 */
r1051r1052
32213302        ROM_LOAD_VROM( "mpr-21048.40",  0x00000e, 0x400000, CRC(96849974) SHA1(347e2216ea1225eda92693dcd80eb97df88caabf) )
32223303        ROM_LOAD_VROM( "mpr-21049.41",  0x00000c, 0x400000, CRC(91e8161a) SHA1(1edc0bc856e5d72f714bd0544814727f4ff12e7a) )
32233304
3224   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3225        ROM_LOAD16_WORD_SWAP( "epr-21066.21",  0x000000, 0x080000, CRC(f7ed2582) SHA1(a4f80d5f82c86f0bdb74bcda5dc69b83b475c542) )
3305   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3306        ROM_LOAD16_WORD_SWAP( "epr-21066.21",  0x080000, 0x080000, CRC(f7ed2582) SHA1(a4f80d5f82c86f0bdb74bcda5dc69b83b475c542) )
32263307
32273308   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
32283309        ROM_LOAD( "mpr-21031.22",  0x000000, 0x400000, CRC(32f6b23a) SHA1(8cd092733b85aecf607c2f4b683c42e388a70906) )
r1051r1052
32343315
32353316   ROM_REGION( 0x800000, REGION_SOUND2, 0 )   /* DSB samples */
32363317      ROM_FILL( 0x000000, 0x800000, 0 )
3318
3319   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3320      ROM_FILL( 0x000000, 0x80000, 0 )
32373321ROM_END
32383322
32393323ROM_START( daytona2 )   /* Step 2.1 */
r1051r1052
32903374        ROM_LOAD_VROM( "mpr-20884.40",  0x00000e, 0x400000, CRC(63c4639a) SHA1(d2b47f7bb8244e0a25c15d025d1bb295101f8875) )
32913375        ROM_LOAD_VROM( "mpr-20885.41",  0x00000c, 0x400000, CRC(61c292ca) SHA1(a2c7e81a8a8ded8d0fd33ffea74a8d2cc8f22520) )
32923376
3293   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3294        ROM_LOAD16_WORD_SWAP( "epr-20865.21",  0x000000, 0x020000, CRC(b70c2699) SHA1(9ec3f59eda18c03530a5ab7a54c09c1e14cb1c4d) )
3377   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3378        ROM_LOAD16_WORD_SWAP( "epr-20865.21",  0x080000, 0x020000, CRC(b70c2699) SHA1(9ec3f59eda18c03530a5ab7a54c09c1e14cb1c4d) )
32953379
32963380   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
32973381        ROM_LOAD( "mpr-20866.22",  0x000000, 0x400000, CRC(91f40c1c) SHA1(0c9bee8e9a8bb5ffb2699922204ec26b489eee84) )
r1051r1052
33073391        ROM_LOAD( "mpr-20888.ic20", 0x400000, 0x400000, CRC(b495fe65) SHA1(1573ced683534bb279a6dd69f6460745b728eac0) )
33083392        ROM_LOAD( "mpr-20889.ic22", 0x800000, 0x400000, CRC(18eec79e) SHA1(341982d89952ed85c921c627c294609bf83ec44b) )
33093393        ROM_LOAD( "mpr-20890.ic24", 0xc00000, 0x400000, CRC(aac96fa2) SHA1(bc68cd48eae50d3558d3c5a0302a3930639e3019) )
3394
3395   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3396      ROM_FILL( 0x000000, 0x80000, 0 )
33103397ROM_END
33113398
33123399ROM_START( dayto2pe )   /* Step 2.1 */
r1051r1052
33613448        ROM_LOAD_VROM( "mpr-21212.40",  0x00000e, 0x400000, CRC(6f8a75e0) SHA1(3b6cb238c29a6778be354882cd27b371ce96d332) )
33623449        ROM_LOAD_VROM( "mpr-21213.41",  0x00000c, 0x400000, CRC(de75bec6) SHA1(f0d6f143ad227b221bf7f7c3d1b2edaa28ad4813) )
33633450
3364   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3365        ROM_LOAD16_WORD_SWAP( "epr-21325.21",  0x000000, 0x020000, CRC(004ad6ad) SHA1(3cedc58aaf40539325870c99ecedf51f161f4f4c) )
3451   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3452        ROM_LOAD16_WORD_SWAP( "epr-21325.21",  0x080000, 0x020000, CRC(004ad6ad) SHA1(3cedc58aaf40539325870c99ecedf51f161f4f4c) )
33663453
33673454   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
33683455        ROM_LOAD( "mpr-21285.22",  0x000000, 0x400000, CRC(7cdca6ac) SHA1(fda23365d5c40f4f9e810def914cd70418e5662e) )
r1051r1052
33783465        ROM_LOAD( "mpr-20888.ic20", 0x400000, 0x400000, CRC(b495fe65) SHA1(1573ced683534bb279a6dd69f6460745b728eac0) )
33793466        ROM_LOAD( "mpr-20889.ic22", 0x800000, 0x400000, CRC(18eec79e) SHA1(341982d89952ed85c921c627c294609bf83ec44b) )
33803467        ROM_LOAD( "mpr-20890.ic24", 0xc00000, 0x400000, CRC(aac96fa2) SHA1(bc68cd48eae50d3558d3c5a0302a3930639e3019) )
3468
3469   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3470      ROM_FILL( 0x000000, 0x80000, 0 )
33813471ROM_END
33823472
33833473ROM_START( srally2 )   /* Step 2.0 */
r1051r1052
34263516        ROM_LOAD_VROM( "mpr-20630.40",  0x00000e, 0x400000, CRC(cc5881b8) SHA1(6d9b973c442c5d3bb872624412b8dfbef0677b34) )
34273517        ROM_LOAD_VROM( "mpr-20631.41",  0x00000c, 0x400000, CRC(5cb69ffd) SHA1(654d8187634726c8218bf84304765a40c2d4b117) )
34283518
3429   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3430        ROM_LOAD16_WORD_SWAP( "epr-20636.21", 0x000000, 0x080000, CRC(7139ebf8) SHA1(3e06e8aa5c3eaf371073caa51e5fc5b42826f015) )
3519   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3520        ROM_LOAD16_WORD_SWAP( "epr-20636.21", 0x080000, 0x080000, CRC(7139ebf8) SHA1(3e06e8aa5c3eaf371073caa51e5fc5b42826f015) )
34313521
34323522   // Samples
34333523   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
34423532        ROM_LOAD( "mpr-20638.58", 0x400000, 0x400000, CRC(d1513382) SHA1(b4d5b7680e2e73b361530d689ffdb0bab62e9ee4) )
34433533        ROM_LOAD( "mpr-20639.59", 0x800000, 0x400000, CRC(f6603b7b) SHA1(9f31a2562168e5eba51864935e1c15db4e3114fb) )
34443534        ROM_LOAD( "mpr-20640.60", 0xc00000, 0x400000, CRC(9eea07b7) SHA1(bdcf136f29e1435c9d82718730ef209d8cfe74d8) )
3535
3536   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3537      ROM_FILL( 0x000000, 0x80000, 0 )
34453538ROM_END
34463539
34473540ROM_START( sraly2dx )   /* Step 2.0 */
r1051r1052
34903583        ROM_LOAD_VROM( "mpr-20500.40",  0x00000e, 0x400000, CRC(3766fd87) SHA1(941ff6d89dbc8e59cc7a9a677c329aadb9068e5d) )
34913584        ROM_LOAD_VROM( "mpr-20501.41",  0x00000c, 0x400000, CRC(741da4ac) SHA1(fa6e52b42b927bc659f139f4dd039204bda3b224) )
34923585
3493   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3494        ROM_LOAD16_WORD_SWAP( "epr-20506.21", 0x000000, 0x080000, CRC(855af67b) SHA1(a0359b8329c9c0746bc996b9272b7a1f2db07368) )
3586   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3587        ROM_LOAD16_WORD_SWAP( "epr-20506.21", 0x080000, 0x080000, CRC(855af67b) SHA1(a0359b8329c9c0746bc996b9272b7a1f2db07368) )
34953588
34963589   // Samples
34973590   ROM_REGION( 0x800000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
35033596
35043597   ROM_REGION( 0x1000000, REGION_SOUND2, 0 )   /* DSB samples */
35053598      ROM_FILL( 0x000000, 0x1000000, 0 )
3599
3600   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3601      ROM_FILL( 0x000000, 0x80000, 0 )
35063602ROM_END
35073603
35083604ROM_START( harley )   /* Step 2.0 */
r1051r1052
35513647        ROM_LOAD_VROM( "mpr-20391.40",  0x00000e, 0x400000, CRC(5dc452dc) SHA1(203d5d8008bea8d2f43566fff6971b3f7add75bc) )
35523648        ROM_LOAD_VROM( "mpr-20392.41",  0x00000c, 0x400000, CRC(892208cb) SHA1(12b5309f5f66d7c2165b285e0a9710ee0d9c99f4) )
35533649
3554   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3555        ROM_LOAD16_WORD_SWAP( "epr-20397.21",  0x000000, 0x080000, CRC(5b20b54a) SHA1(26fa5aedc6ccc37f2c0879e1a0f9fbac2331e12e) )
3650   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3651        ROM_LOAD16_WORD_SWAP( "epr-20397.21",  0x080000, 0x080000, CRC(5b20b54a) SHA1(26fa5aedc6ccc37f2c0879e1a0f9fbac2331e12e) )
35563652
35573653   // Samples
35583654   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
35663662
35673663   ROM_REGION( 0x1000000, REGION_SOUND2, 0 )   /* DSB samples */
35683664      ROM_FILL( 0x000000, 0x1000000, 0 )
3665
3666   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3667      ROM_FILL( 0x000000, 0x80000, 0 )
35693668ROM_END
35703669
35713670ROM_START( fvipers2 )   /* Step 2.0 */
r1051r1052
36203719        ROM_LOAD_VROM( "mpr-20594.40",  0x00000e, 0x400000, CRC(35578240) SHA1(7902f41d376dd3449a17fb4d907e0bd84d70272b) )
36213720        ROM_LOAD_VROM( "mpr-20595.41",  0x00000c, 0x400000, CRC(1d4a2cad) SHA1(0ee9eef0bb969e715a98ca1c212a02d413f36145) )
36223721
3623   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3624        ROM_LOAD16_WORD_SWAP( "epr-20600a.21",  0x000000, 0x080000, CRC(f0e7db7e) SHA1(980c1c6d3e8534c414d8b8016531e90f77e00f90) )
3722   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3723        ROM_LOAD16_WORD_SWAP( "epr-20600a.21",  0x080000, 0x080000, CRC(f0e7db7e) SHA1(980c1c6d3e8534c414d8b8016531e90f77e00f90) )
36253724
36263725   // Samples
36273726   /* Are these in the correct order ?? */
r1051r1052
36363735
36373736   ROM_REGION( 0x1000000, REGION_SOUND2, 0 )   /* DSB samples */
36383737      ROM_FILL( 0x000000, 0x1000000, 0 )
3738
3739   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3740      ROM_FILL( 0x000000, 0x80000, 0 )
36393741ROM_END
36403742
36413743ROM_START( spikeout )   /* Step 2.1 */
r1051r1052
36923794        ROM_LOAD_VROM( "mpr21168.40",  0x00000e, 0x400000, CRC(c58be980) SHA1(77e3d5109c6659e1839b56ca2fdb157cdfba4b6a) )
36933795        ROM_LOAD_VROM( "mpr21169.41",  0x00000c, 0x400000, CRC(aa3b2cc0) SHA1(1c804e602f9227a4e553cd1a5dfbfebd04930c61) )
36943796
3695   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3696        ROM_LOAD16_WORD_SWAP( "epr21218.21",  0x000000, 0x080000, CRC(5821001a) SHA1(f6bc416b77279670bc6c1c3a62f42faf9323387e) )
3797   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3798        ROM_LOAD16_WORD_SWAP( "epr21218.21",  0x080000, 0x080000, CRC(5821001a) SHA1(f6bc416b77279670bc6c1c3a62f42faf9323387e) )
36973799
36983800   // Samples
36993801   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
37103812        ROM_LOAD( "mpr21171.ic20",  0x400000, 0x400000, CRC(8d3bd5b6) SHA1(42167dd53e4562869382ec1c8a00b69d1fd4602a) )
37113813        ROM_LOAD( "mpr21172.ic22",  0x800000, 0x400000, CRC(be221e27) SHA1(cf396d0145172a0492bf4203a7ff12c5c8480c0c) )
37123814        ROM_LOAD( "mpr21173.ic24",  0xc00000, 0x400000, CRC(ca7226d6) SHA1(e15c6fb9dee91a42889cef350479b1964bf1e5df) )
3815
3816   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3817      ROM_FILL( 0x000000, 0x80000, 0 )
37133818ROM_END
37143819
37153820ROM_START( spikeofe )   /* Step 2.1 */
r1051r1052
37663871        ROM_LOAD_VROM( "mpr21647.40",  0x00000e, 0x400000, CRC(cf87991f) SHA1(8249e086d2ef5ded8a0544b0ddbd2328e3c64876) )
37673872        ROM_LOAD_VROM( "mpr21648.41",  0x00000c, 0x400000, CRC(30f974a1) SHA1(03e2481b9af9083c3b97273819c0fcd5edc41bd4) )
37683873
3769   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3770        ROM_LOAD16_WORD_SWAP( "epr21657.21",  0x000000, 0x080000, CRC(7242e8fd) SHA1(9712972d821e2eca8db6666693340aca884f4393) )
3874   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3875        ROM_LOAD16_WORD_SWAP( "epr21657.21",  0x080000, 0x080000, CRC(7242e8fd) SHA1(9712972d821e2eca8db6666693340aca884f4393) )
37713876
37723877   // Samples
37733878   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
37843889        ROM_LOAD( "mpr21650.ic20",  0x400000, 0x400000, CRC(86d90123) SHA1(1e90fb0242fbb032825684e763a5ebb329f63869) )
37853890        ROM_LOAD( "mpr21651.ic22",  0x800000, 0x400000, CRC(81715565) SHA1(533deefed3565e7373a0aa2d043ea10e43e78b71) )
37863891        ROM_LOAD( "mpr21652.ic24",  0xc00000, 0x400000, CRC(e7c8c9bf) SHA1(76d8fa89aed86fff4d1ba704aeef96fd2c326bc9) )
3892
3893   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3894      ROM_FILL( 0x000000, 0x80000, 0 )
37873895ROM_END
37883896
37893897ROM_START( eca )   /* Step 2.1 */
r1051r1052
38323940        ROM_LOAD_VROM( "mpr22868.40",  0x00000e, 0x400000, CRC(2db40cf8) SHA1(be1e04aeb5034c2edc5c0ad153700c385a1b773a) )
38333941        ROM_LOAD_VROM( "mpr22869.41",  0x00000c, 0x400000, CRC(c6d62634) SHA1(72d493653b50fb31333f70c7ee143a8c7531106f) )
38343942
3835   ROM_REGION( 0x80000, REGION_CPU2, 0 )   /* 68000 code */
3836        ROM_LOAD16_WORD_SWAP( "epr22886.21",  0x000000, 0x080000, CRC(374ec1c6) SHA1(b06e678db191971f6701bd1f739815d00d4cfb3e) )
3943   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 code */
3944        ROM_LOAD16_WORD_SWAP( "epr22886.21",  0x080000, 0x080000, CRC(374ec1c6) SHA1(b06e678db191971f6701bd1f739815d00d4cfb3e) )
38373945
38383946   // Samples
38393947   ROM_REGION( 0x1000000, REGION_SOUND1, 0 )   /* SCSP samples */
r1051r1052
38473955
38483956   ROM_REGION( 0x1000000, REGION_SOUND2, 0 )   /* DSB samples */
38493957      ROM_FILL( 0x000000, 0x1000000, 0 )
3958
3959   ROM_REGION( 0x80000, REGION_SOUND3, 0 )      /* second SCSP's RAM */
3960      ROM_FILL( 0x000000, 0x80000, 0 )
38503961ROM_END
38513962
3963/* Model 3 sound board emulation */
38523964
3965static WRITE16_HANDLER( model3snd_ctrl )
3966{
3967   // handle sample banking
3968   if (memory_region_length(REGION_SOUND1) > 0x800000)
3969   {
3970      if (data & 0x20)
3971      {
3972           memory_set_bankptr(4, memory_region(REGION_SOUND1) + 0x200000);
3973         memory_set_bankptr(5, memory_region(REGION_SOUND1) + 0x600000);
3974      }
3975      else
3976      {
3977         memory_set_bankptr(4, memory_region(REGION_SOUND1) + 0x800000);
3978         memory_set_bankptr(5, memory_region(REGION_SOUND1) + 0xa00000);
3979      }
3980   }
3981}
3982
3983static ADDRESS_MAP_START( model3_snd, ADDRESS_SPACE_PROGRAM, 16 )
3984   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_REGION(REGION_CPU2, 0) AM_BASE(&model3_soundram)
3985   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(SCSP_0_r, SCSP_0_w)
3986   AM_RANGE(0x200000, 0x27ffff) AM_RAM AM_REGION(REGION_SOUND3, 0)
3987   AM_RANGE(0x300000, 0x300fff) AM_READWRITE(SCSP_1_r, SCSP_1_w)
3988   AM_RANGE(0x400000, 0x400001) AM_WRITE(model3snd_ctrl)
3989   AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION(REGION_CPU2, 0x80000)
3990   AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION(REGION_SOUND1, 0)
3991   AM_RANGE(0xa00000, 0xdfffff) AM_READ(MRA16_BANK4)
3992   AM_RANGE(0xe00000, 0xffffff) AM_READ(MRA16_BANK5)
3993ADDRESS_MAP_END
3994
3995static int scsp_last_line = 0;
3996
3997static void scsp_irq(int irq)
3998{
3999    if (irq > 0)
4000   {
4001      scsp_last_line = irq;
4002      cpunum_set_input_line(1, irq, PULSE_LINE);
4003   }
4004}
4005
4006static struct SCSPinterface scsp_interface =
4007{
4008   REGION_CPU2,
4009   0,
4010   scsp_irq
4011};
4012
4013static struct SCSPinterface scsp2_interface =
4014{
4015   REGION_SOUND3,
4016   0,
4017   NULL
4018};
4019
38534020/* IRQs */
38544021/*
38554022    0x80: Unused ?
r1051r1052
39024069   MDRV_CPU_PROGRAM_MAP(model3_mem, 0)
39034070    MDRV_CPU_VBLANK_INT(model3_interrupt,2)
39044071
4072   MDRV_CPU_ADD(M68000, 12000000)
4073   MDRV_CPU_PROGRAM_MAP(model3_snd, 0)
4074
39054075    MDRV_INTERLEAVE(10)
39064076
39074077   MDRV_MACHINE_RESET(model3_10)
r1051r1052
39174087
39184088   MDRV_VIDEO_START(model3)
39194089   MDRV_VIDEO_UPDATE(model3)
4090
4091   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
4092   MDRV_SOUND_ADD(SCSP, 0)
4093   MDRV_SOUND_CONFIG(scsp_interface)
4094   MDRV_SOUND_ROUTE(0, "left", 2.0)
4095   MDRV_SOUND_ROUTE(0, "right", 2.0)
4096   MDRV_SOUND_ADD(SCSP, 0)
4097   MDRV_SOUND_CONFIG(scsp2_interface)
4098   MDRV_SOUND_ROUTE(0, "left", 2.0)
4099   MDRV_SOUND_ROUTE(0, "right", 2.0)
39204100MACHINE_DRIVER_END
39214101
39224102static MACHINE_DRIVER_START( model3_15 )
r1051r1052
39254105   MDRV_CPU_PROGRAM_MAP(model3_mem, 0)
39264106    MDRV_CPU_VBLANK_INT(model3_interrupt,2)
39274107
4108   MDRV_CPU_ADD(M68000, 12000000)
4109   MDRV_CPU_PROGRAM_MAP(model3_snd, 0)
4110
39284111   MDRV_MACHINE_RESET(model3_15)
39294112   MDRV_NVRAM_HANDLER(model3)
39304113
r1051r1052
39384121
39394122   MDRV_VIDEO_START(model3)
39404123   MDRV_VIDEO_UPDATE(model3)
4124
4125   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
4126   MDRV_SOUND_ADD(SCSP, 0)
4127   MDRV_SOUND_CONFIG(scsp_interface)
4128   MDRV_SOUND_ROUTE(0, "left", 2.0)
4129   MDRV_SOUND_ROUTE(0, "right", 2.0)
4130   MDRV_SOUND_ADD(SCSP, 0)
4131   MDRV_SOUND_CONFIG(scsp2_interface)
4132   MDRV_SOUND_ROUTE(0, "left", 2.0)
4133   MDRV_SOUND_ROUTE(0, "right", 2.0)
39414134MACHINE_DRIVER_END
39424135
39434136static MACHINE_DRIVER_START( model3_20 )
r1051r1052
39464139   MDRV_CPU_PROGRAM_MAP(model3_mem, 0)
39474140    MDRV_CPU_VBLANK_INT(model3_interrupt,2)
39484141
4142   MDRV_CPU_ADD(M68000, 12000000)
4143   MDRV_CPU_PROGRAM_MAP(model3_snd, 0)
4144
39494145   MDRV_MACHINE_RESET(model3_20)
39504146   MDRV_NVRAM_HANDLER(model3)
39514147
r1051r1052
39594155
39604156   MDRV_VIDEO_START(model3)
39614157   MDRV_VIDEO_UPDATE(model3)
4158
4159   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
4160   MDRV_SOUND_ADD(SCSP, 0)
4161   MDRV_SOUND_CONFIG(scsp_interface)
4162   MDRV_SOUND_ROUTE(0, "left", 2.0)
4163   MDRV_SOUND_ROUTE(0, "right", 2.0)
4164   MDRV_SOUND_ADD(SCSP, 0)
4165   MDRV_SOUND_CONFIG(scsp2_interface)
4166   MDRV_SOUND_ROUTE(0, "left", 2.0)
4167   MDRV_SOUND_ROUTE(0, "right", 2.0)
39624168MACHINE_DRIVER_END
39634169
39644170static MACHINE_DRIVER_START( model3_21 )
r1051r1052
39674173   MDRV_CPU_PROGRAM_MAP(model3_mem, 0)
39684174    MDRV_CPU_VBLANK_INT(model3_interrupt,2)
39694175
4176   MDRV_CPU_ADD(M68000, 12000000)
4177   MDRV_CPU_PROGRAM_MAP(model3_snd, 0)
4178
39704179   MDRV_MACHINE_RESET(model3_21)
39714180   MDRV_NVRAM_HANDLER(model3)
39724181
r1051r1052
39804189
39814190   MDRV_VIDEO_START(model3)
39824191   MDRV_VIDEO_UPDATE(model3)
4192
4193   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
4194   MDRV_SOUND_ADD(SCSP, 0)
4195   MDRV_SOUND_CONFIG(scsp_interface)
4196   MDRV_SOUND_ROUTE(0, "left", 2.0)
4197   MDRV_SOUND_ROUTE(0, "right", 2.0)
4198   MDRV_SOUND_ADD(SCSP, 0)
4199   MDRV_SOUND_CONFIG(scsp2_interface)
4200   MDRV_SOUND_ROUTE(0, "left", 2.0)
4201   MDRV_SOUND_ROUTE(0, "right", 2.0)
39834202MACHINE_DRIVER_END
39844203
39854204static void interleave_vroms(void)
src/mame/drivers/namcos21.c
r1051r1052
15031503   8*64 /* sprite offset */
15041504};
15051505
1506static const gfx_decode gfxdecodeinfo[] =
1507{
1508   { REGION_GFX1, 0x000000, &tile_layout,  0x1000, 0x10 },
1509   { -1 }
1510};
1506static GFXDECODE_START( namcos21 )
1507   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tile_layout,  0x1000, 0x10 )
1508GFXDECODE_END
15111509
15121510static struct C140interface C140_interface_typeA =
15131511{
r1051r1052
15611559   MDRV_SCREEN_SIZE(NAMCOS21_POLY_FRAME_WIDTH,NAMCOS21_POLY_FRAME_HEIGHT)
15621560   MDRV_SCREEN_VISIBLE_AREA(0,495,0,479)
15631561
1564   MDRV_GFXDECODE(gfxdecodeinfo)
1562   MDRV_GFXDECODE(namcos21)
15651563   MDRV_PALETTE_LENGTH(NAMCOS21_NUM_COLORS)
15661564
15671565   MDRV_VIDEO_START(namcos21)
r1051r1052
16331631   MDRV_SCREEN_SIZE(NAMCOS21_POLY_FRAME_WIDTH,NAMCOS21_POLY_FRAME_HEIGHT)
16341632   MDRV_SCREEN_VISIBLE_AREA(0,495,0,479)
16351633
1636   MDRV_GFXDECODE(gfxdecodeinfo)
1634   MDRV_GFXDECODE(namcos21)
16371635   MDRV_PALETTE_LENGTH(NAMCOS21_NUM_COLORS)
16381636
16391637   MDRV_VIDEO_START(namcos21)
src/mame/drivers/pgm.c
r1051r1052
460460   cpunum_set_input_line(1, 0, level);
461461}
462462
463struct ics2115_interface pgm_ics2115_interface = {
463static struct ics2115_interface pgm_ics2115_interface = {
464464   REGION_SOUND1,
465465   sound_irq
466466};
r1051r1052
15171517    32*256
15181518};
15191519
1520static const gfx_decode gfxdecodeinfo[] =
1521{
1522   { REGION_GFX1, 0, &pgm8_charlayout,    0x800, 32  }, /* 8x8x4 Tiles */
1523   { REGION_GFX2, 0, &pgm32_charlayout,   0x400, 32  }, /* 32x32x5 Tiles */
1524   { -1 }
1525};
1520static GFXDECODE_START( pgm )
1521   GFXDECODE_ENTRY( REGION_GFX1, 0, pgm8_charlayout,    0x800, 32  ) /* 8x8x4 Tiles */
1522   GFXDECODE_ENTRY( REGION_GFX2, 0, pgm32_charlayout,   0x400, 32  ) /* 32x32x5 Tiles */
1523GFXDECODE_END
15261524
15271525/*** Machine Driver **********************************************************/
15281526
r1051r1052
15651563   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15661564   MDRV_SCREEN_SIZE(64*8, 64*8)
15671565   MDRV_SCREEN_VISIBLE_AREA(0*8, 56*8-1, 0*8, 28*8-1)
1568   MDRV_GFXDECODE(gfxdecodeinfo)
1566   MDRV_GFXDECODE(pgm)
15691567   MDRV_PALETTE_LENGTH(0x1200/2)
15701568   MDRV_MACHINE_RESET ( pgm )
15711569
src/mame/drivers/iqblock.c
r1051r1052
265265   32*16
266266};
267267
268static const gfx_decode gfxdecodeinfo_iqblock[] =
269{
270   { REGION_GFX1, 0, &tilelayout1, 0, 16 },   /* only odd color codes are used */
271   { REGION_GFX2, 0, &tilelayout2, 0,  4 },   /* only color codes 0 and 3 used */
272   { -1 }
273};
268static GFXDECODE_START( iqblock )
269   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout1, 0, 16 )   /* only odd color codes are used */
270   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout2, 0,  4 )   /* only color codes 0 and 3 used */
271GFXDECODE_END
274272
275static const gfx_decode gfxdecodeinfo_cabaret[] =
276{
277   { REGION_GFX1, 0, &tilelayout1, 0, 16 },
278   { REGION_GFX2, 0, &tilelayout3, 0, 16 },
279   { -1 }
280};
273static GFXDECODE_START( cabaret )
274   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout1, 0, 16 )
275   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout3, 0, 16 )
276GFXDECODE_END
281277
282278
283279static MACHINE_DRIVER_START( iqblock )
r1051r1052
297293   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298294   MDRV_SCREEN_SIZE(64*8, 32*8)
299295   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 30*8-1)
300   MDRV_GFXDECODE(gfxdecodeinfo_iqblock)
296   MDRV_GFXDECODE(iqblock)
301297   MDRV_PALETTE_LENGTH(1024)
302298
303299   MDRV_VIDEO_START(iqblock)
r1051r1052
327323   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
328324   MDRV_SCREEN_SIZE(64*8, 32*8)
329325   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 30*8-1)
330   MDRV_GFXDECODE(gfxdecodeinfo_cabaret)
326   MDRV_GFXDECODE(cabaret)
331327   MDRV_PALETTE_LENGTH(1024)
332328
333329   MDRV_VIDEO_START(iqblock)
src/mame/drivers/ikki.c
r1051r1052
179179   8*8*8
180180};
181181
182static const gfx_decode gfxdecodeinfo[] =
183{
184   { REGION_GFX2, 0x0000, &charlayout,   512, 64 },
185   { REGION_GFX1, 0x0000, &spritelayout, 0,   64 },
186   { -1 }
187};
182static GFXDECODE_START( ikki )
183   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   512, 64 )
184   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0,   64 )
185GFXDECODE_END
188186
189187
190188static MACHINE_DRIVER_START( ikki )
r1051r1052
206204   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
207205   MDRV_SCREEN_SIZE(32*8, 32*8)
208206   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
209   MDRV_GFXDECODE(gfxdecodeinfo)
207   MDRV_GFXDECODE(ikki)
210208   MDRV_PALETTE_LENGTH(256+1)
211209   MDRV_COLORTABLE_LENGTH(1024)
212210
src/mame/drivers/darius.c
r1051r1052
815815   16*8   /* every sprite takes 32 consecutive bytes */
816816};
817817
818static const gfx_decode darius_gfxdecodeinfo[] =
819{
820   { REGION_GFX2, 0, &tilelayout,   0, 256 },   /* sprites */
821   { REGION_GFX1, 0, &charlayout,   0, 256 },   /* scr tiles */
822   { REGION_GFX3, 0, &char2layout,  0, 256 },   /* top layer scr tiles */
823   { -1 }
824};
818static GFXDECODE_START( darius )
819   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0, 256 )   /* sprites */
820   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 256 )   /* scr tiles */
821   GFXDECODE_ENTRY( REGION_GFX3, 0, char2layout,  0, 256 )   /* top layer scr tiles */
822GFXDECODE_END
825823
826824
827825/**************************************************************
r1051r1052
883881
884882   /* video hardware */
885883   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
886   MDRV_GFXDECODE(darius_gfxdecodeinfo)
884   MDRV_GFXDECODE(darius)
887885   MDRV_PALETTE_LENGTH(4096*2)
888886   MDRV_DEFAULT_LAYOUT(layout_darius)
889887
src/mame/drivers/ssingles.c
r1051r1052
219219   8*8*2
220220};
221221
222static const gfx_decode gfxdecodeinfo[] =
223{
224   { REGION_GFX1, 0, &charlayout,   0x0000, 1 },
225   { -1 }
226};
222static GFXDECODE_START( ssingles )
223   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x0000, 1 )
224GFXDECODE_END
227225
228226static MACHINE_DRIVER_START( ssingles )
229227   MDRV_CPU_ADD(Z80,4000000)       /* ? MHz */
r1051r1052
239237
240238   MDRV_SCREEN_VISIBLE_AREA(0*8, 288-1, 0*8, 224-1)
241239
242   MDRV_GFXDECODE(gfxdecodeinfo)
240   MDRV_GFXDECODE(ssingles)
243241   MDRV_PALETTE_LENGTH(16*4) //guess
244242
245243   MDRV_VIDEO_START(ssingles)
src/mame/drivers/cbasebal.c
r1051r1052
241241   64*8    /* every sprite takes 64 consecutive bytes */
242242};
243243
244static const gfx_decode cbasebal_gfxdecodeinfo[] =
245{
246   { REGION_GFX1, 0, &cbasebal_textlayout,   256,  8 }, /* colors 256- 287 */
247   { REGION_GFX2, 0, &cbasebal_tilelayout,   768, 16 }, /* colors 768-1023 */
248   { REGION_GFX3, 0, &cbasebal_spritelayout, 512,  8 }, /* colors 512- 639 */
249   { -1 }
250};
244static GFXDECODE_START( cbasebal )
245   GFXDECODE_ENTRY( REGION_GFX1, 0, cbasebal_textlayout,   256,  8 ) /* colors 256- 287 */
246   GFXDECODE_ENTRY( REGION_GFX2, 0, cbasebal_tilelayout,   768, 16 ) /* colors 768-1023 */
247   GFXDECODE_ENTRY( REGION_GFX3, 0, cbasebal_spritelayout, 512,  8 ) /* colors 512- 639 */
248GFXDECODE_END
251249
252250
253251
r1051r1052
269267   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
270268   MDRV_SCREEN_SIZE(64*8, 32*8)
271269   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
272   MDRV_GFXDECODE(cbasebal_gfxdecodeinfo)
270   MDRV_GFXDECODE(cbasebal)
273271   MDRV_PALETTE_LENGTH(1024)
274272
275273   MDRV_VIDEO_START(cbasebal)
src/mame/drivers/st0016.c
r1051r1052
388388   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
389389INPUT_PORTS_END
390390
391static const gfx_decode gfxdecodeinfo[] =
392{
393//  { 0, 0, &charlayout,      0, 16*4  },
394   { -1 }   /* end of array */
395};
391static GFXDECODE_START( st0016 )
392//  GFXDECODE_ENTRY( 0, 0, charlayout,      0, 16*4  )
393GFXDECODE_END
396394
397395INTERRUPT_GEN(st0016_int)
398396{
r1051r1052
431429   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
432430   MDRV_SCREEN_SIZE(48*8, 48*8)
433431   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 48*8-1)
434   MDRV_GFXDECODE(gfxdecodeinfo)
432   MDRV_GFXDECODE(st0016)
435433   MDRV_PALETTE_LENGTH(16*16*4+1)
436434
437435   MDRV_VIDEO_START(st0016)
src/mame/drivers/sbasketb.c
r1051r1052
221221
222222
223223
224static const gfx_decode gfxdecodeinfo[] =
225{
226   { REGION_GFX1, 0, &charlayout,       0, 16 },
227   { REGION_GFX2, 0, &spritelayout, 16*16, 16*16 },
228   { -1 }
229};
224static GFXDECODE_START( sbasketb )
225   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
226   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16*16 )
227GFXDECODE_END
230228
231229
232230struct VLM5030interface sbasketb_vlm5030_interface =
r1051r1052
255253   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
256254   MDRV_SCREEN_SIZE(32*8, 32*8)
257255   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
258   MDRV_GFXDECODE(gfxdecodeinfo)
256   MDRV_GFXDECODE(sbasketb)
259257   MDRV_PALETTE_LENGTH(256)
260258   MDRV_COLORTABLE_LENGTH(16*16+16*16*16)
261259
src/mame/drivers/funkyjet.c
r1051r1052
344344   64*8
345345};
346346
347static const gfx_decode gfxdecodeinfo[] =
348{
349   { REGION_GFX1, 0, &charlayout,  256, 32 },   /* Characters 8x8 */
350   { REGION_GFX1, 0, &tile_layout, 256, 32 },   /* Tiles 16x16 */
351   { REGION_GFX2, 0, &tile_layout,   0, 16 },   /* Sprites 16x16 */
352   { -1 }
353};
347static GFXDECODE_START( funkyjet )
348   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  256, 32 )   /* Characters 8x8 */
349   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 256, 32 )   /* Tiles 16x16 */
350   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,   0, 16 )   /* Sprites 16x16 */
351GFXDECODE_END
354352
355353/******************************************************************************/
356354
r1051r1052
383381   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
384382   MDRV_SCREEN_SIZE(40*8, 32*8)
385383   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
386   MDRV_GFXDECODE(gfxdecodeinfo)
384   MDRV_GFXDECODE(funkyjet)
387385   MDRV_PALETTE_LENGTH(1024)
388386
389387   MDRV_VIDEO_START(funkyjet)
src/mame/drivers/skyarmy.c
r1051r1052
244244        32*8
245245};
246246
247static const gfx_decode gfxdecodeinfo[] =
248{
249        { REGION_GFX1, 0, &charlayout,   0, 32 },
250        { REGION_GFX2, 0, &spritelayout, 0, 32 },
251   { -1 }
252};
247static GFXDECODE_START( skyarmy )
248        GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 32 )
249        GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 32 )
250GFXDECODE_END
253251
254252static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
255253   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
r1051r1052
277275   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
278276   MDRV_SCREEN_SIZE(32*8,32*8)
279277   MDRV_SCREEN_VISIBLE_AREA(0*8,32*8-1,1*8,31*8-1)
280   MDRV_GFXDECODE(gfxdecodeinfo)
278   MDRV_GFXDECODE(skyarmy)
281279   MDRV_PALETTE_LENGTH(32)
282280
283281   MDRV_PALETTE_INIT(skyarmy)
src/mame/drivers/ksayakyu.c
r1051r1052
231231   8*8*4
232232};
233233
234static const gfx_decode gfxdecodeinfo[] =
235{
236   { REGION_GFX1, 0, &charlayout,   0, 16 },
237   { REGION_GFX3, 0, &charlayout2,  16*4, 32 },
238   { REGION_GFX2, 0, &spritelayout, 0, 16 },
239   { -1 }
240};
234static GFXDECODE_START( ksayakyu )
235   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
236   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout2,  16*4, 32 )
237   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 16 )
238GFXDECODE_END
241239
242240static MACHINE_DRIVER_START( ksayakyu )
243241   MDRV_CPU_ADD(Z80,8000000/2)
r1051r1052
260258
261259   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
262260
263   MDRV_GFXDECODE(gfxdecodeinfo)
261   MDRV_GFXDECODE(ksayakyu)
264262   MDRV_PALETTE_INIT(ksayakyu)
265263   MDRV_PALETTE_LENGTH(256)
266264
src/mame/drivers/qix.c
r1051r1052
643643   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
644644
645645   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
646   MDRV_SOUND_CONFIG(qix_discrete_interface)
646   MDRV_SOUND_CONFIG_DISCRETE(qix)
647647   MDRV_SOUND_ROUTE(0, "left", 1.0)
648648   MDRV_SOUND_ROUTE(1, "right", 1.0)
649649MACHINE_DRIVER_END
src/mame/drivers/suprgolf.c
r1051r1052
280280   8*8*4
281281};
282282
283static const gfx_decode gfxdecodeinfo[] =
284{
285   { REGION_GFX1, 0, &gfxlayout,   0, 32 },
286   { -1 }
287};
283static GFXDECODE_START( suprgolf )
284   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout,   0, 32 )
285GFXDECODE_END
288286
289287static MACHINE_DRIVER_START( suprgolf )
290288
r1051r1052
307305   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
308306   MDRV_SCREEN_SIZE(256, 256)
309307   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 191)
310   MDRV_GFXDECODE(gfxdecodeinfo)
308   MDRV_GFXDECODE(suprgolf)
311309   MDRV_PALETTE_LENGTH(512)
312310
313311   /* sound hardware */
src/mame/drivers/wallc.c
r1051r1052
229229   8*8 /* every char takes 8 consecutive bytes */
230230};
231231
232static const gfx_decode gfxdecodeinfo[] =
233{
234   { REGION_GFX1, 0     , &charlayout, 0, 4 },
235   { -1 }
236};
232static GFXDECODE_START( wallc )
233   GFXDECODE_ENTRY( REGION_GFX1, 0     , charlayout, 0, 4 )
234GFXDECODE_END
237235
238236static DRIVER_INIT( wallc )
239237{
r1051r1052
290288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
291289   MDRV_SCREEN_SIZE(32*8, 32*8)
292290   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
293   MDRV_GFXDECODE(gfxdecodeinfo)
291   MDRV_GFXDECODE(wallc)
294292   MDRV_PALETTE_LENGTH(32)
295293
296294   MDRV_PALETTE_INIT(wallc)
src/mame/drivers/marinedt.c
r1051r1052
400400   32*32*2
401401};
402402
403static const gfx_decode marinedt_gfxdecodeinfo[] =
404{
405   { REGION_GFX1, 0, &marinedt_charlayout, 0,  4 },   //really only 1 colour set?
406   { REGION_GFX2, 0, &marinedt_objlayout,  48, 4 },
407   { REGION_GFX3, 0, &marinedt_objlayout,  32, 4 },
408   { -1 }
409};
403static GFXDECODE_START( marinedt )
404   GFXDECODE_ENTRY( REGION_GFX1, 0, marinedt_charlayout, 0,  4 )   //really only 1 colour set?
405   GFXDECODE_ENTRY( REGION_GFX2, 0, marinedt_objlayout,  48, 4 )
406   GFXDECODE_ENTRY( REGION_GFX3, 0, marinedt_objlayout,  32, 4 )
407GFXDECODE_END
410408
411409PALETTE_INIT( marinedt )
412410{
r1051r1052
599597   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
600598   MDRV_SCREEN_SIZE(4*8+32*8, 32*8)
601599   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 32*8-1)
602   MDRV_GFXDECODE(marinedt_gfxdecodeinfo)
600   MDRV_GFXDECODE(marinedt)
603601   MDRV_PALETTE_LENGTH(64)
604602
605603   MDRV_PALETTE_INIT(marinedt)
src/mame/drivers/ironhors.c
r1051r1052
333333   32*32
334334};
335335
336static const gfx_decode ironhors_gfxdecodeinfo[] =
337{
338   { REGION_GFX1, 0, &ironhors_charlayout,         0, 16*8 },
339   { REGION_GFX1, 0, &ironhors_spritelayout, 16*8*16, 16*8 },
340   { REGION_GFX1, 0, &ironhors_charlayout,   16*8*16, 16*8 },  /* to handle 8x8 sprites */
341   { -1 }
342};
336static GFXDECODE_START( ironhors )
337   GFXDECODE_ENTRY( REGION_GFX1, 0, ironhors_charlayout,         0, 16*8 )
338   GFXDECODE_ENTRY( REGION_GFX1, 0, ironhors_spritelayout, 16*8*16, 16*8 )
339   GFXDECODE_ENTRY( REGION_GFX1, 0, ironhors_charlayout,   16*8*16, 16*8 )  /* to handle 8x8 sprites */
340GFXDECODE_END
343341
344342
345343static const gfx_layout farwest_charlayout =
r1051r1052
377375   8*8   /* every char takes 8 consecutive bytes */
378376};
379377
380static const gfx_decode farwest_gfxdecodeinfo[] =
381{
382   { REGION_GFX1, 0, &farwest_charlayout,         0, 16*8 },
383   { REGION_GFX2, 0, &farwest_spritelayout, 16*8*16, 16*8 },
384   { REGION_GFX2, 0, &farwest_spritelayout2,16*8*16, 16*8 },  /* to handle 8x8 sprites */
385   { -1 }
386};
378static GFXDECODE_START( farwest )
379   GFXDECODE_ENTRY( REGION_GFX1, 0, farwest_charlayout,         0, 16*8 )
380   GFXDECODE_ENTRY( REGION_GFX2, 0, farwest_spritelayout, 16*8*16, 16*8 )
381   GFXDECODE_ENTRY( REGION_GFX2, 0, farwest_spritelayout2,16*8*16, 16*8 )  /* to handle 8x8 sprites */
382GFXDECODE_END
387383
388384
389385static struct YM2203interface ym2203_interface =
r1051r1052
415411   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
416412   MDRV_SCREEN_SIZE(32*8, 32*8)
417413   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
418   MDRV_GFXDECODE(ironhors_gfxdecodeinfo)
414   MDRV_GFXDECODE(ironhors)
419415   MDRV_PALETTE_LENGTH(256)
420416   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
421417
r1051r1052
449445   MDRV_CPU_PROGRAM_MAP(farwest_slave_map, 0)
450446   MDRV_CPU_IO_MAP(0, 0)
451447
452   MDRV_GFXDECODE(farwest_gfxdecodeinfo)
448   MDRV_GFXDECODE(farwest)
453449MACHINE_DRIVER_END
454450
455451
src/mame/drivers/battlex.c
r1051r1052
197197};
198198
199199
200static const gfx_decode gfxdecodeinfo[] =
201{
202   { REGION_GFX1, 0, &battlex_charlayout,      0, 8 },
203   { REGION_GFX2, 0, &battlex_spritelayout, 16*8, 8 },
204   { -1 }
205};
200static GFXDECODE_START( battlex )
201   GFXDECODE_ENTRY( REGION_GFX1, 0, battlex_charlayout,      0, 8 )
202   GFXDECODE_ENTRY( REGION_GFX2, 0, battlex_spritelayout, 16*8, 8 )
203GFXDECODE_END
206204
207205/*** MACHINE DRIVERS *********************************************************/
208206
r1051r1052
222220   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
223221   MDRV_SCREEN_SIZE(32*8, 32*8)
224222   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
225   MDRV_GFXDECODE(gfxdecodeinfo)
223   MDRV_GFXDECODE(battlex)
226224   MDRV_PALETTE_LENGTH(16*8+64)
227225
228226   MDRV_PALETTE_INIT(battlex)
src/mame/drivers/skullxbo.c
r1051r1052
231231};
232232
233233
234static const gfx_decode gfxdecodeinfo[] =
235{
236   { REGION_GFX1, 0, &molayout, 0x000, 32 },
237   { REGION_GFX2, 0, &pflayout, 0x200, 16 },
238   { REGION_GFX3, 0, &anlayout, 0x300, 16 },
239   { -1 }
240};
234static GFXDECODE_START( skullxbo )
235   GFXDECODE_ENTRY( REGION_GFX1, 0, molayout, 0x000, 32 )
236   GFXDECODE_ENTRY( REGION_GFX2, 0, pflayout, 0x200, 16 )
237   GFXDECODE_ENTRY( REGION_GFX3, 0, anlayout, 0x300, 16 )
238GFXDECODE_END
241239
242240
243241
r1051r1052
259257
260258   /* video hardware */
261259   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
262   MDRV_GFXDECODE(gfxdecodeinfo)
260   MDRV_GFXDECODE(skullxbo)
263261   MDRV_PALETTE_LENGTH(2048)
264262
265263   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/mrflea.c
r1051r1052
8282   16*16
8383};
8484
85static const gfx_decode gfxdecodeinfo[] = {
86   { REGION_GFX1, 0, &sprite_layout,   0x10, 1 },
87   { REGION_GFX2, 0, &tile_layout,      0x00, 1 },
88   { -1 }
89};
85static GFXDECODE_START( mrflea )
86   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout,   0x10, 1 )
87   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,      0x00, 1 )
88GFXDECODE_END
9089
9190/*******************************************************/
9291
r1051r1052
294293   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
295294   MDRV_SCREEN_SIZE(32*8, 32*8)
296295   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 31*8-1)
297   MDRV_GFXDECODE(gfxdecodeinfo)
296   MDRV_GFXDECODE(mrflea)
298297   MDRV_PALETTE_LENGTH(32)
299298
300299   MDRV_VIDEO_START(mrflea)
src/mame/drivers/glass.c
r1051r1052
6262   32*8
6363};
6464
65static const gfx_decode glass_gfxdecodeinfo[] =
66{
67   { REGION_GFX1, 0x000000, &glass_tilelayout16, 0, 64 },
68   { -1 }
69};
65static GFXDECODE_START( glass )
66   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, glass_tilelayout16, 0, 64 )
67GFXDECODE_END
7068
7169
7270static ADDRESS_MAP_START( glass_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r1051r1052
217215   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
218216   MDRV_SCREEN_SIZE(32*16, 32*16)
219217   MDRV_SCREEN_VISIBLE_AREA(0, 368-1, 16, 256-1)
220   MDRV_GFXDECODE(glass_gfxdecodeinfo)
218   MDRV_GFXDECODE(glass)
221219   MDRV_PALETTE_LENGTH(1024)
222220
223221   MDRV_VIDEO_START(glass)
src/mame/drivers/mcatadv.c
r1051r1052
470470   128*8
471471};
472472
473static const gfx_decode mcatadv_gfxdecodeinfo[] =
474{
475   { REGION_GFX2, 0, &mcatadv_tiles16x16x4_layout, 0, 0x200 },
476   { REGION_GFX3, 0, &mcatadv_tiles16x16x4_layout, 0, 0x200 },
477   { -1 }
478};
473static GFXDECODE_START( mcatadv )
474   GFXDECODE_ENTRY( REGION_GFX2, 0, mcatadv_tiles16x16x4_layout, 0, 0x200 )
475   GFXDECODE_ENTRY( REGION_GFX3, 0, mcatadv_tiles16x16x4_layout, 0, 0x200 )
476GFXDECODE_END
479477
480478
481479/* Stolen from Psikyo.c */
r1051r1052
510508   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
511509   MDRV_SCREEN_SIZE(320, 256)
512510   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
513   MDRV_GFXDECODE(mcatadv_gfxdecodeinfo)
511   MDRV_GFXDECODE(mcatadv)
514512   MDRV_PALETTE_LENGTH(0x2000/2)
515513
516514   MDRV_WATCHDOG_VBLANK_INIT(DEFAULT_60HZ_3S_VBLANK_WATCHDOG)
src/mame/drivers/toaplan2.c
r1051r1052
12491249
12501250
12511251
1252struct EEPROM_interface eeprom_interface_93C66 =
1252static struct EEPROM_interface eeprom_interface_93C66 =
12531253{
12541254   /* Pin 6 of the 93C66 is connected to Gnd!
12551255       So it's configured for 512 bytes */
r1051r1052
32213221   8*8*4
32223222};
32233223
3224static const gfx_decode gfxdecodeinfo[] =
3225{
3226   { REGION_GFX1, 0, &tilelayout,   0, 128 },
3227   { REGION_GFX1, 0, &spritelayout, 0,  64 },
3228   { -1 }
3229};
3224static GFXDECODE_START( toaplan2 )
3225   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0, 128 )
3226   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0,  64 )
3227GFXDECODE_END
32303228
3231static const gfx_decode gfxdecodeinfo_2[] =
3232{
3233   { REGION_GFX1, 0, &tilelayout,   0, 128 },
3234   { REGION_GFX1, 0, &spritelayout, 0,  64 },
3235   { REGION_GFX2, 0, &tilelayout,   0, 128 },
3236   { REGION_GFX2, 0, &spritelayout, 0,  64 },
3237   { -1 }
3238};
3229static GFXDECODE_START( 2 )
3230   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0, 128 )
3231   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0,  64 )
3232   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0, 128 )
3233   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0,  64 )
3234GFXDECODE_END
32393235
3240static const gfx_decode truxton2_gfxdecodeinfo[] =
3241{
3242   { REGION_GFX1, 0,       &tilelayout            , 0, 128 },
3243   { REGION_GFX1, 0,       &spritelayout          , 0,  64 },
3244//  { REGION_CPU1, 0x40000, &truxton2_tx_tilelayout, 0, 128 },  /* Truxton 2 */
3245//  { REGION_CPU1, 0x68000, &truxton2_tx_tilelayout, 0, 128 },  /* Fix Eight */
3246   { 0, 0, &truxton2_tx_tilelayout,  0, 128 },
3247   { -1 }
3248};
3236static GFXDECODE_START( truxton2 )
3237   GFXDECODE_ENTRY( REGION_GFX1, 0,       tilelayout            , 0, 128 )
3238   GFXDECODE_ENTRY( REGION_GFX1, 0,       spritelayout          , 0,  64 )
3239//  GFXDECODE_ENTRY( REGION_CPU1, 0x40000, truxton2_tx_tilelayout, 0, 128 )  /* Truxton 2 */
3240//  GFXDECODE_ENTRY( REGION_CPU1, 0x68000, truxton2_tx_tilelayout, 0, 128 )  /* Fix Eight */
3241   GFXDECODE_ENTRY( 0, 0, truxton2_tx_tilelayout,  0, 128 )
3242GFXDECODE_END
32493243
3250static const gfx_decode raizing_gfxdecodeinfo[] =
3251{
3252   { REGION_GFX1, 0, &tilelayout,         0, 128 },
3253   { REGION_GFX1, 0, &spritelayout,       0,  64 },
3254   { REGION_GFX2, 0, &raizing_textlayout, 0, 128 },      /* Extra-text layer */
3255   { -1 }
3256};
3244static GFXDECODE_START( raizing )
3245   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,         0, 128 )
3246   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,       0,  64 )
3247   GFXDECODE_ENTRY( REGION_GFX2, 0, raizing_textlayout, 0, 128 )      /* Extra-text layer */
3248GFXDECODE_END
32573249
32583250/* This is wrong a bit. Text layer is dynamically changed. */
3259static const gfx_decode batrider_gfxdecodeinfo[] =
3260{
3261   { REGION_GFX1, 0, &tilelayout,             0, 128 },
3262   { REGION_GFX1, 0, &spritelayout,           0,  64 },
3263   { 0,           0, &batrider_tx_tilelayout, 0,  16 },
3264   { -1 }
3265};
3251static GFXDECODE_START( batrider )
3252   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,             0, 128 )
3253   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,           0,  64 )
3254   GFXDECODE_ENTRY( 0,           0, batrider_tx_tilelayout, 0,  16 )
3255GFXDECODE_END
32663256
3267static const gfx_decode fixeighb_gfxdecodeinfo[] =
3268{
3269   { REGION_GFX1, 0, &tilelayout     , 0, 128 },
3270   { REGION_GFX1, 0, &spritelayout   , 0,  64 },
3271   { REGION_GFX2, 0, &fixeighblayout , 0, 128 },
3272   { -1 }
3273};
3257static GFXDECODE_START( fixeighb )
3258   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout     , 0, 128 )
3259   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout   , 0,  64 )
3260   GFXDECODE_ENTRY( REGION_GFX2, 0, fixeighblayout , 0, 128 )
3261GFXDECODE_END
32743262
32753263static void irqhandler(int linestate)
32763264{
r1051r1052
33123300   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33133301   MDRV_SCREEN_SIZE(432, 262)
33143302   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3315   MDRV_GFXDECODE(gfxdecodeinfo)
3303   MDRV_GFXDECODE(toaplan2)
33163304   MDRV_PALETTE_LENGTH(2048)
33173305
33183306   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
33493337   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33503338   MDRV_SCREEN_SIZE(432, 262)
33513339   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3352   MDRV_GFXDECODE(gfxdecodeinfo)
3340   MDRV_GFXDECODE(toaplan2)
33533341   MDRV_PALETTE_LENGTH(2048)
33543342
33553343   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
33863374   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33873375   MDRV_SCREEN_SIZE(432, 262)
33883376   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3389   MDRV_GFXDECODE(gfxdecodeinfo_2)
3377   MDRV_GFXDECODE(2)
33903378   MDRV_PALETTE_LENGTH(2048)
33913379
33923380   MDRV_VIDEO_START(toaplan2_1)
r1051r1052
34273415   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
34283416   MDRV_SCREEN_SIZE(432, 262)
34293417   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3430   MDRV_GFXDECODE(gfxdecodeinfo)
3418   MDRV_GFXDECODE(toaplan2)
34313419   MDRV_PALETTE_LENGTH(2048)
34323420
34333421   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
34613449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
34623450   MDRV_SCREEN_SIZE(432, 262)
34633451   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3464   MDRV_GFXDECODE(gfxdecodeinfo)
3452   MDRV_GFXDECODE(toaplan2)
34653453   MDRV_PALETTE_LENGTH(2048)
34663454
34673455   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
34973485   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
34983486   MDRV_SCREEN_SIZE(432, 262)
34993487   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3500   MDRV_GFXDECODE(truxton2_gfxdecodeinfo)
3488   MDRV_GFXDECODE(truxton2)
35013489   MDRV_PALETTE_LENGTH(2048)
35023490
35033491   MDRV_VIDEO_START(truxton2_0)
r1051r1052
35363524   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
35373525   MDRV_SCREEN_SIZE(432, 262)
35383526   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3539   MDRV_GFXDECODE(gfxdecodeinfo)
3527   MDRV_GFXDECODE(toaplan2)
35403528   MDRV_PALETTE_LENGTH(2048)
35413529
35423530   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
35733561   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
35743562   MDRV_SCREEN_SIZE(432, 262)
35753563   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3576   MDRV_GFXDECODE(gfxdecodeinfo)
3564   MDRV_GFXDECODE(toaplan2)
35773565   MDRV_PALETTE_LENGTH(2048)
35783566
35793567   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
36093597   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
36103598   MDRV_SCREEN_SIZE(432, 262)
36113599   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3612   MDRV_GFXDECODE(gfxdecodeinfo)
3600   MDRV_GFXDECODE(toaplan2)
36133601   MDRV_PALETTE_LENGTH(2048)
36143602
36153603   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
36483636   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
36493637   MDRV_SCREEN_SIZE(432, 262)
36503638   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3651   MDRV_GFXDECODE(truxton2_gfxdecodeinfo)
3639   MDRV_GFXDECODE(truxton2)
36523640   MDRV_PALETTE_LENGTH(2048)
36533641
36543642   MDRV_VIDEO_START(truxton2_0)
r1051r1052
36823670   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
36833671   MDRV_SCREEN_SIZE(432, 262)
36843672   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3685   MDRV_GFXDECODE(fixeighb_gfxdecodeinfo)
3673   MDRV_GFXDECODE(fixeighb)
36863674   MDRV_PALETTE_LENGTH(2048)
36873675
36883676   MDRV_VIDEO_START(truxton2_0)
r1051r1052
37203708   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37213709   MDRV_SCREEN_SIZE(432, 262)
37223710   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3723   MDRV_GFXDECODE(gfxdecodeinfo)
3711   MDRV_GFXDECODE(toaplan2)
37243712   MDRV_PALETTE_LENGTH(2048)
37253713
37263714   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
37573745   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37583746   MDRV_SCREEN_SIZE(432, 262)
37593747   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3760   MDRV_GFXDECODE(gfxdecodeinfo_2)
3748   MDRV_GFXDECODE(2)
37613749   MDRV_PALETTE_LENGTH(2048)
37623750
37633751   MDRV_VIDEO_START(toaplan2_1)
r1051r1052
37923780   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37933781   MDRV_SCREEN_SIZE(432, 262)
37943782   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3795   MDRV_GFXDECODE(gfxdecodeinfo)
3783   MDRV_GFXDECODE(toaplan2)
37963784   MDRV_PALETTE_LENGTH(2048)
37973785
37983786   MDRV_VIDEO_START(toaplan2_0)
r1051r1052
38313819   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
38323820   MDRV_SCREEN_SIZE(432, 262)
38333821   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3834   MDRV_GFXDECODE(raizing_gfxdecodeinfo)
3822   MDRV_GFXDECODE(raizing)
38353823   MDRV_PALETTE_LENGTH(2048)
38363824
38373825   MDRV_VIDEO_START(bgaregga_0)
r1051r1052
38703858   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
38713859   MDRV_SCREEN_SIZE(432, 262)
38723860   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3873   MDRV_GFXDECODE(raizing_gfxdecodeinfo)
3861   MDRV_GFXDECODE(raizing)
38743862   MDRV_PALETTE_LENGTH(2048)
38753863
38763864   MDRV_VIDEO_START(bgaregga_0)
r1051r1052
39093897   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39103898   MDRV_SCREEN_SIZE(432, 262)
39113899   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3912   MDRV_GFXDECODE(raizing_gfxdecodeinfo)
3900   MDRV_GFXDECODE(raizing)
39133901   MDRV_PALETTE_LENGTH(2048)
39143902
39153903   MDRV_VIDEO_START(bgaregga_0)
r1051r1052
39493937   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39503938   MDRV_SCREEN_SIZE(432, 262)
39513939   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3952   MDRV_GFXDECODE(batrider_gfxdecodeinfo)
3940   MDRV_GFXDECODE(batrider)
39533941   MDRV_PALETTE_LENGTH(2048)
39543942
39553943   MDRV_VIDEO_START(batrider_0)
r1051r1052
39923980   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39933981   MDRV_SCREEN_SIZE(432, 262)
39943982   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
3995   MDRV_GFXDECODE(batrider_gfxdecodeinfo)
3983   MDRV_GFXDECODE(batrider)
39963984   MDRV_PALETTE_LENGTH(2048)
39973985
39983986   MDRV_VIDEO_START(batrider_0)
src/mame/drivers/mjkjidai.c
r1051r1052
337337   32*8
338338};
339339
340static const gfx_decode gfxdecodeinfo[] =
341{
342   { REGION_GFX1, 0, &charlayout,   0, 32 },
343   { REGION_GFX1, 0, &spritelayout, 0, 16 },
344   { -1 }
345};
340static GFXDECODE_START( mjkjidai )
341   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 32 )
342   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 16 )
343GFXDECODE_END
346344
347345
348346static struct CustomSound_interface adpcm_interface =
r1051r1052
370368   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
371369   MDRV_SCREEN_SIZE(64*8, 32*8)
372370   MDRV_SCREEN_VISIBLE_AREA(3*8, 61*8-1, 2*8, 30*8-1)
373   MDRV_GFXDECODE(gfxdecodeinfo)
371   MDRV_GFXDECODE(mjkjidai)
374372   MDRV_PALETTE_LENGTH(0x100)
375373
376374   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/jchan.c
r1051r1052
660660
661661// we don't decode the sprites, they are non-tile based and RLE encoded!, see suprnova.c */
662662
663static const gfx_decode gfxdecodeinfo[] =
664{
665//  { REGION_GFX1, 0, &char2layout,   0, 512  },
666//  { REGION_GFX2, 0, &char2layout,   0, 512  },
667   { REGION_GFX3, 0, &tilelayout,   16384, 16384  },
668   { -1 }
669};
663static GFXDECODE_START( jchan )
664//  GFXDECODE_ENTRY( REGION_GFX1, 0, char2layout,   0, 512  )
665//  GFXDECODE_ENTRY( REGION_GFX2, 0, char2layout,   0, 512  )
666   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,   16384, 16384  )
667GFXDECODE_END
670668
671669
672670/* input ports */
r1051r1052
758756   MDRV_SCREEN_REFRESH_RATE(60)
759757   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
760758
761   MDRV_GFXDECODE(gfxdecodeinfo)
759   MDRV_GFXDECODE(jchan)
762760
763761   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
764762   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/jailbrek.c
r1051r1052
214214   128*8   /* every sprite takes 128 consecutive bytes */
215215};
216216
217static const gfx_decode gfxdecodeinfo[] =
218{
219   { REGION_GFX1, 0, &charlayout,   0, 16 }, /* characters */
220   { REGION_GFX2, 0, &spritelayout, 16*16, 16 }, /* sprites */
221   { -1 }
222};
217static GFXDECODE_START( jailbrek )
218   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 ) /* characters */
219   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 ) /* sprites */
220GFXDECODE_END
223221
224222
225223
r1051r1052
253251   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
254252   MDRV_SCREEN_SIZE(32*8, 32*8)
255253   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
256   MDRV_GFXDECODE(gfxdecodeinfo)
254   MDRV_GFXDECODE(jailbrek)
257255   MDRV_PALETTE_LENGTH(32)
258256   MDRV_COLORTABLE_LENGTH(512)
259257
src/mame/drivers/couple.c
r1051r1052
422422   16*8
423423};
424424
425static const gfx_decode gfxdecodeinfo[] =
426{
427   { REGION_GFX1, 0, &tiles8x8x3_layout, 0, 32 },
428   { REGION_GFX2, 0, &tiles8x8x4_layout, 0, 16 },
429   { REGION_GFX1, 8, &tiles8x8x3_layout, 0, 32 }, //flipped tiles
430   { REGION_GFX2, 8, &tiles8x8x4_layout, 0, 16 }, //flipped tiles
431   { -1 }
432};
425static GFXDECODE_START( couple )
426   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8x3_layout, 0, 32 )
427   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8x4_layout, 0, 16 )
428   GFXDECODE_ENTRY( REGION_GFX1, 8, tiles8x8x3_layout, 0, 32 ) //flipped tiles
429   GFXDECODE_ENTRY( REGION_GFX2, 8, tiles8x8x4_layout, 0, 16 ) //flipped tiles
430GFXDECODE_END
433431
434432static MACHINE_DRIVER_START( couple )
435433   MDRV_CPU_ADD(Z80,18432000/6)       /* ?? */
r1051r1052
446444   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
447445   MDRV_SCREEN_SIZE(64*8, 32*8)
448446   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
449   MDRV_GFXDECODE(gfxdecodeinfo)
447   MDRV_GFXDECODE(couple)
450448   MDRV_PALETTE_LENGTH(0x100)
451449   MDRV_PALETTE_INIT(couple)
452450
src/mame/drivers/sgladiat.c
r1051r1052
4949   256
5050};
5151
52static const gfx_decode tnk3_gfxdecodeinfo[] =
53{
54   { REGION_GFX1, 0x0, &tile_layout,   128*3,  8 },
55   { REGION_GFX2, 0x0, &tile_layout,   128*1, 16 },
56   { REGION_GFX3, 0x0, &sprite_layout,   128*0, 16 },
57   { -1 }
58};
52static GFXDECODE_START( tnk3 )
53   GFXDECODE_ENTRY( REGION_GFX1, 0x0, tile_layout,   128*3,  8 )
54   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile_layout,   128*1, 16 )
55   GFXDECODE_ENTRY( REGION_GFX3, 0x0, sprite_layout,   128*0, 16 )
56GFXDECODE_END
5957
6058/************************************************************************/
6159
r1051r1052
168166   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
169167   MDRV_SCREEN_SIZE(36*8, 28*8)
170168   MDRV_SCREEN_VISIBLE_AREA(0*8+16, 36*8-1-16, 1*8, 28*8-1)
171   MDRV_GFXDECODE(tnk3_gfxdecodeinfo)
169   MDRV_GFXDECODE(tnk3)
172170   MDRV_PALETTE_LENGTH(1024)
173171
174172   MDRV_PALETTE_INIT(aso)
src/mame/drivers/mlanding.c
r1051r1052
342342   cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
343343}
344344
345static const gfx_decode gfxdecodeinfo[] =
346{
347   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
348   { -1 }
349};
345static GFXDECODE_START( mlanding )
346   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
347GFXDECODE_END
350348
351349static struct MSM5205interface msm5205_interface =
352350{
r1051r1052
386384   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
387385   MDRV_SCREEN_SIZE(512, 512)
388386   MDRV_SCREEN_VISIBLE_AREA(0, 511, 14*8, 511)
389   MDRV_GFXDECODE(gfxdecodeinfo)
387   MDRV_GFXDECODE(mlanding)
390388   MDRV_PALETTE_LENGTH(512*16)
391389
392390   MDRV_VIDEO_START(mlanding)
src/mame/drivers/gaelco.c
r1051r1052
4444   32*8                                                         \
4545}
4646
47#define GFXDECODEINFO(NUM,ENTRIES) static const gfx_decode gfxdecodeinfo_##NUM[] =   \
48{                                                                  \
49   { REGION_GFX1, 0x000000, &tilelayout8_##NUM,0,   ENTRIES },                     \
50   { REGION_GFX1, 0x000000, &tilelayout16_##NUM,0,   ENTRIES },                     \
51   { -1 }                                                            \
52}
47#define GFXDECODEINFO(NUM,ENTRIES) \
48static GFXDECODE_START( NUM )\
49   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout8_##NUM,0,   ENTRIES )                     \
50   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout16_##NUM,0,   ENTRIES )                     \
51GFXDECODE_END
5352
53
5454/*============================================================================
5555                            BIG KARNAK
5656  ============================================================================*/
r1051r1052
233233   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
234234   MDRV_SCREEN_SIZE(32*16, 32*16)
235235   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
236   MDRV_GFXDECODE(gfxdecodeinfo_0x100000)
236   MDRV_GFXDECODE(0x100000)
237237   MDRV_PALETTE_LENGTH(1024)
238238
239239   MDRV_VIDEO_START(bigkarnk)
r1051r1052
482482   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
483483   MDRV_SCREEN_SIZE(32*16, 32*16)
484484   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
485   MDRV_GFXDECODE(gfxdecodeinfo_0x100000)
485   MDRV_GFXDECODE(0x100000)
486486   MDRV_PALETTE_LENGTH(1024)
487487
488488   MDRV_VIDEO_START(maniacsq)
r1051r1052
11191119   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11201120   MDRV_SCREEN_SIZE(32*16, 32*16)
11211121   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
1122   MDRV_GFXDECODE(gfxdecodeinfo_0x100000)
1122   MDRV_GFXDECODE(0x100000)
11231123   MDRV_PALETTE_LENGTH(1024)
11241124
11251125   MDRV_VIDEO_START(maniacsq)
r1051r1052
12861286   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12871287   MDRV_SCREEN_SIZE(32*16, 32*16)
12881288   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
1289   MDRV_GFXDECODE(gfxdecodeinfo_0x100000)
1289   MDRV_GFXDECODE(0x100000)
12901290   MDRV_PALETTE_LENGTH(1024)
12911291
12921292   MDRV_VIDEO_START(maniacsq)
src/mame/drivers/bankp.c
r1051r1052
261261   8*8   /* every char takes 8 consecutive bytes */
262262};
263263
264static const gfx_decode gfxdecodeinfo[] =
265{
266   { REGION_GFX1, 0, &charlayout,      0, 32 },
267   { REGION_GFX2, 0, &charlayout2,  32*4, 16 },
268   { -1 }
269};
264static GFXDECODE_START( bankp )
265   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 32 )
266   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout2,  32*4, 16 )
267GFXDECODE_END
270268
271269
272270
r1051r1052
287285   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
288286   MDRV_SCREEN_SIZE(32*8, 32*8)
289287   MDRV_SCREEN_VISIBLE_AREA(3*8, 31*8-1, 2*8, 30*8-1)
290   MDRV_GFXDECODE(gfxdecodeinfo)
288   MDRV_GFXDECODE(bankp)
291289   MDRV_PALETTE_LENGTH(32*4+16*8)
292290
293291   MDRV_PALETTE_INIT(bankp)
src/mame/drivers/tankbust.c
r1051r1052
352352   8*8      /* every char takes 8 consecutive bytes */
353353};
354354
355static const gfx_decode gfxdecodeinfo[] =
356{
357   { REGION_GFX1, 0, &spritelayout,   0x00, 2 },   /* sprites 32x32  (2 * 16 colors) */
358   { REGION_GFX2, 0, &charlayout,      0x20, 8 },   /* bg tilemap characters */
359   { REGION_GFX3, 0, &charlayout2,      0x60, 16  },   /* txt tilemap characters*/
360   { -1 }
361};
355static GFXDECODE_START( tankbust )
356   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,   0x00, 2 )   /* sprites 32x32  (2 * 16 colors) */
357   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,      0x20, 8 )   /* bg tilemap characters */
358   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout2,      0x60, 16  )   /* txt tilemap characters*/
359GFXDECODE_END
362360
363361static struct AY8910interface ay8910_interface =
364362{
r1051r1052
390388   MDRV_SCREEN_SIZE   ( 64*8, 32*8 )
391389   MDRV_SCREEN_VISIBLE_AREA  ( 16*8, 56*8-1, 1*8, 31*8-1 )
392390//  MDRV_SCREEN_VISIBLE_AREA  (  0*8, 64*8-1, 1*8, 31*8-1 )
393   MDRV_GFXDECODE( gfxdecodeinfo )
391   MDRV_GFXDECODE( tankbust )
394392
395393   MDRV_PALETTE_LENGTH( 128 )
396394   MDRV_PALETTE_INIT  ( tankbust )
src/mame/drivers/wecleman.c
r1051r1052
656656}
657657
658658/* Protection - an external multiplyer connected to the sound CPU */
659READ8_HANDLER( multiply_r )
659static READ8_HANDLER( multiply_r )
660660{
661661   return (multiply_reg[0] * multiply_reg[1]) & 0xFF;
662662}
663663
664WRITE8_HANDLER( multiply_w )
664static WRITE8_HANDLER( multiply_w )
665665{
666666   multiply_reg[offset] = data;
667667}
r1051r1052
10461046   NULL
10471047};
10481048
1049static const gfx_decode wecleman_gfxdecodeinfo[] =
1050{
1049static GFXDECODE_START( wecleman )
10511050   // REGION_GFX1 holds sprite, which are not decoded here
1052   { REGION_GFX2, 0, &wecleman_bg_layout,   0, 2048/8 },   // [0] bg + fg + txt
1053   { REGION_GFX3, 0, &wecleman_road_layout, 0, 2048/8 },   // [1] road
1054   { -1 }
1055};
1051   GFXDECODE_ENTRY( REGION_GFX2, 0, wecleman_bg_layout,   0, 2048/8 )   // [0] bg + fg + txt
1052   GFXDECODE_ENTRY( REGION_GFX3, 0, wecleman_road_layout, 0, 2048/8 )   // [1] road
1053GFXDECODE_END
10561054
10571055
10581056/***************************************************************************
r1051r1052
10821080   NULL
10831081};
10841082
1085static const gfx_decode hotchase_gfxdecodeinfo[] =
1086{
1083static GFXDECODE_START( hotchase )
10871084   // REGION_GFX1 holds sprite, which are not decoded here
10881085   // REGION_GFX2 and 3 are for the 051316
1089   { REGION_GFX4, 0, &hotchase_road_layout, 0x70*16, 16 },   // road
1090   { -1 }
1091};
1086   GFXDECODE_ENTRY( REGION_GFX4, 0, hotchase_road_layout, 0x70*16, 16 )   // road
1087GFXDECODE_END
10921088
10931089
10941090/***************************************************************************
r1051r1052
11391135   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
11401136   MDRV_SCREEN_SIZE(320 +16, 224 +16)
11411137   MDRV_SCREEN_VISIBLE_AREA(0 +8, 320-1 +8, 0 +8, 224-1 +8)
1142   MDRV_GFXDECODE(wecleman_gfxdecodeinfo)
1138   MDRV_GFXDECODE(wecleman)
11431139
11441140   MDRV_PALETTE_LENGTH(2048)
11451141
r1051r1052
11941190   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11951191   MDRV_SCREEN_SIZE(320, 224)
11961192   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
1197   MDRV_GFXDECODE(hotchase_gfxdecodeinfo)
1193   MDRV_GFXDECODE(hotchase)
11981194   MDRV_PALETTE_LENGTH(2048*2)
11991195
12001196   MDRV_VIDEO_START(hotchase)
src/mame/drivers/crbaloon.c
r1051r1052
300300};
301301
302302
303static const gfx_decode gfxdecodeinfo[] =
304{
305   { REGION_GFX1, 0, &charlayout,   0, 16 },
306   { REGION_GFX2, 0, &spritelayout, 0, 16 },
307   { -1 }
308};
303static GFXDECODE_START( crbaloon )
304   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
305   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 16 )
306GFXDECODE_END
309307
310308
311309static struct SN76477interface sn76477_interface =
r1051r1052
354352   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
355353   MDRV_SCREEN_SIZE(32*8, 32*8)
356354   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
357   MDRV_GFXDECODE(gfxdecodeinfo)
355   MDRV_GFXDECODE(crbaloon)
358356   MDRV_PALETTE_LENGTH(16)
359357   MDRV_COLORTABLE_LENGTH(16*2)
360358
r1051r1052
370368   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
371369
372370   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
373   MDRV_SOUND_CONFIG(crbaloon_discrete_interface)
371   MDRV_SOUND_CONFIG_DISCRETE(crbaloon)
374372   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
375373MACHINE_DRIVER_END
376374
src/mame/drivers/dmndrby.c
r1051r1052
125125   tiles8x64_layout_yoffset
126126};
127127
128static const gfx_decode gfxdecodeinfo[] =
129{
130   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
131   { REGION_GFX2, 0, &tiles8x64_layout, 0, 16 },
132   { REGION_GFX3, 0, &tiles8x8_layout2, 0, 16 },
128static GFXDECODE_START( dmndrby )
129   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
130   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x64_layout, 0, 16 )
131   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles8x8_layout2, 0, 16 )
133132
134   { -1 }
135};
133GFXDECODE_END
136134
137135VIDEO_START(dderby)
138136{
r1051r1052
189187   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
190188   MDRV_SCREEN_SIZE(256, 256)
191189   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
192   MDRV_GFXDECODE(gfxdecodeinfo)
190   MDRV_GFXDECODE(dmndrby)
193191   MDRV_PALETTE_LENGTH(0x100)
194192
195193   MDRV_VIDEO_START(dderby)
src/mame/drivers/seattle.c
r1051r1052
24912491   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
24922492   MDRV_SCREEN_SIZE(640, 480)
24932493   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
2494   MDRV_PALETTE_LENGTH(65536)
24952494
24962495   MDRV_VIDEO_START(seattle)
24972496   MDRV_VIDEO_UPDATE(seattle)
src/mame/drivers/portrait.c
r1051r1052
243243   8*16 /* character offset */
244244};
245245
246static const gfx_decode gfxdecodeinfo[] =
247{
248   { REGION_GFX1, 0x00000, &tile_layout, 0, 0x100 },
249   { -1 }
250};
246static GFXDECODE_START( portrait )
247   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, tile_layout, 0, 0x100 )
248GFXDECODE_END
251249
252250static MACHINE_DRIVER_START( portrait )
253251   MDRV_CPU_ADD(Z80, 4000000)     /* 4 MHz ? */
r1051r1052
268266   MDRV_SCREEN_SIZE(64*8, 64*8)
269267   MDRV_SCREEN_VISIBLE_AREA(0*8, 54*8-1, 0*8, 40*8-1)
270268
271   MDRV_GFXDECODE(gfxdecodeinfo)
269   MDRV_GFXDECODE(portrait)
272270   MDRV_PALETTE_LENGTH(0x800)
273271//  MDRV_PALETTE_INIT(portrait)
274272
src/mame/drivers/munchmo.c
r1051r1052
273273   256
274274};
275275
276static const gfx_decode gfxdecodeinfo[] =
277{
278   { REGION_GFX1, 0,      &char_layout,      0,  4 },   /* colors   0- 63 */
279   { REGION_GFX2, 0x1000, &tile_layout,     64,  4 },   /* colors  64-127 */
280   { REGION_GFX3, 0,      &sprite_layout1, 128, 16 },   /* colors 128-255 */
281   { REGION_GFX4, 0,      &sprite_layout2, 128, 16 },   /* colors 128-255 */
282   { -1 }
283};
276static GFXDECODE_START( munchmo )
277   GFXDECODE_ENTRY( REGION_GFX1, 0,      char_layout,      0,  4 )   /* colors   0- 63 */
278   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, tile_layout,     64,  4 )   /* colors  64-127 */
279   GFXDECODE_ENTRY( REGION_GFX3, 0,      sprite_layout1, 128, 16 )   /* colors 128-255 */
280   GFXDECODE_ENTRY( REGION_GFX4, 0,      sprite_layout2, 128, 16 )   /* colors 128-255 */
281GFXDECODE_END
284282
285283static MACHINE_DRIVER_START( munchmo )
286284
r1051r1052
302300   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
303301   MDRV_SCREEN_SIZE(256+32+32, 256)
304302   MDRV_SCREEN_VISIBLE_AREA(0, 255+32+32,0, 255-16)
305   MDRV_GFXDECODE(gfxdecodeinfo)
303   MDRV_GFXDECODE(munchmo)
306304   MDRV_PALETTE_LENGTH(256)
307305
308306   MDRV_PALETTE_INIT(mnchmobl)
src/mame/drivers/funkybee.c
r1051r1052
286286   4*16*8
287287};
288288
289static const gfx_decode gfxdecodeinfo[] =
290{
291   { REGION_GFX1, 0, &charlayout,     0, 8 },
292   { REGION_GFX2, 0, &charlayout,     0, 8 },
293   { REGION_GFX1, 0, &spritelayout, 16, 4 },
294   { REGION_GFX2, 0, &spritelayout, 16, 4 },
295   { -1 }
296};
289static GFXDECODE_START( funkybee )
290   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 8 )
291   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,     0, 8 )
292   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 16, 4 )
293   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16, 4 )
294GFXDECODE_END
297295
298296
299297static struct AY8910interface ay8910_interface =
r1051r1052
318316   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
319317   MDRV_SCREEN_SIZE(32*8, 32*8)
320318   MDRV_SCREEN_VISIBLE_AREA(12, 32*8-1-12, 0*8, 28*8-1)
321   MDRV_GFXDECODE(gfxdecodeinfo)
319   MDRV_GFXDECODE(funkybee)
322320   MDRV_PALETTE_LENGTH(32)
323321
324322   MDRV_PALETTE_INIT(funkybee)
src/mame/drivers/tetrisp2.c
r1051r1052
968968   16*16*8
969969};
970970
971static const gfx_decode tetrisp2_gfxdecodeinfo[] =
972{
973   { REGION_GFX1, 0, &layout_8x8x8,   0x0000, 0x10 }, // [0] Sprites
974   { REGION_GFX2, 0, &layout_16x16x8, 0x1000, 0x10 }, // [1] Background
975   { REGION_GFX3, 0, &layout_16x16x8, 0x2000, 0x10 }, // [2] Rotation
976   { REGION_GFX4, 0, &layout_8x8x8,   0x6000, 0x10 }, // [3] Foreground
977   { -1 }
978};
971static GFXDECODE_START( tetrisp2 )
972   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8,   0x0000, 0x10 ) // [0] Sprites
973   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x8, 0x1000, 0x10 ) // [1] Background
974   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8, 0x2000, 0x10 ) // [2] Rotation
975   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,   0x6000, 0x10 ) // [3] Foreground
976GFXDECODE_END
979977
980static const gfx_decode rocknms_gfxdecodeinfo[] =
981{
982   { REGION_GFX1, 0, &layout_8x8x8,   0x0000, 0x10 }, // [0] Sprites
983   { REGION_GFX2, 0, &layout_16x16x8, 0x1000, 0x10 }, // [1] Background
984   { REGION_GFX3, 0, &layout_16x16x8, 0x2000, 0x10 }, // [2] Rotation
985   { REGION_GFX4, 0, &layout_8x8x8,   0x6000, 0x10 }, // [3] Foreground
986   { REGION_GFX5, 0, &layout_8x8x8,   0x8000, 0x10 }, // [0] Sprites
987   { REGION_GFX6, 0, &layout_16x16x8, 0x9000, 0x10 }, // [1] Background
988   { REGION_GFX7, 0, &layout_16x16x8, 0xa000, 0x10 }, // [2] Rotation
989   { REGION_GFX8, 0, &layout_8x8x8,   0xe000, 0x10 }, // [3] Foreground
990   { -1 }
991};
978static GFXDECODE_START( rocknms )
979   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8,   0x0000, 0x10 ) // [0] Sprites
980   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x8, 0x1000, 0x10 ) // [1] Background
981   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8, 0x2000, 0x10 ) // [2] Rotation
982   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,   0x6000, 0x10 ) // [3] Foreground
983   GFXDECODE_ENTRY( REGION_GFX5, 0, layout_8x8x8,   0x8000, 0x10 ) // [0] Sprites
984   GFXDECODE_ENTRY( REGION_GFX6, 0, layout_16x16x8, 0x9000, 0x10 ) // [1] Background
985   GFXDECODE_ENTRY( REGION_GFX7, 0, layout_16x16x8, 0xa000, 0x10 ) // [2] Rotation
986   GFXDECODE_ENTRY( REGION_GFX8, 0, layout_8x8x8,   0xe000, 0x10 ) // [3] Foreground
987GFXDECODE_END
992988
993989
994990/***************************************************************************
r1051r1052
10911087   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10921088   MDRV_SCREEN_SIZE(0x140, 0xe0)
10931089   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1)
1094   MDRV_GFXDECODE(tetrisp2_gfxdecodeinfo)
1090   MDRV_GFXDECODE(tetrisp2)
10951091   MDRV_PALETTE_LENGTH(0x8000)
10961092
10971093   MDRV_VIDEO_START(tetrisp2)
r1051r1052
11231119   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11241120   MDRV_SCREEN_SIZE(0x140, 0xe0)
11251121   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1)
1126   MDRV_GFXDECODE(tetrisp2_gfxdecodeinfo)
1122   MDRV_GFXDECODE(tetrisp2)
11271123   MDRV_PALETTE_LENGTH(0x8000)
11281124
11291125   MDRV_VIDEO_START(rockntread)
r1051r1052
11571153   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11581154   MDRV_SCREEN_SIZE(0x140, 0xe0)
11591155   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1)
1160   MDRV_GFXDECODE(tetrisp2_gfxdecodeinfo)
1156   MDRV_GFXDECODE(tetrisp2)
11611157   MDRV_PALETTE_LENGTH(0x8000)
11621158
11631159   MDRV_VIDEO_START(rockntread)
r1051r1052
11891185   /* video hardware */
11901186   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
11911187
1192   MDRV_GFXDECODE(rocknms_gfxdecodeinfo)
1188   MDRV_GFXDECODE(rocknms)
11931189   MDRV_PALETTE_LENGTH(0x10000)
11941190   MDRV_DEFAULT_LAYOUT(layout_rocknms)
11951191
src/mame/drivers/lastduel.c
r1051r1052
212212   64*16
213213};
214214
215static const gfx_decode lastduel_gfxdecodeinfo[] =
216{
217   { REGION_GFX1, 0,&sprite_layout, 0x200, 16 },   /* colors 0x200-0x2ff */
218   { REGION_GFX2, 0,&text_layout,   0x300, 16 },   /* colors 0x300-0x33f */
219   { REGION_GFX3, 0,&tile_layout,   0x000, 16 },   /* colors 0x000-0x0ff */
220   { REGION_GFX4, 0,&tile_layout,   0x100, 16 },   /* colors 0x100-0x1ff */
221   { -1 }
222};
215static GFXDECODE_START( lastduel )
216   GFXDECODE_ENTRY( REGION_GFX1, 0,sprite_layout, 0x200, 16 )   /* colors 0x200-0x2ff */
217   GFXDECODE_ENTRY( REGION_GFX2, 0,text_layout,   0x300, 16 )   /* colors 0x300-0x33f */
218   GFXDECODE_ENTRY( REGION_GFX3, 0,tile_layout,   0x000, 16 )   /* colors 0x000-0x0ff */
219   GFXDECODE_ENTRY( REGION_GFX4, 0,tile_layout,   0x100, 16 )   /* colors 0x100-0x1ff */
220GFXDECODE_END
223221
224static const gfx_decode madgear_gfxdecodeinfo[] =
225{
226   { REGION_GFX1, 0,&sprite_layout, 0x200, 16 },   /* colors 0x200-0x2ff */
227   { REGION_GFX2, 0,&text_layout,   0x300, 16 },   /* colors 0x300-0x33f */
228   { REGION_GFX3, 0,&madgear_tile,  0x000, 16 },   /* colors 0x000-0x0ff */
229   { REGION_GFX4, 0,&madgear_tile2, 0x100, 16 },   /* colors 0x100-0x1ff */
230   { -1 }
231};
222static GFXDECODE_START( madgear )
223   GFXDECODE_ENTRY( REGION_GFX1, 0,sprite_layout, 0x200, 16 )   /* colors 0x200-0x2ff */
224   GFXDECODE_ENTRY( REGION_GFX2, 0,text_layout,   0x300, 16 )   /* colors 0x300-0x33f */
225   GFXDECODE_ENTRY( REGION_GFX3, 0,madgear_tile,  0x000, 16 )   /* colors 0x000-0x0ff */
226   GFXDECODE_ENTRY( REGION_GFX4, 0,madgear_tile2, 0x100, 16 )   /* colors 0x100-0x1ff */
227GFXDECODE_END
232228
233229/******************************************************************************/
234230
r1051r1052
274270   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
275271   MDRV_SCREEN_SIZE(64*8, 32*8)
276272   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
277   MDRV_GFXDECODE(lastduel_gfxdecodeinfo)
273   MDRV_GFXDECODE(lastduel)
278274   MDRV_PALETTE_LENGTH(1024)
279275
280276   MDRV_VIDEO_START(lastduel)
r1051r1052
312308   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
313309   MDRV_SCREEN_SIZE(64*8, 32*8)
314310   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
315   MDRV_GFXDECODE(madgear_gfxdecodeinfo)
311   MDRV_GFXDECODE(madgear)
316312   MDRV_PALETTE_LENGTH(1024)
317313
318314   MDRV_VIDEO_START(madgear)
src/mame/drivers/alpha68k.c
r1051r1052
204204
205205static UINT16 *shared_ram;
206206static int invert_controls;
207int microcontroller_id;
207int alpha68k_microcontroller_id;
208208static int coin_id;
209209
210#define microcontroller_id alpha68k_microcontroller_id
211
210212static unsigned trigstate=0, deposits1=0, deposits2=0, credits=0;
211213
212214/******************************************************************************/
213215
214216/* resets the values related to the microcontroller */
215MACHINE_RESET( common )
217static MACHINE_RESET( common )
216218{
217219   trigstate = 0;
218220   deposits1 = 0;
r1051r1052
19701972
19711973/******************************************************************************/
19721974
1973static const gfx_decode alpha68k_II_gfxdecodeinfo[] =
1974{
1975   { REGION_GFX1, 0, &charlayout,   0,  16 },
1976   { REGION_GFX2, 0, &spritelayout, 0, 128 },
1977   { -1 }
1978};
1975static GFXDECODE_START( alpha68k_II )
1976   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0,  16 )
1977   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 128 )
1978GFXDECODE_END
19791979
1980static const gfx_decode alpha68k_V_gfxdecodeinfo[] =
1981{
1982   { REGION_GFX1, 0, &charlayout_V,    0,  16 },
1983   { REGION_GFX2, 0, &spritelayout_V,  0, 256 },
1984   { -1 }
1985};
1980static GFXDECODE_START( alpha68k_V )
1981   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_V,    0,  16 )
1982   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_V,  0, 256 )
1983GFXDECODE_END
19861984
1987static const gfx_decode paddle_gfxdecodeinfo[] =
1988{
1989   { REGION_GFX1, 0, &paddle_layout,  0, 64 },
1990   { -1 }
1991};
1985static GFXDECODE_START( paddle )
1986   GFXDECODE_ENTRY( REGION_GFX1, 0, paddle_layout,  0, 64 )
1987GFXDECODE_END
19921988
1993static const gfx_decode tnexspce_gfxdecodeinfo[] =
1994{
1995   { REGION_GFX1, 0, &tnexspce_layout,  0, 64 },
1996   { -1 }
1997};
1989static GFXDECODE_START( tnexspce )
1990   GFXDECODE_ENTRY( REGION_GFX1, 0, tnexspce_layout,  0, 64 )
1991GFXDECODE_END
19981992
1999static const gfx_decode sstingry_gfxdecodeinfo[] =
2000{
2001   { REGION_GFX1, 0x00000, &sting_layout1,  0, 32 },
2002   { REGION_GFX1, 0x00000, &sting_layout2,  0, 32 },
2003   { REGION_GFX1, 0x10000, &sting_layout1,  0, 32 },
2004   { REGION_GFX1, 0x10000, &sting_layout3,  0, 32 },
2005   { -1 }
2006};
1993static GFXDECODE_START( sstingry )
1994   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, sting_layout1,  0, 32 )
1995   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, sting_layout2,  0, 32 )
1996   GFXDECODE_ENTRY( REGION_GFX1, 0x10000, sting_layout1,  0, 32 )
1997   GFXDECODE_ENTRY( REGION_GFX1, 0x10000, sting_layout3,  0, 32 )
1998GFXDECODE_END
20071999
2008static const gfx_decode kyros_gfxdecodeinfo[] =
2009{
2010   { REGION_GFX1, 0x00000, &kyros_char_layout1,  0, 32 },
2011   { REGION_GFX1, 0x00000, &kyros_char_layout2,  0, 32 },
2012   { REGION_GFX1, 0x18000, &kyros_char_layout1,  0, 32 },
2013   { REGION_GFX1, 0x18000, &kyros_char_layout2,  0, 32 },
2014   { REGION_GFX1, 0x30000, &kyros_char_layout1,  0, 32 },
2015   { REGION_GFX1, 0x30000, &kyros_char_layout2,  0, 32 },
2016   { REGION_GFX1, 0x48000, &kyros_char_layout1,  0, 32 },
2017   { REGION_GFX1, 0x48000, &kyros_char_layout2,  0, 32 },
2018   { -1 }
2019};
2000static GFXDECODE_START( kyros )
2001   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, kyros_char_layout1,  0, 32 )
2002   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, kyros_char_layout2,  0, 32 )
2003   GFXDECODE_ENTRY( REGION_GFX1, 0x18000, kyros_char_layout1,  0, 32 )
2004   GFXDECODE_ENTRY( REGION_GFX1, 0x18000, kyros_char_layout2,  0, 32 )
2005   GFXDECODE_ENTRY( REGION_GFX1, 0x30000, kyros_char_layout1,  0, 32 )
2006   GFXDECODE_ENTRY( REGION_GFX1, 0x30000, kyros_char_layout2,  0, 32 )
2007   GFXDECODE_ENTRY( REGION_GFX1, 0x48000, kyros_char_layout1,  0, 32 )
2008   GFXDECODE_ENTRY( REGION_GFX1, 0x48000, kyros_char_layout2,  0, 32 )
2009GFXDECODE_END
20202010
2021static const gfx_decode jongbou_gfxdecodeinfo[] =
2022{
2023   { REGION_GFX1, 0, &jongbou_layout1,  0, 32 },
2024   { REGION_GFX1, 0, &jongbou_layout2,  0, 32 },
2025   { REGION_GFX1, 0, &jongbou_layout3,  0, 32 },
2026   { REGION_GFX1, 0, &jongbou_layout4,  0, 32 },
2027   { REGION_GFX1, 0, &jongbou_layout5,  0, 32 },
2028   { -1 }
2029};
2011static GFXDECODE_START( jongbou )
2012   GFXDECODE_ENTRY( REGION_GFX1, 0, jongbou_layout1,  0, 32 )
2013   GFXDECODE_ENTRY( REGION_GFX1, 0, jongbou_layout2,  0, 32 )
2014   GFXDECODE_ENTRY( REGION_GFX1, 0, jongbou_layout3,  0, 32 )
2015   GFXDECODE_ENTRY( REGION_GFX1, 0, jongbou_layout4,  0, 32 )
2016   GFXDECODE_ENTRY( REGION_GFX1, 0, jongbou_layout5,  0, 32 )
2017GFXDECODE_END
20302018
20312019/******************************************************************************/
20322020
r1051r1052
20872075   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20882076   MDRV_SCREEN_SIZE(32*8, 32*8)
20892077   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2090   MDRV_GFXDECODE(sstingry_gfxdecodeinfo)
2078   MDRV_GFXDECODE(sstingry)
20912079   MDRV_PALETTE_LENGTH(256)
20922080//AT
20932081   MDRV_COLORTABLE_LENGTH(256)
r1051r1052
21382126   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21392127   MDRV_SCREEN_SIZE(32*8, 32*8)
21402128   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2141   MDRV_GFXDECODE(kyros_gfxdecodeinfo)
2129   MDRV_GFXDECODE(kyros)
21422130   MDRV_PALETTE_LENGTH(256)
21432131   MDRV_COLORTABLE_LENGTH(256)
21442132
r1051r1052
21862174   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21872175   MDRV_SCREEN_SIZE(32*8, 32*8)
21882176   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2189   MDRV_GFXDECODE(jongbou_gfxdecodeinfo)
2177   MDRV_GFXDECODE(jongbou)
21902178   MDRV_PALETTE_LENGTH(256)
21912179   MDRV_COLORTABLE_LENGTH(256)
21922180
r1051r1052
22202208   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22212209   MDRV_SCREEN_SIZE(32*8, 32*8)
22222210   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2223   MDRV_GFXDECODE(paddle_gfxdecodeinfo)
2211   MDRV_GFXDECODE(paddle)
22242212//AT
22252213   MDRV_PALETTE_LENGTH(256)
22262214   MDRV_COLORTABLE_LENGTH(1024)
r1051r1052
22592247   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22602248   MDRV_SCREEN_SIZE(32*8, 32*8)
22612249   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2262   MDRV_GFXDECODE(alpha68k_II_gfxdecodeinfo)
2250   MDRV_GFXDECODE(alpha68k_II)
22632251   MDRV_PALETTE_LENGTH(2048)
22642252
22652253   MDRV_VIDEO_START(alpha68k)
r1051r1052
23092297   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23102298   MDRV_SCREEN_SIZE(32*8, 32*8)
23112299   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2312   MDRV_GFXDECODE(alpha68k_II_gfxdecodeinfo)
2300   MDRV_GFXDECODE(alpha68k_II)
23132301   MDRV_PALETTE_LENGTH(2048)
23142302
23152303   MDRV_VIDEO_START(alpha68k)
r1051r1052
23532341   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23542342   MDRV_SCREEN_SIZE(32*8, 32*8)
23552343   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2356   MDRV_GFXDECODE(alpha68k_V_gfxdecodeinfo)
2344   MDRV_GFXDECODE(alpha68k_V)
23572345   MDRV_PALETTE_LENGTH(4096)
23582346
23592347   MDRV_VIDEO_START(alpha68k)
r1051r1052
23962384   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23972385   MDRV_SCREEN_SIZE(32*8, 32*8)
23982386   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2399   MDRV_GFXDECODE(alpha68k_V_gfxdecodeinfo)
2387   MDRV_GFXDECODE(alpha68k_V)
24002388   MDRV_PALETTE_LENGTH(4096)
24012389
24022390   MDRV_VIDEO_START(alpha68k)
r1051r1052
24382426   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24392427   MDRV_SCREEN_SIZE(32*8, 32*8)
24402428   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2441   MDRV_GFXDECODE(tnexspce_gfxdecodeinfo)
2429   MDRV_GFXDECODE(tnexspce)
24422430
24432431   MDRV_PALETTE_LENGTH(256)
24442432   MDRV_COLORTABLE_LENGTH(1024)
src/mame/drivers/drgnmst.c
r1051r1052
349349};
350350
351351
352static const gfx_decode gfxdecodeinfo[] =
353{
354   { REGION_GFX1, 0, &drgnmst_char16x16_layout,   0,      0x200  }, /* sprite tiles */
355   { REGION_GFX2, 0, &drgnmst_char8x8_layout,     0x200,  0x200  }, /* fg tiles */
356   { REGION_GFX2, 0, &drgnmst_char16x16_layout,   0x0400, 0x200  }, /* md tiles */
357   { REGION_GFX2, 0, &drgnmst_char32x32_layout,   0x0600, 0x200  }, /* bg tiles */
358   { -1 }
359};
352static GFXDECODE_START( drgnmst )
353   GFXDECODE_ENTRY( REGION_GFX1, 0, drgnmst_char16x16_layout,   0,      0x200  ) /* sprite tiles */
354   GFXDECODE_ENTRY( REGION_GFX2, 0, drgnmst_char8x8_layout,     0x200,  0x200  ) /* fg tiles */
355   GFXDECODE_ENTRY( REGION_GFX2, 0, drgnmst_char16x16_layout,   0x0400, 0x200  ) /* md tiles */
356   GFXDECODE_ENTRY( REGION_GFX2, 0, drgnmst_char32x32_layout,   0x0600, 0x200  ) /* bg tiles */
357GFXDECODE_END
360358
361359
362360static MACHINE_DRIVER_START( drgnmst )
r1051r1052
371369   MDRV_SCREEN_REFRESH_RATE(60)
372370   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
373371
374   MDRV_GFXDECODE(gfxdecodeinfo)
372   MDRV_GFXDECODE(drgnmst)
375373
376374   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
377375   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/lucky8.c
r1051r1052
351351   NULL
352352};
353353
354static const gfx_decode gfxdecodeinfo[] =
355{
356   { REGION_GFX1, 0x0000, &charlayout,      0, 64 },
357   { REGION_GFX2, 0x0000, &spritelayout,  0, 64 },
358   { REGION_GFX2, 0x1000, &spritelayout2, 0, 64 },
359   { -1 }
360};
354static GFXDECODE_START( lucky8 )
355   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 64 )
356   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,  0, 64 )
357   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, spritelayout2, 0, 64 )
358GFXDECODE_END
361359
362360static struct AY8910interface ay8910_interface =
363361{
r1051r1052
382380   MDRV_SCREEN_SIZE(64*8, 32*8)
383381   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
384382
385   MDRV_GFXDECODE(gfxdecodeinfo)
383   MDRV_GFXDECODE(lucky8)
386384   MDRV_PALETTE_LENGTH(32)
387385   MDRV_COLORTABLE_LENGTH(256)
388386
src/mame/drivers/boxer.c
r1051r1052
291291};
292292
293293
294static const gfx_decode gfxdecodeinfo[] =
295{
296   { REGION_GFX1, 0, &sprite_layout, 0, 1 },
297   { REGION_GFX2, 0, &sprite_layout, 0, 1 },
298   { REGION_GFX3, 0, &tile_layout, 2, 1 },
299   { -1 }
300};
294static GFXDECODE_START( boxer )
295   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout, 0, 1 )
296   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 0, 1 )
297   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout, 2, 1 )
298GFXDECODE_END
301299
302300
303301static MACHINE_DRIVER_START(boxer)
r1051r1052
315313   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
316314   MDRV_SCREEN_SIZE(256, 262)
317315   MDRV_SCREEN_VISIBLE_AREA(8, 247, 0, 239)
318   MDRV_GFXDECODE(gfxdecodeinfo)
316   MDRV_GFXDECODE(boxer)
319317   MDRV_PALETTE_LENGTH(2)
320318   MDRV_COLORTABLE_LENGTH(4)
321319   MDRV_PALETTE_INIT(boxer)
src/mame/drivers/tmaster.c
r1051r1052
169169   8*32
170170};
171171
172static const gfx_decode gfxdecodeinfo[] =
173{
174   { REGION_GFX1, 0, &tmaster_layout,   0x300, 2  },
175   { REGION_GFX2, 0, &tmaster_layout,   0x300, 2  },
176   { REGION_GFX3, 0, &tmaster_layout,   0x300, 2  },
177   { -1 }
178};
172static GFXDECODE_START( tmaster )
173   GFXDECODE_ENTRY( REGION_GFX1, 0, tmaster_layout,   0x300, 2  )
174   GFXDECODE_ENTRY( REGION_GFX2, 0, tmaster_layout,   0x300, 2  )
175   GFXDECODE_ENTRY( REGION_GFX3, 0, tmaster_layout,   0x300, 2  )
176GFXDECODE_END
179177
180178static INTERRUPT_GEN( tmaster_interrupt )
181179{
r1051r1052
191189   MDRV_SCREEN_REFRESH_RATE(60)
192190   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
193191
194   MDRV_GFXDECODE(gfxdecodeinfo)
192   MDRV_GFXDECODE(tmaster)
195193
196194   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
197195   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/tcl.c
r1051r1052
8181};
8282
8383
84static const gfx_decode gfxdecodeinfo[] =
85{
86   { REGION_GFX1, 0, &charlayout,     0, 16 },
87   { REGION_GFX2, 0, &charlayout2,     0, 16 }, /* wrong */
88   { -1 }   /* end of array */
89};
84static GFXDECODE_START( tcl )
85   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
86   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout2,     0, 16 ) /* wrong */
87GFXDECODE_END
9088
9189static ppi8255_interface ppi8255_intf =
9290{
r1051r1052
119117   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
120118   MDRV_SCREEN_SIZE(32*8, 32*8)
121119   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
122   MDRV_GFXDECODE(gfxdecodeinfo)
120   MDRV_GFXDECODE(tcl)
123121   MDRV_PALETTE_LENGTH(16*16)
124122
125123   MDRV_VIDEO_START(tcl)
src/mame/drivers/freekick.c
r1051r1052
647647   16*16
648648};
649649
650static const gfx_decode gfxdecodeinfo[] =
651{
652   { REGION_GFX1, 0, &charlayout,   0x000, 32 },
653   { REGION_GFX2, 0, &spritelayout, 0x100, 32 },
654   { -1 }
655};
650static GFXDECODE_START( freekick )
651   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x000, 32 )
652   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x100, 32 )
653GFXDECODE_END
656654
657655/*************************************
658656 *
r1051r1052
669667   MDRV_SCREEN_REFRESH_RATE(60)
670668   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
671669
672   MDRV_GFXDECODE(gfxdecodeinfo)
670   MDRV_GFXDECODE(freekick)
673671
674672   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
675673   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/cischeat.c
r1051r1052
16611661                                Big Run
16621662**************************************************************************/
16631663
1664static const gfx_decode bigrun_gfxdecodeinfo[] =
1665{
1666   { REGION_GFX1, 0, &tiles_8x8,   0x0000, 16 }, // [0] Scroll 0
1667   { REGION_GFX2, 0, &tiles_8x8,   0x0100, 16 }, // [1] Scroll 1
1668   { REGION_GFX3, 0, &tiles_8x8,   0x0e00, 16 }, // [2] Scroll 2
1669   { REGION_GFX4, 0, &tiles_16x16,   0x0a00, 64 }, // [3] Sprites
1670   { REGION_GFX5, 0, &road_layout,   0x0600, 64 }, // [4] Road 0
1671   { REGION_GFX6, 0, &road_layout,   0x0200, 64 }, // [5] Road 1
1672   { -1 }
1673};
1664static GFXDECODE_START( bigrun )
1665   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles_8x8,   0x0000, 16 ) // [0] Scroll 0
1666   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles_8x8,   0x0100, 16 ) // [1] Scroll 1
1667   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles_8x8,   0x0e00, 16 ) // [2] Scroll 2
1668   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles_16x16,   0x0a00, 64 ) // [3] Sprites
1669   GFXDECODE_ENTRY( REGION_GFX5, 0, road_layout,   0x0600, 64 ) // [4] Road 0
1670   GFXDECODE_ENTRY( REGION_GFX6, 0, road_layout,   0x0200, 64 ) // [5] Road 1
1671GFXDECODE_END
16741672
16751673/**************************************************************************
16761674                                Cisco Heat
16771675**************************************************************************/
16781676
1679static const gfx_decode cischeat_gfxdecodeinfo[] =
1680{
1681   { REGION_GFX1, 0, &tiles_8x8,   0x0000, 32  }, // [0] Scroll 0
1682   { REGION_GFX2, 0, &tiles_8x8,   0x0200, 32  }, // [1] Scroll 1
1683   { REGION_GFX3, 0, &tiles_8x8,   0x0400, 32  }, // [2] Scroll 2
1684   { REGION_GFX4, 0, &tiles_16x16,   0x0e00, 128 }, // [3] Sprites
1685   { REGION_GFX5, 0, &road_layout,   0x0600, 64  }, // [4] Road 0
1686   { REGION_GFX6, 0, &road_layout,   0x0a00, 64  }, // [5] Road 1
1687   { -1 }
1688};
1677static GFXDECODE_START( cischeat )
1678   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles_8x8,   0x0000, 32  ) // [0] Scroll 0
1679   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles_8x8,   0x0200, 32  ) // [1] Scroll 1
1680   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles_8x8,   0x0400, 32  ) // [2] Scroll 2
1681   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles_16x16,   0x0e00, 128 ) // [3] Sprites
1682   GFXDECODE_ENTRY( REGION_GFX5, 0, road_layout,   0x0600, 64  ) // [4] Road 0
1683   GFXDECODE_ENTRY( REGION_GFX6, 0, road_layout,   0x0a00, 64  ) // [5] Road 1
1684GFXDECODE_END
16891685
16901686/**************************************************************************
16911687                            F1 GrandPrix Star
16921688**************************************************************************/
16931689
1694static const gfx_decode f1gpstar_gfxdecodeinfo[] =
1695{
1696   { REGION_GFX1, 0, &tiles_8x8,   0x0000, 16  }, // [0] Scroll 0
1697   { REGION_GFX2, 0, &tiles_8x8,   0x0100, 16  }, // [1] Scroll 1
1698   { REGION_GFX3, 0, &tiles_8x8,   0x0200, 16  }, // [2] Scroll 2
1699   { REGION_GFX4, 0, &tiles_16x16,   0x0b00, 128 }, // [3] Sprites
1700   { REGION_GFX5, 0, &road_layout,   0x0300, 64  }, // [4] Road 0
1701   { REGION_GFX6, 0, &road_layout,   0x0700, 64  }, // [5] Road 1
1702   { -1 }
1703};
1690static GFXDECODE_START( f1gpstar )
1691   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles_8x8,   0x0000, 16  ) // [0] Scroll 0
1692   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles_8x8,   0x0100, 16  ) // [1] Scroll 1
1693   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles_8x8,   0x0200, 16  ) // [2] Scroll 2
1694   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles_16x16,   0x0b00, 128 ) // [3] Sprites
1695   GFXDECODE_ENTRY( REGION_GFX5, 0, road_layout,   0x0300, 64  ) // [4] Road 0
1696   GFXDECODE_ENTRY( REGION_GFX6, 0, road_layout,   0x0700, 64  ) // [5] Road 1
1697GFXDECODE_END
17041698
17051699/**************************************************************************
17061700                                Scud Hammer
17071701**************************************************************************/
17081702
1709static const gfx_decode gfxdecodeinfo_scudhamm[] =
1710{
1711   { REGION_GFX1, 0, &tiles_8x8,         0x0000, 16  },   // [0] Scroll 0
1712   { REGION_GFX1, 0, &tiles_8x8,         0x0000, 16  },   // [1] UNUSED
1713   { REGION_GFX3, 0, &tiles_8x8,         0x0100, 16  },   // [2] Scroll 2
1714   { REGION_GFX4, 0, &tiles_16x16_quad,   0x0200, 128 },   // [3] sprites
1703static GFXDECODE_START( scudhamm )
1704   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles_8x8,         0x0000, 16  )   // [0] Scroll 0
1705   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles_8x8,         0x0000, 16  )   // [1] UNUSED
1706   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles_8x8,         0x0100, 16  )   // [2] Scroll 2
1707   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles_16x16_quad,   0x0200, 128 )   // [3] sprites
17151708   // No Road Layers
1716   { -1 }
1717};
1709GFXDECODE_END
17181710
17191711
17201712/***************************************************************************
r1051r1052
17841776   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17851777   MDRV_SCREEN_SIZE(256, 256)
17861778   MDRV_SCREEN_VISIBLE_AREA(0, 256-1,   0+16, 256-16-1)
1787   MDRV_GFXDECODE(bigrun_gfxdecodeinfo)
1779   MDRV_GFXDECODE(bigrun)
17881780   MDRV_PALETTE_LENGTH(16*16 * 3 + 64*16 * 2 + 64*16)   /* scroll 0,1,2; road 0,1; sprites */
17891781
17901782   MDRV_VIDEO_START(bigrun)
r1051r1052
18251817
18261818   /* video hardware */
18271819   MDRV_SCREEN_VISIBLE_AREA(0, 256-1,   0+16, 256-16-8-1)
1828   MDRV_GFXDECODE(cischeat_gfxdecodeinfo)
1820   MDRV_GFXDECODE(cischeat)
18291821   MDRV_PALETTE_LENGTH(32*16 * 3 + 64*16 * 2 + 128*16)   /* scroll 0,1,2; road 0,1; sprites */
18301822
18311823   MDRV_VIDEO_START(cischeat)
r1051r1052
18501842   MDRV_CPU_PROGRAM_MAP(f1gpstar_sound_readmem,f1gpstar_sound_writemem)
18511843
18521844   /* video hardware */
1853   MDRV_GFXDECODE(f1gpstar_gfxdecodeinfo)
1845   MDRV_GFXDECODE(f1gpstar)
18541846   MDRV_PALETTE_LENGTH(16*16 * 3 + 64*16 * 2 + 128*16)   /* scroll 0,1,2; road 0,1; sprites */
18551847
18561848   MDRV_VIDEO_START(f1gpstar)
r1051r1052
19111903   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19121904   MDRV_SCREEN_SIZE(256, 256)
19131905   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0 +16, 256-1 -16)
1914   MDRV_GFXDECODE(gfxdecodeinfo_scudhamm)
1906   MDRV_GFXDECODE(scudhamm)
19151907   MDRV_PALETTE_LENGTH(16*16+16*16+128*16)
19161908
19171909   MDRV_VIDEO_START(f1gpstar)
src/mame/drivers/namcos22.c
r1051r1052
10241024   64*16
10251025}; /* cg_layout */
10261026
1027static const gfx_decode gfxdecodeinfo[] =
1028{
1029   { 0,                   0, &namcos22_cg_layout,   0, 0x800 },
1030   { REGION_TEXTURE_TILE, 0, &texture_tile_layout,  0, 0x80 },
1031   { -1 },
1032};
1027static GFXDECODE_START( namcos22 )
1028   GFXDECODE_ENTRY( 0,                   0, namcos22_cg_layout,   0, 0x800 )
1029   GFXDECODE_ENTRY( REGION_TEXTURE_TILE, 0, texture_tile_layout,  0, 0x80 )
1030GFXDECODE_END
10331031
1034static const gfx_decode gfxdecodeinfo_super[] =
1035{
1036   { 0,                   0, &namcos22_cg_layout,   0, 0x800 },
1037   { REGION_TEXTURE_TILE, 0, &texture_tile_layout,  0, 0x80 },
1038   { REGION_SPRITE,       0, &sprite_layout,        0, 0x80 },
1039   { -1 },
1040};
1032static GFXDECODE_START( super )
1033   GFXDECODE_ENTRY( 0,                   0, namcos22_cg_layout,   0, 0x800 )
1034   GFXDECODE_ENTRY( REGION_TEXTURE_TILE, 0, texture_tile_layout,  0, 0x80 )
1035   GFXDECODE_ENTRY( REGION_SPRITE,       0, sprite_layout,        0, 0x80 )
1036GFXDECODE_END
10411037
10421038/* prelim! */
10431039static READ32_HANDLER( namcos22_C139_SCI_r )
r1051r1052
18361832   MDRV_SCREEN_SIZE(NAMCOS22_NUM_COLS*16,NAMCOS22_NUM_ROWS*16)
18371833   MDRV_SCREEN_VISIBLE_AREA(0,NAMCOS22_NUM_COLS*16-1,0,NAMCOS22_NUM_ROWS*16-1)
18381834   MDRV_PALETTE_LENGTH(NAMCOS22_PALETTE_SIZE)
1839   MDRV_GFXDECODE(gfxdecodeinfo_super)
1835   MDRV_GFXDECODE(super)
18401836   MDRV_VIDEO_START(namcos22s)
18411837   MDRV_VIDEO_UPDATE(namcos22s)
18421838   MDRV_MACHINE_RESET(namcoss22)
r1051r1052
22492245   MDRV_SCREEN_SIZE(NAMCOS22_NUM_COLS*16,NAMCOS22_NUM_ROWS*16)
22502246   MDRV_SCREEN_VISIBLE_AREA(0,NAMCOS22_NUM_COLS*16-1,0,NAMCOS22_NUM_ROWS*16-1)
22512247   MDRV_PALETTE_LENGTH(NAMCOS22_PALETTE_SIZE)
2252   MDRV_GFXDECODE(gfxdecodeinfo)
2248   MDRV_GFXDECODE(namcos22)
22532249   MDRV_VIDEO_START(namcos22)
22542250   MDRV_VIDEO_UPDATE(namcos22)
22552251   MDRV_MACHINE_RESET(namcos22)
src/mame/drivers/flyball.c
r1051r1052
243243   0x100     /* increment */
244244};
245245
246static const gfx_decode flyball_gfx_decode_info[] =
247{
248   { REGION_GFX1, 0, &flyball_tiles_layout, 0, 2 },
249   { REGION_GFX2, 0, &flyball_sprites_layout, 2, 2 },
250   { -1 }
251};
246static GFXDECODE_START( flyball )
247   GFXDECODE_ENTRY( REGION_GFX1, 0, flyball_tiles_layout, 0, 2 )
248   GFXDECODE_ENTRY( REGION_GFX2, 0, flyball_sprites_layout, 2, 2 )
249GFXDECODE_END
252250
253251
254252PALETTE_INIT( flyball )
r1051r1052
276274   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
277275   MDRV_SCREEN_SIZE(256, 262)
278276   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
279   MDRV_GFXDECODE(flyball_gfx_decode_info)
277   MDRV_GFXDECODE(flyball)
280278   MDRV_PALETTE_LENGTH(4)
281279
282280   MDRV_PALETTE_INIT(flyball)
src/mame/drivers/redclash.c
r1051r1052
334334   32*32
335335};
336336
337static const gfx_decode gfxdecodeinfo[] =
338{
339   { REGION_GFX1, 0x0000, &charlayout,          0,  8 },
340   { REGION_GFX3, 0x0000, &spritelayout8x8,   4*8, 16 },
341   { REGION_GFX2, 0x0000, &spritelayout16x16, 4*8, 16 },
342   { REGION_GFX2, 0x0000, &spritelayout24x24, 4*8, 16 },
343   { REGION_GFX2, 0x0000, &spritelayout16x16bis, 4*8, 16 },
344   { REGION_GFX2, 0x0004, &spritelayout16x16bis, 4*8, 16 },
345   { -1 }
346};
337static GFXDECODE_START( redclash )
338   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,          0,  8 )
339   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, spritelayout8x8,   4*8, 16 )
340   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout16x16, 4*8, 16 )
341   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout24x24, 4*8, 16 )
342   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout16x16bis, 4*8, 16 )
343   GFXDECODE_ENTRY( REGION_GFX2, 0x0004, spritelayout16x16bis, 4*8, 16 )
344GFXDECODE_END
347345
348346
349347
r1051r1052
362360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
363361   MDRV_SCREEN_SIZE(32*8, 32*8)
364362   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
365   MDRV_GFXDECODE(gfxdecodeinfo)
363   MDRV_GFXDECODE(redclash)
366364   MDRV_PALETTE_LENGTH(64)
367365   MDRV_COLORTABLE_LENGTH(4*24)
368366
r1051r1052
390388   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
391389   MDRV_SCREEN_SIZE(32*8, 32*8)
392390   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
393   MDRV_GFXDECODE(gfxdecodeinfo)
391   MDRV_GFXDECODE(redclash)
394392   MDRV_PALETTE_LENGTH(64)
395393   MDRV_COLORTABLE_LENGTH(4*24)
396394
src/mame/drivers/xybots.c
r1051r1052
171171};
172172
173173
174static const gfx_decode gfxdecodeinfo[] =
175{
176   { REGION_GFX1, 0, &pfmolayout,    512, 16 },      /* playfield */
177   { REGION_GFX2, 0, &pfmolayout,    256, 48 },      /* sprites */
178   { REGION_GFX3, 0, &anlayout,        0, 64 },      /* characters 8x8 */
179   { -1 }
180};
174static GFXDECODE_START( xybots )
175   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,    512, 16 )      /* playfield */
176   GFXDECODE_ENTRY( REGION_GFX2, 0, pfmolayout,    256, 48 )      /* sprites */
177   GFXDECODE_ENTRY( REGION_GFX3, 0, anlayout,        0, 64 )      /* characters 8x8 */
178GFXDECODE_END
181179
182180
183181
r1051r1052
199197
200198   /* video hardware */
201199   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
202   MDRV_GFXDECODE(gfxdecodeinfo)
200   MDRV_GFXDECODE(xybots)
203201   MDRV_PALETTE_LENGTH(1024)
204202
205203   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/speglsht.c
r1051r1052
240240  PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
241241INPUT_PORTS_END
242242
243static const gfx_decode gfxdecodeinfo[] =
244{
245   { -1 }   /* end of array */
246};
243static GFXDECODE_START( speglsht )
244GFXDECODE_END
247245
248246static struct ST0016interface st0016_interface =
249247{
r1051r1052
290288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
291289   MDRV_SCREEN_SIZE(512, 512)
292290   MDRV_SCREEN_VISIBLE_AREA(0, 319, 8, 239-8)
293   MDRV_GFXDECODE(gfxdecodeinfo)
291   MDRV_GFXDECODE(speglsht)
294292   MDRV_PALETTE_LENGTH(16*16*4+1)
295293
296294   MDRV_VIDEO_START(st0016)
src/mame/drivers/rockola.c
r1051r1052
691691
692692/* Graphics Decode Information */
693693
694static const gfx_decode sasuke_gfxdecodeinfo[] =
695{
696   { 0,           0x1000, &swapcharlayout,      0, 4 },   /* the game dynamically modifies this */
697   { REGION_GFX1, 0x0000, &swapcharlayout,    4*4, 4 },
698   { -1 }
699};
694static GFXDECODE_START( sasuke )
695   GFXDECODE_ENTRY( 0,           0x1000, swapcharlayout,      0, 4 )   /* the game dynamically modifies this */
696   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, swapcharlayout,    4*4, 4 )
697GFXDECODE_END
700698
701static const gfx_decode satansat_gfxdecodeinfo[] =
702{
703   { 0,           0x1000, &charlayout_memory,   0, 4 },   /* the game dynamically modifies this */
704   { REGION_GFX1, 0x0000, &charlayout,        4*4, 4 },
705   { -1 }
706};
699static GFXDECODE_START( satansat )
700   GFXDECODE_ENTRY( 0,           0x1000, charlayout_memory,   0, 4 )   /* the game dynamically modifies this */
701   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,        4*4, 4 )
702GFXDECODE_END
707703
708static const gfx_decode vanguard_gfxdecodeinfo[] =
709{
710   { 0,           0x1000, &charlayout_memory,   0, 8 },   /* the game dynamically modifies this */
711   { REGION_GFX1, 0x0000, &charlayout,        8*4, 8 },
712   { -1 }
713};
704static GFXDECODE_START( vanguard )
705   GFXDECODE_ENTRY( 0,           0x1000, charlayout_memory,   0, 8 )   /* the game dynamically modifies this */
706   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,        8*4, 8 )
707GFXDECODE_END
714708
715709/* Sound Interfaces */
716710
r1051r1052
10281022   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10291023   MDRV_SCREEN_SIZE(32*8, 32*8)
10301024   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
1031   MDRV_GFXDECODE(sasuke_gfxdecodeinfo)
1025   MDRV_GFXDECODE(sasuke)
10321026   MDRV_PALETTE_LENGTH(32)
10331027
10341028   MDRV_PALETTE_INIT(satansat)
r1051r1052
10681062   MDRV_MACHINE_RESET(satansat)
10691063
10701064   // video hardware
1071   MDRV_GFXDECODE(satansat_gfxdecodeinfo)
1065   MDRV_GFXDECODE(satansat)
10721066
10731067   // sound hardware
10741068   MDRV_SOUND_REPLACE("samples", SAMPLES, 0)
r1051r1052
11001094   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11011095   MDRV_SCREEN_SIZE(32*8, 32*8)
11021096   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
1103   MDRV_GFXDECODE(vanguard_gfxdecodeinfo)
1097   MDRV_GFXDECODE(vanguard)
11041098   MDRV_PALETTE_LENGTH(64)
11051099
11061100   MDRV_PALETTE_INIT(rockola)
src/mame/drivers/magicfly.c
r1051r1052
624624* Graphics Decode Information *
625625******************************/
626626
627static const gfx_decode gfxdecodeinfo[] =
628{
629   { REGION_GFX1,   0x1800,   &charlayout, 0, 16 },
630   { REGION_GFX1,   0x1000,   &tilelayout, 16, 16 },
631   { -1 }
632};
627static GFXDECODE_START( magicfly )
628   GFXDECODE_ENTRY( REGION_GFX1,   0x1800,   charlayout, 0, 16 )
629   GFXDECODE_ENTRY( REGION_GFX1,   0x1000,   tilelayout, 16, 16 )
630GFXDECODE_END
633631
634632
635633/*************************
r1051r1052
654652   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)            /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1). */
655653   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1)   /* Taken from MC6845 init, registers 01 & 06. */
656654
657   MDRV_GFXDECODE(gfxdecodeinfo)
655   MDRV_GFXDECODE(magicfly)
658656   MDRV_PALETTE_LENGTH(32)
659657   MDRV_PALETTE_INIT(magicfly)
660658   MDRV_COLORTABLE_LENGTH(256)
src/mame/drivers/centiped.c
r1051r1052
13981398   16*8
13991399};
14001400
1401static const gfx_decode centiped_gfxdecodeinfo[] =
1402{
1403   { REGION_GFX1, 0, &charlayout,     0, 1 },
1404   { REGION_GFX1, 0, &spritelayout,   4, 4*4*4 },
1405   { -1 }
1406};
1401static GFXDECODE_START( centiped )
1402   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 1 )
1403   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,   4, 4*4*4 )
1404GFXDECODE_END
14071405
1408static const gfx_decode milliped_gfxdecodeinfo[] =
1409{
1410   { REGION_GFX1, 0, &charlayout,     0, 4 },
1411   { REGION_GFX1, 0, &spritelayout, 4*4, 4*4*4*4 },
1412   { -1 }
1413};
1406static GFXDECODE_START( milliped )
1407   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 4 )
1408   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 4*4, 4*4*4*4 )
1409GFXDECODE_END
14141410
14151411
14161412
r1051r1052
14311427   8*8
14321428};
14331429
1434static const gfx_decode warlords_gfxdecodeinfo[] =
1435{
1436   { REGION_GFX1, 0x000, &warlords_charlayout, 0,   8 },
1437   { REGION_GFX1, 0x200, &warlords_charlayout, 8*4, 8*4 },
1438   { -1 }
1439};
1430static GFXDECODE_START( warlords )
1431   GFXDECODE_ENTRY( REGION_GFX1, 0x000, warlords_charlayout, 0,   8 )
1432   GFXDECODE_ENTRY( REGION_GFX1, 0x200, warlords_charlayout, 8*4, 8*4 )
1433GFXDECODE_END
14401434
14411435
14421436
r1051r1052
14961490   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14971491   MDRV_SCREEN_SIZE(32*8, 32*8)
14981492   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
1499   MDRV_GFXDECODE(centiped_gfxdecodeinfo)
1493   MDRV_GFXDECODE(centiped)
15001494   MDRV_PALETTE_LENGTH(4+4)
15011495   MDRV_COLORTABLE_LENGTH(4+4*4*4*4)
15021496
r1051r1052
15581552   MDRV_CPU_PROGRAM_MAP(milliped_map,0)
15591553
15601554   /* video hardware */
1561   MDRV_GFXDECODE(milliped_gfxdecodeinfo)
1555   MDRV_GFXDECODE(milliped)
15621556   MDRV_PALETTE_LENGTH(4*4+4*4)
15631557   MDRV_COLORTABLE_LENGTH(4*4+4*4*4*4*4)
15641558
r1051r1052
15851579   MDRV_CPU_PROGRAM_MAP(warlords_map,0)
15861580
15871581   /* video hardware */
1588   MDRV_GFXDECODE(warlords_gfxdecodeinfo)
1582   MDRV_GFXDECODE(warlords)
15891583   MDRV_PALETTE_LENGTH(128)
15901584   MDRV_COLORTABLE_LENGTH(8*4+8*4)
15911585
r1051r1052
16161610   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16171611   MDRV_SCREEN_SIZE(32*8, 32*8)
16181612   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
1619   MDRV_GFXDECODE(centiped_gfxdecodeinfo)
1613   MDRV_GFXDECODE(centiped)
16201614   MDRV_PALETTE_LENGTH(4+4)
16211615   MDRV_COLORTABLE_LENGTH(4+4*4*4*4)
16221616   MDRV_PALETTE_INIT(centiped)
src/mame/drivers/atarisy1.c
r1051r1052
710710};
711711
712712
713static const gfx_decode gfxdecodeinfo[] =
714{
715   { REGION_GFX1, 0x00000, &anlayout,       0, 64 },
716   { -1 }
717};
713static GFXDECODE_START( atarisy1 )
714   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, anlayout,       0, 64 )
715GFXDECODE_END
718716
719717
720718
r1051r1052
752750
753751   /* video hardware */
754752   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
755   MDRV_GFXDECODE(gfxdecodeinfo)
753   MDRV_GFXDECODE(atarisy1)
756754   MDRV_PALETTE_LENGTH(1024)
757755
758756   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/wgp.c
r1051r1052
934934/* taitoic.c TC0100SCN routines expect scr stuff to be in second gfx
935935   slot */
936936
937static const gfx_decode wgp_gfxdecodeinfo[] =
938{
939   { REGION_GFX3, 0x0, &wgp_tilelayout,  0, 256 },      /* sprites */
940   { REGION_GFX1, 0x0, &charlayout,  0, 256 },      /* sprites & playfield */
941   { REGION_GFX2, 0x0, &wgp_tile2layout,  0, 256 },   /* piv */
942   { -1 }
943};
937static GFXDECODE_START( wgp )
938   GFXDECODE_ENTRY( REGION_GFX3, 0x0, wgp_tilelayout,  0, 256 )      /* sprites */
939   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,  0, 256 )      /* sprites & playfield */
940   GFXDECODE_ENTRY( REGION_GFX2, 0x0, wgp_tile2layout,  0, 256 )   /* piv */
941GFXDECODE_END
944942
945943
946944/**************************************************************
r1051r1052
10041002   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10051003   MDRV_SCREEN_SIZE(40*8, 32*8)
10061004   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1007   MDRV_GFXDECODE(wgp_gfxdecodeinfo)
1005   MDRV_GFXDECODE(wgp)
10081006   MDRV_PALETTE_LENGTH(4096)
10091007
10101008   MDRV_VIDEO_START(wgp)
r1051r1052
10481046   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10491047   MDRV_SCREEN_SIZE(40*8, 32*8)
10501048   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1051   MDRV_GFXDECODE(wgp_gfxdecodeinfo)
1049   MDRV_GFXDECODE(wgp)
10521050   MDRV_PALETTE_LENGTH(4096)
10531051
10541052   MDRV_VIDEO_START(wgp2)
src/mame/drivers/welltris.c
r1051r1052
708708   64*8
709709};
710710
711static const gfx_decode welltris_gfxdecodeinfo[] =
712{
713   { REGION_GFX1, 0, &welltris_charlayout,   16* 0, 4*16 },
714   { REGION_GFX2, 0, &welltris_spritelayout, 16*96, 2*16 },
715   { -1 }
716};
711static GFXDECODE_START( welltris )
712   GFXDECODE_ENTRY( REGION_GFX1, 0, welltris_charlayout,   16* 0, 4*16 )
713   GFXDECODE_ENTRY( REGION_GFX2, 0, welltris_spritelayout, 16*96, 2*16 )
714GFXDECODE_END
717715
718716
719717
r1051r1052
768766   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
769767   MDRV_SCREEN_SIZE(512, 256)
770768   MDRV_SCREEN_VISIBLE_AREA(15, 367-1, 8, 248-1)
771   MDRV_GFXDECODE(welltris_gfxdecodeinfo)
769   MDRV_GFXDECODE(welltris)
772770   MDRV_PALETTE_LENGTH(2048)
773771
774772   MDRV_VIDEO_START(welltris)
src/mame/drivers/sprint8.c
r1051r1052
520520};
521521
522522
523static const gfx_decode gfxdecodeinfo[] =
524{
525   { REGION_GFX1, 0, &tile_layout_1, 0, 18 },
526   { REGION_GFX1, 0, &tile_layout_2, 0, 18 },
527   { REGION_GFX2, 0, &car_layout, 0, 16 },
528   { -1 }
529};
523static GFXDECODE_START( sprint8 )
524   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout_1, 0, 18 )
525   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout_2, 0, 18 )
526   GFXDECODE_ENTRY( REGION_GFX2, 0, car_layout, 0, 16 )
527GFXDECODE_END
530528
531529
532530static MACHINE_DRIVER_START( sprint8 )
r1051r1052
543541   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
544542   MDRV_SCREEN_SIZE(512, 261)
545543   MDRV_SCREEN_VISIBLE_AREA(0, 495, 0, 231)
546   MDRV_GFXDECODE(gfxdecodeinfo)
544   MDRV_GFXDECODE(sprint8)
547545   MDRV_PALETTE_LENGTH(18)
548546   MDRV_COLORTABLE_LENGTH(36)
549547
src/mame/drivers/pturn.c
r1051r1052
344344   128*8
345345};
346346
347static const gfx_decode gfxdecodeinfo[] =
348{
349   { REGION_GFX1, 0, &charlayout,   0x000, 32 },
350   { REGION_GFX2, 0, &charlayout,   0x000, 32 },
351   { REGION_GFX3, 0, &spritelayout, 0x000, 32 },
352   { -1 }
353};
347static GFXDECODE_START( pturn )
348   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x000, 32 )
349   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   0x000, 32 )
350   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x000, 32 )
351GFXDECODE_END
354352
355353INPUT_PORTS_START( pturn )
356354   PORT_START_TAG("IN0")
r1051r1052
459457   MDRV_SCREEN_REFRESH_RATE(60)
460458   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
461459
462   MDRV_GFXDECODE(gfxdecodeinfo)
460   MDRV_GFXDECODE(pturn)
463461
464462   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
465463   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/gumbo.c
r1051r1052
300300   4*16
301301};
302302
303static const gfx_decode gfxdecodeinfo[] =
304{
305   { REGION_GFX1, 0, &gumbo_layout,   0x0, 2  }, /* bg tiles */
306   { REGION_GFX2, 0, &gumbo2_layout,  0x0, 2  }, /* fg tiles */
307   { -1 }
308};
303static GFXDECODE_START( gumbo )
304   GFXDECODE_ENTRY( REGION_GFX1, 0, gumbo_layout,   0x0, 2  ) /* bg tiles */
305   GFXDECODE_ENTRY( REGION_GFX2, 0, gumbo2_layout,  0x0, 2  ) /* fg tiles */
306GFXDECODE_END
309307
310308
311309static MACHINE_DRIVER_START( gumbo )
r1051r1052
316314   MDRV_SCREEN_REFRESH_RATE(60)
317315   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
318316
319   MDRV_GFXDECODE(gfxdecodeinfo)
317   MDRV_GFXDECODE(gumbo)
320318
321319   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
322320   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/scregg.c
r1051r1052
220220   32*8    /* every sprite takes 32 consecutive bytes */
221221};
222222
223static const gfx_decode gfxdecodeinfo[] =
224{
225   { REGION_GFX1, 0, &charlayout,          0, 1 },     /* char set #1 */
226   { REGION_GFX1, 0, &spritelayout,        0, 1 },     /* sprites */
227   { -1 }
228};
223static GFXDECODE_START( scregg )
224   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 1 )     /* char set #1 */
225   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,        0, 1 )     /* sprites */
226GFXDECODE_END
229227
230228
231229
r1051r1052
244242   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
245243   MDRV_SCREEN_SIZE(32*8, 32*8)
246244   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 1*8, 31*8-1)
247   MDRV_GFXDECODE(gfxdecodeinfo)
245   MDRV_GFXDECODE(scregg)
248246   MDRV_PALETTE_LENGTH(8)
249247
250248   MDRV_PALETTE_INIT(btime)
r1051r1052
277275   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
278276   MDRV_SCREEN_SIZE(32*8, 32*8)
279277   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
280   MDRV_GFXDECODE(gfxdecodeinfo)
278   MDRV_GFXDECODE(scregg)
281279   MDRV_PALETTE_LENGTH(8)
282280
283281   MDRV_PALETTE_INIT(btime)
src/mame/drivers/dec0.c
r1051r1052
886886   16*16
887887};
888888
889static const gfx_decode gfxdecodeinfo[] =
890{
891   { REGION_GFX1, 0, &charlayout,   0, 16 },   /* Characters 8x8 */
892   { REGION_GFX2, 0, &tilelayout, 512, 16 },   /* Tiles 16x16 */
893   { REGION_GFX3, 0, &tilelayout, 768, 16 },   /* Tiles 16x16 */
894   { REGION_GFX4, 0, &tilelayout, 256, 16 },   /* Sprites 16x16 */
895   { -1 }
896};
889static GFXDECODE_START( dec0 )
890   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )   /* Characters 8x8 */
891   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 512, 16 )   /* Tiles 16x16 */
892   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 768, 16 )   /* Tiles 16x16 */
893   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 256, 16 )   /* Sprites 16x16 */
894GFXDECODE_END
897895
898static const gfx_decode midres_gfxdecodeinfo[] =
899{
900   { REGION_GFX1, 0, &charlayout, 256, 16 },   /* Characters 8x8 */
901   { REGION_GFX2, 0, &tilelayout, 512, 16 },   /* Tiles 16x16 */
902   { REGION_GFX3, 0, &tilelayout, 768, 16 },   /* Tiles 16x16 */
903   { REGION_GFX4, 0, &tilelayout,   0, 16 },   /* Sprites 16x16 */
904   { -1 }
905};
896static GFXDECODE_START( midres )
897   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 256, 16 )   /* Characters 8x8 */
898   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 512, 16 )   /* Tiles 16x16 */
899   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 768, 16 )   /* Tiles 16x16 */
900   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,   0, 16 )   /* Sprites 16x16 */
901GFXDECODE_END
906902
907903/******************************************************************************/
908904
r1051r1052
947943   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
948944   MDRV_SCREEN_SIZE(32*8, 32*8)
949945   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
950   MDRV_GFXDECODE(gfxdecodeinfo)
946   MDRV_GFXDECODE(dec0)
951947   MDRV_PALETTE_LENGTH(1024)
952948
953949   MDRV_VIDEO_START(dec0)
r1051r1052
990986   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
991987   MDRV_SCREEN_SIZE(32*8, 32*8)
992988   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
993   MDRV_GFXDECODE(gfxdecodeinfo)
989   MDRV_GFXDECODE(dec0)
994990   MDRV_PALETTE_LENGTH(1024)
995991
996992   MDRV_VIDEO_START(dec0)
r1051r1052
10331029   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10341030   MDRV_SCREEN_SIZE(32*8, 32*8)
10351031   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1036   MDRV_GFXDECODE(gfxdecodeinfo)
1032   MDRV_GFXDECODE(dec0)
10371033   MDRV_PALETTE_LENGTH(1024)
10381034
10391035   MDRV_VIDEO_START(dec0)
r1051r1052
10801076   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10811077   MDRV_SCREEN_SIZE(32*8, 32*8)
10821078   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1083   MDRV_GFXDECODE(gfxdecodeinfo)
1079   MDRV_GFXDECODE(dec0)
10841080   MDRV_PALETTE_LENGTH(1024)
10851081
10861082   MDRV_VIDEO_START(dec0)
r1051r1052
11231119   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11241120   MDRV_SCREEN_SIZE(32*8, 32*8)
11251121   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1126   MDRV_GFXDECODE(gfxdecodeinfo)
1122   MDRV_GFXDECODE(dec0)
11271123   MDRV_PALETTE_LENGTH(1024)
11281124
11291125   MDRV_VIDEO_START(dec0)
r1051r1052
11701166   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11711167   MDRV_SCREEN_SIZE(32*8, 32*8)
11721168   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1173   MDRV_GFXDECODE(gfxdecodeinfo)
1169   MDRV_GFXDECODE(dec0)
11741170   MDRV_PALETTE_LENGTH(1024)
11751171
11761172   MDRV_VIDEO_START(dec0)
r1051r1052
12131209   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12141210   MDRV_SCREEN_SIZE(32*8, 32*8)
12151211   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1216   MDRV_GFXDECODE(gfxdecodeinfo)
1212   MDRV_GFXDECODE(dec0)
12171213   MDRV_PALETTE_LENGTH(1024)
12181214
12191215   MDRV_VIDEO_START(dec0_nodma)
r1051r1052
12561252   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12571253   MDRV_SCREEN_SIZE(32*8, 32*8)
12581254   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1259   MDRV_GFXDECODE(midres_gfxdecodeinfo)
1255   MDRV_GFXDECODE(midres)
12601256   MDRV_PALETTE_LENGTH(1024)
12611257
12621258   MDRV_VIDEO_START(dec0_nodma)
src/mame/drivers/ssv.c
r1051r1052
33293329   16*8*2
33303330};
33313331
3332static const gfx_decode ssv_gfxdecodeinfo[] =
3333{
3334   { REGION_GFX1, 0, &layout_16x8x8, 0, 0x8000/64 }, // [0] Sprites (256 colors)
3335   { REGION_GFX1, 0, &layout_16x8x6, 0, 0x8000/64 }, // [1] Sprites (64 colors)
3336   { -1 }
3337};
3332static GFXDECODE_START( ssv )
3333   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x8x8, 0, 0x8000/64 ) // [0] Sprites (256 colors)
3334   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x8x6, 0, 0x8000/64 ) // [1] Sprites (64 colors)
3335GFXDECODE_END
33383336
33393337static const gfx_layout layout_16x8x8_2 =
33403338{
r1051r1052
33583356   16*8*8
33593357};
33603358
3361static const gfx_decode eaglshot_gfxdecodeinfo[] =
3362{
3363   { REGION_GFX1, 0, &layout_16x8x8_2, 0, 0x8000/64 }, // [0] Sprites (256 colors, decoded from ram)
3364   { REGION_GFX1, 0, &layout_16x8x6_2, 0, 0x8000/64 }, // [1] Sprites (64 colors, decoded from ram)
3365   { -1 }
3366};
3359static GFXDECODE_START( eaglshot )
3360   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x8x8_2, 0, 0x8000/64 ) // [0] Sprites (256 colors, decoded from ram)
3361   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x8x6_2, 0, 0x8000/64 ) // [1] Sprites (64 colors, decoded from ram)
3362GFXDECODE_END
33673363
33683364static const gfx_layout layout_16x16x8 =
33693365{
r1051r1052
33763372   16*16*8
33773373};
33783374
3379static const gfx_decode gdfs_gfxdecodeinfo[] =
3380{
3381   { REGION_GFX1, 0, &layout_16x8x8,   0, 0x8000/64  }, // [0] Sprites (256 colors)
3382   { REGION_GFX1, 0, &layout_16x8x6,   0, 0x8000/64  }, // [1] Sprites (64 colors)
3383   { REGION_GFX2, 0, &layout_16x8x8_2, 0, 0x8000/64  }, // [2] Zooming Sprites (256 colors, decoded from ram)
3384   { REGION_GFX3, 0, &layout_16x16x8,  0, 0x8000/256 }, // [3] Tilemap
3385   { -1 }
3386};
3375static GFXDECODE_START( gdfs )
3376   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x8x8,   0, 0x8000/64  ) // [0] Sprites (256 colors)
3377   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x8x6,   0, 0x8000/64  ) // [1] Sprites (64 colors)
3378   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x8x8_2, 0, 0x8000/64  ) // [2] Zooming Sprites (256 colors, decoded from ram)
3379   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8,  0, 0x8000/256 ) // [3] Tilemap
3380GFXDECODE_END
33873381
33883382/***************************************************************************
33893383
r1051r1052
35203514
35213515   MDRV_SCREEN_SIZE(0x180, 0x100)
35223516   MDRV_SCREEN_VISIBLE_AREA(0, 0x150-1, 0, 0xf0-1)
3523   MDRV_GFXDECODE(ssv_gfxdecodeinfo)
3517   MDRV_GFXDECODE(ssv)
35243518   MDRV_PALETTE_LENGTH(0x8000)
35253519   MDRV_VIDEO_START(ssv)
35263520   MDRV_VIDEO_UPDATE(ssv)
r1051r1052
35623556   /* video hardware */
35633557   MDRV_SCREEN_VISIBLE_AREA(0, 0x150-1, 0, 0xf0-1)
35643558
3565   MDRV_GFXDECODE(gdfs_gfxdecodeinfo)
3559   MDRV_GFXDECODE(gdfs)
35663560   MDRV_VIDEO_START(gdfs)
35673561   MDRV_VIDEO_UPDATE(gdfs)
35683562MACHINE_DRIVER_END
r1051r1052
37223716   /* video hardware */
37233717   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 8, 0xe8-1)
37243718
3725   MDRV_GFXDECODE(eaglshot_gfxdecodeinfo)
3719   MDRV_GFXDECODE(eaglshot)
37263720   MDRV_VIDEO_START(eaglshot)
37273721   MDRV_VIDEO_UPDATE(eaglshot)
37283722MACHINE_DRIVER_END
src/mame/drivers/taitoair.c
r1051r1052
560560   16*16
561561};
562562
563static const gfx_decode airsys_gfxdecodeinfo[] =
564{
565   { REGION_GFX1, 0, &tilelayout, 0, 32*16 },
566   { -1 }
567};
563static GFXDECODE_START( airsys )
564   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0, 32*16 )
565GFXDECODE_END
568566
569567
570568/************************************************************
r1051r1052
615613   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
616614   MDRV_SCREEN_SIZE(64*16, 64*16)
617615   MDRV_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 3*16, 28*16-1)
618   MDRV_GFXDECODE(airsys_gfxdecodeinfo)
616   MDRV_GFXDECODE(airsys)
619617   MDRV_PALETTE_LENGTH(512*16)
620618
621619   MDRV_VIDEO_START(taitoair)
src/mame/drivers/atarig42.c
r1051r1052
498498   32*8
499499};
500500
501static const gfx_decode gfxdecodeinfo[] =
502{
503   { REGION_GFX1, 0, &pflayout, 0x000, 64 },
504   { REGION_GFX2, 0, &anlayout, 0x000, 16 },
505   { REGION_GFX1, 0, &pftoplayout, 0x000, 64 },
506   { -1 }
507};
501static GFXDECODE_START( atarig42 )
502   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout, 0x000, 64 )
503   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout, 0x000, 16 )
504   GFXDECODE_ENTRY( REGION_GFX1, 0, pftoplayout, 0x000, 64 )
505GFXDECODE_END
508506
509507
510508
r1051r1052
529527
530528   /* video hardware */
531529   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
532   MDRV_GFXDECODE(gfxdecodeinfo)
530   MDRV_GFXDECODE(atarig42)
533531   MDRV_PALETTE_LENGTH(2048)
534532
535533   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/tceptor.c
r1051r1052
474474   2*8*8
475475};
476476
477static const gfx_decode gfxdecodeinfo[] =
478{
479   { REGION_GFX1, 0, &tile_layout,     0,  256 },
477static GFXDECODE_START( tceptor )
478   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,     0,  256 )
480479
481480   /* decode in VIDEO_START */
482   //{ REGION_GFX2, 0, &bg_layout,    2048,   64 },
483   //{ REGION_GFX3, 0, &spr16_layout, 1024,   64 },
484   //{ REGION_GFX4, 0, &spr32_layout, 1024,   64 },
485   { -1 }
486};
481   //GFXDECODE_ENTRY( REGION_GFX2, 0, bg_layout,    2048,   64 )
482   //GFXDECODE_ENTRY( REGION_GFX3, 0, spr16_layout, 1024,   64 )
483   //GFXDECODE_ENTRY( REGION_GFX4, 0, spr32_layout, 1024,   64 )
484GFXDECODE_END
487485
488486
489487/*******************************************************************/
r1051r1052
555553   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
556554   MDRV_SCREEN_SIZE(38*8, 32*8)
557555   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
558   MDRV_GFXDECODE(gfxdecodeinfo)
556   MDRV_GFXDECODE(tceptor)
559557   MDRV_PALETTE_LENGTH(1024)
560558   MDRV_COLORTABLE_LENGTH(4096)
561559
src/mame/drivers/cop01.c
r1051r1052
403403   64*8
404404};
405405
406static const gfx_decode gfxdecodeinfo[] =
407{
408   { REGION_GFX1, 0, &charlayout,         0,  1 },
409   { REGION_GFX2, 0, &tilelayout,        16,  8 },
410   { REGION_GFX3, 0, &spritelayout, 16+8*16, 16 },
411   { -1 }
412};
406static GFXDECODE_START( cop01 )
407   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0,  1 )
408   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,        16,  8 )
409   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 16+8*16, 16 )
410GFXDECODE_END
413411
414412
415413
r1051r1052
434432   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
435433   MDRV_SCREEN_SIZE(32*8, 32*8)
436434   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
437   MDRV_GFXDECODE(gfxdecodeinfo)
435   MDRV_GFXDECODE(cop01)
438436   MDRV_PALETTE_LENGTH(256)
439437   MDRV_COLORTABLE_LENGTH(16+8*16+16*16)
440438
r1051r1052
476474   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
477475   MDRV_SCREEN_SIZE(32*8, 32*8)
478476   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
479   MDRV_GFXDECODE(gfxdecodeinfo)
477   MDRV_GFXDECODE(cop01)
480478   MDRV_PALETTE_LENGTH(256)
481479   MDRV_COLORTABLE_LENGTH(16+8*16+16*16)
482480
src/mame/drivers/vindictr.c
r1051r1052
178178};
179179
180180
181static const gfx_decode gfxdecodeinfo[] =
182{
183   { REGION_GFX1, 0, &pfmolayout,  256, 32 },      /* sprites & playfield */
184   { REGION_GFX2, 0, &anlayout,      0, 64 },      /* characters 8x8 */
185   { -1 }
186};
181static GFXDECODE_START( vindictr )
182   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  256, 32 )      /* sprites & playfield */
183   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout,      0, 64 )      /* characters 8x8 */
184GFXDECODE_END
187185
188186
189187
r1051r1052
204202
205203   /* video hardware */
206204   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
207   MDRV_GFXDECODE(gfxdecodeinfo)
205   MDRV_GFXDECODE(vindictr)
208206   MDRV_PALETTE_LENGTH(2048*8)
209207
210208   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/hanaawas.c
r1051r1052
187187GFX( charlayout_1bpp, 0x2000*8+4, 0x2000*8+4, 0x2000*8+4 )
188188GFX( charlayout_3bpp, 0x2000*8,   0,          4          )
189189
190static const gfx_decode gfxdecodeinfo[] =
191{
192   { REGION_GFX1, 0, &charlayout_1bpp, 0, 32 },
193   { REGION_GFX1, 0, &charlayout_3bpp, 0, 32 },
194   { -1 }
195};
190static GFXDECODE_START( hanaawas )
191   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_1bpp, 0, 32 )
192   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_3bpp, 0, 32 )
193GFXDECODE_END
196194
197195
198196static struct AY8910interface ay8910_interface =
r1051r1052
220218   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
221219   MDRV_SCREEN_SIZE(32*8, 32*8)
222220   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
223   MDRV_GFXDECODE(gfxdecodeinfo)
221   MDRV_GFXDECODE(hanaawas)
224222   MDRV_PALETTE_LENGTH(16)
225223   MDRV_COLORTABLE_LENGTH(32*8)
226224
src/mame/drivers/aquarium.c
r1051r1052
345345}
346346
347347
348static const gfx_decode gfxdecodeinfo[] =
349{
350   { REGION_GFX3, 0, &tilelayout,       0x300, 32 },
351   { REGION_GFX1, 0, &char5bpplayout,   0x400, 32 },
352   { REGION_GFX2, 0, &char_8x8_layout,  0x200, 32 },
353   { REGION_GFX4, 0, &char5bpplayout,   0x400, 32 },
354   { -1 }
355};
348static GFXDECODE_START( aquarium )
349   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,       0x300, 32 )
350   GFXDECODE_ENTRY( REGION_GFX1, 0, char5bpplayout,   0x400, 32 )
351   GFXDECODE_ENTRY( REGION_GFX2, 0, char_8x8_layout,  0x200, 32 )
352   GFXDECODE_ENTRY( REGION_GFX4, 0, char5bpplayout,   0x400, 32 )
353GFXDECODE_END
356354
357355static void irq_handler(int irq)
358356{
r1051r1052
389387   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
390388   MDRV_SCREEN_SIZE(64*8, 64*8)
391389   MDRV_SCREEN_VISIBLE_AREA(2*8, 42*8-1, 2*8, 34*8-1)
392   MDRV_GFXDECODE(gfxdecodeinfo)
390   MDRV_GFXDECODE(aquarium)
393391   MDRV_PALETTE_LENGTH(0x1000/2)
394392
395393   MDRV_VIDEO_START(aquarium)
src/mame/drivers/metro.c
r1051r1052
36423642   8*8*8*4
36433643};
36443644
3645static const gfx_decode gfxdecodeinfo_14100[] =
3646{
3647   { REGION_GFX1, 0, &layout_8x8x4,    0x0, 0x200 }, // [0] 4 Bit Tiles
3648   { -1 }
3649};
3645static GFXDECODE_START( 14100 )
3646   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
3647GFXDECODE_END
36503648
3651static const gfx_decode gfxdecodeinfo_14220[] =
3652{
3653   { REGION_GFX1, 0, &layout_8x8x4,    0x0, 0x200 }, // [0] 4 Bit Tiles
3654   { REGION_GFX1, 0, &layout_8x8x8h,   0x0,  0x20 }, // [1] 8 Bit Tiles
3655   { -1 }
3656};
3649static GFXDECODE_START( 14220 )
3650   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
3651   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8h,   0x0,  0x20 ) // [1] 8 Bit Tiles
3652GFXDECODE_END
36573653
3658static const gfx_decode gfxdecodeinfo_blzntrnd[] =
3659{
3660   { REGION_GFX1, 0, &layout_8x8x4,    0x0, 0x200 }, // [0] 4 Bit Tiles
3661   { REGION_GFX1, 0, &layout_8x8x8h,   0x0,  0x20 }, // [1] 8 Bit Tiles
3662   { REGION_GFX3, 0, &layout_053936,   0x0,  0x20 }, // [2] 053936 Tiles
3663   { -1 }
3664};
3654static GFXDECODE_START( blzntrnd )
3655   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
3656   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8h,   0x0,  0x20 ) // [1] 8 Bit Tiles
3657   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_053936,   0x0,  0x20 ) // [2] 053936 Tiles
3658GFXDECODE_END
36653659
3666static const gfx_decode gfxdecodeinfo_gstrik2[] =
3667{
3668   { REGION_GFX1, 0, &layout_8x8x4,    0x0, 0x200 }, // [0] 4 Bit Tiles
3669   { REGION_GFX1, 0, &layout_8x8x8h,   0x0,  0x20 }, // [1] 8 Bit Tiles
3670   { REGION_GFX3, 0, &layout_053936_16,0x0,  0x20 }, // [2] 053936 Tiles
3671   { -1 }
3672};
3660static GFXDECODE_START( gstrik2 )
3661   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
3662   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8h,   0x0,  0x20 ) // [1] 8 Bit Tiles
3663   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_053936_16,0x0,  0x20 ) // [2] 053936 Tiles
3664GFXDECODE_END
36733665
3674static const gfx_decode gfxdecodeinfo_14300[] =
3675{
3676   { REGION_GFX1, 0, &layout_8x8x4,    0x0, 0x200 }, // [0] 4 Bit Tiles
3677   { REGION_GFX1, 0, &layout_8x8x8h,   0x0,  0x20 }, // [1] 8 Bit Tiles
3678   { REGION_GFX1, 0, &layout_16x16x4q, 0x0, 0x200 }, // [2] 4 Bit Tiles 16x16
3679   { REGION_GFX1, 0, &layout_16x16x8o, 0x0, 0x200 }, // [2] 8 Bit Tiles 16x16
3680   { -1 }
3681};
3666static GFXDECODE_START( 14300 )
3667   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
3668   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8h,   0x0,  0x20 ) // [1] 8 Bit Tiles
3669   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4q, 0x0, 0x200 ) // [2] 4 Bit Tiles 16x16
3670   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8o, 0x0, 0x200 ) // [2] 8 Bit Tiles 16x16
3671GFXDECODE_END
36823672
36833673
36843674/***************************************************************************
r1051r1052
37123702   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37133703   MDRV_SCREEN_SIZE(320, 224)
37143704   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
3715   MDRV_GFXDECODE(gfxdecodeinfo_14220)
3705   MDRV_GFXDECODE(14220)
37163706   MDRV_PALETTE_LENGTH(8192)
37173707
37183708   MDRV_VIDEO_START(metro_14220)
r1051r1052
37453735   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37463736   MDRV_SCREEN_SIZE(320, 224)
37473737   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
3748   MDRV_GFXDECODE(gfxdecodeinfo_14220)
3738   MDRV_GFXDECODE(14220)
37493739   MDRV_PALETTE_LENGTH(8192)
37503740
37513741   MDRV_VIDEO_START(metro_14220)
r1051r1052
37783768   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37793769   MDRV_SCREEN_SIZE(320, 224)
37803770   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
3781   MDRV_GFXDECODE(gfxdecodeinfo_14220)
3771   MDRV_GFXDECODE(14220)
37823772   MDRV_PALETTE_LENGTH(8192)
37833773
37843774   MDRV_VIDEO_START(metro_14220)
r1051r1052
38163806   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
38173807   MDRV_SCREEN_SIZE(320, 224)
38183808   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
3819   MDRV_GFXDECODE(gfxdecodeinfo_14220)
3809   MDRV_GFXDECODE(14220)
38203810   MDRV_PALETTE_LENGTH(8192)
38213811
38223812   MDRV_VIDEO_START(metro_14220)
r1051r1052
38603850   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
38613851   MDRV_SCREEN_SIZE(320, 224)
38623852   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
3863   MDRV_GFXDECODE(gfxdecodeinfo_14100)
3853   MDRV_GFXDECODE(14100)
38643854   MDRV_PALETTE_LENGTH(8192)
38653855
38663856   MDRV_VIDEO_START(metro_14100)
r1051r1052
39033893   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39043894   MDRV_SCREEN_SIZE(320, 240)
39053895   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
3906   MDRV_GFXDECODE(gfxdecodeinfo_14100)
3896   MDRV_GFXDECODE(14100)
39073897   MDRV_PALETTE_LENGTH(8192)
39083898
39093899   MDRV_VIDEO_START(metro_14100)
r1051r1052
39463936   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39473937   MDRV_SCREEN_SIZE(320, 240)
39483938   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
3949   MDRV_GFXDECODE(gfxdecodeinfo_14220)
3939   MDRV_GFXDECODE(14220)
39503940   MDRV_PALETTE_LENGTH(8192)
39513941
39523942   MDRV_VIDEO_START(metro_14220)
r1051r1052
39893979   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
39903980   MDRV_SCREEN_SIZE(360, 224)
39913981   MDRV_SCREEN_VISIBLE_AREA(0, 360-1, 0, 224-1)
3992   MDRV_GFXDECODE(gfxdecodeinfo_14100)
3982   MDRV_GFXDECODE(14100)
39933983   MDRV_PALETTE_LENGTH(8192)
39943984
39953985   MDRV_VIDEO_START(metro_14100)
r1051r1052
40314021   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
40324022   MDRV_SCREEN_SIZE(360, 224)
40334023   MDRV_SCREEN_VISIBLE_AREA(0, 360-1, 0, 224-1)
4034   MDRV_GFXDECODE(gfxdecodeinfo_14100)
4024   MDRV_GFXDECODE(14100)
40354025   MDRV_PALETTE_LENGTH(8192)
40364026
40374027   MDRV_VIDEO_START(metro_14100)
r1051r1052
40674057   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
40684058   MDRV_SCREEN_SIZE(320, 256-32)
40694059   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1)
4070   MDRV_GFXDECODE(gfxdecodeinfo_14300)
4060   MDRV_GFXDECODE(14300)
40714061   MDRV_PALETTE_LENGTH(8192)
40724062
40734063   MDRV_VIDEO_START(metro_14300)
r1051r1052
41184108   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
41194109   MDRV_SCREEN_SIZE(384, 256-32)
41204110   MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-32-1)
4121   MDRV_GFXDECODE(gfxdecodeinfo_14300)
4111   MDRV_GFXDECODE(14300)
41224112   MDRV_PALETTE_LENGTH(8192)
41234113
41244114   MDRV_VIDEO_START(metro_14300)
r1051r1052
41564146   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
41574147   MDRV_SCREEN_SIZE(320, 240)
41584148   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
4159   MDRV_GFXDECODE(gfxdecodeinfo_14300)
4149   MDRV_GFXDECODE(14300)
41604150   MDRV_PALETTE_LENGTH(8192)
41614151
41624152   MDRV_VIDEO_START(metro_14300)
r1051r1052
41944184   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
41954185   MDRV_SCREEN_SIZE(320, 240)
41964186   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
4197   MDRV_GFXDECODE(gfxdecodeinfo_14300)
4187   MDRV_GFXDECODE(14300)
41984188   MDRV_PALETTE_LENGTH(8192)
41994189
42004190   MDRV_VIDEO_START(metro_14300)
r1051r1052
42374227   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
42384228   MDRV_SCREEN_SIZE(360, 224)
42394229   MDRV_SCREEN_VISIBLE_AREA(0, 360-1, 0, 224-1)
4240   MDRV_GFXDECODE(gfxdecodeinfo_14100)
4230   MDRV_GFXDECODE(14100)
42414231   MDRV_PALETTE_LENGTH(8192)
42424232
42434233   MDRV_VIDEO_START(metro_14100)
r1051r1052
42804270   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
42814271   MDRV_SCREEN_SIZE(360, 224)
42824272   MDRV_SCREEN_VISIBLE_AREA(0, 360-1, 0, 224-1)
4283   MDRV_GFXDECODE(gfxdecodeinfo_14100)
4273   MDRV_GFXDECODE(14100)
42844274   MDRV_PALETTE_LENGTH(8192)
42854275
42864276   MDRV_VIDEO_START(metro_14100)
r1051r1052
43234313   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
43244314   MDRV_SCREEN_SIZE(320, 224)
43254315   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
4326   MDRV_GFXDECODE(gfxdecodeinfo_14100)
4316   MDRV_GFXDECODE(14100)
43274317   MDRV_PALETTE_LENGTH(8192)
43284318
43294319   MDRV_VIDEO_START(metro_14100)
r1051r1052
43674357   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
43684358   MDRV_SCREEN_SIZE(360, 224)
43694359   MDRV_SCREEN_VISIBLE_AREA(0, 360-1, 0, 224-1)
4370   MDRV_GFXDECODE(gfxdecodeinfo_14100)
4360   MDRV_GFXDECODE(14100)
43714361   MDRV_PALETTE_LENGTH(8192)
43724362
43734363   MDRV_VIDEO_START(metro_14100)
r1051r1052
44104400   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
44114401   MDRV_SCREEN_SIZE(320, 224)
44124402   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
4413   MDRV_GFXDECODE(gfxdecodeinfo_14100)
4403   MDRV_GFXDECODE(14100)
44144404   MDRV_PALETTE_LENGTH(8192)
44154405
44164406   MDRV_VIDEO_START(metro_14100)
r1051r1052
44474437   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
44484438   MDRV_SCREEN_SIZE(512, 256)
44494439   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
4450   MDRV_GFXDECODE(gfxdecodeinfo_14300)
4440   MDRV_GFXDECODE(14300)
44514441   MDRV_PALETTE_LENGTH(8192)
44524442
44534443   MDRV_VIDEO_START(metro_14300)
r1051r1052
44884478   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
44894479   MDRV_SCREEN_SIZE(320, 224)
44904480   MDRV_SCREEN_VISIBLE_AREA(8, 320-8-1, 0, 224-1)
4491   MDRV_GFXDECODE(gfxdecodeinfo_blzntrnd)
4481   MDRV_GFXDECODE(blzntrnd)
44924482   MDRV_PALETTE_LENGTH(8192)
44934483
44944484   MDRV_VIDEO_START(blzntrnd)
r1051r1052
45284518   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
45294519   MDRV_SCREEN_SIZE(320, 224)
45304520   MDRV_SCREEN_VISIBLE_AREA(8, 320-8-1, 0, 224-1)
4531   MDRV_GFXDECODE(gfxdecodeinfo_gstrik2)
4521   MDRV_GFXDECODE(gstrik2)
45324522   MDRV_PALETTE_LENGTH(8192)
45334523
45344524   MDRV_VIDEO_START(gstrik2)
src/mame/drivers/angelkds.c
r1051r1052
603603   16*32
604604};
605605
606static const gfx_decode gfxdecodeinfo[] =
607{
608   { REGION_GFX1, 0, &angelkds_charlayout,   0x30, 1  },
609   { REGION_GFX3, 0, &angelkds_charlayout,   0, 16 },
610   { REGION_GFX4, 0, &angelkds_charlayout,   0, 16 },
611   { REGION_GFX2, 0, &angelkds_spritelayout, 0x20, 0x0d },
612   { -1 }
613};
606static GFXDECODE_START( angelkds )
607   GFXDECODE_ENTRY( REGION_GFX1, 0, angelkds_charlayout,   0x30, 1  )
608   GFXDECODE_ENTRY( REGION_GFX3, 0, angelkds_charlayout,   0, 16 )
609   GFXDECODE_ENTRY( REGION_GFX4, 0, angelkds_charlayout,   0, 16 )
610   GFXDECODE_ENTRY( REGION_GFX2, 0, angelkds_spritelayout, 0x20, 0x0d )
611GFXDECODE_END
614612
615613/*** Machine Driver
616614
r1051r1052
641639   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
642640   MDRV_SCREEN_SIZE(32*8, 32*8)
643641   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
644   MDRV_GFXDECODE(gfxdecodeinfo)
642   MDRV_GFXDECODE(angelkds)
645643   MDRV_PALETTE_LENGTH(0x100)
646644
647645   MDRV_VIDEO_START(angelkds)
src/mame/drivers/jrpacman.c
r1051r1052
235235};
236236
237237
238static const gfx_decode gfxdecodeinfo[] =
239{
240   { REGION_GFX1, 0x0000, &tilelayout,   0, 128 },
241   { REGION_GFX1, 0x2000, &spritelayout, 0, 128 },
242   { -1 }
243};
238static GFXDECODE_START( jrpacman )
239   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tilelayout,   0, 128 )
240   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, spritelayout, 0, 128 )
241GFXDECODE_END
244242
245243
246244
r1051r1052
280278   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
281279   MDRV_SCREEN_SIZE(36*8, 28*8)
282280   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
283   MDRV_GFXDECODE(gfxdecodeinfo)
281   MDRV_GFXDECODE(jrpacman)
284282   MDRV_PALETTE_LENGTH(128*4)
285283
286284   MDRV_PALETTE_INIT(pacman)
src/mame/drivers/circusc.c
r1051r1052
290290   32*4*8    /* every sprite takes 128 consecutive bytes */
291291};
292292
293static const gfx_decode gfxdecodeinfo[] =
294{
295   { REGION_GFX1, 0, &charlayout,       0, 16 },
296   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
297   { -1 }
298};
293static GFXDECODE_START( circusc )
294   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
295   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
296GFXDECODE_END
299297
300298
301299
r1051r1052
321319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
322320   MDRV_SCREEN_SIZE(32*8, 32*8)
323321   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
324   MDRV_GFXDECODE(gfxdecodeinfo)
322   MDRV_GFXDECODE(circusc)
325323   MDRV_PALETTE_LENGTH(32)
326324   MDRV_COLORTABLE_LENGTH(16*16+16*16)
327325
src/mame/drivers/mikie.c
r1051r1052
228228
229229/* Graphics Decode Information */
230230
231static const gfx_decode gfxdecodeinfo[] =
232{
233   { REGION_GFX1, 0x0000, &charlayout,         0, 16*8 },
234   { REGION_GFX2, 0x0000, &spritelayout, 16*8*16, 16*8 },
235   { REGION_GFX2, 0x0001, &spritelayout, 16*8*16, 16*8 },
236   { -1 }
237};
231static GFXDECODE_START( mikie )
232   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,         0, 16*8 )
233   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 16*8*16, 16*8 )
234   GFXDECODE_ENTRY( REGION_GFX2, 0x0001, spritelayout, 16*8*16, 16*8 )
235GFXDECODE_END
238236
239237/* Sound Interface */
240238
r1051r1052
262260   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
263261   MDRV_SCREEN_SIZE(32*8, 32*8)
264262   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
265   MDRV_GFXDECODE(gfxdecodeinfo)
263   MDRV_GFXDECODE(mikie)
266264   MDRV_PALETTE_LENGTH(256)
267265   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
268266
src/mame/drivers/midvunit.c
r1051r1052
248248 *
249249 *************************************/
250250
251READ32_HANDLER( tms32031_control_r )
251static READ32_HANDLER( tms32031_control_r )
252252{
253253   /* watch for accesses to the timers */
254254   if (offset == 0x24 || offset == 0x34)
r1051r1052
268268}
269269
270270
271WRITE32_HANDLER( tms32031_control_w )
271static WRITE32_HANDLER( tms32031_control_w )
272272{
273273   COMBINE_DATA(&tms32031_control[offset]);
274274
src/mame/drivers/namcond1.c
r1051r1052
210210   16*16*8
211211};
212212
213static const gfx_decode gfxdecodeinfo[] =
214{
215   { REGION_GFX1, 0x00000000, &pts_8x8_4bits_layout,    0,  16 },
216   { REGION_GFX1, 0x00000000, &pts_16x16_4bits_layout,  0,  16 },
217   { REGION_GFX1, 0x00000000, &pts_32x32_4bits_layout,  0,  16 },
218   { REGION_GFX1, 0x00000000, &pts_64x64_4bits_layout,  0,  16 },
219   { REGION_GFX1, 0x00000000, &pts_8x8_8bits_layout,    0, 256 },
220   { REGION_GFX1, 0x00000000, &pts_16x16_8bits_layout,  0, 256 },
221   { -1 }
222};
213static GFXDECODE_START( namcond1 )
214   GFXDECODE_ENTRY( REGION_GFX1, 0x00000000, pts_8x8_4bits_layout,    0,  16 )
215   GFXDECODE_ENTRY( REGION_GFX1, 0x00000000, pts_16x16_4bits_layout,  0,  16 )
216   GFXDECODE_ENTRY( REGION_GFX1, 0x00000000, pts_32x32_4bits_layout,  0,  16 )
217   GFXDECODE_ENTRY( REGION_GFX1, 0x00000000, pts_64x64_4bits_layout,  0,  16 )
218   GFXDECODE_ENTRY( REGION_GFX1, 0x00000000, pts_8x8_8bits_layout,    0, 256 )
219   GFXDECODE_ENTRY( REGION_GFX1, 0x00000000, pts_16x16_8bits_layout,  0, 256 )
220GFXDECODE_END
223221
224222static WRITE16_HANDLER( sharedram_sub_w )
225223{
r1051r1052
313311   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
314312   MDRV_SCREEN_SIZE(288, 224)   // maximum display resolution (512x512 in theory)
315313   MDRV_SCREEN_VISIBLE_AREA(0, 287, 0, 223)   // default visible area
316   MDRV_GFXDECODE(gfxdecodeinfo)
314   MDRV_GFXDECODE(namcond1)
317315   MDRV_PALETTE_LENGTH(256)
318316
319317   MDRV_VIDEO_START(ygv608)
src/mame/drivers/usgames.c
r1051r1052
280280   8*8
281281};
282282
283static const gfx_decode gfxdecodeinfo[] =
284{
285   { REGION_CPU1, 0x2800, &charlayout, 0, 256 },
286   { -1 }
287};
283static GFXDECODE_START( usgames )
284   GFXDECODE_ENTRY( REGION_CPU1, 0x2800, charlayout, 0, 256 )
285GFXDECODE_END
288286
289287
290288
r1051r1052
305303   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
306304   MDRV_SCREEN_SIZE(64*8, 32*8)
307305   MDRV_SCREEN_VISIBLE_AREA(7*8, 57*8-1, 0*8, 31*8-1)
308   MDRV_GFXDECODE(gfxdecodeinfo)
306   MDRV_GFXDECODE(usgames)
309307   MDRV_PALETTE_LENGTH(16)
310308   MDRV_COLORTABLE_LENGTH(2*256)
311309
src/mame/drivers/opwolf.c
r1051r1052
519519   128*8   /* every sprite takes 128 consecutive bytes */
520520};
521521
522static const gfx_decode opwolf_gfxdecodeinfo[] =
523{
524   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites */
525   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* scr tiles */
526   { -1 }
527};
522static GFXDECODE_START( opwolf )
523   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites */
524   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* scr tiles */
525GFXDECODE_END
528526
529static const gfx_decode opwolfb_gfxdecodeinfo[] =
530{
531   { REGION_GFX2, 0, &tilelayout_b,  0, 256 },   /* sprites */
532   { REGION_GFX1, 0, &charlayout_b,  0, 256 },   /* scr tiles */
533   { -1 }
534};
527static GFXDECODE_START( opwolfb )
528   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_b,  0, 256 )   /* sprites */
529   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_b,  0, 256 )   /* scr tiles */
530GFXDECODE_END
535531
536532
537533/**************************************************************
r1051r1052
587583   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
588584   MDRV_SCREEN_SIZE(40*8, 32*8)
589585   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
590   MDRV_GFXDECODE(opwolf_gfxdecodeinfo)
586   MDRV_GFXDECODE(opwolf)
591587   MDRV_PALETTE_LENGTH(8192)
592588
593589   MDRV_VIDEO_START(opwolf)
r1051r1052
638634   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
639635   MDRV_SCREEN_SIZE(40*8, 32*8)
640636   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
641   MDRV_GFXDECODE(opwolfb_gfxdecodeinfo)
637   MDRV_GFXDECODE(opwolfb)
642638   MDRV_PALETTE_LENGTH(8192)
643639
644640   MDRV_VIDEO_START(opwolf)
src/mame/drivers/pmpoker.c
r1051r1052
866866* Graphics Decode Information *
867867******************************/
868868
869static const gfx_decode gfxdecodeinfo[] =
870{
871   { REGION_GFX1, 0, &charlayout, 0, 16 },
872   { REGION_GFX2, 0, &tilelayout, (8 * 3) + 128, 16 },
873   { -1 }
874};
869static GFXDECODE_START( pmpoker )
870   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
871   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, (8 * 3) + 128, 16 )
872GFXDECODE_END
875873
876874
877875/***********************
r1051r1052
10021000   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)                  /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
10031001   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1)    /* Taken from MC6845 init, registers 01 & 06 */
10041002
1005   MDRV_GFXDECODE(gfxdecodeinfo)
1003   MDRV_GFXDECODE(pmpoker)
10061004
10071005   MDRV_PALETTE_LENGTH(256)
10081006   MDRV_PALETTE_INIT(pottnpkr)
src/mame/drivers/suna16.c
r1051r1052
640640   8*8*4/2
641641};
642642
643static const gfx_decode suna16_gfxdecodeinfo[] =
644{
645   { REGION_GFX1, 0, &layout_8x8x4, 0, 16*2 }, // [0] Sprites
646   { -1 }
647};
643static GFXDECODE_START( suna16 )
644   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4, 0, 16*2 ) // [0] Sprites
645GFXDECODE_END
648646
649647
650648
r1051r1052
701699   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
702700   MDRV_SCREEN_SIZE(256, 256)
703701   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
704   MDRV_GFXDECODE(suna16_gfxdecodeinfo)
702   MDRV_GFXDECODE(suna16)
705703   MDRV_PALETTE_LENGTH(512)
706704
707705   MDRV_VIDEO_START(suna16)
r1051r1052
760758   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
761759   MDRV_SCREEN_SIZE(256, 256)
762760   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
763   MDRV_GFXDECODE(suna16_gfxdecodeinfo)
761   MDRV_GFXDECODE(suna16)
764762   MDRV_PALETTE_LENGTH(512)
765763
766764   MDRV_VIDEO_START(suna16)
r1051r1052
811809   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
812810   MDRV_SCREEN_SIZE(256, 256)
813811   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
814   MDRV_GFXDECODE(suna16_gfxdecodeinfo)
812   MDRV_GFXDECODE(suna16)
815813   MDRV_PALETTE_LENGTH(512)
816814
817815   MDRV_VIDEO_START(suna16)
src/mame/drivers/zaccaria.c
r1051r1052
635635   32*8
636636};
637637
638static const gfx_decode gfxdecodeinfo[] =
639{
640   { REGION_GFX1, 0, &charlayout,      0, 32 },
641   { REGION_GFX1, 0, &spritelayout, 32*8, 32 },
642   { -1 }
643};
638static GFXDECODE_START( zaccaria )
639   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 32 )
640   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 32*8, 32 )
641GFXDECODE_END
644642
645643
646644static struct AY8910interface ay8910_interface =
r1051r1052
685683   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
686684   MDRV_SCREEN_SIZE(32*8, 32*8)
687685   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
688   MDRV_GFXDECODE(gfxdecodeinfo)
686   MDRV_GFXDECODE(zaccaria)
689687   MDRV_PALETTE_LENGTH(512)
690688   MDRV_COLORTABLE_LENGTH(32*8+32*8)
691689
src/mame/drivers/shadfrce.c
r1051r1052
523523   64*8
524524};
525525
526static const gfx_decode gfxdecodeinfo[] =
527{
528   { REGION_GFX1, 0, &fg8x8x4_layout,   0x0000, 256 },
529   { REGION_GFX2, 0, &sp16x16x5_layout, 0x1000, 128 },
530   { REGION_GFX3, 0, &bg16x16x6_layout, 0x2000, 128 },
531   { -1 }
532};
526static GFXDECODE_START( shadfrce )
527   GFXDECODE_ENTRY( REGION_GFX1, 0, fg8x8x4_layout,   0x0000, 256 )
528   GFXDECODE_ENTRY( REGION_GFX2, 0, sp16x16x5_layout, 0x1000, 128 )
529   GFXDECODE_ENTRY( REGION_GFX3, 0, bg16x16x6_layout, 0x2000, 128 )
530GFXDECODE_END
533531
534532/* Machine Driver Bits */
535533
r1051r1052
564562   MDRV_SCREEN_REFRESH_RATE(60)
565563   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
566564
567   MDRV_GFXDECODE(gfxdecodeinfo)
565   MDRV_GFXDECODE(shadfrce)
568566
569567   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
570568   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/speedbal.c
r1051r1052
216216   128*8  /* every sprite takes 128 consecutive bytes */
217217};
218218
219static const gfx_decode gfxdecodeinfo[] =
220{
221   { REGION_GFX1, 0, &charlayout,    256, 16 },
222   { REGION_GFX2, 0, &tilelayout,    512, 16 },
223   { REGION_GFX3, 0, &spritelayout,   0, 16 },
224   { -1 }
225};
219static GFXDECODE_START( speedbal )
220   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    256, 16 )
221   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    512, 16 )
222   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0, 16 )
223GFXDECODE_END
226224
227225
228226
r1051r1052
247245   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
248246   MDRV_SCREEN_SIZE(32*8, 32*8)
249247   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
250   MDRV_GFXDECODE(gfxdecodeinfo)
248   MDRV_GFXDECODE(speedbal)
251249   MDRV_PALETTE_LENGTH(768)
252250
253251   MDRV_VIDEO_START(speedbal)
src/mame/drivers/yumefuda.c
r1051r1052
9797   8*8
9898};
9999
100gfx_decode yumefuda_gfxdecodeinfo[] =
101{
102   { REGION_GFX1, 0x0000, &charlayout,   0, 0x10 },
103   { -1 }
104};
100static GFXDECODE_START( yumefuda )
101   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 0x10 )
102GFXDECODE_END
105103
106104
107105static WRITE8_HANDLER( yumefuda_vram_w )
r1051r1052
254252   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
255253   MDRV_SCREEN_SIZE(32*8, 32*8)
256254   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1)
257   MDRV_GFXDECODE( yumefuda_gfxdecodeinfo )
255   MDRV_GFXDECODE( yumefuda )
258256   MDRV_PALETTE_LENGTH(0x100)
259257
260258   MDRV_VIDEO_START( yumefuda )
src/mame/drivers/tagteam.c
r1051r1052
259259   32*8    /* every sprite takes 32 consecutive bytes */
260260};
261261
262static const gfx_decode tagteam_gfxdecodeinfo[] =
263{
264   { REGION_GFX1, 0, &charlayout,   0, 4 }, /* chars */
265   { REGION_GFX1, 0, &spritelayout, 0, 4 }, /* sprites */
266   { -1 }
267};
262static GFXDECODE_START( tagteam )
263   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 4 ) /* chars */
264   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 4 ) /* sprites */
265GFXDECODE_END
268266
269267
270268
r1051r1052
288286   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
289287   MDRV_SCREEN_SIZE(32*8, 32*8)
290288   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
291   MDRV_GFXDECODE(tagteam_gfxdecodeinfo)
289   MDRV_GFXDECODE(tagteam)
292290   MDRV_PALETTE_LENGTH(32)
293291
294292   MDRV_PALETTE_INIT(tagteam)
src/mame/drivers/bigevglf.c
r1051r1052
241241   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
242242   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
243243
244   PORT_START   /* port 05 on sub cpu */
245   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
246   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
247   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
248   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
249   PORT_DIPSETTING(    0x02, DEF_STR( Off ))
250   PORT_DIPSETTING(    0x00, DEF_STR( On ))
251   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
252    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
253    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
255   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) )
256   PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
257   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
258   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
259   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_2C ) )
244   PORT_START_TAG("DSW1")   /* port 05 on sub cpu */
245   PORT_DIPNAME( 0x01,   0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
246   PORT_DIPSETTING(      0x00, DEF_STR( Upright ) )
247   PORT_DIPSETTING(      0x01, DEF_STR( Cocktail ) )
248   PORT_DIPNAME( 0x02,   0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
249   PORT_DIPSETTING(      0x02, DEF_STR( Off ) )
250   PORT_DIPSETTING(      0x00, DEF_STR( On ) )
251   PORT_SERVICE_DIPLOC(  0x04, IP_ACTIVE_LOW, "SW1:3" )
252    PORT_DIPNAME( 0x08,   0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4")
253    PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
254   PORT_DIPSETTING(      0x08, DEF_STR( On ) )
255   PORT_DIPNAME( 0xf0,   0xf0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
256   PORT_DIPSETTING(      0x50, DEF_STR( 2C_1C ) )
257   PORT_DIPSETTING(      0xf0, DEF_STR( 1C_1C ) )
258   PORT_DIPSETTING(      0x00, DEF_STR( 2C_3C ) )
259   PORT_DIPSETTING(      0xa0, DEF_STR( 1C_2C ) )
260260
261   PORT_START   /* port 06 on sub cpu */
262   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
263   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
264   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
265   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
266   PORT_DIPSETTING(    0x00, "Difficult" )
267   PORT_DIPNAME( 0x0c, 0x0c, "Holes" )
268   PORT_DIPSETTING(    0x0c, "3" )
269    PORT_DIPSETTING(    0x08, "2" )
270    PORT_DIPSETTING(    0x04, "1" )
271    PORT_DIPSETTING(    0x00, "4" )
272   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Language ) ) /* Also changes the copyright on the title screen */
273   PORT_DIPSETTING(    0x00, DEF_STR( English ) )  /* (c) 1986 Taito America Corp. */
274    PORT_DIPSETTING(    0x10, DEF_STR( Japanese ) ) /* (c) Taito Corporation 1986 */
275    PORT_DIPNAME( 0xe0, 0xa0, "Full game price (credits)" )
276   PORT_DIPSETTING(    0xe0, "3" )
277   PORT_DIPSETTING(    0xc0, "4" )
278   PORT_DIPSETTING(    0xa0, "5" )
279   PORT_DIPSETTING(    0x80, "6" )
280   PORT_DIPSETTING(    0x60, "7" )
281   PORT_DIPSETTING(    0x40, "8" )
282   PORT_DIPSETTING(    0x20, "9" )
283   PORT_DIPSETTING(    0x00, "10" )
261   PORT_START_TAG("DSW2")   /* port 06 on sub cpu */
262   PORT_DIPNAME( 0x03,   0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
263   PORT_DIPSETTING(      0x01, DEF_STR( Easy ) )
264   PORT_DIPSETTING(      0x03, DEF_STR( Normal ) )
265   PORT_DIPSETTING(      0x02, DEF_STR( Hard ) )
266   PORT_DIPSETTING(      0x00, DEF_STR( Hardest ) )
267   PORT_DIPNAME( 0x0c,   0x0c, "Holes" ) PORT_DIPLOCATION("SW2:3,4")
268   PORT_DIPSETTING(      0x0c, "3" )
269    PORT_DIPSETTING(      0x08, "2" )
270    PORT_DIPSETTING(      0x04, "1" )
271    PORT_DIPSETTING(      0x00, "4" )
272   PORT_DIPNAME( 0x10,   0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:5") /* Also changes the copyright on the title screen */
273   PORT_DIPSETTING(      0x00, DEF_STR( English ) )                            /* (c) 1986 Taito America Corp. */
274    PORT_DIPSETTING(      0x10, DEF_STR( Japanese ) )                           /* (c) Taito Corporation 1986 */
275    PORT_DIPNAME( 0xe0,   0xa0, "Full game price (credits)" ) PORT_DIPLOCATION("SW2:6,7,8")
276   PORT_DIPSETTING(      0xe0, "3" )
277   PORT_DIPSETTING(      0xc0, "4" )
278   PORT_DIPSETTING(      0xa0, "5" )
279   PORT_DIPSETTING(      0x80, "6" )
280   PORT_DIPSETTING(      0x60, "7" )
281   PORT_DIPSETTING(      0x40, "8" )
282   PORT_DIPSETTING(      0x20, "9" )
283   PORT_DIPSETTING(      0x00, "10" )
284284
285285   PORT_START  /* TRACKBALL X - port 02 on sub cpu */
286286   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X  ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
r1051r1052
290290INPUT_PORTS_END
291291
292292INPUT_PORTS_START( bigevglj )
293   PORT_INCLUDE(bigevglf)
293294
294   PORT_START   /* port 00 on sub cpu */
295   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
296   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 )
297   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
298   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
299   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
300   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
301   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )
302   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
295   PORT_MODIFY("DSW2")
296   PORT_DIPNAME( 0x10,   0x10, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:5") /* Doesn't change the title screen copyright like the US set */
297   PORT_DIPSETTING(      0x00, DEF_STR( English ) )
298    PORT_DIPSETTING(      0x10, DEF_STR( Japanese ) )
303299
304   PORT_START   /* port 04 on sub cpu - bit 0 and bit 1 are coin inputs */
305   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
306   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
307
308   PORT_START   /* port 05 on sub cpu */
309   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
310   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
311   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
312   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
313   PORT_DIPSETTING(    0x02, DEF_STR( Off ))
314   PORT_DIPSETTING(    0x00, DEF_STR( On ))
315   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
316    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
317    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
318   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
319   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) )
320   PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
321   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
323   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_2C ) )
324
325   PORT_START   /* port 06 on sub cpu */
326   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
327   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
328   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
329   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
330   PORT_DIPSETTING(    0x00, "Difficult" )
331   PORT_DIPNAME( 0x0c, 0x0c, "Holes" )
332   PORT_DIPSETTING(    0x0c, "3" )
333    PORT_DIPSETTING(    0x08, "2" )
334    PORT_DIPSETTING(    0x04, "1" )
335    PORT_DIPSETTING(    0x00, "4" )
336   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Language ) ) /* Doesn't change the title screen copyright like the US set */
337   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
338    PORT_DIPSETTING(    0x10, DEF_STR( Japanese ) )
339    PORT_DIPNAME( 0xe0, 0xa0, "Full game price (credits)" )
340   PORT_DIPSETTING(    0xe0, "3" )
341   PORT_DIPSETTING(    0xc0, "4" )
342   PORT_DIPSETTING(    0xa0, "5" )
343   PORT_DIPSETTING(    0x80, "6" )
344   PORT_DIPSETTING(    0x60, "7" )
345   PORT_DIPSETTING(    0x40, "8" )
346   PORT_DIPSETTING(    0x20, "9" )
347   PORT_DIPSETTING(    0x00, "10" )
348
349   PORT_START  /* TRACKBALL X - port 02 on sub cpu */
350   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X  ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
351
352   PORT_START  /* TRACKBALL Y - port 03 on sub cpu */
353   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE
354300INPUT_PORTS_END
355301
356302
r1051r1052
511457   8*8
512458};
513459
514static const gfx_decode gfxdecodeinfo[] =
515{
516   { REGION_GFX1, 0, &gfxlayout,   0x20*16, 16 },
517   { -1 }   /* end of array */
518};
460static GFXDECODE_START( bigevglf )
461   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout,   0x20*16, 16 )
462GFXDECODE_END
519463
520464MACHINE_RESET( bigevglf )
521465{
r1051r1052
561505   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
562506   MDRV_SCREEN_SIZE(32*8, 32*8)
563507   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
564   MDRV_GFXDECODE(gfxdecodeinfo)
508   MDRV_GFXDECODE(bigevglf)
565509   MDRV_PALETTE_LENGTH(0x800)
566510   MDRV_VIDEO_START(bigevglf)
567511   MDRV_VIDEO_UPDATE(bigevglf)
src/mame/drivers/bagman.c
r1051r1052
533533
534534
535535
536static const gfx_decode gfxdecodeinfo[] =
537{
538   { REGION_GFX1, 0, &charlayout,      0, 16 },   /* char set #1 */
539   { REGION_GFX1, 0, &spritelayout,   0, 16 },   /* sprites */
540   { REGION_GFX2, 0, &charlayout,      0, 16 },   /* char set #2 */
541   { -1 }
542};
536static GFXDECODE_START( bagman )
537   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 16 )   /* char set #1 */
538   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,   0, 16 )   /* sprites */
539   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,      0, 16 )   /* char set #2 */
540GFXDECODE_END
543541
544static const gfx_decode pickin_gfxdecodeinfo[] =
545{
546   { REGION_GFX1, 0, &charlayout,      0, 16 },   /* char set #1 */
547   { REGION_GFX1, 0, &spritelayout,   0, 16 },   /* sprites */
542static GFXDECODE_START( pickin )
543   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 16 )   /* char set #1 */
544   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,   0, 16 )   /* sprites */
548545   /* no gfx2 */
549   { -1 }
550};
546GFXDECODE_END
551547
552548
553549
r1051r1052
581577   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
582578   MDRV_SCREEN_SIZE(32*8, 32*8)
583579   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
584   MDRV_GFXDECODE(gfxdecodeinfo)
580   MDRV_GFXDECODE(bagman)
585581   MDRV_PALETTE_LENGTH(64)
586582
587583   MDRV_PALETTE_INIT(bagman)
r1051r1052
618614   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
619615   MDRV_SCREEN_SIZE(32*8, 32*8)
620616   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
621   MDRV_GFXDECODE(pickin_gfxdecodeinfo)
617   MDRV_GFXDECODE(pickin)
622618   MDRV_PALETTE_LENGTH(64)
623619
624620   MDRV_PALETTE_INIT(bagman)
r1051r1052
669665   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
670666   MDRV_SCREEN_SIZE(32*8, 32*8)
671667   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
672   MDRV_GFXDECODE(gfxdecodeinfo)
668   MDRV_GFXDECODE(bagman)
673669   MDRV_PALETTE_LENGTH(64)
674670
675671   MDRV_PALETTE_INIT(bagman)
src/mame/drivers/namcos23.c
r1051r1052
833833};
834834#endif
835835
836static const gfx_decode gfxdecodeinfo[] =
837{
838   { 0, 0, &namcos23_cg_layout,  0, 0x80 },
839   { -1 },
840};
836static GFXDECODE_START( namcos23 )
837   GFXDECODE_ENTRY( 0, 0, namcos23_cg_layout,  0, 0x80 )
838GFXDECODE_END
841839
842840static struct mips3_config config =
843841{
r1051r1052
875873   MDRV_SCREEN_VISIBLE_AREA(0, 64*16-1, 0, 30*16-1)
876874   MDRV_PALETTE_LENGTH(0x8000)
877875
878   MDRV_GFXDECODE(gfxdecodeinfo)
876   MDRV_GFXDECODE(namcos23)
879877
880878   MDRV_VIDEO_START(ss23)
881879   MDRV_VIDEO_UPDATE(ss23)
r1051r1052
913911   MDRV_SCREEN_VISIBLE_AREA(0, 48*16-1, 0, 30*16-1)
914912   MDRV_PALETTE_LENGTH(0x8000)
915913
916   MDRV_GFXDECODE(gfxdecodeinfo)
914   MDRV_GFXDECODE(namcos23)
917915
918916   MDRV_VIDEO_START(ss23)
919917   MDRV_VIDEO_UPDATE(ss23)
src/mame/drivers/inufuku.c
r1051r1052
363363   128*8
364364};
365365
366static const gfx_decode inufuku_gfxdecodeinfo[] =
367{
368   { REGION_GFX1, 0, &tilelayout,    0, 256*16 },   // bg
369   { REGION_GFX2, 0, &tilelayout,    0, 256*16 },   // text
370   { REGION_GFX3, 0, &spritelayout,  0, 256*16 },   // sprite
371   { -1 }
372};
366static GFXDECODE_START( inufuku )
367   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,    0, 256*16 )   // bg
368   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    0, 256*16 )   // text
369   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  0, 256*16 )   // sprite
370GFXDECODE_END
373371
374372
375373/******************************************************************************
r1051r1052
420418   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
421419   MDRV_SCREEN_SIZE(2048, 256)
422420   MDRV_SCREEN_VISIBLE_AREA(0, 319-1, 1, 224-1)
423   MDRV_GFXDECODE(inufuku_gfxdecodeinfo)
421   MDRV_GFXDECODE(inufuku)
424422   MDRV_PALETTE_LENGTH(4096)
425423
426424   MDRV_VIDEO_START(inufuku)
src/mame/drivers/tattack.c
r1051r1052
157157
158158
159159
160static gfx_decode gfxdecodeinfo[] =
161{
162   { REGION_GFX1, 0     , &charlayout,  0, 1 },
163   { -1 }
164};
160static GFXDECODE_START( tattack )
161   GFXDECODE_ENTRY( REGION_GFX1, 0     , charlayout,  0, 1 )
162GFXDECODE_END
165163
166164static PALETTE_INIT( tattack  )
167165{
r1051r1052
198196   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
199197   MDRV_SCREEN_SIZE(32*8, 32*8)
200198   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
201   MDRV_GFXDECODE(gfxdecodeinfo)
199   MDRV_GFXDECODE(tattack)
202200   MDRV_PALETTE_LENGTH(16)
203201   MDRV_PALETTE_INIT(tattack )
204202
src/mame/drivers/commando.c
r1051r1052
215215
216216/* Graphics Decode Information */
217217
218static const gfx_decode gfxdecodeinfo[] =
219{
220   { REGION_GFX1, 0, &charlayout,   192, 16 },   // colors 192-255
221   { REGION_GFX2, 0, &tilelayout,     0, 16 },   // colors   0-127
222   { REGION_GFX3, 0, &spritelayout, 128,  4 },   // colors 128-191
223   { -1 }
224};
218static GFXDECODE_START( commando )
219   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   192, 16 )   // colors 192-255
220   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     0, 16 )   // colors   0-127
221   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 128,  4 )   // colors 128-191
222GFXDECODE_END
225223
226224/* Sound Interface */
227225
r1051r1052
257255   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
258256   MDRV_SCREEN_SIZE(32*8, 32*8)
259257   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
260   MDRV_GFXDECODE(gfxdecodeinfo)
258   MDRV_GFXDECODE(commando)
261259   MDRV_PALETTE_LENGTH(256)
262260
263261   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/atarisy2.c
r1051r1052
12541254};
12551255
12561256
1257static const gfx_decode gfxdecodeinfo[] =
1258{
1259   { REGION_GFX1, 0, &pflayout, 128, 8 },
1260   { REGION_GFX2, 0, &molayout,   0, 4 },
1261   { REGION_GFX3, 0, &anlayout,  64, 8 },
1262   { -1 }
1263};
1257static GFXDECODE_START( atarisy2 )
1258   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout, 128, 8 )
1259   GFXDECODE_ENTRY( REGION_GFX2, 0, molayout,   0, 4 )
1260   GFXDECODE_ENTRY( REGION_GFX3, 0, anlayout,  64, 8 )
1261GFXDECODE_END
12641262
12651263
12661264
r1051r1052
13201318       This value seems to work ok, but needs to be verified */
13211319   MDRV_SCREEN_SIZE(64*8, 420)
13221320   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 48*8-1)
1323   MDRV_GFXDECODE(gfxdecodeinfo)
1321   MDRV_GFXDECODE(atarisy2)
13241322   MDRV_PALETTE_LENGTH(256)
13251323
13261324   MDRV_VIDEO_START(atarisy2)
src/mame/drivers/ninjakd2.c
r1051r1052
441441   8*64
442442};
443443
444static const gfx_decode gfxdecodeinfo[] =
445{
446   { REGION_GFX1, 0, &spritelayout,  0*16, 16 },
447   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
448   { REGION_GFX3, 0, &charlayout,   32*16, 16 },
449   { -1 }
450};
444static GFXDECODE_START( ninjakd2 )
445   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,  0*16, 16 )
446   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
447   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,   32*16, 16 )
448GFXDECODE_END
451449
452450static struct Samplesinterface samples_interface =
453451{
r1051r1052
488486   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
489487   MDRV_SCREEN_SIZE(32*8, 32*8)
490488   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
491   MDRV_GFXDECODE(gfxdecodeinfo)
489   MDRV_GFXDECODE(ninjakd2)
492490   MDRV_PALETTE_LENGTH(768)
493491
494492   MDRV_VIDEO_START(ninjakd2)
src/mame/drivers/skydiver.c
r1051r1052
342342};
343343
344344
345static const gfx_decode gfxdecodeinfo[] =
346{
347   { REGION_GFX1, 0, &charlayout,    0, 4 },
348   { REGION_GFX2, 0, &motion_layout, 0, 4 },
349   { -1 }
350};
345static GFXDECODE_START( skydiver )
346   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 4 )
347   GFXDECODE_ENTRY( REGION_GFX2, 0, motion_layout, 0, 4 )
348GFXDECODE_END
351349
352350
353351
r1051r1052
374372   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
375373   MDRV_SCREEN_SIZE(32*8, 32*8)
376374   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
377   MDRV_GFXDECODE(gfxdecodeinfo)
375   MDRV_GFXDECODE(skydiver)
378376   MDRV_PALETTE_LENGTH(3)
379377   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
380378
r1051r1052
386384   MDRV_SPEAKER_STANDARD_MONO("mono")
387385
388386   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
389   MDRV_SOUND_CONFIG(skydiver_discrete_interface)
387   MDRV_SOUND_CONFIG_DISCRETE(skydiver)
390388   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
391389MACHINE_DRIVER_END
392390
src/mame/drivers/yunsung8.c
r1051r1052
488488   8*8*8/4
489489};
490490
491static const gfx_decode yunsung8_gfxdecodeinfo[] =
492{
493   { REGION_GFX1, 0, &layout_8x8x8, 0, 0x08 }, // [0] Tiles (Background)
494   { REGION_GFX2, 0, &layout_8x8x4, 0,   0x40 }, // [1] Tiles (Text)
495   { -1 }
496};
491static GFXDECODE_START( yunsung8 )
492   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x8, 0, 0x08 ) // [0] Tiles (Background)
493   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4, 0,   0x40 ) // [1] Tiles (Text)
494GFXDECODE_END
497495
498496
499497
r1051r1052
548546   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
549547   MDRV_SCREEN_SIZE(512, 256)
550548   MDRV_SCREEN_VISIBLE_AREA(0+64, 512-64-1, 0+8, 256-8-1)
551   MDRV_GFXDECODE(yunsung8_gfxdecodeinfo)
549   MDRV_GFXDECODE(yunsung8)
552550   MDRV_PALETTE_LENGTH(2048)
553551
554552   MDRV_VIDEO_START(yunsung8)
src/mame/drivers/warpwarp.c
r1051r1052
805805   8*8
806806};
807807
808static const gfx_decode gfxdecodeinfo_1k[] =
809{
810   { REGION_CPU1, 0x3000, &charlayout_1k, 0, 4 },
811   { -1 }
812};
808static GFXDECODE_START( 1k )
809   GFXDECODE_ENTRY( REGION_CPU1, 0x3000, charlayout_1k, 0, 4 )
810GFXDECODE_END
813811
814static const gfx_decode gfxdecodeinfo_2k[] =
815{
816   { REGION_CPU1, 0x3000, &charlayout_2k, 0, 2 },
817   { -1 }
818};
812static GFXDECODE_START( 2k )
813   GFXDECODE_ENTRY( REGION_CPU1, 0x3000, charlayout_2k, 0, 2 )
814GFXDECODE_END
819815
820static const gfx_decode gfxdecodeinfo_color[] =
821{
822   { REGION_CPU1, 0x4800, &charlayout_2k, 0, 256 },
823   { -1 }
824};
816static GFXDECODE_START( color )
817   GFXDECODE_ENTRY( REGION_CPU1, 0x4800, charlayout_2k, 0, 256 )
818GFXDECODE_END
825819
826820
827821static struct CustomSound_interface geebee_custom_interface =
r1051r1052
852846   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
853847   MDRV_SCREEN_SIZE(34*8, 28*8)
854848   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 28*8-1)
855   MDRV_GFXDECODE(gfxdecodeinfo_1k)
849   MDRV_GFXDECODE(1k)
856850   MDRV_PALETTE_LENGTH(3)
857851   MDRV_COLORTABLE_LENGTH(4*2)
858852
r1051r1052
873867   /* basic machine hardware */
874868   MDRV_IMPORT_FROM(geebee)
875869
876   MDRV_GFXDECODE(gfxdecodeinfo_2k)
870   MDRV_GFXDECODE(2k)
877871   MDRV_COLORTABLE_LENGTH(2*2)
878872
879873   MDRV_PALETTE_INIT(navarone)
r1051r1052
895889   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
896890   MDRV_SCREEN_SIZE(34*8, 28*8)
897891   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 28*8-1)
898   MDRV_GFXDECODE(gfxdecodeinfo_color)
892   MDRV_GFXDECODE(color)
899893   MDRV_PALETTE_LENGTH(256)
900894   MDRV_COLORTABLE_LENGTH(2*256)
901895
src/mame/drivers/steaser.c
r1051r1052
7272   8*64
7373};
7474
75static const gfx_decode gfxdecodeinfo[] =
76{
77   { REGION_GFX1, 0, &steaser_layout,   0x0, 2  },
78   { -1 }
79};
75static GFXDECODE_START( steaser )
76   GFXDECODE_ENTRY( REGION_GFX1, 0, steaser_layout,   0x0, 2  )
77GFXDECODE_END
8078
8179
8280
r1051r1052
8583   MDRV_CPU_PROGRAM_MAP(steaser_map,0)
8684//  MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
8785
88   MDRV_GFXDECODE(gfxdecodeinfo)
86   MDRV_GFXDECODE(steaser)
8987
9088   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
9189   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/cbuster.c
r1051r1052
321321   64*8
322322};
323323
324static const gfx_decode gfxdecodeinfo[] =
325{
326   { REGION_GFX1, 0, &charlayout,       0, 0x500 },   /* Characters 8x8 */
327   { REGION_GFX1, 0, &tilelayout,     0, 0x500 },   /* Tiles 16x16 */
328   { REGION_GFX2, 0, &tilelayout,     0, 0x500 },   /* Tiles 16x16 */
329   { REGION_GFX3, 0, &spritelayout, 0x100, 80 },   /* Sprites 16x16 */
330   { -1 }
331};
324static GFXDECODE_START( cbuster )
325   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 0x500 )   /* Characters 8x8 */
326   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,     0, 0x500 )   /* Tiles 16x16 */
327   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     0, 0x500 )   /* Tiles 16x16 */
328   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x100, 80 )   /* Sprites 16x16 */
329GFXDECODE_END
332330
333331/******************************************************************************/
334332
r1051r1052
360358   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
361359   MDRV_SCREEN_SIZE(32*8, 32*8)
362360   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
363   MDRV_GFXDECODE(gfxdecodeinfo)
361   MDRV_GFXDECODE(cbuster)
364362   MDRV_PALETTE_LENGTH(2048)
365363
366364   MDRV_VIDEO_START(twocrude)
src/mame/drivers/dunhuang.c
r1051r1052
653653   32*32
654654};
655655
656static const gfx_decode gfxdecodeinfo[] =
657{
658   { REGION_GFX1, 0, &layout_8x8,  0, 16 },
659   { REGION_GFX2, 0, &layout_8x32, 0, 16 },
660   { -1 }
661};
656static GFXDECODE_START( dunhuang )
657   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8,  0, 16 )
658   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x32, 0, 16 )
659GFXDECODE_END
662660
663661
664662/***************************************************************************
r1051r1052
688686   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
689687   MDRV_SCREEN_SIZE(512, 256)
690688   MDRV_SCREEN_VISIBLE_AREA(0+8, 512-8-1, 0+16, 256-16-1)
691   MDRV_GFXDECODE(gfxdecodeinfo)
689   MDRV_GFXDECODE(dunhuang)
692690   MDRV_PALETTE_LENGTH(0x100)
693691
694692   MDRV_VIDEO_START(dunhuang)
src/mame/drivers/gng.c
r1051r1052
327327
328328
329329
330static const gfx_decode gfxdecodeinfo[] =
331{
332   { REGION_GFX1, 0, &charlayout,    0x80, 16 },   /* colors 0x80-0xbf */
333   { REGION_GFX2, 0, &tilelayout,    0x00,   8 },   /* colors 0x00-0x3f */
334   { REGION_GFX3, 0, &spritelayout, 0x40,   4 },   /* colors 0x40-0x7f */
335   { -1 }
336};
330static GFXDECODE_START( gng )
331   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0x80, 16 )   /* colors 0x80-0xbf */
332   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    0x00,   8 )   /* colors 0x00-0x3f */
333   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x40,   4 )   /* colors 0x40-0x7f */
334GFXDECODE_END
337335
338336
339337
r1051r1052
360358   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
361359   MDRV_SCREEN_SIZE(32*8, 32*8)
362360   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
363   MDRV_GFXDECODE(gfxdecodeinfo)
361   MDRV_GFXDECODE(gng)
364362   MDRV_PALETTE_LENGTH(256)
365363
366364   MDRV_VIDEO_START(gng)
src/mame/drivers/onetwo.c
r1051r1052
235235   16*8
236236};
237237
238static const gfx_decode gfxdecodeinfo[] =
239{
240   { REGION_GFX1, 0, &tiles8x8x6_layout, 0, 2 },
241   { -1 }
242};
238static GFXDECODE_START( onetwo )
239   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8x6_layout, 0, 2 )
240GFXDECODE_END
243241
244242VIDEO_START( onetwo )
245243{
r1051r1052
282280   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
283281   MDRV_SCREEN_SIZE(512, 256)
284282   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
285   MDRV_GFXDECODE(gfxdecodeinfo)
283   MDRV_GFXDECODE(onetwo)
286284   MDRV_PALETTE_LENGTH(0x80)
287285
288286   MDRV_VIDEO_START(onetwo)
src/mame/drivers/ojankohs.c
r1051r1052
919919   16*8
920920};
921921
922static const gfx_decode ojankohs_gfxdecodeinfo[] =
923{
924   { REGION_GFX1, 0, &ojankohs_bglayout,   0, 64 },
925   { -1 }                   /* end of array */
926};
922static GFXDECODE_START( ojankohs )
923   GFXDECODE_ENTRY( REGION_GFX1, 0, ojankohs_bglayout,   0, 64 )
924GFXDECODE_END
927925
928926
929927static struct AY8910interface ojankohs_ay8910_interface =
r1051r1052
970968   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
971969   MDRV_SCREEN_SIZE(512, 512)
972970   MDRV_SCREEN_VISIBLE_AREA(0, 288-1, 0, 224-1)
973   MDRV_GFXDECODE(ojankohs_gfxdecodeinfo)
971   MDRV_GFXDECODE(ojankohs)
974972   MDRV_PALETTE_LENGTH(1024)
975973
976974   MDRV_VIDEO_START(ojankohs)
r1051r1052
10071005   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10081006   MDRV_SCREEN_SIZE(512, 512)
10091007   MDRV_SCREEN_VISIBLE_AREA(0, 288-1, 0, 224-1)
1010   MDRV_GFXDECODE(ojankohs_gfxdecodeinfo)
1008   MDRV_GFXDECODE(ojankohs)
10111009   MDRV_PALETTE_LENGTH(1024)
10121010   MDRV_PALETTE_INIT(ojankoy)
10131011
r1051r1052
10451043   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10461044   MDRV_SCREEN_SIZE(512, 512)
10471045   MDRV_SCREEN_VISIBLE_AREA(0, 288-1, 0, 224-1)
1048   MDRV_GFXDECODE(ojankohs_gfxdecodeinfo)
1046   MDRV_GFXDECODE(ojankohs)
10491047   MDRV_PALETTE_LENGTH(1024)
10501048
10511049   MDRV_VIDEO_START(ojankoy)
src/mame/drivers/raiders5.c
r1051r1052
196196};
197197
198198
199static const gfx_decode gfxdecodeinfo[] =
200{
201   { REGION_GFX1, 0x0000, &spritelayout, 512, 16 }, /* sprite */
202   { REGION_GFX1, 0x4000, &spritelayout, 512, 16 }, /* sprite */
203   { REGION_GFX1, 0x0000, &charlayout,     0, 16 }, /* FG */
204   { REGION_GFX1, 0x8000, &charlayout,   256, 16 }, /* BG */
205   { REGION_GFX1, 0x4000, &charlayout,   256, 16 }, /* BG (?)*/
206   { -1 }
207};
199static GFXDECODE_START( raiders5 )
200   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 512, 16 ) /* sprite */
201   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, spritelayout, 512, 16 ) /* sprite */
202   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,     0, 16 ) /* FG */
203   GFXDECODE_ENTRY( REGION_GFX1, 0x8000, charlayout,   256, 16 ) /* BG */
204   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, charlayout,   256, 16 ) /* BG (?)*/
205GFXDECODE_END
208206
209207
210208
r1051r1052
239237   /* video hardware */
240238   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
241239   MDRV_PALETTE_LENGTH(768)
242   MDRV_GFXDECODE(gfxdecodeinfo)
240   MDRV_GFXDECODE(raiders5)
243241   MDRV_VIDEO_START(raiders5)
244242   MDRV_VIDEO_UPDATE(raiders5)
245243
src/mame/drivers/wc90b.c
r1051r1052
334334   32*8   /* every char takes 128 consecutive bytes */
335335};
336336
337static const gfx_decode gfxdecodeinfo[] =
338{
339   { REGION_GFX1, 0x00000, &charlayout,         1*16*16, 16*16 },
340   { REGION_GFX2, 0x00000, &tilelayout,         2*16*16, 16*16 },
341   { REGION_GFX2, 0x02000, &tilelayout,         2*16*16, 16*16 },
342   { REGION_GFX2, 0x04000, &tilelayout,         2*16*16, 16*16 },
343   { REGION_GFX2, 0x06000, &tilelayout,         2*16*16, 16*16 },
344   { REGION_GFX2, 0x08000, &tilelayout,         2*16*16, 16*16 },
345   { REGION_GFX2, 0x0a000, &tilelayout,         2*16*16, 16*16 },
346   { REGION_GFX2, 0x0c000, &tilelayout,         2*16*16, 16*16 },
347   { REGION_GFX2, 0x0e000, &tilelayout,         2*16*16, 16*16 },
348   { REGION_GFX2, 0x10000, &tilelayout,         3*16*16, 16*16 },
349   { REGION_GFX2, 0x12000, &tilelayout,         3*16*16, 16*16 },
350   { REGION_GFX2, 0x14000, &tilelayout,         3*16*16, 16*16 },
351   { REGION_GFX2, 0x16000, &tilelayout,         3*16*16, 16*16 },
352   { REGION_GFX2, 0x18000, &tilelayout,         3*16*16, 16*16 },
353   { REGION_GFX2, 0x1a000, &tilelayout,         3*16*16, 16*16 },
354   { REGION_GFX2, 0x1c000, &tilelayout,         3*16*16, 16*16 },
355   { REGION_GFX2, 0x1e000, &tilelayout,         3*16*16, 16*16 },
356   { REGION_GFX3, 0x00000, &spritelayout,      0*16*16, 16*16 }, // sprites
357   { -1 }
358};
337static GFXDECODE_START( wc90b )
338   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,         1*16*16, 16*16 )
339   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout,         2*16*16, 16*16 )
340   GFXDECODE_ENTRY( REGION_GFX2, 0x02000, tilelayout,         2*16*16, 16*16 )
341   GFXDECODE_ENTRY( REGION_GFX2, 0x04000, tilelayout,         2*16*16, 16*16 )
342   GFXDECODE_ENTRY( REGION_GFX2, 0x06000, tilelayout,         2*16*16, 16*16 )
343   GFXDECODE_ENTRY( REGION_GFX2, 0x08000, tilelayout,         2*16*16, 16*16 )
344   GFXDECODE_ENTRY( REGION_GFX2, 0x0a000, tilelayout,         2*16*16, 16*16 )
345   GFXDECODE_ENTRY( REGION_GFX2, 0x0c000, tilelayout,         2*16*16, 16*16 )
346   GFXDECODE_ENTRY( REGION_GFX2, 0x0e000, tilelayout,         2*16*16, 16*16 )
347   GFXDECODE_ENTRY( REGION_GFX2, 0x10000, tilelayout,         3*16*16, 16*16 )
348   GFXDECODE_ENTRY( REGION_GFX2, 0x12000, tilelayout,         3*16*16, 16*16 )
349   GFXDECODE_ENTRY( REGION_GFX2, 0x14000, tilelayout,         3*16*16, 16*16 )
350   GFXDECODE_ENTRY( REGION_GFX2, 0x16000, tilelayout,         3*16*16, 16*16 )
351   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tilelayout,         3*16*16, 16*16 )
352   GFXDECODE_ENTRY( REGION_GFX2, 0x1a000, tilelayout,         3*16*16, 16*16 )
353   GFXDECODE_ENTRY( REGION_GFX2, 0x1c000, tilelayout,         3*16*16, 16*16 )
354   GFXDECODE_ENTRY( REGION_GFX2, 0x1e000, tilelayout,         3*16*16, 16*16 )
355   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, spritelayout,      0*16*16, 16*16 ) // sprites
356GFXDECODE_END
359357
360358
361359
r1051r1052
412410   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
413411   MDRV_SCREEN_SIZE(32*8, 32*8)
414412   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
415   MDRV_GFXDECODE(gfxdecodeinfo)
413   MDRV_GFXDECODE(wc90b)
416414   MDRV_PALETTE_LENGTH(1024)
417415
418416   MDRV_VIDEO_START(wc90b)
src/mame/drivers/kncljoe.c
r1051r1052
168168   32*8
169169};
170170
171static const gfx_decode gfxdecodeinfo[] =
172{
173   { REGION_GFX1, 0, &charlayout,   0x00, 16 },   /* colors 0x00-0x7f direct mapped */
174   { REGION_GFX2, 0, &spritelayout, 0x80, 16 },   /* colors 0x80-0x8f with lookup table */
175   { REGION_GFX3, 0, &spritelayout, 0x80, 16 },
176   { -1 }
177};
171static GFXDECODE_START( kncljoe )
172   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x00, 16 )   /* colors 0x00-0x7f direct mapped */
173   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x80, 16 )   /* colors 0x80-0x8f with lookup table */
174   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x80, 16 )
175GFXDECODE_END
178176
179177
180178
r1051r1052
194192   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
195193   MDRV_SCREEN_SIZE(32*8, 32*8)
196194   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 32*8-1)
197   MDRV_GFXDECODE(gfxdecodeinfo)
195   MDRV_GFXDECODE(kncljoe)
198196   MDRV_PALETTE_LENGTH(128+16)
199197   MDRV_COLORTABLE_LENGTH(16*8+16*8)
200198
src/mame/drivers/holeland.c
r1051r1052
268268   8*16
269269};
270270
271static const gfx_decode holeland_gfxdecodeinfo[] =
272{
273   { REGION_GFX1, 0, &holeland_charlayout,   0, 256 },
274   { REGION_GFX2, 0, &holeland_spritelayout, 0, 256 },
275   { -1 }
276};
271static GFXDECODE_START( holeland )
272   GFXDECODE_ENTRY( REGION_GFX1, 0, holeland_charlayout,   0, 256 )
273   GFXDECODE_ENTRY( REGION_GFX2, 0, holeland_spritelayout, 0, 256 )
274GFXDECODE_END
277275
278static const gfx_decode crzrally_gfxdecodeinfo[] =
279{
280   { REGION_GFX1, 0, &crzrally_charlayout,   0, 256 },
281   { REGION_GFX2, 0, &crzrally_spritelayout, 0, 256 },
282   { -1 }
283};
276static GFXDECODE_START( crzrally )
277   GFXDECODE_ENTRY( REGION_GFX1, 0, crzrally_charlayout,   0, 256 )
278   GFXDECODE_ENTRY( REGION_GFX2, 0, crzrally_spritelayout, 0, 256 )
279GFXDECODE_END
284280
285281
286282
r1051r1052
314310   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
315311   MDRV_SCREEN_SIZE(32*16, 32*16)
316312   MDRV_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 2*16, 30*16-1)
317   MDRV_GFXDECODE(holeland_gfxdecodeinfo)
313   MDRV_GFXDECODE(holeland)
318314   MDRV_PALETTE_LENGTH(256)
319315
320316   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
383379   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
384380   MDRV_SCREEN_SIZE(32*8, 32*8)
385381   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
386   MDRV_GFXDECODE(crzrally_gfxdecodeinfo)
382   MDRV_GFXDECODE(crzrally)
387383   MDRV_PALETTE_LENGTH(256)
388384
389385   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/liberate.c
r1051r1052
474474   64*8
475475};
476476
477static const gfx_decode gfxdecodeinfo[] =
478{
479   { REGION_GFX1, 0x00000, &charlayout,  0, 4 },
480   { REGION_GFX1, 0x00000, &sprites,     0, 4 },
481   { REGION_GFX2, 0x00000, &tiles1,      0, 4 },
482   { REGION_GFX2, 0x00000, &tiles2,      0, 4 },
483   { -1 }
484};
477static GFXDECODE_START( liberate )
478   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,  0, 4 )
479   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, sprites,     0, 4 )
480   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tiles1,      0, 4 )
481   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tiles2,      0, 4 )
482GFXDECODE_END
485483
486static const gfx_decode prosport_gfxdecodeinfo[] =
487{
488   { REGION_GFX1, 0x00000, &charlayout,  0, 4 },
489   { REGION_GFX1, 0x00000, &sprites,     0, 4 },
490   { REGION_GFX2, 0x00000, &pro_tiles,   0, 4 },
491   { REGION_GFX2, 0x00800, &pro_tiles,   0, 4 },
492   { -1 }
493};
484static GFXDECODE_START( prosport )
485   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,  0, 4 )
486   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, sprites,     0, 4 )
487   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, pro_tiles,   0, 4 )
488   GFXDECODE_ENTRY( REGION_GFX2, 0x00800, pro_tiles,   0, 4 )
489GFXDECODE_END
494490
495491/*************************************
496492 *
r1051r1052
539535   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
540536   MDRV_SCREEN_SIZE(32*8, 32*8)
541537   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
542   MDRV_GFXDECODE(gfxdecodeinfo)
538   MDRV_GFXDECODE(liberate)
543539   MDRV_PALETTE_LENGTH(33)
544540   MDRV_PALETTE_INIT(liberate)
545541
r1051r1052
609605   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
610606   MDRV_SCREEN_SIZE(32*8, 32*8)
611607   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
612   MDRV_GFXDECODE(prosport_gfxdecodeinfo)
608   MDRV_GFXDECODE(prosport)
613609   MDRV_PALETTE_LENGTH(256)
614610
615611   MDRV_VIDEO_START(boomrang)
src/mame/drivers/spdodgeb.c
r1051r1052
401401   64*8
402402};
403403
404static const gfx_decode gfxdecodeinfo[] =
405{
406   { REGION_GFX1, 0, &charlayout,   0x000, 32 },   /* colors 0x000-0x1ff */
407   { REGION_GFX2, 0, &spritelayout, 0x200, 32 },   /* colors 0x200-0x3ff */
408   { -1 }
409};
404static GFXDECODE_START( spdodgeb )
405   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x000, 32 )   /* colors 0x000-0x1ff */
406   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x200, 32 )   /* colors 0x200-0x3ff */
407GFXDECODE_END
410408
411409
412410static void irq_handler(int irq)
r1051r1052
446444   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
447445   MDRV_SCREEN_SIZE(32*8, 32*8)
448446   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
449   MDRV_GFXDECODE(gfxdecodeinfo)
447   MDRV_GFXDECODE(spdodgeb)
450448   MDRV_PALETTE_LENGTH(1024)
451449
452450   MDRV_PALETTE_INIT(spdodgeb)
src/mame/drivers/gunsmoke.c
r1051r1052
275275
276276/* Graphics Decode Info */
277277
278static const gfx_decode gfxdecodeinfo[] =
279{
280   { REGION_GFX1, 0, &charlayout,            0, 32 },
281   { REGION_GFX2, 0, &tilelayout,         32*4, 16 },
282   { REGION_GFX3, 0, &spritelayout, 32*4+16*16, 16 },
283   { -1 }
284};
278static GFXDECODE_START( gunsmoke )
279   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,            0, 32 )
280   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,         32*4, 16 )
281   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 32*4+16*16, 16 )
282GFXDECODE_END
285283
286284/* Machine Driver */
287285
r1051r1052
304302   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
305303   MDRV_SCREEN_SIZE(32*8, 32*8)
306304   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
307   MDRV_GFXDECODE(gfxdecodeinfo)
305   MDRV_GFXDECODE(gunsmoke)
308306   MDRV_PALETTE_LENGTH(256)
309307   MDRV_COLORTABLE_LENGTH(32*4+16*16+16*16)
310308
src/mame/drivers/cvs.c
r1051r1052
359359   8*16
360360};
361361
362static const gfx_decode cvs_gfxdecodeinfo[] =
363{
364   { REGION_GFX1, 0x0000, &charlayout8colour, 0, 259 },   /* Rom chars */
365   { REGION_GFX1, 0x0000, &charlayout8colour, 0, 259 },   /* Ram chars */
366     { REGION_GFX1, 0x0000, &s2636_character10, 2072, 8 },   /* s2636 #1  */
367     { REGION_GFX1, 0x0000, &s2636_character10, 2072, 8 },   /* s2636 #2  */
368     { REGION_GFX1, 0x0000, &s2636_character10, 2072, 8 },   /* s2636 #3  */
369   { -1 }
370};
362static GFXDECODE_START( cvs )
363   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout8colour, 0, 259 )   /* Rom chars */
364   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout8colour, 0, 259 )   /* Ram chars */
365     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #1  */
366     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #2  */
367     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #3  */
368GFXDECODE_END
371369
372370static MACHINE_DRIVER_START( cvs )
373371
r1051r1052
390388   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
391389   MDRV_SCREEN_SIZE(32*8, 32*8)
392390   MDRV_SCREEN_VISIBLE_AREA(0*8, 30*8-1, 1*8, 32*8-1)
393   MDRV_GFXDECODE(cvs_gfxdecodeinfo)
391   MDRV_GFXDECODE(cvs)
394392   MDRV_PALETTE_LENGTH(16)
395393   MDRV_COLORTABLE_LENGTH(4096)
396394
src/mame/drivers/turbo.c
r1051r1052
982982 *
983983 *************************************/
984984
985static const gfx_decode gfxdecodeinfo[] =
986{
987   { REGION_GFX2, 0, &gfx_8x8x2_planar, 0, 64 },
988   { -1 }
989};
985static GFXDECODE_START( turbo )
986   GFXDECODE_ENTRY( REGION_GFX2, 0, gfx_8x8x2_planar, 0, 64 )
987GFXDECODE_END
990988
991989
992990
r1051r1052
10061004
10071005   /* video hardware */
10081006   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
1009   MDRV_GFXDECODE(gfxdecodeinfo)
1007   MDRV_GFXDECODE(turbo)
10101008   MDRV_PALETTE_LENGTH(256)
10111009
10121010   MDRV_SCREEN_ADD("main", 0)
r1051r1052
10321030
10331031   /* video hardware */
10341032   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1035   MDRV_GFXDECODE(gfxdecodeinfo)
1033   MDRV_GFXDECODE(turbo)
10361034   MDRV_PALETTE_LENGTH(256)
10371035
10381036   MDRV_SCREEN_ADD("main", 0)
r1051r1052
10651063
10661064   /* video hardware */
10671065   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1068   MDRV_GFXDECODE(gfxdecodeinfo)
1066   MDRV_GFXDECODE(turbo)
10691067   MDRV_PALETTE_LENGTH(1024)
10701068
10711069   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/seta.c
r1051r1052
62256225                                Blandia
62266226***************************************************************************/
62276227
6228static const gfx_decode blandia_gfxdecodeinfo[] =
6229{
6230   { REGION_GFX1, 0, &layout_planes_2roms,       0,           32 }, // [0] Sprites
6231   { REGION_GFX2, 0, &layout_packed_6bits_3roms, 16*32+64*32, 32 }, // [1] Layer 1
6232   { REGION_GFX3, 0, &layout_packed_6bits_3roms, 16*32,       32 }, // [2] Layer 2
6233   { -1 }
6234};
6228static GFXDECODE_START( blandia )
6229   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms,       0,           32 ) // [0] Sprites
6230   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed_6bits_3roms, 16*32+64*32, 32 ) // [1] Layer 1
6231   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_packed_6bits_3roms, 16*32,       32 ) // [2] Layer 2
6232GFXDECODE_END
62356233
62366234/***************************************************************************
62376235                                DownTown
62386236***************************************************************************/
62396237
6240static const gfx_decode downtown_gfxdecodeinfo[] =
6241{
6242   { REGION_GFX1, 0, &layout_planes_2roms,       512*0, 32 }, // [0] Sprites
6243   { REGION_GFX2, 0, &layout_planes_2roms_split, 512*0, 32 }, // [1] Layer 1
6244   { -1 }
6245};
6238static GFXDECODE_START( downtown )
6239   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms,       512*0, 32 ) // [0] Sprites
6240   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_planes_2roms_split, 512*0, 32 ) // [1] Layer 1
6241GFXDECODE_END
62466242
62476243/***************************************************************************
62486244                                J.J.Squawkers
62496245***************************************************************************/
62506246
6251static const gfx_decode jjsquawk_gfxdecodeinfo[] =
6252{
6253   { REGION_GFX1, 0, &layout_planes_2roms,       0,             32 }, // [0] Sprites
6254   { REGION_GFX2, 0, &layout_packed_6bits_2roms, 512 + 64*32*0, 32 }, // [1] Layer 1
6255   { REGION_GFX3, 0, &layout_packed_6bits_2roms, 512 + 64*32*1, 32 }, // [2] Layer 2
6256   { -1 }
6257};
6247static GFXDECODE_START( jjsquawk )
6248   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms,       0,             32 ) // [0] Sprites
6249   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed_6bits_2roms, 512 + 64*32*0, 32 ) // [1] Layer 1
6250   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_packed_6bits_2roms, 512 + 64*32*1, 32 ) // [2] Layer 2
6251GFXDECODE_END
62586252
62596253/***************************************************************************
62606254                            Mobile Suit Gundam
62616255***************************************************************************/
62626256
6263static const gfx_decode msgundam_gfxdecodeinfo[] =
6264{
6265   { REGION_GFX1, 0, &layout_planes_2roms, 512*0, 32 }, // [0] Sprites
6266   { REGION_GFX2, 0, &layout_packed,       512*2, 32 }, // [1] Layer 1
6267   { REGION_GFX3, 0, &layout_packed,       512*1, 32 }, // [2] Layer 2
6268   { -1 }
6269};
6257static GFXDECODE_START( msgundam )
6258   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms, 512*0, 32 ) // [0] Sprites
6259   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed,       512*2, 32 ) // [1] Layer 1
6260   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_packed,       512*1, 32 ) // [2] Layer 2
6261GFXDECODE_END
62706262
62716263/***************************************************************************
62726264                                Quiz Kokology 2
62736265***************************************************************************/
62746266
6275static const gfx_decode qzkklgy2_gfxdecodeinfo[] =
6276{
6277   { REGION_GFX1, 0, &layout_planes_2roms,   512*0, 32 }, // [0] Sprites
6278   { REGION_GFX2, 0, &layout_packed,       512*0, 32 }, // [1] Layer 1
6279   { -1 }
6280};
6267static GFXDECODE_START( qzkklgy2 )
6268   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms,   512*0, 32 ) // [0] Sprites
6269   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed,       512*0, 32 ) // [1] Layer 1
6270GFXDECODE_END
62816271
62826272/***************************************************************************
62836273                                Thundercade
62846274***************************************************************************/
62856275
6286static const gfx_decode tndrcade_gfxdecodeinfo[] =
6287{
6288   { REGION_GFX1, 0, &layout_planes_2roms, 512*0, 32 }, // [0] Sprites
6289   { -1 }
6290};
6276static GFXDECODE_START( tndrcade )
6277   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms, 512*0, 32 ) // [0] Sprites
6278GFXDECODE_END
62916279
62926280/***************************************************************************
62936281                                Wiggie Waggle
r1051r1052
63096297};
63106298
63116299
6312static const gfx_decode wiggie_gfxdecodeinfo[] =
6313{
6314   { REGION_GFX1, 0, &wiggie_layout,   0x0, 32  }, /* bg tiles */
6315   { -1 }
6316};
6300static GFXDECODE_START( wiggie )
6301   GFXDECODE_ENTRY( REGION_GFX1, 0, wiggie_layout,   0x0, 32  ) /* bg tiles */
6302GFXDECODE_END
63176303
63186304
63196305/***************************************************************************
63206306                                U.S. Classic
63216307***************************************************************************/
63226308
6323static const gfx_decode usclssic_gfxdecodeinfo[] =
6324{
6325   { REGION_GFX1, 0, &layout_planes_2roms,       0, 32 }, // [0] Sprites
6326   { REGION_GFX2, 0, &layout_packed_6bits_3roms, 512, 32 }, // [1] Layer 1
6327   { -1 }
6328};
6309static GFXDECODE_START( usclssic )
6310   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms,       0, 32 ) // [0] Sprites
6311   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed_6bits_3roms, 512, 32 ) // [1] Layer 1
6312GFXDECODE_END
63296313
63306314
63316315/***************************************************************************
63326316                                Zing Zing Zip
63336317***************************************************************************/
63346318
6335static const gfx_decode zingzip_gfxdecodeinfo[] =
6336{
6337   { REGION_GFX1, 0, &layout_planes_2roms,       512*0, 32 }, // [0] Sprites
6338   { REGION_GFX2, 0, &layout_packed_6bits_2roms, 512*2, 32 }, // [1] Layer 1
6339   { REGION_GFX3, 0, &layout_packed,             512*1, 32 }, // [2] Layer 2
6340   { -1 }
6341};
6319static GFXDECODE_START( zingzip )
6320   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes_2roms,       512*0, 32 ) // [0] Sprites
6321   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed_6bits_2roms, 512*2, 32 ) // [1] Layer 1
6322   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_packed,             512*1, 32 ) // [2] Layer 2
6323GFXDECODE_END
63426324
63436325
63446326/***************************************************************************
63456327                                Crazy Fight
63466328***************************************************************************/
63476329
6348static const gfx_decode crazyfgt_gfxdecodeinfo[] =
6349{
6350   { REGION_GFX1, 0, &layout_planes,             0,           32 }, // [0] Sprites
6351   { REGION_GFX2, 0, &layout_packed_6bits_3roms, 16*32+64*32, 32 }, // [1] Layer 1
6352   { REGION_GFX3, 0, &layout_packed_6bits_3roms, 16*32,       32 }, // [2] Layer 2
6353   { -1 }
6354};
6330static GFXDECODE_START( crazyfgt )
6331   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes,             0,           32 ) // [0] Sprites
6332   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_packed_6bits_3roms, 16*32+64*32, 32 ) // [1] Layer 1
6333   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_packed_6bits_3roms, 16*32,       32 ) // [2] Layer 2
6334GFXDECODE_END
63556335
63566336
63576337
r1051r1052
64336413   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
64346414   MDRV_SCREEN_SIZE(64*8, 32*8)
64356415   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
6436   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
6416   MDRV_GFXDECODE(tndrcade)
64376417   MDRV_PALETTE_LENGTH(512)   /* sprites only */
64386418
64396419   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
64836463   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
64846464   MDRV_SCREEN_SIZE(64*8, 32*8)
64856465   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6486   MDRV_GFXDECODE(downtown_gfxdecodeinfo)
6466   MDRV_GFXDECODE(downtown)
64876467   MDRV_PALETTE_LENGTH(512)
64886468
64896469   MDRV_VIDEO_START(twineagl_1_layer)
r1051r1052
65256505   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
65266506   MDRV_SCREEN_SIZE(64*8, 32*8)
65276507   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6528   MDRV_GFXDECODE(downtown_gfxdecodeinfo)
6508   MDRV_GFXDECODE(downtown)
65296509   MDRV_PALETTE_LENGTH(512)
65306510
65316511   MDRV_VIDEO_START(seta_1_layer)
r1051r1052
65856565   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
65866566   MDRV_SCREEN_SIZE(64*8, 32*8)
65876567   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6588   MDRV_GFXDECODE(usclssic_gfxdecodeinfo)
6568   MDRV_GFXDECODE(usclssic)
65896569   MDRV_PALETTE_LENGTH(16*32+0x200)
65906570   MDRV_COLORTABLE_LENGTH(16*32 + 64*32)      /* sprites, layer */
65916571
r1051r1052
66316611   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
66326612   MDRV_SCREEN_SIZE(64*8, 32*8)
66336613   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6634   MDRV_GFXDECODE(downtown_gfxdecodeinfo)
6614   MDRV_GFXDECODE(downtown)
66356615   MDRV_PALETTE_LENGTH(512)
66366616
66376617   MDRV_VIDEO_START(seta_1_layer)
r1051r1052
66726652   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
66736653   MDRV_SCREEN_SIZE(64*8, 32*8)
66746654   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
6675   MDRV_GFXDECODE(downtown_gfxdecodeinfo)
6655   MDRV_GFXDECODE(downtown)
66766656   MDRV_PALETTE_LENGTH(512)
66776657
66786658   MDRV_VIDEO_START(seta_1_layer)
r1051r1052
67116691   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
67126692   MDRV_SCREEN_SIZE(64*8, 32*8)
67136693   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6714   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
6694   MDRV_GFXDECODE(tndrcade)
67156695   MDRV_PALETTE_LENGTH(512)   /* sprites only */
67166696
67176697   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
67536733   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
67546734   MDRV_SCREEN_SIZE(64*8, 32*8)
67556735   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6756   MDRV_GFXDECODE(blandia_gfxdecodeinfo)
6736   MDRV_GFXDECODE(blandia)
67576737   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
67586738   MDRV_COLORTABLE_LENGTH(16*32+64*32+64*32)   /* sprites, layer1, layer2 */
67596739
r1051r1052
67866766   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
67876767   MDRV_SCREEN_SIZE(64*8, 32*8)
67886768   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6789   MDRV_GFXDECODE(blandia_gfxdecodeinfo)
6769   MDRV_GFXDECODE(blandia)
67906770   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
67916771   MDRV_COLORTABLE_LENGTH(16*32+64*32+64*32)   /* sprites, layer1, layer2 */
67926772
r1051r1052
68246804   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
68256805   MDRV_SCREEN_SIZE(64*8, 32*8)
68266806   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6827   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
6807   MDRV_GFXDECODE(tndrcade)
68286808   MDRV_PALETTE_LENGTH(512)   /* sprites only */
68296809
68306810   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
68596839   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
68606840   MDRV_SCREEN_SIZE(64*8, 32*8)
68616841   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6862   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
6842   MDRV_GFXDECODE(msgundam)
68636843   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer1, layer2 */
68646844
68656845   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
68996879   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
69006880   MDRV_SCREEN_SIZE(64*8, 32*8)
69016881   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6902   MDRV_GFXDECODE(downtown_gfxdecodeinfo)
6882   MDRV_GFXDECODE(downtown)
69036883   MDRV_PALETTE_LENGTH(512)
69046884
69056885   MDRV_VIDEO_START(seta_1_layer)
r1051r1052
69336913   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
69346914   MDRV_SCREEN_SIZE(64*8, 32*8)
69356915   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
6936   MDRV_GFXDECODE(qzkklgy2_gfxdecodeinfo)
6916   MDRV_GFXDECODE(qzkklgy2)
69376917   MDRV_PALETTE_LENGTH(512)
69386918
69396919   MDRV_VIDEO_START(seta_1_layer)
r1051r1052
69696949   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
69706950   MDRV_SCREEN_SIZE(64*8, 32*8)
69716951   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
6972   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
6952   MDRV_GFXDECODE(msgundam)
69736953   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer1, layer2 */
69746954
69756955   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
70096989   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
70106990   MDRV_SCREEN_SIZE(64*8, 32*8)
70116991   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
7012   MDRV_GFXDECODE(zingzip_gfxdecodeinfo)
6992   MDRV_GFXDECODE(zingzip)
70136993   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
70146994   MDRV_COLORTABLE_LENGTH(16*32+16*32+64*32)   /* sprites, layer2, layer1 */
70156995
r1051r1052
70717051   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
70727052   MDRV_SCREEN_SIZE(64*8, 32*8)
70737053   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7074   MDRV_GFXDECODE(jjsquawk_gfxdecodeinfo)
7054   MDRV_GFXDECODE(jjsquawk)
70757055   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
70767056   MDRV_COLORTABLE_LENGTH(16*32+64*32+64*32)   /* sprites, layer2, layer1 */
70777057
r1051r1052
71127092   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
71137093   MDRV_SCREEN_SIZE(64*8, 32*8)
71147094   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7115   MDRV_GFXDECODE(jjsquawk_gfxdecodeinfo)
7095   MDRV_GFXDECODE(jjsquawk)
71167096   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
71177097   MDRV_COLORTABLE_LENGTH(16*32+64*32+64*32)   /* sprites, layer2, layer1 */
71187098
r1051r1052
71537133   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
71547134   MDRV_SCREEN_SIZE(64*8, 32*8)
71557135   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7156   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7136   MDRV_GFXDECODE(msgundam)
71577137   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer2, layer1 */
71587138
71597139   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
71887168   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
71897169   MDRV_SCREEN_SIZE(64*8, 32*8)
71907170   MDRV_SCREEN_VISIBLE_AREA(1*8, 39*8-1, 1*8, 31*8-1)
7191   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
7171   MDRV_GFXDECODE(tndrcade)
71927172   MDRV_PALETTE_LENGTH(512)   /* sprites only */
71937173
71947174   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
72297209   MDRV_SCREEN_SIZE(64*8, 32*8)
72307210   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
72317211
7232   MDRV_GFXDECODE(jjsquawk_gfxdecodeinfo)
7212   MDRV_GFXDECODE(jjsquawk)
72337213   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
72347214   MDRV_COLORTABLE_LENGTH(16*32+64*32+64*32)   /* sprites, layer2, layer1 */
72357215
r1051r1052
72767256   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
72777257   MDRV_SCREEN_SIZE(64*8, 32*8)
72787258   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7279   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7259   MDRV_GFXDECODE(msgundam)
72807260   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer2, layer1 */
72817261
72827262   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
73137293   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
73147294   MDRV_SCREEN_SIZE(64*8, 32*8)
73157295   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
7316   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7296   MDRV_GFXDECODE(msgundam)
73177297   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer2, layer1 */
73187298
73197299   MDRV_VIDEO_START(oisipuzl_2_layers)   // flip is inverted for the tilemaps
r1051r1052
73497329   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
73507330   MDRV_SCREEN_SIZE(64*8, 32*8)
73517331   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
7352   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7332   MDRV_GFXDECODE(msgundam)
73537333   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer2, layer1 */
73547334
73557335   MDRV_VIDEO_START(oisipuzl_2_layers)   // flip is inverted for the tilemaps
r1051r1052
73837363   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
73847364   MDRV_SCREEN_SIZE(64*8, 32*8)
73857365   MDRV_SCREEN_VISIBLE_AREA(0*8, 56*8-1, 1*8, 31*8-1)
7386   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
7366   MDRV_GFXDECODE(tndrcade)
73877367   MDRV_PALETTE_LENGTH(512)   /* sprites only */
73887368
73897369   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
74217401   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
74227402   MDRV_SCREEN_SIZE(64*8, 32*8)
74237403   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7424   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7404   MDRV_GFXDECODE(msgundam)
74257405   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer1, layer2 */
74267406
74277407   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
74597439   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
74607440   MDRV_SCREEN_SIZE(64*8, 32*8)
74617441   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7462   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
7442   MDRV_GFXDECODE(tndrcade)
74637443   MDRV_PALETTE_LENGTH(512)   /* sprites only */
74647444
74657445   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
74937473   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
74947474   MDRV_SCREEN_SIZE(64*8, 32*8)
74957475   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7496   MDRV_GFXDECODE(wiggie_gfxdecodeinfo)
7476   MDRV_GFXDECODE(wiggie)
74977477   MDRV_PALETTE_LENGTH(512)   /* sprites only */
74987478
74997479   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
75237503   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
75247504   MDRV_SCREEN_SIZE(64*8, 32*8)
75257505   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7526   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
7506   MDRV_GFXDECODE(tndrcade)
75277507   MDRV_PALETTE_LENGTH(512)   /* sprites only */
75287508
75297509   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
75597539   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
75607540   MDRV_SCREEN_SIZE(64*8, 32*8)
75617541   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7562   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
7542   MDRV_GFXDECODE(tndrcade)
75637543   MDRV_PALETTE_LENGTH(512)
75647544
75657545   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
76007580   MDRV_SCREEN_SIZE(64*8, 32*8)
76017581   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
76027582
7603   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7583   MDRV_GFXDECODE(msgundam)
76047584   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer2, layer1 */
76057585
76067586   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
76487628   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
76497629   MDRV_SCREEN_SIZE(64*8, 32*8)
76507630   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7651   MDRV_GFXDECODE(msgundam_gfxdecodeinfo)
7631   MDRV_GFXDECODE(msgundam)
76527632   MDRV_PALETTE_LENGTH(512 * 3)   /* sprites, layer1, layer2 */
76537633
76547634   MDRV_VIDEO_START(seta_2_layers)
r1051r1052
76907670   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
76917671   MDRV_SCREEN_SIZE(64*8, 32*8)
76927672   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7693   MDRV_GFXDECODE(zingzip_gfxdecodeinfo)
7673   MDRV_GFXDECODE(zingzip)
76947674   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
76957675   MDRV_COLORTABLE_LENGTH(16*32+16*32+64*32)   /* sprites, layer2, layer1 */
76967676
r1051r1052
77267706   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
77277707   MDRV_SCREEN_SIZE(64*8, 32*8)
77287708   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
7729   MDRV_GFXDECODE(tndrcade_gfxdecodeinfo)
7709   MDRV_GFXDECODE(tndrcade)
77307710   MDRV_PALETTE_LENGTH(2048)   /* sprites only */
77317711
77327712   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
77707750   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
77717751   MDRV_SCREEN_SIZE(64*8, 32*8)
77727752   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8-4, 30*8-1-4)
7773   MDRV_GFXDECODE(crazyfgt_gfxdecodeinfo)
7753   MDRV_GFXDECODE(crazyfgt)
77747754   MDRV_PALETTE_LENGTH(16*32+16*32+16*32)
77757755   MDRV_COLORTABLE_LENGTH(16*32+64*32+64*32)   /* sprites, layer1, layer2 */
77767756
src/mame/drivers/laserbat.c
r1051r1052
512512   32*32*2
513513};
514514
515static const gfx_decode laserbat_gfxdecodeinfo[] =
516{
517   { REGION_GFX1, 0x0000, &charlayout,        0, 256 },   /* Rom chars */
518   { REGION_CPU1, 0x1500, &s2636_character10, 0,   8 },   /* s2636 #1  */
519   { REGION_CPU1, 0x1600, &s2636_character10, 0,   8 },   /* s2636 #2  */
520   { REGION_CPU1, 0x1700, &s2636_character10, 0,   8 },   /* s2636 #3  */
521   { REGION_GFX2, 0x0000, &sprites_layout,    0,   8 },   /* Sprites   */
522   { -1 }
523};
515static GFXDECODE_START( laserbat )
516   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,        0, 256 )   /* Rom chars */
517   GFXDECODE_ENTRY( REGION_CPU1, 0x1500, s2636_character10, 0,   8 )   /* s2636 #1  */
518   GFXDECODE_ENTRY( REGION_CPU1, 0x1600, s2636_character10, 0,   8 )   /* s2636 #2  */
519   GFXDECODE_ENTRY( REGION_CPU1, 0x1700, s2636_character10, 0,   8 )   /* s2636 #3  */
520   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, sprites_layout,    0,   8 )   /* Sprites   */
521GFXDECODE_END
524522
525523static TILE_GET_INFO( get_tile_info )
526524{
r1051r1052
702700   MDRV_SCREEN_SIZE(256, 256)
703701   MDRV_SCREEN_VISIBLE_AREA(1*8, 29*8-1, 2*8, 32*8-1)
704702
705   MDRV_GFXDECODE(laserbat_gfxdecodeinfo)
703   MDRV_GFXDECODE(laserbat)
706704   MDRV_PALETTE_LENGTH(1024)
707705   MDRV_COLORTABLE_LENGTH(4096)
708706
r1051r1052
745743   MDRV_SCREEN_SIZE(256, 256)
746744   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 32*8-1)
747745
748   MDRV_GFXDECODE(laserbat_gfxdecodeinfo)
746   MDRV_GFXDECODE(laserbat)
749747   MDRV_PALETTE_LENGTH(1024)
750748   MDRV_COLORTABLE_LENGTH(4096)
751749
src/mame/drivers/tnzs.c
r1051r1052
12371237   64*8
12381238};
12391239
1240static const gfx_decode tnzs_gfxdecodeinfo[] =
1241{
1242   { REGION_GFX1, 0, &tnzs_charlayout, 0, 32 },
1243   { -1 }   /* end of array */
1244};
1240static GFXDECODE_START( tnzs )
1241   GFXDECODE_ENTRY( REGION_GFX1, 0, tnzs_charlayout, 0, 32 )
1242GFXDECODE_END
12451243
1246static const gfx_decode insectx_gfxdecodeinfo[] =
1247{
1248   { REGION_GFX1, 0, &insectx_charlayout, 0, 32 },
1249   { -1 }   /* end of array */
1250};
1244static GFXDECODE_START( insectx )
1245   GFXDECODE_ENTRY( REGION_GFX1, 0, insectx_charlayout, 0, 32 )
1246GFXDECODE_END
12511247
12521248
12531249static struct YM2203interface ym2203_interface =
r1051r1052
13131309   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13141310   MDRV_SCREEN_SIZE(32*8, 32*8)
13151311   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1316   MDRV_GFXDECODE(tnzs_gfxdecodeinfo)
1312   MDRV_GFXDECODE(tnzs)
13171313   MDRV_PALETTE_LENGTH(512)
13181314
13191315   MDRV_PALETTE_INIT(arknoid2)
r1051r1052
13511347   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13521348   MDRV_SCREEN_SIZE(32*8, 32*8)
13531349   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1354   MDRV_GFXDECODE(tnzs_gfxdecodeinfo)
1350   MDRV_GFXDECODE(tnzs)
13551351   MDRV_PALETTE_LENGTH(512)
13561352
13571353   MDRV_PALETTE_INIT(arknoid2)
r1051r1052
13931389   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13941390   MDRV_SCREEN_SIZE(32*8, 32*8)
13951391   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1396   MDRV_GFXDECODE(tnzs_gfxdecodeinfo)
1392   MDRV_GFXDECODE(tnzs)
13971393   MDRV_PALETTE_LENGTH(512)
13981394
13991395   MDRV_VIDEO_UPDATE(tnzs)
r1051r1052
14301426   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14311427   MDRV_SCREEN_SIZE(32*8, 32*8)
14321428   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1433   MDRV_GFXDECODE(insectx_gfxdecodeinfo)
1429   MDRV_GFXDECODE(insectx)
14341430   MDRV_PALETTE_LENGTH(512)
14351431
14361432   MDRV_VIDEO_UPDATE(tnzs)
r1051r1052
14671463   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
14681464   MDRV_SCREEN_SIZE(32*8, 32*8)
14691465   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1470   MDRV_GFXDECODE(tnzs_gfxdecodeinfo)
1466   MDRV_GFXDECODE(tnzs)
14711467   MDRV_PALETTE_LENGTH(512)
14721468
14731469   MDRV_VIDEO_UPDATE(tnzs)
r1051r1052
15151511   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15161512   MDRV_SCREEN_SIZE(32*8, 32*8)
15171513   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1518   MDRV_GFXDECODE(tnzs_gfxdecodeinfo)
1514   MDRV_GFXDECODE(tnzs)
15191515   MDRV_PALETTE_LENGTH(512)
15201516
15211517   MDRV_VIDEO_UPDATE(tnzs)
src/mame/drivers/tp84.c
r1051r1052
461461   64*8
462462};
463463
464static const gfx_decode gfxdecodeinfo[] =
465{
466   { REGION_GFX1, 0, &charlayout,        0, 64*8 },
467   { REGION_GFX2, 0, &spritelayout, 64*4*8, 16*8 },
468   { -1 }
469};
464static GFXDECODE_START( tp84 )
465   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        0, 64*8 )
466   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 64*4*8, 16*8 )
467GFXDECODE_END
470468
471469
472470
r1051r1052
495493   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
496494   MDRV_SCREEN_SIZE(32*8, 32*8)
497495   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
498   MDRV_GFXDECODE(gfxdecodeinfo)
496   MDRV_GFXDECODE(tp84)
499497   MDRV_PALETTE_LENGTH(256)
500498   MDRV_COLORTABLE_LENGTH(4096)
501499
src/mame/drivers/rohga.c
r1051r1052
768768   64*8
769769};
770770
771static const gfx_decode gfxdecodeinfo[] =
772{
773   { REGION_GFX1, 0, &charlayout,          0, 32 },   /* Characters 8x8 */
774   { REGION_GFX2, 0, &tilelayout,          0, 32 },   /* Tiles 16x16 */
775   { REGION_GFX3, 0, &tilelayout,        512, 32 },   /* Tiles 16x16 */
776   { REGION_GFX4, 0, &spritelayout_6bpp,1024, 16 },   /* Sprites 16x16 */
777   { -1 }
778};
771static GFXDECODE_START( rohga )
772   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 32 )   /* Characters 8x8 */
773   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,          0, 32 )   /* Tiles 16x16 */
774   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,        512, 32 )   /* Tiles 16x16 */
775   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout_6bpp,1024, 16 )   /* Sprites 16x16 */
776GFXDECODE_END
779777
780static const gfx_decode gfxdecodeinfo_wizdfire[] =
781{
782   { REGION_GFX1, 0, &charlayout,        0, 32 },   /* Gfx chip 1 as 8x8 */
783   { REGION_GFX2, 0, &tilelayout,        0, 32 },   /* Gfx chip 1 as 16x16 */
784   { REGION_GFX3, 0, &tilelayout,      512, 32 },  /* Gfx chip 2 as 16x16 */
785   { REGION_GFX4, 0, &spritelayout,   1024, 32 }, /* Sprites 16x16 */
786   { REGION_GFX5, 0, &spritelayout,   1536, 32 },
787   { -1 }
788};
778static GFXDECODE_START( wizdfire )
779   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        0, 32 )   /* Gfx chip 1 as 8x8 */
780   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,        0, 32 )   /* Gfx chip 1 as 16x16 */
781   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,      512, 32 )  /* Gfx chip 2 as 16x16 */
782   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,   1024, 32 ) /* Sprites 16x16 */
783   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout,   1536, 32 )
784GFXDECODE_END
789785
790static const gfx_decode gfxdecodeinfo_schmeisr[] =
791{
792   { REGION_GFX1, 0, &charlayout,          0, 32 },   /* Characters 8x8 */
793   { REGION_GFX2, 0, &tilelayout,          0, 32 },   /* Tiles 16x16 */
794   { REGION_GFX3, 0, &tilelayout,        512, 32 },   /* Tiles 16x16 */
795   { REGION_GFX4, 0, &spritelayout2,    1024, 64 },   /* Sprites 16x16 */
796   { -1 }
797};
786static GFXDECODE_START( schmeisr )
787   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 32 )   /* Characters 8x8 */
788   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,          0, 32 )   /* Tiles 16x16 */
789   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,        512, 32 )   /* Tiles 16x16 */
790   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout2,    1024, 64 )   /* Sprites 16x16 */
791GFXDECODE_END
798792
799793/**********************************************************************************/
800794
r1051r1052
835829   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
836830   MDRV_SCREEN_SIZE(40*8, 32*8)
837831   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
838   MDRV_GFXDECODE(gfxdecodeinfo)
832   MDRV_GFXDECODE(rohga)
839833   MDRV_PALETTE_LENGTH(2048)
840834
841835   MDRV_VIDEO_START(rohga)
r1051r1052
878872   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
879873   MDRV_SCREEN_SIZE(40*8, 32*8)
880874   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
881   MDRV_GFXDECODE(gfxdecodeinfo_wizdfire)
875   MDRV_GFXDECODE(wizdfire)
882876   MDRV_PALETTE_LENGTH(2048)
883877
884878   MDRV_VIDEO_START(wizdfire)
r1051r1052
921915   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
922916   MDRV_SCREEN_SIZE(40*8, 32*8)
923917   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
924   MDRV_GFXDECODE(gfxdecodeinfo_wizdfire)
918   MDRV_GFXDECODE(wizdfire)
925919   MDRV_PALETTE_LENGTH(2048)
926920
927921   MDRV_VIDEO_START(nitrobal)
r1051r1052
964958   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
965959   MDRV_SCREEN_SIZE(40*8, 32*8)
966960   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
967   MDRV_GFXDECODE(gfxdecodeinfo_schmeisr)
961   MDRV_GFXDECODE(schmeisr)
968962   MDRV_PALETTE_LENGTH(2048)
969963
970964   MDRV_VIDEO_START(rohga)
src/mame/drivers/vball.c
r1051r1052
381381};
382382
383383
384static const gfx_decode vb_gfxdecodeinfo[] =
385{
386   { REGION_GFX1, 0, &charlayout,     0, 8 },   /* 8x8 chars */
387   { REGION_GFX2, 0, &spritelayout, 128, 8 },   /* 16x16 sprites */
388   { -1 }
389};
384static GFXDECODE_START( vb )
385   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 8 )   /* 8x8 chars */
386   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 128, 8 )   /* 16x16 sprites */
387GFXDECODE_END
390388
391389static void vball_irq_handler(int irq)
392390{
r1051r1052
417415   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
418416   MDRV_SCREEN_SIZE(32*8, 32*8)
419417   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)   /* 240 x 240 */
420   MDRV_GFXDECODE(vb_gfxdecodeinfo)
418   MDRV_GFXDECODE(vb)
421419   MDRV_PALETTE_LENGTH(256)
422420
423421   MDRV_VIDEO_START(vb)
r1051r1052
456454   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
457455   MDRV_SCREEN_SIZE(32*8, 32*8)
458456   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)   /* 240 x 240 */
459   MDRV_GFXDECODE(vb_gfxdecodeinfo)
457   MDRV_GFXDECODE(vb)
460458   MDRV_PALETTE_LENGTH(256)
461459
462460   MDRV_VIDEO_START(vb)
src/mame/drivers/higemaru.c
r1051r1052
163163   64*8
164164};
165165
166static const gfx_decode gfxdecodeinfo[] =
167{
168   { REGION_GFX1, 0, &charlayout,       0, 32 },
169   { REGION_GFX2, 0, &spritelayout,  32*4, 16 },
170   { -1 }
171};
166static GFXDECODE_START( higemaru )
167   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 32 )
168   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  32*4, 16 )
169GFXDECODE_END
172170
173171
174172static MACHINE_DRIVER_START( higemaru )
r1051r1052
186184   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
187185   MDRV_SCREEN_SIZE(32*8, 32*8)
188186   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
189   MDRV_GFXDECODE(gfxdecodeinfo)
187   MDRV_GFXDECODE(higemaru)
190188   MDRV_PALETTE_LENGTH(32)
191189   MDRV_COLORTABLE_LENGTH(32*4+16*16)
192190
src/mame/drivers/plygonet.c
r1051r1052
677677   128*8
678678};
679679
680static const gfx_decode gfxdecodeinfo[] =
681{
682   { REGION_GFX2, 0, &bglayout,     0x0000, 64 },
683   { -1 }
684};
680static GFXDECODE_START( plygonet )
681   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,     0x0000, 64 )
682GFXDECODE_END
685683
686684MACHINE_DRIVER_START( plygonet )
687685   MDRV_CPU_ADD(M68EC020, 16000000)   /* 16 MHz (xtal is 32.0 MHz) */
r1051r1052
700698   MDRV_SCREEN_REFRESH_RATE(60)
701699   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
702700
703   MDRV_GFXDECODE(gfxdecodeinfo)
701   MDRV_GFXDECODE(plygonet)
704702   MDRV_NVRAM_HANDLER(polygonet)
705703
706704   /* video hardware */
src/mame/drivers/batman.c
r1051r1052
206206};
207207
208208
209static const gfx_decode gfxdecodeinfo[] =
210{
211   { REGION_GFX3, 0, &pfmolayout,  512, 64 },      /* sprites & playfield */
212   { REGION_GFX2, 0, &pfmolayout,  256, 64 },      /* sprites & playfield */
213   { REGION_GFX1, 0, &anlayout,      0, 64 },      /* characters 8x8 */
214   { -1 }
215};
209static GFXDECODE_START( batman )
210   GFXDECODE_ENTRY( REGION_GFX3, 0, pfmolayout,  512, 64 )      /* sprites & playfield */
211   GFXDECODE_ENTRY( REGION_GFX2, 0, pfmolayout,  256, 64 )      /* sprites & playfield */
212   GFXDECODE_ENTRY( REGION_GFX1, 0, anlayout,      0, 64 )      /* characters 8x8 */
213GFXDECODE_END
216214
217215
218216
r1051r1052
233231
234232   /* video hardware */
235233   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
236   MDRV_GFXDECODE(gfxdecodeinfo)
234   MDRV_GFXDECODE(batman)
237235   MDRV_PALETTE_LENGTH(2048)
238236
239237   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/afega.c
r1051r1052
10391039   16*16*4
10401040};
10411041
1042static const gfx_decode grdnstrm_gfxdecodeinfo[] =
1043{
1044   { REGION_GFX1, 0, &layout_16x16x4,   256*1, 16 }, // [0] Sprites
1045   { REGION_GFX2, 0, &layout_16x16x8,   256*3, 16 }, // [1] Layer 0
1046   { REGION_GFX3, 0, &layout_8x8x4,   256*2, 16 }, // [2] Layer 1
1047   { -1 }
1048};
1042static GFXDECODE_START( grdnstrm )
1043   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,   256*1, 16 ) // [0] Sprites
1044   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x8,   256*3, 16 ) // [1] Layer 0
1045   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   256*2, 16 ) // [2] Layer 1
1046GFXDECODE_END
10491047
1050static const gfx_decode stagger1_gfxdecodeinfo[] =
1051{
1052   { REGION_GFX1, 0, &layout_16x16x4,   256*1, 16 }, // [0] Sprites
1053   { REGION_GFX2, 0, &layout_16x16x4,   256*0, 16 }, // [1] Layer 0
1054   { REGION_GFX3, 0, &layout_8x8x4,   256*2, 16 }, // [2] Layer 1
1055   { -1 }
1056};
1048static GFXDECODE_START( stagger1 )
1049   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,   256*1, 16 ) // [0] Sprites
1050   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,   256*0, 16 ) // [1] Layer 0
1051   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   256*2, 16 ) // [2] Layer 1
1052GFXDECODE_END
10571053
1058static const gfx_decode redhawkb_gfxdecodeinfo[] =
1059{
1060   { REGION_GFX1, 0, &layout_16x16x4_swapped,   256*1, 16 }, // [0] Sprites
1061   { REGION_GFX2, 0, &layout_16x16x4_swapped,   256*0, 16 }, // [1] Layer 0
1062   { REGION_GFX3, 0, &layout_8x8x4,         256*2, 16 }, // [2] Layer 1
1063   { -1 }
1064};
1054static GFXDECODE_START( redhawkb )
1055   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4_swapped,   256*1, 16 ) // [0] Sprites
1056   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4_swapped,   256*0, 16 ) // [1] Layer 0
1057   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,         256*2, 16 ) // [2] Layer 1
1058GFXDECODE_END
10651059
10661060
10671061/***************************************************************************
r1051r1052
11101104   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11111105   MDRV_SCREEN_SIZE(256, 256)
11121106   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)   /* fixed */
1113   MDRV_GFXDECODE(stagger1_gfxdecodeinfo)
1107   MDRV_GFXDECODE(stagger1)
11141108   MDRV_PALETTE_LENGTH(768)
11151109
11161110   MDRV_VIDEO_START(afega)
r1051r1052
11341128   /* basic machine hardware */
11351129   MDRV_IMPORT_FROM(stagger1)
11361130   /* video hardware */
1137   MDRV_GFXDECODE(redhawkb_gfxdecodeinfo)
1131   MDRV_GFXDECODE(redhawkb)
11381132   MDRV_VIDEO_UPDATE(redhawkb)
11391133MACHINE_DRIVER_END
11401134
r1051r1052
11441138   MDRV_IMPORT_FROM(stagger1)
11451139
11461140   /* video hardware */
1147   MDRV_GFXDECODE(grdnstrm_gfxdecodeinfo)
1141   MDRV_GFXDECODE(grdnstrm)
11481142   MDRV_PALETTE_LENGTH(768)
11491143   MDRV_COLORTABLE_LENGTH(768 + 16*256)
11501144
r1051r1052
11571151   MDRV_IMPORT_FROM(stagger1)
11581152
11591153   /* video hardware */
1160   MDRV_GFXDECODE(grdnstrm_gfxdecodeinfo)
1154   MDRV_GFXDECODE(grdnstrm)
11611155   MDRV_PALETTE_LENGTH(768)
11621156   MDRV_COLORTABLE_LENGTH(768 + 16*256)
11631157
r1051r1052
11971191   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11981192   MDRV_SCREEN_SIZE(256, 256)
11991193   MDRV_SCREEN_VISIBLE_AREA(8, 256-8-1, 16, 256-16-1)
1200   MDRV_GFXDECODE(grdnstrm_gfxdecodeinfo)
1194   MDRV_GFXDECODE(grdnstrm)
12011195   MDRV_PALETTE_LENGTH(768)
12021196   MDRV_COLORTABLE_LENGTH(768 + 16*256)
12031197
r1051r1052
12471241   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12481242   MDRV_SCREEN_SIZE(256, 256)
12491243   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
1250   MDRV_GFXDECODE(stagger1_gfxdecodeinfo)
1244   MDRV_GFXDECODE(stagger1)
12511245   MDRV_PALETTE_LENGTH(768)
12521246
12531247   MDRV_VIDEO_START(twinactn)
src/mame/drivers/nemesis.c
r1051r1052
20752075   spritelayout6464_yoffset
20762076};
20772077
2078static const gfx_decode gfxdecodeinfo[] =
2079{
2080    { 0, 0x0, &charlayout,   0, 0x80 },   /* the game dynamically modifies this */
2081    { 0, 0x0, &spritelayout, 0, 0x80 },   /* the game dynamically modifies this */
2082    { 0, 0x0, &spritelayout3216, 0, 0x80 },   /* the game dynamically modifies this */
2083    { 0, 0x0, &spritelayout816, 0, 0x80 },   /* the game dynamically modifies this */
2084    { 0, 0x0, &spritelayout3232, 0, 0x80 },   /* the game dynamically modifies this */
2085    { 0, 0x0, &spritelayout1632, 0, 0x80 },   /* the game dynamically modifies this */
2086    { 0, 0x0, &spritelayout168, 0, 0x80 },   /* the game dynamically modifies this */
2087    { 0, 0x0, &spritelayout6464, 0, 0x80 },   /* the game dynamically modifies this */
2088   { -1 }
2089};
2078static GFXDECODE_START( nemesis )
2079    GFXDECODE_ENTRY( 0, 0x0, charlayout,   0, 0x80 )   /* the game dynamically modifies this */
2080    GFXDECODE_ENTRY( 0, 0x0, spritelayout, 0, 0x80 )   /* the game dynamically modifies this */
2081    GFXDECODE_ENTRY( 0, 0x0, spritelayout3216, 0, 0x80 )   /* the game dynamically modifies this */
2082    GFXDECODE_ENTRY( 0, 0x0, spritelayout816, 0, 0x80 )   /* the game dynamically modifies this */
2083    GFXDECODE_ENTRY( 0, 0x0, spritelayout3232, 0, 0x80 )   /* the game dynamically modifies this */
2084    GFXDECODE_ENTRY( 0, 0x0, spritelayout1632, 0, 0x80 )   /* the game dynamically modifies this */
2085    GFXDECODE_ENTRY( 0, 0x0, spritelayout168, 0, 0x80 )   /* the game dynamically modifies this */
2086    GFXDECODE_ENTRY( 0, 0x0, spritelayout6464, 0, 0x80 )   /* the game dynamically modifies this */
2087GFXDECODE_END
20902088
20912089/******************************************************************************/
20922090
r1051r1052
21662164   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21672165   MDRV_SCREEN_SIZE(32*8, 32*8)
21682166   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2169   MDRV_GFXDECODE(gfxdecodeinfo)
2167   MDRV_GFXDECODE(nemesis)
21702168   MDRV_PALETTE_LENGTH(2048)
21712169
21722170   MDRV_VIDEO_START(nemesis)
r1051r1052
22142212   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22152213   MDRV_SCREEN_SIZE(32*8, 32*8)
22162214   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2217   MDRV_GFXDECODE(gfxdecodeinfo)
2215   MDRV_GFXDECODE(nemesis)
22182216   MDRV_PALETTE_LENGTH(2048)
22192217
22202218   MDRV_VIDEO_START(nemesis)
r1051r1052
22582256   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22592257   MDRV_SCREEN_SIZE(32*8, 32*8)
22602258   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2261   MDRV_GFXDECODE(gfxdecodeinfo)
2259   MDRV_GFXDECODE(nemesis)
22622260   MDRV_PALETTE_LENGTH(2048)
22632261
22642262   MDRV_VIDEO_START(nemesis)
r1051r1052
23072305   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23082306   MDRV_SCREEN_SIZE(32*8, 32*8)
23092307   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2310   MDRV_GFXDECODE(gfxdecodeinfo)
2308   MDRV_GFXDECODE(nemesis)
23112309   MDRV_PALETTE_LENGTH(2048)
23122310
23132311   MDRV_VIDEO_START(nemesis)
r1051r1052
23512349   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23522350   MDRV_SCREEN_SIZE(32*8, 32*8)
23532351   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2354   MDRV_GFXDECODE(gfxdecodeinfo)
2352   MDRV_GFXDECODE(nemesis)
23552353   MDRV_PALETTE_LENGTH(2048)
23562354
23572355   MDRV_VIDEO_START(nemesis)
r1051r1052
23992397   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24002398   MDRV_SCREEN_SIZE(32*8, 32*8)
24012399   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2402   MDRV_GFXDECODE(gfxdecodeinfo)
2400   MDRV_GFXDECODE(nemesis)
24032401   MDRV_PALETTE_LENGTH(2048)
24042402
24052403   MDRV_VIDEO_START(nemesis)
r1051r1052
24472445   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24482446   MDRV_SCREEN_SIZE(32*8, 32*8)
24492447   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2450   MDRV_GFXDECODE(gfxdecodeinfo)
2448   MDRV_GFXDECODE(nemesis)
24512449   MDRV_PALETTE_LENGTH(2048)
24522450
24532451   MDRV_VIDEO_START(nemesis)
r1051r1052
24962494   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24972495   MDRV_SCREEN_SIZE(32*8, 32*8)
24982496   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2499   MDRV_GFXDECODE(gfxdecodeinfo)
2497   MDRV_GFXDECODE(nemesis)
25002498   MDRV_PALETTE_LENGTH(2048)
25012499
25022500   MDRV_VIDEO_START(nemesis)
r1051r1052
25432541   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
25442542   MDRV_SCREEN_SIZE(32*8, 32*8)
25452543   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2546   MDRV_GFXDECODE(gfxdecodeinfo)
2544   MDRV_GFXDECODE(nemesis)
25472545   MDRV_PALETTE_LENGTH(2048)
25482546
25492547   MDRV_VIDEO_START(nemesis)
src/mame/drivers/cheekyms.c
r1051r1052
113113
114114
115115
116static const gfx_decode gfxdecodeinfo[] =
117{
118   { REGION_GFX1, 0, &charlayout,   0x00, 0x20 },
119   { REGION_GFX2, 0, &spritelayout, 0x80, 0x10 },
120   { -1 }
121};
116static GFXDECODE_START( cheekyms )
117   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x00, 0x20 )
118   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x80, 0x10 )
119GFXDECODE_END
122120
123121
124122static MACHINE_DRIVER_START( cheekyms )
r1051r1052
137135   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
138136   MDRV_SCREEN_SIZE(32*8, 32*8)
139137   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
140   MDRV_GFXDECODE(gfxdecodeinfo)
138   MDRV_GFXDECODE(cheekyms)
141139   MDRV_PALETTE_LENGTH(0xc0)
142140
143141   MDRV_PALETTE_INIT(cheekyms)
src/mame/drivers/progolf.c
r1051r1052
180180   32*8    /* every sprite takes 32 consecutive bytes */
181181};
182182#endif
183static gfx_decode gfxdecodeinfo[] =
184{
185   { REGION_GFX1, 0x0000, &progolf_charlayout, 0, 8 }, /* sprites */
186   { 0,           0x2000, &charlayout,           0, 4 }, /* char set #1 */
187   { 0,           0x2000, &spritelayout,         0, 4 }, /* sprites */
183static GFXDECODE_START( progolf )
184   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, progolf_charlayout, 0, 8 ) /* sprites */
185   GFXDECODE_ENTRY( 0,           0x2000, charlayout,           0, 4 ) /* char set #1 */
186   GFXDECODE_ENTRY( 0,           0x2000, spritelayout,         0, 4 ) /* sprites */
188187
189   { REGION_GFX2, 0x0000, &progolf_charlayout2, 0, 8 }, /* sprites */
190   { REGION_GFX2, 0x0000, &progolf_spritelayout2, 0, 8 }, /* sprites */
191   { -1 }
192};
188   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, progolf_charlayout2, 0, 8 ) /* sprites */
189   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, progolf_spritelayout2, 0, 8 ) /* sprites */
190GFXDECODE_END
193191
194192
195193#ifdef UNUSED_FUNCTION
r1051r1052
219217   MDRV_SCREEN_SIZE(256, 256)
220218   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
221219
222   MDRV_GFXDECODE(gfxdecodeinfo)
220   MDRV_GFXDECODE(progolf)
223221   MDRV_PALETTE_LENGTH(32*3)
224222
225223   MDRV_PALETTE_INIT(btime)
src/mame/drivers/magmax.c
r1051r1052
4848   return (sound_latch | LS74_q);
4949}
5050
51WRITE8_HANDLER( ay8910_portB_0_w )
51static WRITE8_HANDLER( ay8910_portB_0_w )
5252{
5353   /*bit 0 is input to CLR line of the LS74*/
5454   LS74_clr = data & 1;
r1051r1052
9898
9999
100100
101WRITE8_HANDLER( ay8910_portA_0_w )
101static WRITE8_HANDLER( ay8910_portA_0_w )
102102{
103103float percent;
104104
r1051r1052
344344   64*8
345345};
346346
347static const gfx_decode gfxdecodeinfo[] =
348{
349   { REGION_GFX1, 0, &charlayout,           0,  1 }, /*no color codes*/
350   { REGION_GFX2, 0, &spritelayout,      1*16, 16 }, /*16 color codes*/
351   { -1 }
352};
347static GFXDECODE_START( magmax )
348   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0,  1 ) /*no color codes*/
349   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,      1*16, 16 ) /*16 color codes*/
350GFXDECODE_END
353351
354352
355353static struct AY8910interface ay8910_interface =
r1051r1052
384382   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
385383   MDRV_SCREEN_SIZE(32*8, 32*8)
386384   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
387   MDRV_GFXDECODE(gfxdecodeinfo)
385   MDRV_GFXDECODE(magmax)
388386   MDRV_PALETTE_LENGTH(256)
389387   MDRV_COLORTABLE_LENGTH(1*16 + 16*16)
390388
src/mame/drivers/asteroid.c
r1051r1052
649649   MDRV_SPEAKER_STANDARD_MONO("mono")
650650
651651   MDRV_SOUND_ADD_TAG("disc", DISCRETE, 0)
652   MDRV_SOUND_CONFIG(asteroid_discrete_interface)
652   MDRV_SOUND_CONFIG_DISCRETE(asteroid)
653653   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.4)
654654MACHINE_DRIVER_END
655655
r1051r1052
673673
674674   /* sound hardware */
675675   MDRV_SOUND_REPLACE("disc", DISCRETE, 0)
676   MDRV_SOUND_CONFIG(astdelux_discrete_interface)
676   MDRV_SOUND_CONFIG_DISCRETE(astdelux)
677677   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
678678
679679   MDRV_SOUND_ADD(POKEY, MASTER_CLOCK/8)
r1051r1052
699699
700700   /* sound hardware */
701701   MDRV_SOUND_REPLACE("disc", DISCRETE, 0)
702   MDRV_SOUND_CONFIG(llander_discrete_interface)
702   MDRV_SOUND_CONFIG_DISCRETE(llander)
703703   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
704704MACHINE_DRIVER_END
705705
src/mame/drivers/powerbal.c
r1051r1052
404404
405405
406406
407static const gfx_decode gfxdecodeinfo[] =
408{
409   { REGION_GFX2, 0, &tilelayout,          0x100, 16 },   /* colors 0x100-0x1ff */
410   { REGION_GFX1, 0, &magicstk_charlayout, 0x000, 16 },   /* colors 0x000-0x0ff */
411   { -1 }
412};
407static GFXDECODE_START( powerbal )
408   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,          0x100, 16 )   /* colors 0x100-0x1ff */
409   GFXDECODE_ENTRY( REGION_GFX1, 0, magicstk_charlayout, 0x000, 16 )   /* colors 0x000-0x0ff */
410GFXDECODE_END
413411
414412static MACHINE_DRIVER_START( powerbal )
415413   /* basic machine hardware */
r1051r1052
425423   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
426424   MDRV_SCREEN_SIZE(128*8, 64*8)
427425   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
428   MDRV_GFXDECODE(gfxdecodeinfo)
426   MDRV_GFXDECODE(powerbal)
429427   MDRV_PALETTE_LENGTH(512)
430428
431429   MDRV_VIDEO_START(powerbal)
r1051r1052
455453   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
456454   MDRV_SCREEN_SIZE(128*8, 64*8)
457455   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
458   MDRV_GFXDECODE(gfxdecodeinfo)
456   MDRV_GFXDECODE(powerbal)
459457   MDRV_PALETTE_LENGTH(512)
460458
461459   MDRV_VIDEO_START(powerbal)
src/mame/drivers/stv.c
r1051r1052
26282628
26292629
26302630
2631static const gfx_decode gfxdecodeinfo[] =
2632{
2633   { 0, 0, &tiles8x8x4_layout,   0x00, (0x80*(2+1))  },
2634   { 0, 0, &tiles16x16x4_layout, 0x00, (0x80*(2+1))  },
2635   { 0, 0, &tiles8x8x8_layout,   0x00, (0x08*(2+1))  },
2636   { 0, 0, &tiles16x16x8_layout, 0x00, (0x08*(2+1))  },
2631static GFXDECODE_START( stv )
2632   GFXDECODE_ENTRY( 0, 0, tiles8x8x4_layout,   0x00, (0x80*(2+1))  )
2633   GFXDECODE_ENTRY( 0, 0, tiles16x16x4_layout, 0x00, (0x80*(2+1))  )
2634   GFXDECODE_ENTRY( 0, 0, tiles8x8x8_layout,   0x00, (0x08*(2+1))  )
2635   GFXDECODE_ENTRY( 0, 0, tiles16x16x8_layout, 0x00, (0x08*(2+1))  )
26372636
26382637   /* vdp1 .. pointless for drawing but can help us debug */
2639   { 0, 0, &tiles8x8x4_layout,   0x00, 0x100  },
2640   { 0, 0, &tiles16x16x4_layout, 0x00, 0x100  },
2641   { 0, 0, &tiles8x8x8_layout,   0x00, 0x20  },
2642   { 0, 0, &tiles16x16x8_layout, 0x00, 0x20  },
2638   GFXDECODE_ENTRY( 0, 0, tiles8x8x4_layout,   0x00, 0x100  )
2639   GFXDECODE_ENTRY( 0, 0, tiles16x16x4_layout, 0x00, 0x100  )
2640   GFXDECODE_ENTRY( 0, 0, tiles8x8x8_layout,   0x00, 0x20  )
2641   GFXDECODE_ENTRY( 0, 0, tiles16x16x8_layout, 0x00, 0x20  )
26432642
2644   { -1 }
2645};
2643GFXDECODE_END
26462644
26472645struct sh2_config sh2_conf_master = { 0 };
26482646struct sh2_config sh2_conf_slave  = { 1 };
r1051r1052
27572755   MDRV_SCREEN_SIZE(1024, 1024)
27582756   MDRV_SCREEN_VISIBLE_AREA(0*8, 703, 0*8, 512) // we need to use a resolution as high as the max size it can change to
27592757   MDRV_PALETTE_LENGTH(2048+(2048*2))//standard palette + extra memory for rgb brightness.
2760   MDRV_GFXDECODE(gfxdecodeinfo)
2758   MDRV_GFXDECODE(stv)
27612759
27622760   MDRV_VIDEO_START(stv_vdp2)
27632761   MDRV_VIDEO_UPDATE(stv_vdp2)
src/mame/drivers/megatech.c
r1051r1052
8282
8383/* Megatech BIOS specific */
8484static UINT32 bios_port_ctrl;
85static UINT8* megatech_banked_ram;
86static int current_game_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
8587UINT32 bios_ctrl_inputs;
8688
8789#define MASTER_CLOCK      53693100
8890
91/* give us access to the megadriv start and update functions so that we can call them */
92extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
93extern void video_start_megadriv(running_machine *machine);
94extern void video_eof_megadriv(running_machine *machine);
95extern void machine_reset_megadriv(running_machine *machine);
8996
97/* in drivers/segae.c */
98extern UINT32 video_update_megatech_bios(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
99extern void video_eof_megatech_bios(running_machine *machine);
100extern void machine_reset_megatech_bios(running_machine *machine);
101extern void driver_init_megatech_bios(running_machine *machine);
102
103
90104/* not currently used */
91105INPUT_PORTS_START( megatech ) /* Genesis Input Ports */
106   PORT_INCLUDE(megadriv)
92107
93   PORT_START // port 6
108   PORT_START_TAG("BIOS_IN0") // port 6
94109    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Select") PORT_CODE(KEYCODE_0)
95    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN  ) PORT_NAME("0x6800 bit 1") PORT_CODE(KEYCODE_Y)
96    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6800 bit 2") PORT_CODE(KEYCODE_U)
97    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6800 bit 3") PORT_CODE(KEYCODE_I)
98    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Door 1") PORT_CODE(KEYCODE_K)
99    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Door 2") PORT_CODE(KEYCODE_L)
100   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6800 bit 6") PORT_CODE(KEYCODE_O)
110    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
111    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
112    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
113    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
114    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
115    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
116    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
117    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
118    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
119    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
120    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
121    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
122    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
123    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
124    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
125    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
126    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
127    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
101128   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test mode") PORT_CODE(KEYCODE_F2)
102129
103   PORT_START // port 7
130   PORT_START_TAG("BIOS_IN1") // port 6
104131   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 )  // a few coin inputs here
105132   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_COIN2 )
106133   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r1051r1052
110137   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_START1 )
111138   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START2 )
112139
113   PORT_START // port 8
114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2)
115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2)
116   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
117   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
118   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("port DD bit 4")
119   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("port DD bit 5")
120   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("port DD bit 6")
121   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("port DD bit 7")
122
123   PORT_START    // up, down, left, right, button 2,3, 2P up, down.
124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
127   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
128   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
129   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
130   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
132
133    PORT_START   /* DSW A */
140   PORT_START_TAG("BIOS_DSW0")
134141   PORT_DIPNAME( 0x02, 0x02, "Coin slot 3" )
135142   PORT_DIPSETTING (   0x00, "Inhibit" )
136143   PORT_DIPSETTING (   0x02, "Accept" )
r1051r1052
156163   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_6C ) )
157164   PORT_DIPSETTING(    0x00, "Inhibit" )
158165
159   PORT_START /* DSW B */
166   PORT_START_TAG("BIOS_DSW1")
160167   PORT_DIPNAME( 0x0f, 0x01, "Coin Slot 1 value" )
161168   PORT_DIPSETTING(    0x00, "Inhibit" )
162169   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
r1051r1052
192199   PORT_DIPSETTING(    0xe0, "1:00" )
193200   PORT_DIPSETTING(    0xf0, "0:30" )
194201
195   PORT_START    // BIOS input ports extra
196   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
197   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1)
198//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN  ) PORT_NAME("port DD bit 4") PORT_CODE(CODE_NONE)
199//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN  ) PORT_NAME("port DD bit 5") PORT_CODE(CODE_NONE)
200//  PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN  ) PORT_NAME("port DD bit 6") PORT_CODE(CODE_NONE)
201//  PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  ) PORT_NAME("port DD bit 7") PORT_CODE(CODE_NONE)
202
203   PORT_START_TAG("BIOS_J1")
204    PORT_DIPNAME( 0x0001, 0x0001, "5" )
205    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
206    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
207    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
208    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
209    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
210    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
211    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
212    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
213    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
214    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
215    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
216    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
217    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
218    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
219    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
220    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
221    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
222    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
223    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
224    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
225    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
226    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
227    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
228
202229INPUT_PORTS_END
203230
204231/* MEGATECH specific */
205232
206UINT8 mt_ram;
233UINT8 mt_cart_select_reg;
207234
208235static READ8_HANDLER( megatech_instr_r )
209236{
210   UINT8* instr = memory_region(REGION_USER1);
237   UINT8* instr = memory_region(REGION_CPU3)+0x8000;
211238
212   if(mt_ram == 0)
213      return instr[offset/2];
239   return instr[offset/2];
240//  else
241//      return 0xff;
242}
243
244static READ8_HANDLER( megatech_cart_select_r )
245{
246   return (mt_cart_select_reg);
247}
248
249static READ8_HANDLER( z80_unmapped_port_r )
250{
251   printf("unmapped z80 port read %04x\n",offset);
252   return 0;
253}
254
255static WRITE8_HANDLER( z80_unmapped_port_w )
256{
257   printf("unmapped z80 port write %04x\n",offset);
258}
259
260static READ8_HANDLER( z80_unmapped_r )
261{
262   printf("unmapped z80 read %04x\n",offset);
263   return 0;
264}
265
266static WRITE8_HANDLER( z80_unmapped_w )
267{
268   printf("unmapped z80 write %04x\n",offset);
269}
270
271UINT8* sms_mainram;
272UINT8* sms_rom;
273
274
275WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
276{
277   int bank = data&0x1f;
278   //logerror("bank w %02x %02x\n", offset, data);
279
280   sms_mainram[0x1ffc+offset] = data;
281   switch (offset)
282   {
283      case 0:
284         logerror("bank w %02x %02x\n", offset, data);
285         memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MRA8_BANK5);
286         memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_ROM);
287
288         //printf("bank ram??\n");
289         break;
290      case 1:
291         memcpy(sms_rom+0x0000, memory_region(REGION_CPU1)+bank*0x4000, 0x4000);
292         break;
293      case 2:
294         memcpy(sms_rom+0x4000, memory_region(REGION_CPU1)+bank*0x4000, 0x4000);
295         break;
296      case 3:
297         memcpy(sms_rom+0x8000, memory_region(REGION_CPU1)+bank*0x4000, 0x4000);
298         break;
299
300   }
301}
302
303READ8_HANDLER( md_sms_ioport_dc_r )
304{
305   return 0xff;//mame_rand(Machine);
306}
307
308READ8_HANDLER( md_sms_ioport_dd_r )
309{
310   return 0xff;//mame_rand(Machine);
311}
312
313
314
315void megatech_set_genz80_as_sms_standard_ports(void)
316{
317   /* INIT THE PORTS *********************************************************************************************/
318   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r);
319   memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_w);
320
321   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, md_sms_vdp_vcounter_r);
322   memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_sn76496_w);
323
324   memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w);
325
326   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_r);
327   memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_w);
328
329   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_r);
330   memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_w);
331
332   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x10, 0x10, 0, 0, megatech_sms_ioport_dd_r); // super tetris
333
334   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdc, 0xdc, 0, 0, megatech_sms_ioport_dc_r);
335   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdd, 0xdd, 0, 0, megatech_sms_ioport_dd_r);
336   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xde, 0xde, 0, 0, megatech_sms_ioport_dd_r);
337   memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdf, 0xdf, 0, 0, megatech_sms_ioport_dd_r); // adams family
338}
339
340void megatech_set_genz80_as_sms_standard_map(void)
341{
342   /* INIT THE MEMMAP / BANKING *********************************************************************************/
343
344   /* catch any addresses that don't get mapped */
345   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r);
346   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w);
347
348   /* fixed rom bank area */
349   sms_rom = auto_malloc(0x400000);
350   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MRA8_BANK5);
351   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, MWA8_ROM);
352   memory_set_bankptr( 5, sms_rom );
353
354   memcpy(sms_rom, memory_region(REGION_CPU1), 0x400000);
355
356   /* main ram area */
357   sms_mainram = auto_malloc(0x2000); // 8kb of main ram
358   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, MRA8_BANK6);
359   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, MWA8_BANK6);
360   memory_set_bankptr( 6, sms_mainram );
361   memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, MRA8_BANK7);
362   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, MWA8_BANK7);
363   memory_set_bankptr( 7, sms_mainram );
364   memset(sms_mainram,0x00,0x2000);
365
366   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfffc, 0xffff, 0, 0, mt_sms_standard_rom_bank_w);
367
368   megatech_set_genz80_as_sms_standard_ports();
369//  smsgg_backupram = NULL;
370
371}
372
373void megatech_select_game(int gameno)
374{
375   UINT8* game_region;
376   UINT8* bios_region;
377
378   printf("game 0 selected\n");
379
380   cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE);
381   cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
382   cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE);
383   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
384   sndti_reset(SOUND_YM2612, 0);
385
386   game_region = memory_region(REGION_USER1 + (gameno*2) + 0);
387   bios_region = memory_region(REGION_USER1 + (gameno*2) + 1);
388
389   megadriv_stop_scanline_timer();// stop the scanline timer for the genesis vdp... it can be restarted in video eof when needed
390   segae_md_sms_stop_scanline_timer();// stop the scanline timer for the sms vdp
391
392
393   /* if the regions exist we're fine */
394   if (game_region && bios_region)
395   {
396      memcpy(memory_region(REGION_CPU3)+0x8000, bios_region, 0x8000);
397      memcpy(memory_region(REGION_CPU1), game_region, 0x300000);
398
399      // I store an extra byte at the end of the instruction rom region when loading
400      // to indicate if the current cart is an SMS cart.. the original hardware
401      // knows from the cart pinout
402      if (bios_region[0x8000]==2)
403      {
404         printf("SMS cart!!, CPU not running\n");
405         current_game_is_sms = 1;
406         megatech_set_genz80_as_sms_standard_map();
407         cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
408         cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
409
410
411      }
412      else if (bios_region[0x8000]==1)
413      {
414         printf("Genesis Cart, CPU0 running\n");
415         current_game_is_sms = 0;
416         megatech_set_megadrive_z80_as_megadrive_z80();
417         cpunum_set_input_line(0, INPUT_LINE_RESET, CLEAR_LINE);
418         cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE);
419      }
420      else
421      {
422         printf("Error in cart loading??? no type specified\n");
423      }
424   }
214425   else
215      return 0xff;
426   {
427      cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE);
428      cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
429   //  cpunum_set_input_line(0, INPUT_LINE_RESET, ASSERT_LINE);
430   //  cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
431
432      /* no cart.. */
433      memset(memory_region(REGION_CPU3)+0x8000, 0x00, 0x8000);
434      memset(memory_region(REGION_CPU1), 0x00, 0x300000);
435   }
436
437   return;
216438}
217439
218static WRITE8_HANDLER( megatech_instr_w )
440static WRITE8_HANDLER( megatech_cart_select_w )
219441{
220   mt_ram = data;
442   /* seems to write the slot number..
443      but it stores something in (banked?) ram
444      because it always seems to show the
445      same instructions ... */
446
447//  printf("megatech_instr_w %02x\n",data);
448
449   mt_cart_select_reg = data;
450
451
452   megatech_select_game(mt_cart_select_reg);
453
454/*
455    if (mt_cart_select_reg==2)
456    {
457        printf("game 2 selected\n");
458        memcpy(memory_region(REGION_CPU3)+0x8000, memory_region(REGION_USER2), 0x8000);
459    }
460//  else if (mt_cart_select_reg==0)
461//  {
462//      printf("game 0 selected\n");
463//      memcpy(memory_region(REGION_CPU3)+0x8000, memory_region(REGION_USER4), 0x8000);
464//  }
465    else if (mt_cart_select_reg==6)
466    {
467        printf("game 6 selected\n");
468        memcpy(memory_region(REGION_CPU3)+0x8000, memory_region(REGION_USER6), 0x8000);
469    }
470    else
471    {
472        memset(memory_region(REGION_CPU3)+0x8000, 0x00, 0x8000);
473    }
474*/
475
221476}
222477
223478
224479static READ8_HANDLER( bios_ctrl_r )
225480{
481
226482   if(offset == 0)
227483      return 0;
228484   if(offset == 2)
r1051r1052
241497}
242498
243499
500READ8_HANDLER( megaplay_r0) { return readinputportbytag("BIOS_IN0") ; }
501READ8_HANDLER( megaplay_r1) { return readinputportbytag("BIOS_IN1") ; }
502READ8_HANDLER( megaplay_r2) { return readinputportbytag("BIOS_DSW0") ; }
503READ8_HANDLER( megaplay_r3) { return readinputportbytag("BIOS_DSW1") ; }
504
505static int mt_bank_bank_pos = 0;
506static int mt_bank_partial = 0;
507static int mt_bank_addr = 0;
508
509/* this sets 0x300000 which may indicate that the 68k can see the instruction rom
510   there, this limiting the max game rom capacity to 3meg. */
511WRITE8_HANDLER (mt_z80_bank_w)
512{
513   mt_bank_partial |= (data & 0x01)<<23; // add new bit to partial address
514   mt_bank_bank_pos++;
515
516   if (mt_bank_bank_pos<9)
517   {
518      mt_bank_partial >>= 1;
519   }
520   else
521   {
522      mt_bank_bank_pos = 0;
523      mt_bank_addr = mt_bank_partial;
524      mt_bank_partial = 0;
525      printf("MT z80 bank set to %08x\n",mt_bank_addr);
526
527   }
528}
529
530READ8_HANDLER( megatech_banked_ram_r )
531{
532   return megatech_banked_ram[offset + 0x1000 * (mt_cart_select_reg&0x7) ];
533}
534
535WRITE8_HANDLER( megatech_banked_ram_w )
536{
537   megatech_banked_ram[offset + 0x1000 * (mt_cart_select_reg&0x7) ] = data;
538}
539
540
541
244542static ADDRESS_MAP_START( megatech_bios_map, ADDRESS_SPACE_PROGRAM, 8 )
245    AM_RANGE(0x0000, 0x2fff) AM_ROM
246    AM_RANGE(0x3000, 0x5fff) AM_RAM
247   AM_RANGE(0x6400, 0x6400) AM_READ(input_port_10_r)
248   AM_RANGE(0x6401, 0x6401) AM_READ(input_port_11_r)
249   AM_RANGE(0x6404, 0x6404) AM_WRITE(megatech_instr_w)
250   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_6_r)
251   AM_RANGE(0x6801, 0x6801) AM_READ(input_port_7_r)
543    AM_RANGE(0x0000, 0x2fff) AM_ROM // from bios rom (0x0000-0x2fff populated in ROM)
544    AM_RANGE(0x3000, 0x3fff) AM_READWRITE(megatech_banked_ram_r, megatech_banked_ram_w) // copies instruction data here at startup, must be banked
545   AM_RANGE(0x4000, 0x5fff) AM_RAM // plain ram?
546   AM_RANGE(0x6000, 0x6000) AM_WRITE( mt_z80_bank_w )
547   AM_RANGE(0x6400, 0x6400) AM_READ(megaplay_r2)
548   AM_RANGE(0x6401, 0x6401) AM_READ(megaplay_r3)
549   AM_RANGE(0x6404, 0x6404) AM_READWRITE(megatech_cart_select_r, megatech_cart_select_w) // cart select & ram bank
550   AM_RANGE(0x6800, 0x6800) AM_READ(megaplay_r0)
551   AM_RANGE(0x6801, 0x6801) AM_READ(megaplay_r1)
252552   AM_RANGE(0x6802, 0x6807) AM_READWRITE(bios_ctrl_r, bios_ctrl_w)
253553//  AM_RANGE(0x6805, 0x6805) AM_READ(input_port_8_r)
254    AM_RANGE(0x7000, 0x7fff) AM_ROM
255   AM_RANGE(0x8000, 0xffff) AM_READ(megatech_instr_r)
554    AM_RANGE(0x7000, 0x77ff) AM_ROM // from bios rom (0x7000-0x77ff populated in ROM)
555   //AM_RANGE(0x7800, 0x7fff) AM_RAM // ?
556   AM_RANGE(0x8000, 0x9fff) AM_READ(megatech_instr_r) // window into 68k address space, reads instr rom and writes to reset banks on z80 carts?
256557ADDRESS_MAP_END
257558
258559
r1051r1052
261562   bios_port_ctrl = data;
262563}
263564
264static READ8_HANDLER (megatech_bios_port_dc_r)
565static READ8_HANDLER (megatech_bios_joypad_r)
265566{
266   if(bios_port_ctrl == 0x55)
267      return readinputport(12);
268   else
269      return readinputport(9);
567   return megatech_bios_port_cc_dc_r(offset,bios_port_ctrl);
270568}
271569
272static READ8_HANDLER (megatech_bios_port_dd_r)
273{
274   if(bios_port_ctrl == 0x55)
275      return readinputport(12);
276   else
277      return readinputport(8);
278}
279570
571
280572static WRITE8_HANDLER (megatech_bios_port_7f_w)
281573{
282574//  popmessage("CPU #3: I/O port 0x7F write, data %02x",data);
r1051r1052
292584   AM_RANGE(0xbe, 0xbe) AM_READWRITE(sms_vdp_data_r, sms_vdp_data_w)
293585   AM_RANGE(0xbf, 0xbf) AM_READWRITE(sms_vdp_ctrl_r, sms_vdp_ctrl_w)
294586
295   AM_RANGE(0xdc, 0xdc) AM_READ(megatech_bios_port_dc_r)  // player inputs
296   AM_RANGE(0xdd, 0xdd) AM_READ(megatech_bios_port_dd_r)  // other player 2 inputs
587   AM_RANGE(0xdc, 0xdd) AM_READ(megatech_bios_joypad_r)  // player inputs
297588ADDRESS_MAP_END
298589
299590
300591
301/* in video/segasyse.c */
302//void megatech_start_video_normal(running_machine *machine);
303//void megatech_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
304//void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
305
306/* give us access to the megadriv start and update functions so that we can call them */
307extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
308extern void video_start_megadriv(running_machine *machine);
309extern void video_eof_megadriv(running_machine *machine);
310extern void machine_reset_megadriv(running_machine *machine);
311
312/* in drivers/segae.c */
313extern UINT32 video_update_megatech_bios(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
314extern void video_eof_megatech_bios(running_machine *machine);
315extern void machine_reset_megatech_bios(running_machine *machine);
316extern void driver_init_megatech_bios(running_machine *machine);
317
318592DRIVER_INIT(mtnew)
319593{
594   megatech_banked_ram = auto_malloc(0x1000*8);
320595   driver_init_megadriv(Machine);
321596   driver_init_megatech_bios(Machine);
322597}
323598
324599VIDEO_START(mtnew)
325600{
601   init_for_megadrive(); // create an sms vdp too, for comptibility mode
326602   video_start_megadriv(Machine);
327603}
328
604//time_never
329605VIDEO_UPDATE(mtnew)
330606{
331   if (screen ==0) video_update_megadriv(Machine,0,bitmap,cliprect);
332   if (screen ==1) video_update_megatech_bios(Machine, 1, bitmap,cliprect);
607   if (screen ==0)
608   {
609      /* if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip */
610      if (!current_game_is_sms) video_update_megadriv(Machine,0,bitmap,cliprect);
611      else video_update_megatech_md_sms(Machine,0,bitmap,cliprect);
612   }
613   else if (screen ==1) video_update_megatech_bios(Machine, 1, bitmap,cliprect);
333614   return 0;
334615}
335616
336617VIDEO_EOF(mtnew)
337618{
338   video_eof_megadriv(Machine);
619   if (!current_game_is_sms) video_eof_megadriv(Machine);
620   else video_eof_megatech_md_sms(Machine);
339621   video_eof_megatech_bios(Machine);
340622}
341623
r1051r1052
343625{
344626   machine_reset_megadriv(Machine);
345627   machine_reset_megatech_bios(Machine);
628   machine_reset_megatech_md_sms(Machine);
629   megatech_select_game(0);
346630}
347631
348632static MACHINE_DRIVER_START( megatech )
r1051r1052
380664
381665/* 12368-xx  xx is the game number? if so there are a _lot_ of carts, mt_beast is 01, mt_sonic is 52! */
382666
383ROM_START( megatech )
384   ROM_REGION( 0x400000, REGION_CPU1, ROMREGION_ERASEFF )
385667
386   ROM_REGION( 0x8000, REGION_USER1, ROMREGION_ERASEFF ) /* Game Instructions */
668/* add a single extra byte after the instruction rom as an indicator to if the cart is SMS or GENESIS,
669   the real hardware knows from the pinout */
670#define MEGATECH_GAME_IS_GEN 1
671#define MEGATECH_GAME_IS_SMS 2
387672
388   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
389   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
673#define MEGATECH_INSTRUCTION_REGION(INSTRUCTION_REGION,FLAG)\
674   ROM_REGION( 0x8002, INSTRUCTION_REGION, 0 ) \
675   ROM_FILL(0x8000, 2, FLAG) \
676
677#define MEGATECH_BIOS \
678   ROM_REGION( 0x400000, REGION_CPU1, ROMREGION_ERASEFF ) \
679   ROM_REGION( 0x10000, REGION_CPU3, 0 ) \
680   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) ) \
681
682/* no games */
683ROM_START( megatech )
684   MEGATECH_BIOS
390685ROM_END
391686
392ROM_START( mt_beast ) /* Altered Beast */
393   ROM_REGION( 0x400000, REGION_CPU1, 0 )
394   ROM_LOAD16_WORD_SWAP( "mp12538.ic1", 0x000000, 0x080000, CRC(3bea3dce) SHA1(ec72e4fde191dedeb3f148f132603ed3c23f0f86) )
395687
396   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
397   ROM_LOAD( "12368-01.ic2", 0x000000, 0x08000, CRC(40cb0088) SHA1(e1711532c29f395a35a1cb34d789015881b5a1ed) )
688/* Game 01 - Altered Beast (Genesis) */
689#define MEGATECH_GAME01(GAME_REGION, INSTRUCTION_REGION) \
690   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
691   ROM_LOAD16_WORD_SWAP( "mp12538.ic1", 0x000000, 0x080000, CRC(3bea3dce) SHA1(ec72e4fde191dedeb3f148f132603ed3c23f0f86) ) \
692    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
693    ROM_LOAD( "12368-01.ic2", 0x000000, 0x08000, CRC(40cb0088) SHA1(e1711532c29f395a35a1cb34d789015881b5a1ed) ) \
398694
399   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
400   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
695ROM_START( mt_beast )
696   MEGATECH_BIOS
697   MEGATECH_GAME01(REGION_USER1, REGION_USER2)
401698ROM_END
402699
403ROM_START( mt_astro ) /* Astro Warrior (Sms Game!) */
404   ROM_REGION( 0x400000, REGION_CPU1, 0 )
405   /* z80 code because this is sms based .... */
406   ROM_LOAD( "ep13817.ic2", 0x000000, 0x020000, CRC(299cbb74) SHA1(901697a3535ad70190647f34ad5b30b695d54542) )
700/* Game 06 - Out Run (SMS) */
407701
408   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
409   ROM_LOAD( "12368-13.ic1", 0x000000, 0x08000,  CRC(4038cbd1) SHA1(696bc1efce45d9f0052b2cf0332a232687c8d6ab) )
702#define MEGATECH_GAME06(GAME_REGION, INSTRUCTION_REGION) \
703   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
704   ROM_LOAD( "mpr-11078.ic1", 0x000000, 0x040000, CRC(5589d8d2) SHA1(4f9b61b24f0d9fee0448cdbbe8fc05411dbb1102) ) \
705    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
706   ROM_LOAD( "epr-12368-06.ic2", 0x000000, 0x08000, CRC(c7c74429) SHA1(22ee261a653e10d66e0d6703c988bb7f236a7571) ) \
410707
411   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
412   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
708
709ROM_START( mt_orun ) /* Outrun */
710   MEGATECH_BIOS
711   MEGATECH_GAME06(REGION_USER1, REGION_USER2)
413712ROM_END
414713
714/* Game 13 - Astro Warrior (SMS) */
715#define MEGATECH_GAME13(GAME_REGION, INSTRUCTION_REGION) \
716   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
717   ROM_LOAD( "ep13817.ic2", 0x000000, 0x20000, CRC(299cbb74) SHA1(901697a3535ad70190647f34ad5b30b695d54542) ) \
718    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
719   ROM_LOAD( "12368-13.ic1", 0x000000, 0x08000,  CRC(4038cbd1) SHA1(696bc1efce45d9f0052b2cf0332a232687c8d6ab) ) \
415720
416ROM_START( mt_wcsoc ) /* World Cup Soccer */
417   ROM_REGION( 0x400000, REGION_CPU1, 0 )
418   ROM_LOAD16_WORD_SWAP( "mp12607b.ic1", 0x000000, 0x080000, CRC(bc591b30) SHA1(55e8577171c0933eee53af1dabd0f4c6462d5fc8) )
721ROM_START( mt_astro )
722   MEGATECH_BIOS
723   MEGATECH_GAME13(REGION_USER1, REGION_USER2)
724ROM_END
419725
420   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
421   ROM_LOAD( "12368-21.ic2", 0x000000, 0x08000, CRC(028ee46b) SHA1(cd8f81d66e5ae62107eb20e0ca5db4b66d4b2987) )
726/* Game 21 - World Cup Soccer (Genesis) */
727#define MEGATECH_GAME21(GAME_REGION, INSTRUCTION_REGION) \
728   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
729   ROM_LOAD16_WORD_SWAP( "mp12607b.ic1", 0x000000, 0x080000, CRC(bc591b30) SHA1(55e8577171c0933eee53af1dabd0f4c6462d5fc8) ) \
730    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
731   ROM_LOAD( "12368-21.ic2", 0x000000, 0x08000, CRC(028ee46b) SHA1(cd8f81d66e5ae62107eb20e0ca5db4b66d4b2987) ) \
422732
423   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
424   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
733ROM_START( mt_wcsoc )
734   MEGATECH_BIOS
735   MEGATECH_GAME21(REGION_USER1, REGION_USER2)
425736ROM_END
426737
427ROM_START( mt_gng ) /* Ghouls and Ghosts */
428   ROM_REGION( 0x400000, REGION_CPU1, 0 )
429   ROM_LOAD16_WORD_SWAP( "mp12605.ic1", 0x000000, 0x020000, CRC(1066C6AB) SHA1(C30E4442732BDB38C96D780542F8550A94D127B0) )
430   ROM_LOAD16_WORD_SWAP( "mpr12606.ic2", 0x080000, 0x020000, CRC(D0BE7777) SHA1(A44B2A3D427F6973B5C1A3DCD8D1776366ACB9F7) )
431   ROM_CONTINUE(0x020000,0x60000)
738/* Game 23 - Ghouls and Ghosts (Genesis) */
739#define MEGATECH_GAME23(GAME_REGION, INSTRUCTION_REGION) \
740   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
741   ROM_LOAD16_WORD_SWAP( "mp12605.ic1", 0x000000, 0x020000, CRC(1066C6AB) SHA1(C30E4442732BDB38C96D780542F8550A94D127B0) ) \
742   ROM_LOAD16_WORD_SWAP( "mpr12606.ic2", 0x080000, 0x020000, CRC(D0BE7777) SHA1(A44B2A3D427F6973B5C1A3DCD8D1776366ACB9F7) ) \
743   ROM_CONTINUE(0x020000,0x60000) \
744    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
745   ROM_LOAD( "12368-23.ic3", 0x000000, 0x08000, CRC(7ee58546) SHA1(ad5bb0934475eacdc5e354f67c96fe0d2512d33b) ) \
432746
433   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
434   ROM_LOAD( "12368-23.ic3", 0x000000, 0x08000, CRC(7ee58546) SHA1(ad5bb0934475eacdc5e354f67c96fe0d2512d33b) )
435
436   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
437   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
747ROM_START( mt_gng )
748   MEGATECH_BIOS
749   MEGATECH_GAME23(REGION_USER1, REGION_USER2)
438750ROM_END
439751
440ROM_START( mt_shang ) /* Super HangOn */
441   ROM_REGION( 0x400000, REGION_CPU1, 0 )
442   ROM_LOAD16_WORD_SWAP( "mpr-12640.ic1", 0x000000, 0x080000, CRC(2fe2cf62) SHA1(4728bcc847deb38b16338cbd0154837cd4a07b7d) )
752/* Game 24 - Super Hang On (Genesis) */
443753
444   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
445   ROM_LOAD( "epr-12368-24.ic2", 0x000000, 0x08000, CRC(6c2db7e3) SHA1(8de0a10ed9185c9e98f17784811a79d3ce8c4c03) )
754#define MEGATECH_GAME24(GAME_REGION, INSTRUCTION_REGION) \
755   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
756   ROM_LOAD16_WORD_SWAP( "mpr-12640.ic1", 0x000000, 0x080000, CRC(2fe2cf62) SHA1(4728bcc847deb38b16338cbd0154837cd4a07b7d) ) \
757    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
758   ROM_LOAD( "epr-12368-24.ic2", 0x000000, 0x08000, CRC(6c2db7e3) SHA1(8de0a10ed9185c9e98f17784811a79d3ce8c4c03) ) \
446759
447   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
448   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
760ROM_START( mt_shang ) /* Super HangOn */
761   MEGATECH_BIOS
762   MEGATECH_GAME24(REGION_USER1, REGION_USER2)
449763ROM_END
450764
451ROM_START( mt_gaxe ) /* Golden Axe */
452   ROM_REGION( 0x400000, REGION_CPU1, 0 )
453   ROM_LOAD16_WORD_SWAP( "12806.ic1", 0x000000, 0x080000, CRC(43456820) SHA1(2f7f1fcd979969ac99426f11ab99999a5494a121) )
765/* Game 25 - Golden Axe (Genesis) */
454766
455   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
456   ROM_LOAD( "12368-25.ic2", 0x000000, 0x08000, CRC(1f07ed28) SHA1(9d54192f4c6c1f8a51c38a835c1dd1e4e3e8279e) )
767#define MEGATECH_GAME25(GAME_REGION, INSTRUCTION_REGION) \
768   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
769   ROM_LOAD16_WORD_SWAP( "12806.ic1", 0x000000, 0x080000, CRC(43456820) SHA1(2f7f1fcd979969ac99426f11ab99999a5494a121) ) \
770    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
771   ROM_LOAD( "12368-25.ic2", 0x000000, 0x08000, CRC(1f07ed28) SHA1(9d54192f4c6c1f8a51c38a835c1dd1e4e3e8279e) ) \
457772
458   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
459   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
773ROM_START( mt_gaxe )
774   MEGATECH_BIOS
775   MEGATECH_GAME25(REGION_USER1, REGION_USER2)
460776ROM_END
461777
462ROM_START( mt_smgp ) /* Super Monaco Grand Prix */
463   ROM_REGION( 0x400000, REGION_CPU1, 0 )
464   ROM_LOAD16_WORD_SWAP( "13250.ic1", 0x000000, 0x080000, CRC(189b885f) SHA1(31c06ffcb48b1604989a94e584261457de4f1f46) )
778/* Game 39 - Super Monaco Grand Prix (Genesis) */
465779
466   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
467   ROM_LOAD( "12368-39.ic2", 0x000000, 0x08000, CRC(64b3ce25) SHA1(83a9f2432d146a712b037f96f261742f7dc810bb) )
780#define MEGATECH_GAME39(GAME_REGION, INSTRUCTION_REGION) \
781   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
782   ROM_LOAD16_WORD_SWAP( "13250.ic1", 0x000000, 0x080000, CRC(189b885f) SHA1(31c06ffcb48b1604989a94e584261457de4f1f46) ) \
783    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
784   ROM_LOAD( "12368-39.ic2", 0x000000, 0x08000, CRC(64b3ce25) SHA1(83a9f2432d146a712b037f96f261742f7dc810bb) ) \
468785
469   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
470   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
786ROM_START( mt_smgp ) /* Super Monaco Grand Prix */
787   MEGATECH_BIOS
788   MEGATECH_GAME39(REGION_USER1, REGION_USER2)
471789ROM_END
472790
473ROM_START( mt_sonic ) /* Sonic */
474   ROM_REGION( 0x400000, REGION_CPU1, 0 )
475   ROM_LOAD16_WORD_SWAP( "mp13913.ic1", 0x000000, 0x080000, CRC(480b4b5c) SHA1(ab1dc1f738e3b2d0898a314b123fa71182bf572e) )
791/* Game 52 - Sonic (Genesis) */
792#define MEGATECH_GAME52(GAME_REGION, INSTRUCTION_REGION) \
793   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
794   ROM_LOAD16_WORD_SWAP( "mp13913.ic1", 0x000000, 0x080000, CRC(480b4b5c) SHA1(ab1dc1f738e3b2d0898a314b123fa71182bf572e) ) \
795    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
796   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000,  CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) ) \
476797
477   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
478   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000,  CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) )
479
480   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
481   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
798ROM_START( mt_sonic )
799   MEGATECH_BIOS
800   MEGATECH_GAME52(REGION_USER1, REGION_USER2)
482801ROM_END
483802
803#define MEGATECH_GAME52ALT(GAME_REGION, INSTRUCTION_REGION) \
804   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
805   ROM_LOAD16_WORD_SWAP( "mp13933.ic1", 0x000000, 0x080000, CRC(13775004) SHA1(5decfd35944a2d0e7b996b9a4a12b616a309fd5e) ) \
806    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
807   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000,  CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) ) \
808
484809ROM_START( mt_sonia ) /* Sonic  (alt)*/
485   ROM_REGION( 0x400000, REGION_CPU1, 0 )
486   ROM_LOAD16_WORD_SWAP( "mp13933.ic1", 0x000000, 0x080000, CRC(13775004) SHA1(5decfd35944a2d0e7b996b9a4a12b616a309fd5e) )
810   MEGATECH_BIOS
811   MEGATECH_GAME52ALT(REGION_USER1, REGION_USER2)
812ROM_END
487813
488   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
489   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000,  CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) )
814/* Game 57 - Golden Axe 2 (Genesis) */
815#define MEGATECH_GAME57(GAME_REGION, INSTRUCTION_REGION) \
816   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
817   ROM_LOAD16_WORD_SWAP( "mp14272.ic1", 0x000000, 0x080000, CRC(d4784cae) SHA1(b6c286027d06fd850016a2a1ee1f1aeea080c3bb) ) \
818    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
819   ROM_LOAD( "12368-57.ic2", 0x000000, 0x08000, CRC(dc9b4433) SHA1(efd3a598569010cdc4bf38ecbf9ed1b4e14ffe36) ) \
490820
491   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
492   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
821ROM_START( mt_gaxe2 ) /* Golden Axe 2 */
822   MEGATECH_BIOS
823   MEGATECH_GAME57(REGION_USER1, REGION_USER2)
493824ROM_END
494825
495ROM_START( mt_gaxe2 ) /* Golden Axe 2 */
496   ROM_REGION( 0x400000, REGION_CPU1, 0 )
497   ROM_LOAD16_WORD_SWAP( "mp14272.ic1", 0x000000, 0x080000, CRC(d4784cae) SHA1(b6c286027d06fd850016a2a1ee1f1aeea080c3bb) )
826/* Game 58 - Sports Talk Football */
827#define MEGATECH_GAME58(GAME_REGION, INSTRUCTION_REGION) \
828   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
829   ROM_LOAD16_WORD_SWAP( "mp14356a-f.ic1", 0x000000, 0x100000, CRC(20cf32f6) SHA1(752314346a7a98b3808b3814609e024dc0a4108c) ) \
830    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
831   ROM_LOAD( "ep12368-58.ic2", 0x000000, 0x08000, CRC(dce2708e) SHA1(fcebb1899ee11468f6bda705899f074e7de9d723) ) \
498832
499   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
500   ROM_LOAD( "12368-57.ic2", 0x000000, 0x08000, CRC(dc9b4433) SHA1(efd3a598569010cdc4bf38ecbf9ed1b4e14ffe36) )
501
502   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
503   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
833ROM_START( mt_stf ) /* Sports Talk Football */
834   MEGATECH_BIOS
835   MEGATECH_GAME58(REGION_USER1, REGION_USER2)
504836ROM_END
505837
506ROM_START( mt_stf ) /* Sports Talk Football */
507   ROM_REGION( 0x400000, REGION_CPU1, 0 )
508   ROM_LOAD16_WORD_SWAP( "mp14356a-f.ic1", 0x000000, 0x100000, CRC(20cf32f6) SHA1(752314346a7a98b3808b3814609e024dc0a4108c) )
838/* Game 53 - Fire Shark */
839#define MEGATECH_GAME53(GAME_REGION, INSTRUCTION_REGION) \
840   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
841   ROM_LOAD16_WORD_SWAP( "mp14341.ic1", 0x000000, 0x080000, CRC(04d65ebc) SHA1(24338aecdc52b6f416548be722ca475c83dbae96) ) \
842    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
843   ROM_LOAD( "12368-53.ic2", 0x000000, 0x08000,  CRC(4fa61044) SHA1(7810deea221c10b0b2f5233443d81f4f1998ee58) ) \
509844
510   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
511   ROM_LOAD( "ep12368-58.ic2", 0x000000, 0x08000, CRC(dce2708e) SHA1(fcebb1899ee11468f6bda705899f074e7de9d723) )
512
513   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
514   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
515ROM_END
516
517ROM_START( mt_fshrk ) /* Fire Shark */
518   ROM_REGION( 0x400000, REGION_CPU1, 0 )
519   ROM_LOAD16_WORD_SWAP( "mp14341.ic1", 0x000000, 0x080000, CRC(04d65ebc) SHA1(24338aecdc52b6f416548be722ca475c83dbae96) )
520845   /* alt version with these roms exists, but the content is the same */
521846   /* (6a221fd6) ep14706.ic1             mp14341.ic1  [even]     IDENTICAL */
522847   /* (09fa48af) ep14707.ic2             mp14341.ic1  [odd]      IDENTICAL */
523848
524   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
525   ROM_LOAD( "12368-53.ic2", 0x000000, 0x08000,  CRC(4fa61044) SHA1(7810deea221c10b0b2f5233443d81f4f1998ee58) )
526
527   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
528   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
849ROM_START( mt_fshrk ) /* Fire Shark */
850   MEGATECH_BIOS
851   MEGATECH_GAME53(REGION_USER1, REGION_USER2)
529852ROM_END
530853
854/* Game 38 - E-Swat */
855#define MEGATECH_GAME38(GAME_REGION, INSTRUCTION_REGION) \
856   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
857   ROM_LOAD16_WORD_SWAP( "mp13192-h.ic1", 0x000000, 0x080000, CRC(82f458ef) SHA1(58444b783312def71ecffc4ad021b72a609685cb) ) \
858    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
859   ROM_LOAD( "12368-38.ic2", 0x000000, 0x08000, CRC(43c5529b) SHA1(104f85adea6da1612c0aa96d553efcaa387d7aaf) ) \
531860
532861ROM_START( mt_eswat ) /* E-Swat */
533   ROM_REGION( 0x400000, REGION_CPU1, 0 )
534   ROM_LOAD16_WORD_SWAP( "mp13192-h.ic1", 0x000000, 0x080000, CRC(82f458ef) SHA1(58444b783312def71ecffc4ad021b72a609685cb) )
862   MEGATECH_BIOS
863   MEGATECH_GAME38(REGION_USER1, REGION_USER2)
864ROM_END
535865
536   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
537   ROM_LOAD( "12368-38.ic2", 0x000000, 0x08000, CRC(43c5529b) SHA1(104f85adea6da1612c0aa96d553efcaa387d7aaf) )
866/* Game 49 - Bonanza Bros */
538867
539   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
540   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
541ROM_END
868#define MEGATECH_GAME49(GAME_REGION, INSTRUCTION_REGION) \
869   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
870   ROM_LOAD16_WORD_SWAP( "mp13905a.ic1", 0x000000, 0x100000, CRC(68a88d60) SHA1(2f56e8a2b0999de4fa0d14a1527f4e1df0f9c7a2) ) \
871    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
872   ROM_LOAD( "12368-49.ic2", 0x000000, 0x08000, CRC(c5101da2) SHA1(636f30043e2e9291e193ef9a2ead2e97a0bf7380) ) \
542873
543874ROM_START( mt_bbros ) /* Bonanza Bros */
544   ROM_REGION( 0x400000, REGION_CPU1, 0 )
545   ROM_LOAD16_WORD_SWAP( "mp13905a.ic1", 0x000000, 0x100000, CRC(68a88d60) SHA1(2f56e8a2b0999de4fa0d14a1527f4e1df0f9c7a2) )
875   MEGATECH_BIOS
876   MEGATECH_GAME49(REGION_USER1, REGION_USER2)
877ROM_END
546878
547   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
548   ROM_LOAD( "12368-49.ic2", 0x000000, 0x08000, CRC(c5101da2) SHA1(636f30043e2e9291e193ef9a2ead2e97a0bf7380) )
879/* Game 62 - Sonic 2 */
549880
550   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
551   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
552ROM_END
881#define MEGATECH_GAME62(GAME_REGION, INSTRUCTION_REGION) \
882   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
883   ROM_LOAD16_WORD_SWAP( "mp15000a-f.ic1", 0x000000, 0x100000, CRC(679ebb49) SHA1(557482064677702454562f753460993067ef9e16) ) \
884    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
885   ROM_LOAD( "ep12368-62.ic2", 0x000000, 0x08000, CRC(14a8566f) SHA1(d1d14162144bf068ddd19e9736477ff98fb43f9e) ) \
553886
887
554888ROM_START( mt_soni2 ) /* Sonic 2 */
555   ROM_REGION( 0x400000, REGION_CPU1, 0 )
556   ROM_LOAD16_WORD_SWAP( "mp15000a-f.ic1", 0x000000, 0x100000, CRC(679ebb49) SHA1(557482064677702454562f753460993067ef9e16) )
889   MEGATECH_BIOS
890   MEGATECH_GAME62(REGION_USER1, REGION_USER2)
891ROM_END
557892
558   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
559   ROM_LOAD( "ep12368-62.ic2", 0x000000, 0x08000, CRC(14a8566f) SHA1(d1d14162144bf068ddd19e9736477ff98fb43f9e) )
893/* Game 59 - Mario Lemieux Hockey */
560894
561   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
562   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
895#define MEGATECH_GAME59(GAME_REGION, INSTRUCTION_REGION) \
896   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
897   ROM_LOAD16_WORD_SWAP( "mpr-14376-h.ic1", 0x000000, 0x80000, CRC(aa9be87e) SHA1(dceed94eaeb30e534f6953a4bc25ff37673b1e6b) ) \
898    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
899   ROM_LOAD( "epr-12368-59.ic2", 0x000000, 0x08000, CRC(6d47b438) SHA1(0a145f6438e4e55c957ae559663c37662b685246) ) \
900
901ROM_START( mt_mlh )
902   MEGATECH_BIOS
903   MEGATECH_GAME59(REGION_USER1, REGION_USER2)
563904ROM_END
564905
565ROM_START( mt_mlh ) /* Mario Lemieux Hockey */
566   ROM_REGION( 0x400000, REGION_CPU1, 0 )
567   ROM_LOAD16_WORD_SWAP( "mpr-14376-h.ic1", 0x000000, 0x80000, CRC(aa9be87e) SHA1(dceed94eaeb30e534f6953a4bc25ff37673b1e6b) )
906/* Game 60 - Kid Chameleon */
568907
569   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
570   ROM_LOAD( "epr-12368-59.ic2", 0x000000, 0x08000, CRC(6d47b438) SHA1(0a145f6438e4e55c957ae559663c37662b685246) )
908#define MEGATECH_GAME60(GAME_REGION, INSTRUCTION_REGION) \
909   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
910   ROM_LOAD16_WORD_SWAP( "mp14557.ic1", 0x000000, 0x100000, CRC(e1a889a4) SHA1(a2768eacafc47d371e5276f0cce4b12b6041337a) ) \
911    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
912   ROM_LOAD( "12368-60.ic2", 0x000000, 0x08000, CRC(a8e4af18) SHA1(dfa49f6ec4047718f33dba1180f6204dbaff884c) ) \
571913
572   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
573   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
574ROM_END
575914
576915ROM_START( mt_kcham ) /* Kid Chameleon */
577   ROM_REGION( 0x400000, REGION_CPU1, 0 )
578   ROM_LOAD16_WORD_SWAP( "mp14557.ic1", 0x000000, 0x100000, CRC(e1a889a4) SHA1(a2768eacafc47d371e5276f0cce4b12b6041337a) )
916   MEGATECH_BIOS
917   MEGATECH_GAME60(REGION_USER1, REGION_USER2)
918ROM_END
579919
580   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
581   ROM_LOAD( "12368-60.ic2", 0x000000, 0x08000, CRC(a8e4af18) SHA1(dfa49f6ec4047718f33dba1180f6204dbaff884c) )
920/* Game 20 - Last Battle */
582921
583   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
584   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
585ROM_END
922#define MEGATECH_GAME20(GAME_REGION, INSTRUCTION_REGION) \
923   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
924   ROM_LOAD16_WORD_SWAP( "mp12578f.ic1", 0x000000, 0x080000, CRC(531191a0) SHA1(f6bc26e975c01a3e10ab4033e4c5f494627a1e2f) ) \
925    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
926   ROM_LOAD( "12368-20.ic2", 0x000000, 0x08000, CRC(e1a71c91) SHA1(c250da18660d8aea86eb2abace41ba46130dabc8) ) \
586927
587928ROM_START( mt_lastb ) /* Last Battle */
588   ROM_REGION( 0x400000, REGION_CPU1, 0 )
589   ROM_LOAD16_WORD_SWAP( "mp12578f.ic1", 0x000000, 0x080000, CRC(531191a0) SHA1(f6bc26e975c01a3e10ab4033e4c5f494627a1e2f) )
929   MEGATECH_BIOS
930   MEGATECH_GAME20(REGION_USER1, REGION_USER2)
931ROM_END
590932
591   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
592   ROM_LOAD( "12368-20.ic2", 0x000000, 0x08000, CRC(e1a71c91) SHA1(c250da18660d8aea86eb2abace41ba46130dabc8) )
933/* Game 40 - Moon Walker */
593934
594   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
595   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
596ROM_END
935#define MEGATECH_GAME40(GAME_REGION, INSTRUCTION_REGION) \
936   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
937   ROM_LOAD16_WORD_SWAP( "mp13285a.ic1", 0x000000, 0x080000, CRC(189516e4) SHA1(2a79e07da2e831832b8d448cae87a833c85e67c9) ) \
938    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
939   ROM_LOAD( "12368-40.ic2", 0x000000, 0x08000, CRC(0482378c) SHA1(734772f3ddb5ff82b76c3514d18a464b2bce8381) ) \
597940
941
598942ROM_START( mt_mwalk ) /* Moon Walker */
599   ROM_REGION( 0x400000, REGION_CPU1, 0 )
600   ROM_LOAD16_WORD_SWAP( "mp13285a.ic1", 0x000000, 0x080000, CRC(189516e4) SHA1(2a79e07da2e831832b8d448cae87a833c85e67c9) )
943   MEGATECH_BIOS
944   MEGATECH_GAME40(REGION_USER1, REGION_USER2)
945ROM_END
601946
602   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
603   ROM_LOAD( "12368-40.ic2", 0x000000, 0x08000, CRC(0482378c) SHA1(734772f3ddb5ff82b76c3514d18a464b2bce8381) )
947/* Game 41 - Crackdown */
604948
605   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
606   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
949#define MEGATECH_GAME41(GAME_REGION, INSTRUCTION_REGION) \
950   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
951   ROM_LOAD16_WORD_SWAP( "mp13578a-s.ic1", 0x000000, 0x080000, CRC(23f19893) SHA1(09aca793871e2246af4dc24925bc1eda8ff34446) ) \
952    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
953   ROM_LOAD( "ep12368-41.ic2", 0x000000, 0x08000, CRC(3014acec) SHA1(07953e9ae5c23fc7e7d08993b215f4dfa88aa5d7) ) \
954
955
956ROM_START( mt_crack )
957   MEGATECH_BIOS
958   MEGATECH_GAME41(REGION_USER1, REGION_USER2)
607959ROM_END
608960
609ROM_START( mt_crack ) /* Crackdown */
610   ROM_REGION( 0x400000, REGION_CPU1, 0 )
611   ROM_LOAD16_WORD_SWAP( "mp13578a-s.ic1", 0x000000, 0x080000, CRC(23f19893) SHA1(09aca793871e2246af4dc24925bc1eda8ff34446) )
612961
613   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
614   ROM_LOAD( "ep12368-41.ic2", 0x000000, 0x08000, CRC(3014acec) SHA1(07953e9ae5c23fc7e7d08993b215f4dfa88aa5d7) )
962/* Game 27 - Mystic Defender */
615963
616   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
617   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
618ROM_END
964#define MEGATECH_GAME27(GAME_REGION, INSTRUCTION_REGION) \
965   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
966   ROM_LOAD16_WORD_SWAP( "mp12707.1", 0x000000, 0x080000, CRC(4f2c513d) SHA1(f9bb548b3688170fe18bb3f1b5b54182354143cf) ) \
967    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
968   ROM_LOAD( "12368-27.ic2", 0x000000, 0x08000, CRC(caf46f78) SHA1(a9659e86a6a223646338cd8f29c346866e4406c7) ) \
619969
620970ROM_START( mt_mystd ) /* Mystic Defender */
621   ROM_REGION( 0x400000, REGION_CPU1, 0 )
622   ROM_LOAD16_WORD_SWAP( "mp12707.1", 0x000000, 0x080000, CRC(4f2c513d) SHA1(f9bb548b3688170fe18bb3f1b5b54182354143cf) )
971   MEGATECH_BIOS
972   MEGATECH_GAME27(REGION_USER1, REGION_USER2)
973ROM_END
623974
624   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
625   ROM_LOAD( "12368-27.ic2", 0x000000, 0x08000, CRC(caf46f78) SHA1(a9659e86a6a223646338cd8f29c346866e4406c7) )
975/* Game 02 - Space Harrier 2 */
626976
627   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
628   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
629ROM_END
977#define MEGATECH_GAME02(GAME_REGION, INSTRUCTION_REGION) \
978   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
979   ROM_LOAD16_WORD_SWAP( "mp11934.ic1", 0x000000, 0x080000, CRC(932daa09) SHA1(a2d7a76f3604c6227d43229908bfbd02b0ef5fd9) ) \
980    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
981   ROM_LOAD( "12368-02.ic2", 0x000000, 0x08000, CRC(c129c66c) SHA1(e7c0c97db9df9eb04e2f9ff561b64305219b8f1f) ) \
630982
631983ROM_START( mt_shar2 ) /* Space Harrier 2 */
632   ROM_REGION( 0x400000, REGION_CPU1, 0 )
633   ROM_LOAD16_WORD_SWAP( "mp11934.ic1", 0x000000, 0x080000, CRC(932daa09) SHA1(a2d7a76f3604c6227d43229908bfbd02b0ef5fd9) )
984   MEGATECH_BIOS
985   MEGATECH_GAME02(REGION_USER1, REGION_USER2)
986ROM_END
634987
635   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
636   ROM_LOAD( "12368-02.ic1", 0x000000, 0x08000, CRC(c129c66c) SHA1(e7c0c97db9df9eb04e2f9ff561b64305219b8f1f) ) // ic2?
988/* Game 03 - Super Thunder Blade */
989#define MEGATECH_GAME03(GAME_REGION, INSTRUCTION_REGION) \
990   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
991   ROM_LOAD16_WORD_SWAP( "mp11996f.ic1", 0x000000, 0x080000,  CRC(9355c34e) SHA1(26ff91c2921408673c644b0b1c8931d98524bf63) ) \
992    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
993   ROM_LOAD( "12368-03.ic2", 0x000000, 0x08000,  CRC(1ba4ac5d) SHA1(9bde57d70189d159ebdc537a9026001abfd0deae) ) \
637994
638   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
639   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
640ROM_END
641995
642996ROM_START( mt_stbld ) /* Super Thunder Blade */
643   ROM_REGION( 0x400000, REGION_CPU1, 0 )
644   ROM_LOAD16_WORD_SWAP( "mp11996f.ic1", 0x000000, 0x080000,  CRC(9355c34e) SHA1(26ff91c2921408673c644b0b1c8931d98524bf63) )
997   MEGATECH_BIOS
998   MEGATECH_GAME03(REGION_USER1, REGION_USER2)
999ROM_END
6451000
646   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
647   ROM_LOAD( "12368-03.ic2", 0x000000, 0x08000,  CRC(1ba4ac5d) SHA1(9bde57d70189d159ebdc537a9026001abfd0deae) )
1001/* Game 22 - Tetris */
1002#define MEGATECH_GAME22(GAME_REGION, INSTRUCTION_REGION) \
1003   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1004   ROM_LOAD16_BYTE( "mpr-12356f.ic1", 0x000001, 0x020000, CRC(1e71c1a0) SHA1(44b2312792e49d46d71e0417a7f022e5ffddbbfe) ) \
1005   ROM_LOAD16_BYTE( "mpr-12357f.ic2", 0x000000, 0x020000, CRC(d52ca49c) SHA1(a9159892eee2c0cf28ebfcfa99f81f80781851c6) ) \
1006    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1007   ROM_LOAD( "12368-22.ic3", 0x000000, 0x08000, CRC(1c1b6468) SHA1(568a38f4186167486e39ab4aa2c1ceffd0b81156) ) \
6481008
649   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
650   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1009ROM_START( mt_tetri ) /* Tetris */
1010   MEGATECH_BIOS
1011   MEGATECH_GAME22(REGION_USER1, REGION_USER2)
6511012ROM_END
6521013
653ROM_START( mt_tetri ) /* Tetris */
654   ROM_REGION( 0x400000, REGION_CPU1, 0 )
655   ROM_LOAD16_BYTE( "mpr-12356f.ic1", 0x000001, 0x020000, CRC(1e71c1a0) SHA1(44b2312792e49d46d71e0417a7f022e5ffddbbfe) )
656   ROM_LOAD16_BYTE( "mpr-12357f.ic2", 0x000000, 0x020000, CRC(d52ca49c) SHA1(a9159892eee2c0cf28ebfcfa99f81f80781851c6) )
1014/* Game 11 - Thunder Force 2 */
6571015
658   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
659   ROM_LOAD( "12368-22.ic3", 0x000000, 0x08000, CRC(1c1b6468) SHA1(568a38f4186167486e39ab4aa2c1ceffd0b81156) )
1016#define MEGATECH_GAME11(GAME_REGION, INSTRUCTION_REGION) \
1017   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1018   ROM_LOAD16_WORD_SWAP( "mp12559.ic1", 0x000000, 0x080000, CRC(b093bee3) SHA1(0bf6194c3d228425f8cf1903ed70d8da1b027b6a) ) \
1019    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1020   ROM_LOAD( "12368-11.ic2", 0x000000, 0x08000, CRC(f4f27e8d) SHA1(ae1a2823deb416c53838115966f1833d5dac72d4) ) \
6601021
661   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
662   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1022ROM_START( mt_tfor2 ) /* Thunder Force 2 */
1023   MEGATECH_BIOS
1024   MEGATECH_GAME11(REGION_USER1, REGION_USER2)
6631025ROM_END
6641026
665ROM_START( mt_tfor2 ) /* Thunder Force 2 */
666   ROM_REGION( 0x400000, REGION_CPU1, 0 )
667   ROM_LOAD16_WORD_SWAP( "mp12559.ic1", 0x000000, 0x080000, CRC(b093bee3) SHA1(0bf6194c3d228425f8cf1903ed70d8da1b027b6a) )
1027/* Game 35 - Tommy Lasorda Baseball */
6681028
669   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
670   ROM_LOAD( "12368-11.ic2", 0x000000, 0x08000, CRC(f4f27e8d) SHA1(ae1a2823deb416c53838115966f1833d5dac72d4) )
1029#define MEGATECH_GAME35(GAME_REGION, INSTRUCTION_REGION) \
1030   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1031   ROM_LOAD16_WORD_SWAP( "mp12706.ic1", 0x000000, 0x080000, CRC(8901214f) SHA1(f5ec166be1cf9b86623b9d7a78ec903b899da32a) ) \
1032    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1033   ROM_LOAD( "12368-35.ic2", 0x000000, 0x08000, CRC(67bbe482) SHA1(6fc283b22e68befabb44b2cc61a7f82a71d6f029) ) \
6711034
672   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
673   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
674ROM_END
6751035
6761036ROM_START( mt_tlbba ) /* Tommy Lasorda Baseball */
677   ROM_REGION( 0x400000, REGION_CPU1, 0 )
678   ROM_LOAD16_WORD_SWAP( "mp12706.ic1", 0x000000, 0x080000, CRC(8901214f) SHA1(f5ec166be1cf9b86623b9d7a78ec903b899da32a) )
1037   MEGATECH_BIOS
1038   MEGATECH_GAME35(REGION_USER1, REGION_USER2)
1039ROM_END
6791040
680   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
681   ROM_LOAD( "12368-35.ic2", 0x000000, 0x08000, CRC(67bbe482) SHA1(6fc283b22e68befabb44b2cc61a7f82a71d6f029) )
1041/* Game 36 - Columns */
6821042
683   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
684   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
685ROM_END
1043#define MEGATECH_GAME36(GAME_REGION, INSTRUCTION_REGION) \
1044   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1045   ROM_LOAD16_WORD_SWAP( "mp13193-t.ic1", 0x000000, 0x080000, CRC(8c770e2f) SHA1(02a3626025c511250a3f8fb3176eebccc646cda9) ) \
1046    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1047   ROM_LOAD( "ep12368-36.ic3", 0x000000, 0x08000,  CRC(a4b29bac) SHA1(c9be866ac96243897d09612fe17562e0481f66e3) ) \
6861048
6871049ROM_START( mt_cols ) /* Columns */
688   ROM_REGION( 0x400000, REGION_CPU1, 0 )
689   ROM_LOAD16_WORD_SWAP( "mp13193-t.ic1", 0x000000, 0x080000, CRC(8c770e2f) SHA1(02a3626025c511250a3f8fb3176eebccc646cda9) )
1050   MEGATECH_BIOS
1051   MEGATECH_GAME36(REGION_USER1, REGION_USER2)
1052ROM_END
6901053
691   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
692   ROM_LOAD( "ep12368-36.ic3", 0x000000, 0x08000,  CRC(a4b29bac) SHA1(c9be866ac96243897d09612fe17562e0481f66e3) )
1054/* Game 04 - Great Golf (SMS) - bad dump */
6931055
694   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
695   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1056#define MEGATECH_GAME04(GAME_REGION, INSTRUCTION_REGION) \
1057   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1058   ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(942738ba) SHA1(e99d4e39c965fc123a39d75521a274687e917a57) ) \
1059    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1060   ROM_LOAD( "12368-04.ic2", 0x000000, 0x08000, CRC(62e5579b) SHA1(e1f531be5c40a1216d4192baeda9352384444410) ) \
1061
1062ROM_START( mt_ggolf )
1063   MEGATECH_BIOS
1064   MEGATECH_GAME04(REGION_USER1, REGION_USER2)
6961065ROM_END
6971066
698ROM_START( mt_ggolf ) /* Great Golf (Bad Dump) */
699   ROM_REGION( 0x400000, REGION_CPU1, 0 )
700   ROM_LOAD16_WORD_SWAP( "mp11129f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(942738ba) SHA1(e99d4e39c965fc123a39d75521a274687e917a57) ) // first 32kb is repeated 4 times, doesn't work in MEKA
1067/* Game 05 - Great Soccer (SMS) - bad dump */
7011068
702   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
703   ROM_LOAD( "12368-04.ic2", 0x000000, 0x08000, CRC(62e5579b) SHA1(e1f531be5c40a1216d4192baeda9352384444410) )
1069#define MEGATECH_GAME05(GAME_REGION, INSTRUCTION_REGION) \
1070   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1071   ROM_LOAD( "mp10747f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(9cf53703) SHA1(c6b4d1de56bd5bf067ec7fc80449c07686d01337) ) \
1072    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1073   ROM_LOAD( "12368-05.ic2", 0x000000, 0x08000, CRC(bab91fcc) SHA1(a160c9d34b253e93ac54fdcef33f95f44d8fa90c) ) \
7041074
705   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
706   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1075ROM_START( mt_gsocr )
1076   MEGATECH_BIOS
1077   MEGATECH_GAME05(REGION_USER1, REGION_USER2)
7071078ROM_END
7081079
709ROM_START( mt_gsocr ) /* Great Soccer (SMS based) (Bad Dump) */
710   ROM_REGION( 0x400000, REGION_CPU1, 0 )
711   ROM_LOAD16_WORD_SWAP( "mp10747f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(9cf53703) SHA1(c6b4d1de56bd5bf067ec7fc80449c07686d01337) ) // first 32kb is repeated 4 times, doesn't work in MEKA
1080/* Game 07 - Alien Syndrome (SMS) */
7121081
713   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
714   ROM_LOAD( "12368-05.ic2", 0x000000, 0x08000, CRC(bab91fcc) SHA1(a160c9d34b253e93ac54fdcef33f95f44d8fa90c) )
1082#define MEGATECH_GAME07(GAME_REGION, INSTRUCTION_REGION) \
1083   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1084   ROM_LOAD( "mpr-11194.ic1", 0x000000, 0x040000, CRC(4cc11df9) SHA1(5d786476b275de34efb95f576dd556cf4b335a83) ) \
1085    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1086   ROM_LOAD( "epr-12368-07.ic2", 0x000000, 0x08000, CRC(14f4a17b) SHA1(0fc010ac95762534892f1ae16986dbf1c25399d3) ) \
7151087
716   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
717   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1088ROM_START( mt_asyn ) /* Alien Syndrome (SMS based) */
1089   MEGATECH_BIOS
1090   MEGATECH_GAME07(REGION_USER1, REGION_USER2)
7181091ROM_END
7191092
720ROM_START( mt_asyn ) /* Alien Syndrome (SMS based) */
721   ROM_REGION( 0x400000, REGION_CPU1, 0 )
722   ROM_LOAD16_WORD_SWAP( "mpr-11194.ic1", 0x000000, 0x040000, CRC(4cc11df9) SHA1(5d786476b275de34efb95f576dd556cf4b335a83) )
1093/* Game 29 - Parlour Games (SMS) */
1094#define MEGATECH_GAME29(GAME_REGION, INSTRUCTION_REGION) \
1095   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1096   ROM_LOAD( "mp11404.ic1", 0x000000, 0x020000, CRC(E030E66C) SHA1(06664DAF208F07CB00B603B12ECCFC3F01213A17) ) \
1097    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1098   ROM_LOAD( "12368-29.ic2", 0x000000, 0x08000, CRC(534151e8) SHA1(219238d90c1d3ac07ff64c9a2098b490fff68f04) ) \
7231099
724   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
725   ROM_LOAD( "epr-12368-07.ic2", 0x000000, 0x08000, CRC(14f4a17b) SHA1(0fc010ac95762534892f1ae16986dbf1c25399d3) )
7261100
727   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
728   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1101ROM_START( mt_parlg ) /* Parlour Games (SMS Based)  */
1102   MEGATECH_BIOS
1103   MEGATECH_GAME29(REGION_USER1, REGION_USER2)
7291104ROM_END
7301105
731ROM_START( mt_parlg ) /* Parlour Games (SMS Based)  */
732   ROM_REGION( 0x400000, REGION_CPU1, 0 )
733   ROM_LOAD16_WORD_SWAP( "mp11404.ic1", 0x000000, 0x020000, CRC(E030E66C) SHA1(06664DAF208F07CB00B603B12ECCFC3F01213A17) )
1106/* Game 08 - Shinobi (SMS) */
7341107
735   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
736   ROM_LOAD( "12368-29.ic2", 0x000000, 0x08000, CRC(534151e8) SHA1(219238d90c1d3ac07ff64c9a2098b490fff68f04) )
1108#define MEGATECH_GAME08(GAME_REGION, INSTRUCTION_REGION) \
1109   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1110   ROM_LOAD( "mp11706.ic1", 0x000000, 0x040000, CRC(0C6FAC4E) SHA1(7C0778C055DC9C2B0AAE1D166DBDB4734E55B9D1) ) \
1111    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1112   ROM_LOAD( "12368-08.ic2", 0x000000, 0x08000, CRC(103A0459) SHA1(D803DDF7926B83785E8503C985B8C78E7CCB5DAC) ) \
7371113
738   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
739   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1114ROM_START( mt_shnbi ) /* Shinobi. */
1115   MEGATECH_BIOS
1116   MEGATECH_GAME08(REGION_USER1, REGION_USER2)
7401117ROM_END
7411118
742ROM_START( mt_shnbi ) /* Shinobi. */
743   ROM_REGION( 0x400000, REGION_CPU1, 0 )
744   ROM_LOAD16_WORD_SWAP( "mp11706.ic1", 0x000000, 0x040000, CRC(0C6FAC4E) SHA1(7C0778C055DC9C2B0AAE1D166DBDB4734E55B9D1) )
1119/* Game 10 - AFterburner (SMS) */
7451120
746   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
747   ROM_LOAD( "12368-08.ic2", 0x000000, 0x08000, CRC(103A0459) SHA1(D803DDF7926B83785E8503C985B8C78E7CCB5DAC) )
1121#define MEGATECH_GAME10(GAME_REGION, INSTRUCTION_REGION) \
1122   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1123   ROM_LOAD( "mp11271.ic1", 0x000000, 0x080000, CRC(1C951F8E) SHA1(51531DF038783C84640A0CAB93122E0B59E3B69A) ) \
1124    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1125   ROM_LOAD( "12368-10.ic2", 0x000000, 0x08000, CRC(2A7CB590) SHA1(2236963BDDC89CA9045B530259CC7B5CCF889EAF) ) \
7481126
749   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
750   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1127ROM_START( mt_aftrb ) /* Afterburner. */
1128   MEGATECH_BIOS
1129   MEGATECH_GAME10(REGION_USER1, REGION_USER2)
7511130ROM_END
7521131
753ROM_START( mt_revsh ) /* The Revenge Of Shinobi. */
754   ROM_REGION( 0x400000, REGION_CPU1, 0 )
755   ROM_LOAD16_WORD_SWAP( "mp12675.ic1", 0x000000, 0x080000, CRC(672A1D4D) SHA1(5FD0AF14C8F2CF8CEAB1AE61A5A19276D861289A) )
1132/* Game 28 - Revenge of Shinobi */
7561133
757   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
758   ROM_LOAD( "12368-28.ic2", 0x000000, 0x08000, CRC(0D30BEDE) SHA1(73A090D84B78A570E02FB54A33666DCADA52849B) )
1134#define MEGATECH_GAME28(GAME_REGION, INSTRUCTION_REGION) \
1135   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1136   ROM_LOAD16_WORD_SWAP( "mp12675.ic1", 0x000000, 0x080000, CRC(672A1D4D) SHA1(5FD0AF14C8F2CF8CEAB1AE61A5A19276D861289A) ) \
1137    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1138   ROM_LOAD( "12368-28.ic2", 0x000000, 0x08000, CRC(0D30BEDE) SHA1(73A090D84B78A570E02FB54A33666DCADA52849B) ) \
7591139
760   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
761   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1140
1141ROM_START( mt_revsh ) /* The Revenge Of Shinobi. */
1142   MEGATECH_BIOS
1143   MEGATECH_GAME28(REGION_USER1, REGION_USER2)
7621144ROM_END
7631145
764ROM_START( mt_aftrb ) /* Afterburner. */
765   ROM_REGION( 0x400000, REGION_CPU1, 0 )
766   ROM_LOAD16_WORD_SWAP( "mp11271.ic1", 0x000000, 0x080000, CRC(1C951F8E) SHA1(51531DF038783C84640A0CAB93122E0B59E3B69A) )
1146/* Game 31 - Arnold Palmer Tournament Gold */
7671147
768   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
769   ROM_LOAD( "12368-10.ic2", 0x000000, 0x08000, CRC(2A7CB590) SHA1(2236963BDDC89CA9045B530259CC7B5CCF889EAF) )
1148#define MEGATECH_GAME31(GAME_REGION, INSTRUCTION_REGION) \
1149   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1150   ROM_LOAD16_WORD_SWAP( "mp12645f.ic1", 0x000000, 0x080000, CRC(c07ef8d2) SHA1(9d111fdc7bb92d52bfa048cd134aa488b4f475ef) ) \
1151    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1152   ROM_LOAD( "12368-31.ic2", 0x000000, 0x08000, CRC(30af7e4a) SHA1(baf91d527393dc90aba9371abcb1e690bcc83c7e) ) \
7701153
771   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
772   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
773ROM_END
7741154
7751155ROM_START( mt_tgolf ) /* Arnold Palmer Tournament Golf */
776   ROM_REGION( 0x400000, REGION_CPU1, 0 )
777   ROM_LOAD16_WORD_SWAP( "mp12645f.ic1", 0x000000, 0x080000, CRC(c07ef8d2) SHA1(9d111fdc7bb92d52bfa048cd134aa488b4f475ef) )
1156   MEGATECH_BIOS
1157   MEGATECH_GAME31(REGION_USER1, REGION_USER2)
1158ROM_END
7781159
779   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
780   ROM_LOAD( "12368-31.ic2", 0x000000, 0x08000, CRC(30af7e4a) SHA1(baf91d527393dc90aba9371abcb1e690bcc83c7e) )
7811160
782   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
783   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
784ROM_END
1161/* Game 47 - Alien Storm */
7851162
1163#define MEGATECH_GAME47(GAME_REGION, INSTRUCTION_REGION) \
1164   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1165   ROM_LOAD16_WORD_SWAP( "mp13941.ic1", 0x000000, 0x080000, CRC(D71B3EE6) SHA1(05F272DAD243D132D517C303388248DC4C0482ED) ) \
1166    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1167   ROM_LOAD( "12368-47.ic2", 0x000000, 0x08000, CRC(31FB683D) SHA1(E356DA020BBF817B97FB10C27F75CF5931EDF4FC) ) \
1168
7861169ROM_START( mt_astrm ) /* Alien Storm. */
787   ROM_REGION( 0x400000, REGION_CPU1, 0 )
788   ROM_LOAD16_WORD_SWAP( "mp13941.ic1", 0x000000, 0x080000, CRC(D71B3EE6) SHA1(05F272DAD243D132D517C303388248DC4C0482ED) )
1170   MEGATECH_BIOS
1171   MEGATECH_GAME47(REGION_USER1, REGION_USER2)
1172ROM_END
7891173
790   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
791   ROM_LOAD( "1236847.ic2", 0x000000, 0x08000, CRC(31FB683D) SHA1(E356DA020BBF817B97FB10C27F75CF5931EDF4FC) )
1174/* Game 44 - Arrow Flash */
7921175
793   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
794   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
795ROM_END
1176#define MEGATECH_GAME44(GAME_REGION, INSTRUCTION_REGION) \
1177   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1178   ROM_LOAD16_WORD_SWAP( "mpr13396h.ic1", 0x000000, 0x080000, CRC(091226e3) SHA1(cb15c6277314f3c4a86b5ae5823f72811d5d269d) ) \
1179    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1180   ROM_LOAD( "epr12368-44.ic2", 0x000000, 0x08000, CRC(e653065d) SHA1(96b014fc4df8eb2188ac94ed0a778d974fe6dcad) ) \
7961181
1182
7971183ROM_START( mt_arrow ) /* Arrow Flash */
798   ROM_REGION( 0x400000, REGION_CPU1, 0 )
799   ROM_LOAD16_WORD_SWAP( "mpr13396h.ic1", 0x000000, 0x080000, CRC(091226e3) SHA1(cb15c6277314f3c4a86b5ae5823f72811d5d269d) )
1184   MEGATECH_BIOS
1185   MEGATECH_GAME44(REGION_USER1, REGION_USER2)
1186ROM_END
8001187
801   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
802   ROM_LOAD( "epr12368-44.ic2", 0x000000, 0x08000, CRC(e653065d) SHA1(96b014fc4df8eb2188ac94ed0a778d974fe6dcad) )
1188/* Game 32 - Super Real Basketball */
1189/* why is this pre-swapped like a console dump?? */
1190#define MEGATECH_GAME32(GAME_REGION, INSTRUCTION_REGION) \
1191   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1192   ROM_LOAD( "mpr-12904f.ic1", 0x000000, 0x080000, CRC(4346e11a) SHA1(c86725780027ef9783cb7884c8770cc030b0cd0d) ) \
1193    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1194   ROM_LOAD( "epr-12368-32.ic2", 0x000000, 0x08000, CRC(f70adcbe) SHA1(d4412a7cd59fe282a1c6619aa1051a2a2e00e1aa) ) \
8031195
804   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
805   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1196ROM_START( mt_srbb ) /* Super Real Basketball */
1197   MEGATECH_BIOS
1198   MEGATECH_GAME32(REGION_USER1, REGION_USER2)
8061199ROM_END
8071200
808ROM_START( mt_orun ) /* Outrun */
809   ROM_REGION( 0x400000, REGION_CPU1, 0 )
810   ROM_LOAD16_WORD_SWAP( "mpr-11078.ic1", 0x000000, 0x040000, CRC(5589d8d2) SHA1(4f9b61b24f0d9fee0448cdbbe8fc05411dbb1102) )
1201/* Game 26 - Forgotten Worlds */
1202/* why is this pre-swapped like a console dump?? */
1203#define MEGATECH_GAME26(GAME_REGION, INSTRUCTION_REGION) \
1204   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1205   ROM_LOAD( "mpr-12672-h.ic1", 0x000000, 0x080000, CRC(d0ee6434) SHA1(8b9a37c206c332ef23dc71f09ec40e1a92b1f83a) ) \
1206    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1207   ROM_LOAD( "epr-12368-26.ic2", 0x000000, 0x08000, CRC(4623b573) SHA1(29df4a5c5de66cd9cb7519e4f30000f7dddc2138) ) \
8111208
812   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
813   ROM_LOAD( "epr-12368-06.ic2", 0x000000, 0x08000, CRC(c7c74429) SHA1(22ee261a653e10d66e0d6703c988bb7f236a7571) )
8141209
815   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
816   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1210ROM_START( mt_fwrld ) /* Forgotten Worlds */
1211   MEGATECH_BIOS
1212   MEGATECH_GAME26(REGION_USER1, REGION_USER2)
8171213ROM_END
8181214
819ROM_START( mt_srbb ) /* Super Real Basketball */
820   ROM_REGION( 0x400000, REGION_CPU1, 0 )
821   ROM_LOAD16_WORD_SWAP( "mpr-12904f.ic1", 0x000000, 0x080000, CRC(4346e11a) SHA1(c86725780027ef9783cb7884c8770cc030b0cd0d) )
1215/* Compilations of games to show the multi-cart support */
8221216
823   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
824   ROM_LOAD( "epr-12368-32.ic2", 0x000000, 0x08000, CRC(f70adcbe) SHA1(d4412a7cd59fe282a1c6619aa1051a2a2e00e1aa) )
825
826   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
827   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1217ROM_START( mt_comp1 )
1218   MEGATECH_BIOS
1219   MEGATECH_GAME01(REGION_USER1, REGION_USER2)
1220   MEGATECH_GAME13(REGION_USER3, REGION_USER4)
1221   MEGATECH_GAME21(REGION_USER5, REGION_USER6)
1222   MEGATECH_GAME06(REGION_USER7, REGION_USER8)
1223   MEGATECH_GAME08(REGION_USER9, REGION_USER10)
1224   MEGATECH_GAME28(REGION_USER11, REGION_USER12)
1225   MEGATECH_GAME49(REGION_USER13, REGION_USER14)
1226   MEGATECH_GAME60(REGION_USER15, REGION_USER16)
8281227ROM_END
8291228
830ROM_START( mt_fwrld ) /* Forgotten Worlds */
831   ROM_REGION( 0x400000, REGION_CPU1, 0 )
832   ROM_LOAD16_WORD_SWAP( "mpr-12672-h.ic1", 0x000000, 0x080000, CRC(d0ee6434) SHA1(8b9a37c206c332ef23dc71f09ec40e1a92b1f83a) )
8331229
834   ROM_REGION( 0x8000, REGION_USER1, 0 ) /* Game Instructions */
835   ROM_LOAD( "epr-12368-26.ic2", 0x000000, 0x08000, CRC(4623b573) SHA1(29df4a5c5de66cd9cb7519e4f30000f7dddc2138) )
836
837   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Bios */
838   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) )
1230ROM_START( mt_comp2 )
1231   MEGATECH_BIOS
1232   MEGATECH_GAME10(REGION_USER1, REGION_USER2)
1233   MEGATECH_GAME39(REGION_USER3, REGION_USER4)
1234   MEGATECH_GAME24(REGION_USER5, REGION_USER6)
1235   MEGATECH_GAME52(REGION_USER7, REGION_USER8)
1236   MEGATECH_GAME29(REGION_USER9, REGION_USER10)
1237   MEGATECH_GAME36(REGION_USER11, REGION_USER12)
1238   MEGATECH_GAME40(REGION_USER13, REGION_USER14)
1239   MEGATECH_GAME57(REGION_USER15, REGION_USER16)
8391240ROM_END
8401241
8411242
1243
8421244/* nn */ /* nn is part of the instruction rom name, should there be a game for each number? */
843/* -- */ GAME( 1989, megatech, 0,        megatech, megadriv, mtnew, ROT0, "Sega",                  "Mega-Tech BIOS", GAME_IS_BIOS_ROOT )
844/* 01 */ GAME( 1988, mt_beast, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Altered Beast (Mega-Tech)", GAME_NOT_WORKING )
845/* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING )
846/* 03 */ GAME( 1988, mt_stbld, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Thunder Blade (Mega-Tech)", GAME_NOT_WORKING )
847/* 04 */ GAME( 19??, mt_ggolf, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Great Golf (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
848/* 05 */ GAME( 19??, mt_gsocr, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Great Soccer (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
849/* 06 */ GAME( 1989, mt_orun,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Out Run (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
850/* 07 */ GAME( 19??, mt_asyn,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Alien Syndrome (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
851/* 08 */ GAME( 19??, mt_shnbi, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Shinobi (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
1245/* -- */ GAME( 1989, megatech, 0,        megatech, megatech, mtnew, ROT0, "Sega",                  "Mega-Tech BIOS", GAME_IS_BIOS_ROOT )
1246/* 01 */ GAME( 1988, mt_beast, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Altered Beast (Mega-Tech)", GAME_NOT_WORKING )
1247/* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING )
1248/* 03 */ GAME( 1988, mt_stbld, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Thunder Blade (Mega-Tech)", GAME_NOT_WORKING )
1249/* 04 */ GAME( 19??, mt_ggolf, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Great Golf (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
1250/* 05 */ GAME( 19??, mt_gsocr, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Great Soccer (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
1251/* 06 */ GAME( 1989, mt_orun,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Out Run (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1252/* 07 */ GAME( 19??, mt_asyn,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Alien Syndrome (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1253/* 08 */ GAME( 19??, mt_shnbi, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Shinobi (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
8521254/* 09 */ // unknown
853/* 10 */ GAME( 19??, mt_aftrb, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "After Burner (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
854/* 11 */ GAME( 1989, mt_tfor2, megatech, megatech, megadriv, mtnew, ROT0, "Tecno Soft / Sega",     "Thunder Force II MD (Mega-Tech)", GAME_NOT_WORKING )
1255/* 10 */ GAME( 19??, mt_aftrb, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "After Burner (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
1256/* 11 */ GAME( 1989, mt_tfor2, megatech, megatech, megatech, mtnew, ROT0, "Tecno Soft / Sega",     "Thunder Force II MD (Mega-Tech)", GAME_NOT_WORKING )
8551257/* 12 */ // unknown
856/* 13 */ GAME( 19??, mt_astro, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Astro Warrior (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1258/* 13 */ GAME( 19??, mt_astro, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Astro Warrior (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
8571259/* 14 */ // unknown
8581260/* 15 */ // unknown
8591261/* 16 */ // unknown
8601262/* 17 */ // unknown
8611263/* 18 */ // unknown
8621264/* 19 */ // unknown
863/* 20 */ GAME( 1989, mt_lastb, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Last Battle (Mega-Tech)", GAME_NOT_WORKING )
864/* 21 */ GAME( 1989, mt_wcsoc, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "World Championship Soccer (Mega-Tech)", GAME_NOT_WORKING )
865/* 22 */ GAME( 19??, mt_tetri, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Tetris (Mega-Tech)", GAME_NOT_WORKING )
866/* 23 */ GAME( 1989, mt_gng,   megatech, megatech, megadriv, mtnew, ROT0, "Capcom / Sega",         "Ghouls'n Ghosts (Mega-Tech)", GAME_NOT_WORKING )
867/* 24 */ GAME( 1989, mt_shang, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Hang-On (Mega-Tech)", GAME_NOT_WORKING )
868/* 25 */ GAME( 1989, mt_gaxe,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Golden Axe (Mega-Tech)", GAME_NOT_WORKING )
869/* 26 */ GAME( 1989, mt_fwrld, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Forgotten Worlds (Mega-Tech)", GAME_NOT_WORKING )
870/* 27 */ GAME( 1989, mt_mystd, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Mystic Defender (Mega-Tech)", GAME_NOT_WORKING )
871/* 28 */ GAME( 1989, mt_revsh, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "The Revenge of Shinobi (Mega-Tech)", GAME_NOT_WORKING )
872/* 29 */ GAME( 19??, mt_parlg, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Parlour Games (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1265/* 20 */ GAME( 1989, mt_lastb, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Last Battle (Mega-Tech)", GAME_NOT_WORKING )
1266/* 21 */ GAME( 1989, mt_wcsoc, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "World Championship Soccer (Mega-Tech)", GAME_NOT_WORKING )
1267/* 22 */ GAME( 19??, mt_tetri, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Tetris (Mega-Tech)", GAME_NOT_WORKING )
1268/* 23 */ GAME( 1989, mt_gng,   megatech, megatech, megatech, mtnew, ROT0, "Capcom / Sega",         "Ghouls'n Ghosts (Mega-Tech)", GAME_NOT_WORKING )
1269/* 24 */ GAME( 1989, mt_shang, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Hang-On (Mega-Tech)", GAME_NOT_WORKING )
1270/* 25 */ GAME( 1989, mt_gaxe,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Golden Axe (Mega-Tech)", GAME_NOT_WORKING )
1271/* 26 */ GAME( 1989, mt_fwrld, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Forgotten Worlds (Mega-Tech)", GAME_NOT_WORKING )
1272/* 27 */ GAME( 1989, mt_mystd, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Mystic Defender (Mega-Tech)", GAME_NOT_WORKING )
1273/* 28 */ GAME( 1989, mt_revsh, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "The Revenge of Shinobi (Mega-Tech)", GAME_NOT_WORKING )
1274/* 29 */ GAME( 19??, mt_parlg, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Parlour Games (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
8731275/* 30 */ // unknown
874/* 31 */ GAME( 1989, mt_tgolf, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Arnold Palmer Tournament Golf (Mega-Tech)", GAME_NOT_WORKING )
875/* 32 */ GAME( 1989, mt_srbb,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Real Basketball (Mega-Tech)", GAME_NOT_WORKING )
1276/* 31 */ GAME( 1989, mt_tgolf, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Arnold Palmer Tournament Golf (Mega-Tech)", GAME_NOT_WORKING )
1277/* 32 */ GAME( 1989, mt_srbb,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Real Basketball (Mega-Tech)", GAME_NOT_WORKING )
8761278/* 33 */ // unknown
8771279/* 34 */ // unknown
878/* 35 */ GAME( 1989, mt_tlbba, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Tommy Lasorda Baseball (Mega-Tech)", GAME_NOT_WORKING )
879/* 36 */ GAME( 1990, mt_cols,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Columns (Mega-Tech)", GAME_NOT_WORKING )
1280/* 35 */ GAME( 1989, mt_tlbba, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Tommy Lasorda Baseball (Mega-Tech)", GAME_NOT_WORKING )
1281/* 36 */ GAME( 1990, mt_cols,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Columns (Mega-Tech)", GAME_NOT_WORKING )
8801282/* 37 */ // unknown
881/* 38 */ GAME( 1990, mt_eswat, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Cyber Police ESWAT: Enhanced Special Weapons and Tactics (Mega-Tech)", GAME_NOT_WORKING )
882/* 39 */ GAME( 1990, mt_smgp,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Monaco GP (Mega-Tech)", GAME_NOT_WORKING )
883/* 40 */ GAME( 1990, mt_mwalk, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Moonwalker (Mega-Tech)", GAME_NOT_WORKING )
884/* 41 */ GAME( 1990, mt_crack, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Crack Down (Mega-Tech)", GAME_NOT_WORKING )
1283/* 38 */ GAME( 1990, mt_eswat, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Cyber Police ESWAT: Enhanced Special Weapons and Tactics (Mega-Tech)", GAME_NOT_WORKING )
1284/* 39 */ GAME( 1990, mt_smgp,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Monaco GP (Mega-Tech)", GAME_NOT_WORKING )
1285/* 40 */ GAME( 1990, mt_mwalk, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Moonwalker (Mega-Tech)", GAME_NOT_WORKING )
1286/* 41 */ GAME( 1990, mt_crack, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Crack Down (Mega-Tech)", GAME_NOT_WORKING )
8851287/* 42 */ // unknown
8861288/* 43 */ // unknown
887/* 44 */ GAME( 1990, mt_arrow, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Arrow Flash (Mega-Tech)", GAME_NOT_WORKING )
1289/* 44 */ GAME( 1990, mt_arrow, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Arrow Flash (Mega-Tech)", GAME_NOT_WORKING )
8881290/* 45 */ // unknown
8891291/* 46 */ // unknown
890/* 47 */ GAME( 1990, mt_astrm, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Alien Storm (Mega-Tech", GAME_NOT_WORKING )
1292/* 47 */ GAME( 1990, mt_astrm, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Alien Storm (Mega-Tech", GAME_NOT_WORKING )
8911293/* 48 */ // unknown
892/* 49 */ GAME( 1991, mt_bbros, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Bonanza Bros. (Mega-Tech)", GAME_NOT_WORKING )
1294/* 49 */ GAME( 1991, mt_bbros, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Bonanza Bros. (Mega-Tech)", GAME_NOT_WORKING )
8931295/* 50 */ // unknown
8941296/* 51 */ // unknown
895/* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING )
896/*    */ GAME( 1991, mt_sonia, mt_sonic, megatech, megadriv, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING )
897/* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megadriv, mtnew, ROT0, "Toaplan / Sega",        "Fire Shark (Mega-Tech)", GAME_NOT_WORKING )
1297/* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING )
1298/*    */ GAME( 1991, mt_sonia, mt_sonic, megatech, megatech, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING )
1299/* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megatech, mtnew, ROT0, "Toaplan / Sega",        "Fire Shark (Mega-Tech)", GAME_NOT_WORKING )
8981300/* 54 */ // unknown
8991301/* 55 */ // unknown
9001302/* 56 */ // unknown
901/* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING )
902/* 58 */ GAME( 1991, mt_stf,   megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Joe Montana II: Sports Talk Football (Mega-Tech)", GAME_NOT_WORKING )
903/* 59 */ GAME( 1991, mt_mlh,   megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Mario Lemieux Hockey (Mega-Tech)", GAME_NOT_WORKING )
904/* 60 */ GAME( 1992, mt_kcham, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Kid Chameleon (Mega-Tech)", GAME_NOT_WORKING )
1303/* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING )
1304/* 58 */ GAME( 1991, mt_stf,   megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Joe Montana II: Sports Talk Football (Mega-Tech)", GAME_NOT_WORKING )
1305/* 59 */ GAME( 1991, mt_mlh,   megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Mario Lemieux Hockey (Mega-Tech)", GAME_NOT_WORKING )
1306/* 60 */ GAME( 1992, mt_kcham, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Kid Chameleon (Mega-Tech)", GAME_NOT_WORKING )
9051307/* 61 */ // unknown
906/* 62 */ GAME( 1992, mt_soni2, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega-Tech)", GAME_NOT_WORKING )
1308/* 62 */ GAME( 1992, mt_soni2, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega-Tech)", GAME_NOT_WORKING )
9071309/*
9081310    Known to Exist, but nn number currently not known:
9091311    Wrestle War
9101312*/
9111313/* more? */
1314
1315/* Compilations to test multi-game support */
1316/* xx */ GAME( 1992, mt_comp1, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Mega-Tech with various carts (set 1) (Mega-Tech)", GAME_NOT_WORKING )
1317/* xx */ GAME( 1992, mt_comp2, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Mega-Tech with various carts (set 2) (Mega-Tech)", GAME_NOT_WORKING )
src/mame/drivers/timelimt.c
r1051r1052
225225   32*8
226226};
227227
228static const gfx_decode gfxdecodeinfo[] =
229{
230   { REGION_GFX1, 0, &charlayout,   32, 1 },   /* seems correct */
231   { REGION_GFX2, 0, &charlayout,    0, 1 },   /* seems correct */
232   { REGION_GFX3, 0, &spritelayout,  0, 8 },   /* ?? */
233   { -1 }
234};
228static GFXDECODE_START( timelimt )
229   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   32, 1 )   /* seems correct */
230   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,    0, 1 )   /* seems correct */
231   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  0, 8 )   /* ?? */
232GFXDECODE_END
235233
236static const gfx_decode progress_gfxdecodeinfo[] =
237{
238   { REGION_GFX1, 0, &charlayout,   32, 1 },   /* seems correct */
239   { REGION_GFX2, 0, &charlayout,    0, 1 },   /* seems correct */
240   { REGION_GFX3, 0, &spritelayout, 64, 4 },   /* seems correct */
241   { -1 }
242};
234static GFXDECODE_START( progress )
235   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   32, 1 )   /* seems correct */
236   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,    0, 1 )   /* seems correct */
237   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 64, 4 )   /* seems correct */
238GFXDECODE_END
243239
244240/***************************************************************************/
245241
r1051r1052
280276   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
281277   MDRV_SCREEN_SIZE(32*8, 32*8)
282278   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
283   MDRV_GFXDECODE(gfxdecodeinfo)
279   MDRV_GFXDECODE(timelimt)
284280   MDRV_PALETTE_LENGTH(64)
285281
286282   MDRV_PALETTE_INIT(timelimt)
r1051r1052
302298   /* basic machine hardware */
303299   MDRV_IMPORT_FROM(timelimt)
304300
305   MDRV_GFXDECODE(progress_gfxdecodeinfo)
301   MDRV_GFXDECODE(progress)
306302   MDRV_PALETTE_LENGTH(96)
307303
308304MACHINE_DRIVER_END
src/mame/drivers/talbot.c
r1051r1052
139139   64*8   /* every sprite takes 64 bytes */
140140};
141141
142static const gfx_decode gfxdecodeinfo[] =
143{
144   { REGION_GFX1, 0, &charlayout,   0, 64 },
145   { REGION_GFX2, 0, &spritelayout, 0, 64 },
146   { -1 }
147};
142static GFXDECODE_START( talbot )
143   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 64 )
144   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 64 )
145GFXDECODE_END
148146
149147static TILE_GET_INFO( get_tile_info_bg )
150148{
r1051r1052
244242   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
245243   MDRV_SCREEN_SIZE(32*8, 32*8)
246244   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
247   MDRV_GFXDECODE(gfxdecodeinfo)
245   MDRV_GFXDECODE(talbot)
248246   MDRV_PALETTE_LENGTH(32)
249247   MDRV_COLORTABLE_LENGTH(0x100)
250248
src/mame/drivers/warriorb.c
r1051r1052
428428   32*8   /* every sprite takes 32 consecutive bytes */
429429};
430430
431static const gfx_decode warriorb_gfxdecodeinfo[] =
432{
433   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites */
434   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* scr tiles (screen 1) */
435   { REGION_GFX3, 0, &charlayout,  0, 256 },   /* scr tiles (screen 2) */
436   { -1 }
437};
431static GFXDECODE_START( warriorb )
432   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites */
433   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* scr tiles (screen 1) */
434   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,  0, 256 )   /* scr tiles (screen 2) */
435GFXDECODE_END
438436
439437
440438/**************************************************************
r1051r1052
500498
501499   /* video hardware */
502500   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
503   MDRV_GFXDECODE(warriorb_gfxdecodeinfo)
501   MDRV_GFXDECODE(warriorb)
504502   MDRV_PALETTE_LENGTH(4096*2)
505503   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
506504
r1051r1052
560558
561559   /* video hardware */
562560   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
563   MDRV_GFXDECODE(warriorb_gfxdecodeinfo)
561   MDRV_GFXDECODE(warriorb)
564562   MDRV_PALETTE_LENGTH(4096*2)
565563   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
566564
src/mame/drivers/igs_blit.c
r1051r1052
23382338    16*16*1
23392339};
23402340
2341static const gfx_decode gfxdecodeinfo[] =
2342{
2343    { REGION_GFX1, 0, &gfxlayout_8x8x4,   0, 0x80  },
2344    { REGION_GFX1, 0, &gfxlayout_16x16x4, 0, 0x80  },
2345    { REGION_GFX1, 0, &gfxlayout_8x8x8,   0, 0x08  },
2346    { REGION_GFX1, 0, &gfxlayout_16x16x8, 0, 0x08  },
2347    { -1 }
2348};
2349static const gfx_decode gfxdecodeinfo_chmplst2[] =
2350{
2351    { REGION_GFX1, 0, &gfxlayout_8x8x4,   0, 0x80  },
2352    { REGION_GFX1, 0, &gfxlayout_16x16x4, 0, 0x80  },
2353    { REGION_GFX1, 0, &gfxlayout_8x8x8,   0, 0x08  },
2354    { REGION_GFX1, 0, &gfxlayout_16x16x8, 0, 0x08  },
2355    { REGION_GFX2, 0, &gfxlayout_16x16x1, 0, 0x80  },
2356    { -1 }
2357};
2341static GFXDECODE_START( igs_blit )
2342    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_8x8x4,   0, 0x80  )
2343    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_16x16x4, 0, 0x80  )
2344    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_8x8x8,   0, 0x08  )
2345    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_16x16x8, 0, 0x08  )
2346GFXDECODE_END
2347static GFXDECODE_START( chmplst2 )
2348    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_8x8x4,   0, 0x80  )
2349    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_16x16x4, 0, 0x80  )
2350    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_8x8x8,   0, 0x08  )
2351    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_16x16x8, 0, 0x08  )
2352    GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_16x16x1, 0, 0x80  )
2353GFXDECODE_END
23582354*/
23592355
23602356static MACHINE_DRIVER_START( igs_base )
r1051r1052
23652361
23662362   MDRV_NVRAM_HANDLER(generic_0fill)
23672363
2368//  MDRV_GFXDECODE(gfxdecodeinfo)
2364//  MDRV_GFXDECODE(igs_blit)
23692365
23702366   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
23712367   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
r1051r1052
24012397   MDRV_CPU_PROGRAM_MAP(chmplst2_readmem,chmplst2_writemem)
24022398   MDRV_CPU_VBLANK_INT(chmplst2_interrupt,1+4)   // lev5 frequency drives the music tempo
24032399
2404//  MDRV_GFXDECODE(gfxdecodeinfo_chmplst2)
2400//  MDRV_GFXDECODE(chmplst2)
24052401
24062402   MDRV_SOUND_ADD(YM2413, 3579545)
24072403   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
r1051r1052
24852481   MDRV_CPU_VBLANK_INT(vbowl_interrupt,3+4)
24862482
24872483   MDRV_VIDEO_EOF(vbowl)   // trackball
2488//  MDRV_GFXDECODE(gfxdecodeinfo_chmplst2)
2484//  MDRV_GFXDECODE(chmplst2)
24892485
24902486   MDRV_SOUND_REMOVE("OKIM6295")
24912487   MDRV_SOUND_ADD(ICS2115, 0)
src/mame/drivers/goal92.c
r1051r1052
299299   1024
300300};
301301
302static const gfx_decode goal92_gfxdecodeinfo[] =
303{
304   { REGION_GFX1, 0, &layout_16x16x4,         0*16, 8*16 }, // Sprites
305   { REGION_GFX2, 0, &layout_8x8x4,        48*16,   16 }, // Text Layer
306   { REGION_GFX2, 0, &layout_16x16x4,         0*16,   16 }, // BG Layer
307   { REGION_GFX2, 0, &layout_16x16x4,        16*16,   16 }, // Mid Layer
308   { REGION_GFX2, 0, &layout_16x16x4,        32*16,   16 }, // FG Layer
309   { -1 }
310};
302static GFXDECODE_START( goal92 )
303   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,         0*16, 8*16 ) // Sprites
304   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,        48*16,   16 ) // Text Layer
305   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,         0*16,   16 ) // BG Layer
306   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,        16*16,   16 ) // Mid Layer
307   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,        32*16,   16 ) // FG Layer
308GFXDECODE_END
311309
312310
313311static MACHINE_DRIVER_START( goal92 )
r1051r1052
330328   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
331329   MDRV_SCREEN_SIZE(40*8, 32*8)
332330   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) // black border at bottom is a game bug...
333   MDRV_GFXDECODE(goal92_gfxdecodeinfo)
331   MDRV_GFXDECODE(goal92)
334332   MDRV_PALETTE_LENGTH(128*16)
335333
336334   MDRV_VIDEO_START(goal92)
src/mame/drivers/champbwl.c
r1051r1052
319319   32*8
320320};
321321
322static const gfx_decode gfxdecodeinfo[] =
323{
324   { REGION_GFX1, 0, &charlayout, 0, 32 },
325   { -1 }   /* end of array */
326};
322static GFXDECODE_START( champbwl )
323   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 )
324GFXDECODE_END
327325
328326static struct x1_010_interface champbwl_sound_intf =
329327{
r1051r1052
347345   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
348346   MDRV_SCREEN_SIZE(64*8, 32*8)
349347   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
350   MDRV_GFXDECODE(gfxdecodeinfo)
348   MDRV_GFXDECODE(champbwl)
351349   MDRV_PALETTE_LENGTH(512)
352350
353351   MDRV_PALETTE_INIT(arknoid2)
src/mame/drivers/vamphalf.c
r1051r1052
2222
2323    Vamp 1/2 (World version)
2424
25 Actual games bugs:
25 Real games bugs:
2626 - dquizgo2: bugged video test
2727
2828*********************************************************************/
r1051r1052
4141static int semicom_prot_which = 0;
4242static UINT16 semicom_prot_data[2];
4343
44static UINT16 finalgdr_backupram_bank = 1;
45static UINT8 *finalgdr_backupram;
46
4447static READ16_HANDLER( oki_r )
4548{
4649   if(offset)
r1051r1052
209212
210213static WRITE32_HANDLER( finalgdr_oki_bank_w )
211214{
212   // is this right ?
213   if(data)
214      OKIM6295_set_bank_base(0, 0x40000 * (((data & 0x300) >> 8) - 1));
215   OKIM6295_set_bank_base(0, 0x40000 * ((data & 0x300) >> 8));
215216}
216217
218static WRITE32_HANDLER( finalgdr_backupram_bank_w )
219{
220   finalgdr_backupram_bank = (data & 0xff000000) >> 24;
221}
222
223static READ32_HANDLER( finalgdr_backupram_r )
224{
225   return finalgdr_backupram[offset + finalgdr_backupram_bank * 0x80] << 24;
226}
227
228static WRITE32_HANDLER( finalgdr_backupram_w )
229{
230   finalgdr_backupram[offset + finalgdr_backupram_bank * 0x80] = data >> 24;
231}
232
233static WRITE32_HANDLER( finalgdr_prize_w )
234{
235   if(data & 0x1000000)
236   {
237      // prize 1
238   }
239
240   if(data & 0x2000000)
241   {
242      // prize 2
243   }
244
245   if(data & 0x4000000)
246   {
247      // prize 3
248   }
249}
250
217251static ADDRESS_MAP_START( common_map, ADDRESS_SPACE_PROGRAM, 16 )
218252   AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&wram)
219253   AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(&tiles)
r1051r1052
280314
281315static ADDRESS_MAP_START( finalgdr_io, ADDRESS_SPACE_IO, 32 )
282316   AM_RANGE(0x2400, 0x2403) AM_READ(finalgdr_prot_r)
283   //AM_RANGE(0x2800, 0x2803) AM_WRITE() //?
284   AM_RANGE(0x2c00, 0x2dff) AM_RAM //AM_BASE(&generic_nvram32) AM_SIZE(&generic_nvram_size)
317   AM_RANGE(0x2800, 0x2803) AM_WRITE(finalgdr_backupram_bank_w)
318   AM_RANGE(0x2c00, 0x2dff) AM_READWRITE(finalgdr_backupram_r, finalgdr_backupram_w)
285319   AM_RANGE(0x3000, 0x3003) AM_WRITE(ym2151_register32_w)
286320   AM_RANGE(0x3004, 0x3007) AM_READWRITE(ym2151_status32_r, ym2151_data32_w)
287321   AM_RANGE(0x3800, 0x3803) AM_READ(finalgdr_input0_r)
288322   AM_RANGE(0x3400, 0x3403) AM_READWRITE(oki32_r, oki32_w)
289323   AM_RANGE(0x3c00, 0x3c03) AM_READ(finalgdr_input1_r)
290324   AM_RANGE(0x4400, 0x4403) AM_READ(eeprom32_r)
291   //AM_RANGE(0x6000, 0x6003) AM_READ(eeprom32_r) //?
325   AM_RANGE(0x6000, 0x6003) AM_READNOP //?
292326   AM_RANGE(0x6000, 0x6003) AM_WRITE(finalgdr_eeprom_w)
293327   AM_RANGE(0x6040, 0x6043) AM_WRITE(finalgdr_prot_w)
294328   //AM_RANGE(0x6080, 0x6083) AM_WRITE(flipscreen32_w) //?
295   //AM_RANGE(0x6060, 0x6063) AM_WRITE() //?
329   AM_RANGE(0x6060, 0x6063) AM_WRITE(finalgdr_prize_w)
296330   AM_RANGE(0x60a0, 0x60a3) AM_WRITE(finalgdr_oki_bank_w)
297331ADDRESS_MAP_END
298332
r1051r1052
431465   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
432466INPUT_PORTS_END
433467
468static INPUT_PORTS_START( finalgdr )
469   PORT_START
470   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(1)
471   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(1)
472   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(1)
473   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
474   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
475   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
476   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
477   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
478   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(2)
479   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(2)
480   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(2)
481   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
482   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
483   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
484   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
485   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
434486
487   PORT_START
488   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
489   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
490   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
491   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
492   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
493   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
494   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
495   PORT_SERVICE_NO_TOGGLE( 0x0080, IP_ACTIVE_LOW )
496   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
497INPUT_PORTS_END
498
499
435500static const gfx_layout sprites_layout =
436501{
437502   16,16,
r1051r1052
443508   16*128,
444509};
445510
446static const gfx_decode gfxdecodeinfo[] =
447{
448   { REGION_GFX1, 0, &sprites_layout, 0, 0x80 },
449   { -1 }
450};
511static GFXDECODE_START( vamphalf )
512   GFXDECODE_ENTRY( REGION_GFX1, 0, sprites_layout, 0, 0x80 )
513GFXDECODE_END
451514
452515
453516UINT8 suplup_default_nvram[128] = {
r1051r1052
491554   }
492555}
493556
557NVRAM_HANDLER( finalgdr )
558{
559   if (read_or_write)
560   {
561      EEPROM_save(file);
562      mame_fwrite(file, finalgdr_backupram, 0x80*0x100);
563   }
564   else
565   {
566      EEPROM_init(&eeprom_interface_93C46);
567      if (file)
568      {
569         EEPROM_load(file);
570         mame_fread(file, finalgdr_backupram, 0x80*0x100);
571      }
572   }
573}
574
494575static ADDRESS_MAP_START( qs1000_prg_map, ADDRESS_SPACE_PROGRAM, 8 )
495576   AM_RANGE( 0x0000, 0xffff) AM_ROM
496577ADDRESS_MAP_END
r1051r1052
516597   MDRV_SCREEN_VISIBLE_AREA(31, 350, 16, 255)
517598
518599   MDRV_PALETTE_LENGTH(0x8000)
519   MDRV_GFXDECODE(gfxdecodeinfo)
600   MDRV_GFXDECODE(vamphalf)
520601
521602   MDRV_VIDEO_UPDATE(common)
522603MACHINE_DRIVER_END
r1051r1052
588669   MDRV_CPU_PROGRAM_MAP(common_32bit_map,0)
589670   MDRV_CPU_IO_MAP(finalgdr_io,0)
590671
672   MDRV_NVRAM_HANDLER(finalgdr)
673
591674   MDRV_IMPORT_FROM(sound_ym_oki)
592675MACHINE_DRIVER_END
593676
r1051r1052
10261109
10271110   /* $00000-$20000 stays the same in all sound banks, */
10281111   /* the second half of the bank is what gets switched */
1029   ROM_REGION( 0xc0000, REGION_SOUND1, 0 ) /* Samples */
1112   ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* Samples */
10301113   ROM_COPY( REGION_USER2, 0x000000, 0x000000, 0x020000)
1031   ROM_COPY( REGION_USER2, 0x020000, 0x020000, 0x020000)
1114   ROM_COPY( REGION_USER2, 0x000000, 0x020000, 0x020000)
10321115   ROM_COPY( REGION_USER2, 0x000000, 0x040000, 0x020000)
1033   ROM_COPY( REGION_USER2, 0x040000, 0x060000, 0x020000)
1116   ROM_COPY( REGION_USER2, 0x020000, 0x060000, 0x020000)
10341117   ROM_COPY( REGION_USER2, 0x000000, 0x080000, 0x020000)
1035   ROM_COPY( REGION_USER2, 0x060000, 0x0a0000, 0x020000)
1118   ROM_COPY( REGION_USER2, 0x040000, 0x0a0000, 0x020000)
1119   ROM_COPY( REGION_USER2, 0x000000, 0x0c0000, 0x020000)
1120   ROM_COPY( REGION_USER2, 0x060000, 0x0e0000, 0x020000)
10361121ROM_END
10371122
10381123/*
r1051r1052
12721357
12731358DRIVER_INIT( finalgdr )
12741359{
1360   finalgdr_backupram = auto_malloc(0x80*0x100);
12751361   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x005e874, 0x005e877, 0, 0, finalgdr_speedup_r );
12761362
12771363   palshift = 0;
r1051r1052
12971383GAME( 1999, vamphalf, 0,      vamphalf, common,   vamphalf, ROT0,   "Danbi & F2 System", "Vamp 1/2 (Korea version)", 0 )
12981384GAME( 2000, dquizgo2, 0,      coolmini, common,   dquizgo2, ROT0,   "SemiCom",           "Date Quiz Go Go Episode 2" , 0)
12991385GAME( 2000, misncrft, 0,      misncrft, common,   misncrft, ROT90,  "Sun",               "Mission Craft (version 2.4)", GAME_NO_SOUND )
1300GAME( 2001, finalgdr, 0,      finalgdr, common,   finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
1386GAME( 2001, finalgdr, 0,      finalgdr, finalgdr, finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea, version 2.20.5915)", 0 )
13011387GAME( 2001, wyvernwg, 0,      wyvernwg, common,   wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND )
src/mame/drivers/1942.c
r1051r1052
254254   64*8
255255};
256256
257static const gfx_decode gfxdecodeinfo[] =
258{
259   { REGION_GFX1, 0, &charlayout,             0, 64 },
260   { REGION_GFX2, 0, &tilelayout,          64*4, 4*32 },
261   { REGION_GFX3, 0, &spritelayout, 64*4+4*32*8, 16 },
262   { -1 }
263};
257static GFXDECODE_START( 1942 )
258   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,             0, 64 )
259   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,          64*4, 4*32 )
260   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 64*4+4*32*8, 16 )
261GFXDECODE_END
264262
265263
266264
r1051r1052
277275
278276   /* video hardware */
279277   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
280   MDRV_GFXDECODE(gfxdecodeinfo)
278   MDRV_GFXDECODE(1942)
281279   MDRV_PALETTE_LENGTH(64*4+4*32*8+16*16)
282280
283281   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/mayumi.c
r1051r1052
257257   8*8
258258};
259259
260static const gfx_decode gfxdecodeinfo[] =
261{
262   { REGION_GFX1, 0x00000, &charlayout, 0, 32 },
263   { -1 }
264};
260static GFXDECODE_START( mayumi )
261   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout, 0, 32 )
262GFXDECODE_END
265263
266264static struct YM2203interface ym2203_interface =
267265{
r1051r1052
286284   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
287285   MDRV_SCREEN_SIZE(64*8, 32*8)
288286   MDRV_SCREEN_VISIBLE_AREA(2*8, 62*8-1, 2*8, 30*8-1)
289   MDRV_GFXDECODE(gfxdecodeinfo)
287   MDRV_GFXDECODE(mayumi)
290288   MDRV_PALETTE_LENGTH(256)
291289
292290   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/poolshrk.c
r1051r1052
195195};
196196
197197
198static const gfx_decode poolshrk_gfx_decode_info[] =
199{
200   { REGION_GFX1, 0, &poolshrk_sprite_layout, 0, 2 },
201   { REGION_GFX2, 0, &poolshrk_tile_layout, 0, 1 },
202   { -1 }
203};
198static GFXDECODE_START( poolshrk )
199   GFXDECODE_ENTRY( REGION_GFX1, 0, poolshrk_sprite_layout, 0, 2 )
200   GFXDECODE_ENTRY( REGION_GFX2, 0, poolshrk_tile_layout, 0, 1 )
201GFXDECODE_END
204202
205203
206204static PALETTE_INIT( poolshrk )
r1051r1052
226224   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
227225   MDRV_SCREEN_SIZE(256, 256)
228226   MDRV_SCREEN_VISIBLE_AREA(1, 255, 24, 255)
229   MDRV_GFXDECODE(poolshrk_gfx_decode_info)
227   MDRV_GFXDECODE(poolshrk)
230228   MDRV_PALETTE_LENGTH(4)
231229   MDRV_PALETTE_INIT(poolshrk)
232230   MDRV_VIDEO_START(poolshrk)
r1051r1052
236234   MDRV_SPEAKER_STANDARD_MONO("mono")
237235
238236   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
239   MDRV_SOUND_CONFIG(poolshrk_discrete_interface)
237   MDRV_SOUND_CONFIG_DISCRETE(poolshrk)
240238   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
241239MACHINE_DRIVER_END
242240
src/mame/drivers/bloodbro.c
r1051r1052
507507
508508/* Graphics Decode Info */
509509
510static const gfx_decode bloodbro_gfxdecodeinfo[] =
511{
512   { REGION_GFX1, 0x00000, &textlayout,   0x70*16,  0x10 }, /* Text */
513   { REGION_GFX2, 0x00000, &backlayout,   0x40*16,  0x10 }, /* Background */
514   { REGION_GFX2, 0x80000, &backlayout,   0x50*16,  0x10 }, /* Foreground */
515   { REGION_GFX3, 0x00000, &spritelayout, 0x00*16,  0x10 }, /* Sprites */
516   { -1 }
517};
510static GFXDECODE_START( bloodbro )
511   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, textlayout,   0x70*16,  0x10 ) /* Text */
512   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, backlayout,   0x40*16,  0x10 ) /* Background */
513   GFXDECODE_ENTRY( REGION_GFX2, 0x80000, backlayout,   0x50*16,  0x10 ) /* Foreground */
514   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, spritelayout, 0x00*16,  0x10 ) /* Sprites */
515GFXDECODE_END
518516
519static const gfx_decode weststry_gfxdecodeinfo[] =
520{
521   { REGION_GFX1, 0x00000, &weststry_textlayout,     16*16,  0x10 },
522   { REGION_GFX2, 0x00000, &weststry_backlayout,     48*16,  0x10 },
523   { REGION_GFX2, 0x80000, &weststry_backlayout,     32*16,  0x10 },
524   { REGION_GFX3, 0x00000, &weststry_spritelayout,    0*16,  0x10 },
525   { -1 }
526};
517static GFXDECODE_START( weststry )
518   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, weststry_textlayout,     16*16,  0x10 )
519   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, weststry_backlayout,     48*16,  0x10 )
520   GFXDECODE_ENTRY( REGION_GFX2, 0x80000, weststry_backlayout,     32*16,  0x10 )
521   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, weststry_spritelayout,    0*16,  0x10 )
522GFXDECODE_END
527523
528524/* Sound Interfaces */
529525
r1051r1052
550546   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
551547   MDRV_SCREEN_SIZE(32*8, 32*8)
552548   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
553   MDRV_GFXDECODE(bloodbro_gfxdecodeinfo)
549   MDRV_GFXDECODE(bloodbro)
554550   MDRV_PALETTE_LENGTH(2048)
555551
556552   MDRV_VIDEO_START(bloodbro)
r1051r1052
567563   MDRV_CPU_PROGRAM_MAP(weststry_map, 0)
568564   MDRV_CPU_VBLANK_INT(irq6_line_hold, 1)
569565
570   MDRV_GFXDECODE(weststry_gfxdecodeinfo)
566   MDRV_GFXDECODE(weststry)
571567   MDRV_PALETTE_LENGTH(1024)
572568
573569   MDRV_VIDEO_UPDATE(weststry)
src/mame/drivers/raiden.c
r1051r1052
212212  1024
213213};
214214
215static const gfx_decode raiden_gfxdecodeinfo[] =
216{
217   { REGION_GFX1, 0, &raiden_charlayout,   768, 16 },
218   { REGION_GFX2, 0, &raiden_spritelayout,   0, 16 },
219   { REGION_GFX3, 0, &raiden_spritelayout, 256, 16 },
220   { REGION_GFX4, 0, &raiden_spritelayout, 512, 16 },
221   { -1 }
222};
215static GFXDECODE_START( raiden )
216   GFXDECODE_ENTRY( REGION_GFX1, 0, raiden_charlayout,   768, 16 )
217   GFXDECODE_ENTRY( REGION_GFX2, 0, raiden_spritelayout,   0, 16 )
218   GFXDECODE_ENTRY( REGION_GFX3, 0, raiden_spritelayout, 256, 16 )
219   GFXDECODE_ENTRY( REGION_GFX4, 0, raiden_spritelayout, 512, 16 )
220GFXDECODE_END
223221
224222/******************************************************************************/
225223
r1051r1052
260258   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
261259   MDRV_SCREEN_SIZE(32*8, 32*8)
262260   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
263   MDRV_GFXDECODE(raiden_gfxdecodeinfo)
261   MDRV_GFXDECODE(raiden)
264262   MDRV_PALETTE_LENGTH(2048)
265263
266264   MDRV_VIDEO_START(raiden)
r1051r1052
296294   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
297295   MDRV_SCREEN_SIZE(32*8, 32*8)
298296   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
299   MDRV_GFXDECODE(raiden_gfxdecodeinfo)
297   MDRV_GFXDECODE(raiden)
300298   MDRV_PALETTE_LENGTH(2048)
301299
302300   MDRV_VIDEO_START(raidena)
src/mame/drivers/galaxia.c
r1051r1052
133133   8*8
134134};
135135
136static const gfx_decode gfxdecodeinfo[] =
137{
138   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
139   { -1 }
140};
136static GFXDECODE_START( galaxia )
137   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
138GFXDECODE_END
141139
142140
143141
r1051r1052
159157   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
160158   MDRV_SCREEN_SIZE(256, 256)
161159   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
162   MDRV_GFXDECODE(gfxdecodeinfo)
160   MDRV_GFXDECODE(galaxia)
163161   MDRV_PALETTE_LENGTH(0x100)
164162
165163   MDRV_VIDEO_START(galaxia)
src/mame/drivers/fromanc2.c
r1051r1052
653653   32*8
654654};
655655
656static const gfx_decode fromanc2_gfxdecodeinfo[] =
657{
658   { REGION_GFX1, 0, &fromanc2_tilelayout, (  0 * 2), (256 * 2) },
659   { REGION_GFX2, 0, &fromanc2_tilelayout, (256 * 2), (256 * 2) },
660   { REGION_GFX3, 0, &fromanc2_tilelayout, (512 * 2), (256 * 2) },
661   { REGION_GFX4, 0, &fromanc2_tilelayout, (768 * 2), (256 * 2) },
662   { -1 }
663};
656static GFXDECODE_START( fromanc2 )
657   GFXDECODE_ENTRY( REGION_GFX1, 0, fromanc2_tilelayout, (  0 * 2), (256 * 2) )
658   GFXDECODE_ENTRY( REGION_GFX2, 0, fromanc2_tilelayout, (256 * 2), (256 * 2) )
659   GFXDECODE_ENTRY( REGION_GFX3, 0, fromanc2_tilelayout, (512 * 2), (256 * 2) )
660   GFXDECODE_ENTRY( REGION_GFX4, 0, fromanc2_tilelayout, (768 * 2), (256 * 2) )
661GFXDECODE_END
664662
665663static const gfx_layout fromancr_tilelayout =
666664{
r1051r1052
673671   64*8
674672};
675673
676static const gfx_decode fromancr_gfxdecodeinfo[] =
677{
678   { REGION_GFX1, 0, &fromancr_tilelayout, (512 * 2), 2 },
679   { REGION_GFX2, 0, &fromancr_tilelayout, (256 * 2), 2 },
680   { REGION_GFX3, 0, &fromancr_tilelayout, (  0 * 2), 2 },
681   { -1 }
682};
674static GFXDECODE_START( fromancr )
675   GFXDECODE_ENTRY( REGION_GFX1, 0, fromancr_tilelayout, (512 * 2), 2 )
676   GFXDECODE_ENTRY( REGION_GFX2, 0, fromancr_tilelayout, (256 * 2), 2 )
677   GFXDECODE_ENTRY( REGION_GFX3, 0, fromancr_tilelayout, (  0 * 2), 2 )
678GFXDECODE_END
683679
684680
685681// ----------------------------------------------------------------------------
r1051r1052
725721
726722   /* video hardware */
727723   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
728   MDRV_GFXDECODE(fromanc2_gfxdecodeinfo)
724   MDRV_GFXDECODE(fromanc2)
729725   MDRV_PALETTE_LENGTH(4096)
730726   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
731727
r1051r1052
778774
779775   /* video hardware */
780776   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
781   MDRV_GFXDECODE(fromancr_gfxdecodeinfo)
777   MDRV_GFXDECODE(fromancr)
782778   MDRV_PALETTE_LENGTH(4096)
783779   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
784780
r1051r1052
827823
828824   /* video hardware */
829825   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
830   MDRV_GFXDECODE(fromancr_gfxdecodeinfo)
826   MDRV_GFXDECODE(fromancr)
831827   MDRV_PALETTE_LENGTH(4096)
832828
833829   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
src/mame/drivers/bombjack.c
r1051r1052
318318   128*8   /* every sprite takes 128 consecutive bytes */
319319};
320320
321static const gfx_decode gfxdecodeinfo[] =
322{
323   { REGION_GFX1, 0x0000, &charlayout1,      0, 16 },   /* characters */
324   { REGION_GFX2, 0x0000, &charlayout2,      0, 16 },   /* background tiles */
325   { REGION_GFX3, 0x0000, &spritelayout1,    0, 16 },   /* normal sprites */
326   { REGION_GFX3, 0x1000, &spritelayout2,    0, 16 },   /* large sprites */
327   { -1 }
328};
321static GFXDECODE_START( bombjack )
322   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout1,      0, 16 )   /* characters */
323   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout2,      0, 16 )   /* background tiles */
324   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, spritelayout1,    0, 16 )   /* normal sprites */
325   GFXDECODE_ENTRY( REGION_GFX3, 0x1000, spritelayout2,    0, 16 )   /* large sprites */
326GFXDECODE_END
329327
330328
331329
r1051r1052
353351   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
354352   MDRV_SCREEN_SIZE(32*8, 32*8)
355353   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
356   MDRV_GFXDECODE(gfxdecodeinfo)
354   MDRV_GFXDECODE(bombjack)
357355   MDRV_PALETTE_LENGTH(128)
358356
359357   MDRV_VIDEO_START(bombjack)
src/mame/drivers/rallyx.c
r1051r1052
798798   16*8
799799};
800800
801static const gfx_decode rallyx_gfxdecodeinfo[] =
802{
803   { REGION_GFX1, 0, &rallyx_charlayout,     0, 64 },
804   { REGION_GFX1, 0, &rallyx_spritelayout,   0, 64 },
805   { REGION_GFX2, 0, &dotlayout,          64*4,  1 },
806   { -1 }
807};
801static GFXDECODE_START( rallyx )
802   GFXDECODE_ENTRY( REGION_GFX1, 0, rallyx_charlayout,     0, 64 )
803   GFXDECODE_ENTRY( REGION_GFX1, 0, rallyx_spritelayout,   0, 64 )
804   GFXDECODE_ENTRY( REGION_GFX2, 0, dotlayout,          64*4,  1 )
805GFXDECODE_END
808806
809static const gfx_decode jungler_gfxdecodeinfo[] =
810{
811   { REGION_GFX1, 0, &jungler_charlayout,    0, 64 },
812   { REGION_GFX1, 0, &jungler_spritelayout,  0, 64 },
813   { REGION_GFX2, 0, &dotlayout,          64*4,  1 },
814   { -1 }
815};
807static GFXDECODE_START( jungler )
808   GFXDECODE_ENTRY( REGION_GFX1, 0, jungler_charlayout,    0, 64 )
809   GFXDECODE_ENTRY( REGION_GFX1, 0, jungler_spritelayout,  0, 64 )
810   GFXDECODE_ENTRY( REGION_GFX2, 0, dotlayout,          64*4,  1 )
811GFXDECODE_END
816812
817813
818814static struct namco_interface namco_interface =
r1051r1052
852848   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
853849   MDRV_SCREEN_SIZE(36*8, 32*8)
854850   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
855   MDRV_GFXDECODE(rallyx_gfxdecodeinfo)
851   MDRV_GFXDECODE(rallyx)
856852   MDRV_PALETTE_LENGTH(32)
857853   MDRV_COLORTABLE_LENGTH(64*4+4)
858854
r1051r1052
892888   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
893889   MDRV_SCREEN_SIZE(36*8, 32*8)
894890   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
895   MDRV_GFXDECODE(jungler_gfxdecodeinfo)
891   MDRV_GFXDECODE(jungler)
896892   MDRV_PALETTE_LENGTH(32+64)
897893   MDRV_COLORTABLE_LENGTH(64*4+4)
898894
src/mame/drivers/trucocl.c
r1051r1052
131131
132132
133133
134static const gfx_decode gfxdecodeinfo[] =
135{
136   { REGION_GFX1, 0,       &tilelayout,      0, 2 },
137   { REGION_GFX1, 0x10000, &tilelayout,      0, 2 },
138   { -1 }
139};
134static GFXDECODE_START( trucocl )
135   GFXDECODE_ENTRY( REGION_GFX1, 0,       tilelayout,      0, 2 )
136   GFXDECODE_ENTRY( REGION_GFX1, 0x10000, tilelayout,      0, 2 )
137GFXDECODE_END
140138
141139static INTERRUPT_GEN( trucocl_interrupt )
142140{
r1051r1052
157155   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
158156   MDRV_SCREEN_SIZE(32*8, 32*8)
159157   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
160   MDRV_GFXDECODE(gfxdecodeinfo)
158   MDRV_GFXDECODE(trucocl)
161159   MDRV_PALETTE_LENGTH(32)
162160   MDRV_COLORTABLE_LENGTH(32)
163161
src/mame/drivers/igs_m68.c
r1051r1052
4646   MDRV_SCREEN_REFRESH_RATE(60)
4747   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
4848
49   //MDRV_GFXDECODE(gfxdecodeinfo)
49   //MDRV_GFXDECODE(igs_m68)
5050
5151   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
5252   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/bking2.c
r1051r1052
494494   16*8    /* every sprite takes 16 consecutive bytes */
495495};
496496
497static const gfx_decode gfxdecodeinfo[] =
498{
499   { REGION_GFX1, 0, &charlayout, 0,           4  }, /* playfield */
500   { REGION_GFX2, 0, &crowlayout, 4*8,         4  }, /* crow */
501   { REGION_GFX3, 0, &balllayout, 4*8+4*4,     4  }, /* ball 1 */
502   { REGION_GFX4, 0, &balllayout, 4*8+4*4+4*2, 4  }, /* ball 2 */
503   { -1 }
504};
497static GFXDECODE_START( bking2 )
498   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0,           4  ) /* playfield */
499   GFXDECODE_ENTRY( REGION_GFX2, 0, crowlayout, 4*8,         4  ) /* crow */
500   GFXDECODE_ENTRY( REGION_GFX3, 0, balllayout, 4*8+4*4,     4  ) /* ball 1 */
501   GFXDECODE_ENTRY( REGION_GFX4, 0, balllayout, 4*8+4*4+4*2, 4  ) /* ball 2 */
502GFXDECODE_END
505503
506504
507505static WRITE8_HANDLER( portb_w )
r1051r1052
543541   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
544542   MDRV_SCREEN_SIZE(32*8, 32*8)
545543   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
546   MDRV_GFXDECODE(gfxdecodeinfo)
544   MDRV_GFXDECODE(bking2)
547545   MDRV_PALETTE_LENGTH(512)
548546   MDRV_COLORTABLE_LENGTH(4*8+4*4+4*2+4*2)
549547
src/mame/drivers/unico.c
r1051r1052
622622   16*16*2
623623};
624624
625static const gfx_decode unico_gfxdecodeinfo[] =
626{
627   { REGION_GFX1, 0, &layout_16x16x8, 0x0, 0x20 }, // [0] Sprites
628   { REGION_GFX2, 0, &layout_16x16x8, 0x0, 0x20 }, // [1] Layers
629   { -1 }
630};
625static GFXDECODE_START( unico )
626   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8, 0x0, 0x20 ) // [0] Sprites
627   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x8, 0x0, 0x20 ) // [1] Layers
628GFXDECODE_END
631629
632630
633631
r1051r1052
690688   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
691689   MDRV_SCREEN_SIZE(0x180, 0xe0)
692690   MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0xe0-1)
693   MDRV_GFXDECODE(unico_gfxdecodeinfo)
691   MDRV_GFXDECODE(unico)
694692   MDRV_PALETTE_LENGTH(8192)
695693
696694   MDRV_VIDEO_START(unico)
r1051r1052
737735   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
738736   MDRV_SCREEN_SIZE(0x180, 0xe0)
739737   MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0xe0-1)
740   MDRV_GFXDECODE(unico_gfxdecodeinfo)
738   MDRV_GFXDECODE(unico)
741739   MDRV_PALETTE_LENGTH(8192)
742740
743741   MDRV_VIDEO_START(unico)
r1051r1052
781779   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
782780   MDRV_SCREEN_SIZE(0x180, 0xe0)
783781   MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0xe0-1)
784   MDRV_GFXDECODE(unico_gfxdecodeinfo)
782   MDRV_GFXDECODE(unico)
785783   MDRV_PALETTE_LENGTH(8192)
786784
787785   MDRV_VIDEO_START(zeropnt2)
src/mame/drivers/gcpinbal.c
r1051r1052
355355   128*8   /* every sprite takes 128 consecutive bytes */
356356};
357357
358static const gfx_decode gfxdecodeinfo[] =
359{
360   { REGION_GFX3, 0, &tilelayout,       0, 256 },   /* sprites & playfield */
361   { REGION_GFX1, 0, &charlayout,       0, 256 },   /* sprites & playfield */
362   { REGION_GFX2, 0, &char_8x8_layout,  0, 256 },   /* sprites & playfield */
363   { -1 }
364};
358static GFXDECODE_START( gcpinbal )
359   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,       0, 256 )   /* sprites & playfield */
360   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 256 )   /* sprites & playfield */
361   GFXDECODE_ENTRY( REGION_GFX2, 0, char_8x8_layout,  0, 256 )   /* sprites & playfield */
362GFXDECODE_END
365363
366364
367365/**************************************************************
r1051r1052
393391   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
394392   MDRV_SCREEN_SIZE(40*8, 32*8)
395393   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
396   MDRV_GFXDECODE(gfxdecodeinfo)
394   MDRV_GFXDECODE(gcpinbal)
397395   MDRV_PALETTE_LENGTH(4096)
398396
399397   MDRV_VIDEO_START(gcpinbal)
src/mame/drivers/realbrk.c
r1051r1052
630630   16*16*8
631631};
632632
633static const gfx_decode realbrk_gfxdecodeinfo[] =
634{
635   { REGION_GFX1, 0, &layout_16x16x8,      0, 0x80      },   // [0] Backgrounds
636   { REGION_GFX2, 0, &layout_8x8x4,      0, 0x800   },   // [1] Text
637   { REGION_GFX3, 0, &layout_16x16x8,      0, 0x80      },   // [2] Sprites (256 colors)
638   { REGION_GFX4, 0, &layout_16x16x4,      0, 0x800   },   // [3] Sprites (16 colors)
639   { -1 }
640};
633static GFXDECODE_START( realbrk )
634   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8,      0, 0x80      )   // [0] Backgrounds
635   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,      0, 0x800   )   // [1] Text
636   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8,      0, 0x80      )   // [2] Sprites (256 colors)
637   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_16x16x4,      0, 0x800   )   // [3] Sprites (16 colors)
638GFXDECODE_END
641639
642static const gfx_decode dai2kaku_gfxdecodeinfo[] =
643{
644   { REGION_GFX1, 0, &layout_16x16x8,      0, 0x80      },   // [0] Backgrounds
645   { REGION_GFX2, 0, &layout_8x8x4,      0, 0x800   },   // [1] Text
646   { REGION_GFX3, 0, &layout_16x16x8,      0, 0x80      },   // [2] Sprites (256 colors)
647   { -1 }
648};
640static GFXDECODE_START( dai2kaku )
641   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8,      0, 0x80      )   // [0] Backgrounds
642   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,      0, 0x800   )   // [1] Text
643   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8,      0, 0x80      )   // [2] Sprites (256 colors)
644GFXDECODE_END
649645
650646
651647/***************************************************************************
r1051r1052
693689   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
694690   MDRV_SCREEN_SIZE(0x140, 0xe0)
695691   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1)
696   MDRV_GFXDECODE(realbrk_gfxdecodeinfo)
692   MDRV_GFXDECODE(realbrk)
697693   MDRV_PALETTE_LENGTH(0x8000)
698694
699695   MDRV_VIDEO_START(realbrk)
r1051r1052
729725   MDRV_CPU_MODIFY("main")
730726   MDRV_CPU_PROGRAM_MAP(base_mem,dai2kaku_mem)
731727
732   MDRV_GFXDECODE(dai2kaku_gfxdecodeinfo)
728   MDRV_GFXDECODE(dai2kaku)
733729   MDRV_VIDEO_UPDATE(dai2kaku)
734730MACHINE_DRIVER_END
735731
src/mame/drivers/diverboy.c
r1051r1052
184184   16*64
185185};
186186
187static const gfx_decode gfxdecodeinfo[] =
188{
189   { REGION_GFX1, 0, &diverboy_spritelayout, 0, 4*16 },
190   { REGION_GFX2, 0, &diverboy_spritelayout, 0, 4*16 },
191   { -1 }
192};
187static GFXDECODE_START( diverboy )
188   GFXDECODE_ENTRY( REGION_GFX1, 0, diverboy_spritelayout, 0, 4*16 )
189   GFXDECODE_ENTRY( REGION_GFX2, 0, diverboy_spritelayout, 0, 4*16 )
190GFXDECODE_END
193191
194192
195193
r1051r1052
205203   MDRV_SCREEN_REFRESH_RATE(60)
206204   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
207205
208   MDRV_GFXDECODE(gfxdecodeinfo)
206   MDRV_GFXDECODE(diverboy)
209207
210208   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
211209   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/arcadia.c
r1051r1052
697697 *
698698 *************************************/
699699
700DRIVER_INIT( none )  {                                                       arcadia_init(); }
700static DRIVER_INIT( none )  {                                                arcadia_init(); }
701701DRIVER_INIT( airh )  { generic_decode(REGION_USER3, 5, 0, 2, 4, 7, 6, 1, 3); arcadia_init(); }
702702DRIVER_INIT( bowl )  { generic_decode(REGION_USER3, 7, 6, 0, 1, 2, 3, 4, 5); arcadia_init(); }
703703DRIVER_INIT( dart )  { generic_decode(REGION_USER3, 4, 0, 7, 6, 3, 1, 2, 5); arcadia_init(); }
src/mame/drivers/carjmbre.c
r1051r1052
176176   16*8
177177};
178178
179static const gfx_decode carjmbre_gfxdecodeinfo[] =
180{
181   { REGION_GFX1, 0, &carjmbre_charlayout,   0, 16 },
182   { REGION_GFX2, 0, &carjmbre_spritelayout, 0, 16 },
183   { -1 }
184};
179static GFXDECODE_START( carjmbre )
180   GFXDECODE_ENTRY( REGION_GFX1, 0, carjmbre_charlayout,   0, 16 )
181   GFXDECODE_ENTRY( REGION_GFX2, 0, carjmbre_spritelayout, 0, 16 )
182GFXDECODE_END
185183
186184static MACHINE_DRIVER_START( carjmbre )
187185
r1051r1052
204202   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
205203   MDRV_SCREEN_SIZE(32*8, 32*8)
206204   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
207   MDRV_GFXDECODE(carjmbre_gfxdecodeinfo)
205   MDRV_GFXDECODE(carjmbre)
208206   MDRV_PALETTE_LENGTH(64)
209207   MDRV_COLORTABLE_LENGTH(64)
210208
src/mame/drivers/ace.c
r1051r1052
304304   32*8   /* every char takes 32 consecutive bytes */
305305};
306306
307static const gfx_decode gfxdecodeinfo[] =
308{
309   { REGION_GFX1, 0     , &charlayout,  0, 2 },
310   { 0          , 0x8000, &charlayout0, 0, 2 },    /* the game dynamically modifies this */
311   { 0          , 0x8000, &charlayout1, 0, 2 },    /* the game dynamically modifies this */
312   { 0          , 0x8000, &charlayout2, 0, 2 },    /* the game dynamically modifies this */
313   { 0          , 0x8000, &scorelayout, 0, 2 },    /* the game dynamically modifies this */
314   { -1 }
315};
307static GFXDECODE_START( ace )
308   GFXDECODE_ENTRY( REGION_GFX1, 0     , charlayout,  0, 2 )
309   GFXDECODE_ENTRY( 0          , 0x8000, charlayout0, 0, 2 )    /* the game dynamically modifies this */
310   GFXDECODE_ENTRY( 0          , 0x8000, charlayout1, 0, 2 )    /* the game dynamically modifies this */
311   GFXDECODE_ENTRY( 0          , 0x8000, charlayout2, 0, 2 )    /* the game dynamically modifies this */
312   GFXDECODE_ENTRY( 0          , 0x8000, scorelayout, 0, 2 )    /* the game dynamically modifies this */
313GFXDECODE_END
316314
317315
318316
r1051r1052
330328   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
331329   MDRV_SCREEN_SIZE(32*8, 32*8)
332330   MDRV_SCREEN_VISIBLE_AREA(4*8, 32*8-1, 2*8, 32*8-1)
333   MDRV_GFXDECODE(gfxdecodeinfo)
331   MDRV_GFXDECODE(ace)
334332   MDRV_PALETTE_LENGTH(2)
335333   MDRV_COLORTABLE_LENGTH(2*2)
336334
src/mame/drivers/vmetal.c
r1051r1052
361361   8*32
362362};
363363
364static const gfx_decode gfxdecodeinfo[] =
365{
366   { REGION_GFX1, 0, &char16x16layout,   0x1000, 512  }, /* bg tiles */
367   { REGION_GFX1, 0, &char8x8layout,   0x1000, 512  }, /* bg tiles */
368   { -1 }
369};
364static GFXDECODE_START( vmetal )
365   GFXDECODE_ENTRY( REGION_GFX1, 0, char16x16layout,   0x1000, 512  ) /* bg tiles */
366   GFXDECODE_ENTRY( REGION_GFX1, 0, char8x8layout,   0x1000, 512  ) /* bg tiles */
367GFXDECODE_END
370368
371369
372370static TILE_GET_INFO( get_vmetal_texttilemap_tile_info )
r1051r1052
439437   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
440438   MDRV_SCREEN_SIZE(2048, 2048)
441439   MDRV_SCREEN_VISIBLE_AREA(0+64, 319+64, 0+64, 223+64)
442   MDRV_GFXDECODE(gfxdecodeinfo)
440   MDRV_GFXDECODE(vmetal)
443441   MDRV_PALETTE_LENGTH(0x4000)
444442
445443   MDRV_VIDEO_START(varia)
src/mame/drivers/superchs.c
r1051r1052
357357   128*8     /* every sprite takes 128 consecutive bytes */
358358};
359359
360static const gfx_decode superchs_gfxdecodeinfo[] =
361{
362   { REGION_GFX2, 0x0, &tile16x16_layout,  0, 512 },
363   { REGION_GFX1, 0x0, &charlayout,        0, 512 },
364   { -1 }
365};
360static GFXDECODE_START( superchs )
361   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x16_layout,  0, 512 )
362   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,        0, 512 )
363GFXDECODE_END
366364
367365
368366/***********************************************************
r1051r1052
439437   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
440438   MDRV_SCREEN_SIZE(40*8, 32*8)
441439   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 2*8, 32*8-1)
442   MDRV_GFXDECODE(superchs_gfxdecodeinfo)
440   MDRV_GFXDECODE(superchs)
443441   MDRV_PALETTE_LENGTH(8192)
444442
445443   MDRV_VIDEO_START(superchs)
src/mame/drivers/flower.c
r1051r1052
218218   16*16*2
219219};
220220
221static const gfx_decode flower_gfxdecodeinfo[] =
222{
223   { REGION_GFX1, 0, &flower_charlayout, 0,  64 },
224   { REGION_GFX2, 0, &flower_tilelayout, 0,  16 },
225   { REGION_GFX3, 0, &flower_tilelayout, 0,  16 },
226   { -1 }
227};
221static GFXDECODE_START( flower )
222   GFXDECODE_ENTRY( REGION_GFX1, 0, flower_charlayout, 0,  64 )
223   GFXDECODE_ENTRY( REGION_GFX2, 0, flower_tilelayout, 0,  16 )
224   GFXDECODE_ENTRY( REGION_GFX3, 0, flower_tilelayout, 0,  16 )
225GFXDECODE_END
228226
229227static struct CustomSound_interface custom_interface =
230228{
r1051r1052
256254   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
257255   MDRV_SCREEN_SIZE(34*8, 33*8)
258256   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 28*8-1)
259   MDRV_GFXDECODE(flower_gfxdecodeinfo)
257   MDRV_GFXDECODE(flower)
260258
261259   MDRV_PALETTE_INIT(flower)
262260   MDRV_PALETTE_LENGTH(256)
src/mame/drivers/battlera.c
r1051r1052
251251   128*8
252252};
253253
254static const gfx_decode gfxdecodeinfo[] =
255{
256   { 0, 0, &tiles,       0,  16 }, /* Dynamically modified */
257   { 0, 0, &sprites,   256,  16 }, /* Dynamically modified */
258   { 0, 0, &tiles  ,   256,  16 }, /* Blank tile */
259   { -1 }
260};
254static GFXDECODE_START( battlera )
255   GFXDECODE_ENTRY( 0, 0, tiles,       0,  16 ) /* Dynamically modified */
256   GFXDECODE_ENTRY( 0, 0, sprites,   256,  16 ) /* Dynamically modified */
257   GFXDECODE_ENTRY( 0, 0, tiles  ,   256,  16 ) /* Blank tile */
258GFXDECODE_END
261259
262260/******************************************************************************/
263261
r1051r1052
289287   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
290288   MDRV_SCREEN_SIZE(32*8, 32*8)
291289   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 30*8-1)
292   MDRV_GFXDECODE(gfxdecodeinfo)
290   MDRV_GFXDECODE(battlera)
293291   MDRV_PALETTE_LENGTH(512)
294292
295293   MDRV_VIDEO_START(battlera)
r1051r1052
374372
375373GAME( 1988, battlera, 0,        battlera, battlera,  0,   ROT0, "Data East Corporation", "Battle Rangers (World)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
376374GAME( 1988, bldwolf,  battlera, battlera, battlera,  0,   ROT0, "Data East USA", "Bloody Wolf (US)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
377GAME( 1988, bldwolfj, battlera, battlera, battlera,  0,   ROT0, "Data East Corporation", "Narazumono Sentai Bloody Wolf (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
375GAME( 1988, bldwolfj, battlera, battlera, battlera,  0,   ROT0, "Data East Corporation", "Narazumono Sentoubutai Bloody Wolf (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/dreamwld.c
r1051r1052
438438};
439439
440440
441static const gfx_decode gfxdecodeinfo[] =
442{
443   { REGION_GFX1, 0, &tiles16x16_layout, 0, 0x100 },
444   { REGION_GFX2, 0, &tiles16x16_layout, 0, 0x100 },
445   { -1 }
446};
441static GFXDECODE_START( dreamwld )
442   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16_layout, 0, 0x100 )
443   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16_layout, 0, 0x100 )
444GFXDECODE_END
447445
448446static MACHINE_DRIVER_START( dreamwld )
449447   /* basic machine hardware */
r1051r1052
461459   MDRV_SCREEN_VISIBLE_AREA(0, 304-1, 0, 224-1)
462460
463461   MDRV_PALETTE_LENGTH(0x1000)
464   MDRV_GFXDECODE(gfxdecodeinfo)
462   MDRV_GFXDECODE(dreamwld)
465463
466464   MDRV_VIDEO_START(dreamwld)
467465   MDRV_VIDEO_UPDATE(dreamwld)
src/mame/drivers/xain.c
r1051r1052
443443   64*8
444444};
445445
446static const gfx_decode gfxdecodeinfo[] =
447{
448   { REGION_GFX1, 0, &charlayout,   0, 8 },   /* 8x8 text */
449   { REGION_GFX2, 0, &tilelayout, 256, 8 },   /* 16x16 Background */
450   { REGION_GFX3, 0, &tilelayout, 384, 8 },   /* 16x16 Background */
451   { REGION_GFX4, 0, &tilelayout, 128, 8 },   /* Sprites */
452   { -1 }
453};
446static GFXDECODE_START( xain )
447   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 8 )   /* 8x8 text */
448   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 256, 8 )   /* 16x16 Background */
449   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 384, 8 )   /* 16x16 Background */
450   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 128, 8 )   /* Sprites */
451GFXDECODE_END
454452
455453
456454
r1051r1052
502500   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
503501   MDRV_SCREEN_SIZE(32*8, 32*8)
504502   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
505   MDRV_GFXDECODE(gfxdecodeinfo)
503   MDRV_GFXDECODE(xain)
506504   MDRV_PALETTE_LENGTH(512)
507505
508506   MDRV_VIDEO_START(xain)
src/mame/drivers/gundealr.c
r1051r1052
450450   128*8
451451};
452452
453static const gfx_decode gfxdecodeinfo[] =
454{
455   { REGION_GFX1, 0, &charlayout,     0, 16 },   /* colors 0-255 */
456   { REGION_GFX2, 0, &spritelayout, 256, 16 },   /* colors 256-511 */
457   { -1 }
458};
453static GFXDECODE_START( gundealr )
454   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )   /* colors 0-255 */
455   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 256, 16 )   /* colors 256-511 */
456GFXDECODE_END
459457
460458
461459
r1051r1052
476474   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
477475   MDRV_SCREEN_SIZE(32*8, 32*8)
478476   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
479   MDRV_GFXDECODE(gfxdecodeinfo)
477   MDRV_GFXDECODE(gundealr)
480478   MDRV_PALETTE_LENGTH(512)
481479
482480   MDRV_VIDEO_START(gundealr)
src/mame/drivers/mrdo.c
r1051r1052
165165
166166
167167
168static const gfx_decode gfxdecodeinfo[] =
169{
170   { REGION_GFX1, 0, &charlayout,      0, 64 },   /* colors 0-255 directly mapped */
171   { REGION_GFX2, 0, &charlayout,      0, 64 },
172   { REGION_GFX3, 0, &spritelayout, 4*64, 16 },
173   { -1 }
174};
168static GFXDECODE_START( mrdo )
169   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 64 )   /* colors 0-255 directly mapped */
170   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,      0, 64 )
171   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 4*64, 16 )
172GFXDECODE_END
175173
176174
177175
r1051r1052
190188   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
191189   MDRV_SCREEN_SIZE(32*8, 32*8)
192190   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
193   MDRV_GFXDECODE(gfxdecodeinfo)
191   MDRV_GFXDECODE(mrdo)
194192   MDRV_PALETTE_LENGTH(256)
195193   MDRV_COLORTABLE_LENGTH(64*4+16*4)
196194
src/mame/drivers/namcos1.c
r1051r1052
953953   32*32*4
954954};
955955
956static const gfx_decode gfxdecodeinfo[] =
957{
958   { REGION_GFX2, 0, &tilelayout,   0x0800,   8 },  /* characters */
959   { REGION_GFX3, 0, &spritelayout, 0x0000, 128 },  /* sprites 32/16/8/4 dots */
960   { -1 }
961};
956static GFXDECODE_START( namcos1 )
957   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0x0800,   8 )  /* characters */
958   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x0000, 128 )  /* sprites 32/16/8/4 dots */
959GFXDECODE_END
962960
963961
964962
r1051r1052
10181016   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10191017   MDRV_SCREEN_SIZE(64*8, 64*8)
10201018   MDRV_SCREEN_VISIBLE_AREA(9 + 8*8, 9 + 44*8-1, 2*8, 30*8-1)
1021   MDRV_GFXDECODE(gfxdecodeinfo)
1019   MDRV_GFXDECODE(namcos1)
10221020   MDRV_PALETTE_LENGTH(0x2000)
10231021
10241022   MDRV_VIDEO_START(namcos1)
src/mame/drivers/m62.c
r1051r1052
13081308   32*8
13091309};
13101310
1311static const gfx_decode ldrun_gfxdecodeinfo[] =
1312{
1313   { REGION_GFX1, 0, &tilelayout_1024,       0, 32 },   /* use colors   0-255 */
1314   { REGION_GFX2, 0, &spritelayout,        256, 32 },   /* use colors 256-511 */
1315   { -1 }
1316};
1311static GFXDECODE_START( ldrun )
1312   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_1024,       0, 32 )   /* use colors   0-255 */
1313   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,        256, 32 )   /* use colors 256-511 */
1314GFXDECODE_END
13171315
1318static const gfx_decode battroad_gfxdecodeinfo[] =
1319{
1320   { REGION_GFX1, 0, &tilelayout_1024,       0, 32 },   /* use colors   0-255 */
1321   { REGION_GFX2, 0, &spritelayout,        256, 32 },   /* use colors 256-511 */
1322   { REGION_GFX3, 0, &battroad_charlayout,   512, 32 },   /* use colors 512-543 */
1323   { -1 }
1324};
1316static GFXDECODE_START( battroad )
1317   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_1024,       0, 32 )   /* use colors   0-255 */
1318   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,        256, 32 )   /* use colors 256-511 */
1319   GFXDECODE_ENTRY( REGION_GFX3, 0, battroad_charlayout,   512, 32 )   /* use colors 512-543 */
1320GFXDECODE_END
13251321
1326static const gfx_decode ldrun3_gfxdecodeinfo[] =
1327{
1328   { REGION_GFX1, 0, &tilelayout_2048,      0, 32 },   /* use colors   0-255 */
1329   { REGION_GFX2, 0, &spritelayout,       256, 32 },   /* use colors 256-511 */
1330   { -1 }
1331};
1322static GFXDECODE_START( ldrun3 )
1323   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_2048,      0, 32 )   /* use colors   0-255 */
1324   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 32 )   /* use colors 256-511 */
1325GFXDECODE_END
13321326
1333static const gfx_decode lotlot_gfxdecodeinfo[] =
1334{
1335   { REGION_GFX1, 0, &lotlot_charlayout,    0, 32 },   /* use colors   0-255 */
1336   { REGION_GFX2, 0, &spritelayout,       256, 32 },   /* use colors 256-511 */
1337   { REGION_GFX3, 0, &lotlot_charlayout,  512, 32 },   /* use colors 512-767 */
1338   { -1 }
1339};
1327static GFXDECODE_START( lotlot )
1328   GFXDECODE_ENTRY( REGION_GFX1, 0, lotlot_charlayout,    0, 32 )   /* use colors   0-255 */
1329   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 32 )   /* use colors 256-511 */
1330   GFXDECODE_ENTRY( REGION_GFX3, 0, lotlot_charlayout,  512, 32 )   /* use colors 512-767 */
1331GFXDECODE_END
13401332
1341static const gfx_decode kidniki_gfxdecodeinfo[] =
1342{
1343   { REGION_GFX1, 0, &tilelayout_4096,      0, 32 },   /* use colors   0-255 */
1344   { REGION_GFX2, 0, &spritelayout,       256, 32 },   /* use colors 256-511 */
1345   { REGION_GFX3, 0, &kidniki_charlayout,   0, 32 },   /* use colors   0-255 */
1346   { -1 }
1347};
1333static GFXDECODE_START( kidniki )
1334   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_4096,      0, 32 )   /* use colors   0-255 */
1335   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 32 )   /* use colors 256-511 */
1336   GFXDECODE_ENTRY( REGION_GFX3, 0, kidniki_charlayout,   0, 32 )   /* use colors   0-255 */
1337GFXDECODE_END
13481338
1349static const gfx_decode spelunkr_gfxdecodeinfo[] =
1350{
1351   { REGION_GFX1, 0, &tilelayout_4096,        0, 32 },   /* use colors   0-255 */
1352   { REGION_GFX2, 0, &spritelayout,       256, 32 },   /* use colors 256-511 */
1353   { REGION_GFX3, 0, &spelunk2_charlayout,  0, 32 },   /* use colors   0-255 */
1354   { -1 }
1355};
1339static GFXDECODE_START( spelunkr )
1340   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_4096,        0, 32 )   /* use colors   0-255 */
1341   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 32 )   /* use colors 256-511 */
1342   GFXDECODE_ENTRY( REGION_GFX3, 0, spelunk2_charlayout,  0, 32 )   /* use colors   0-255 */
1343GFXDECODE_END
13561344
1357static const gfx_decode spelunk2_gfxdecodeinfo[] =
1358{
1359   { REGION_GFX1, 0, &tilelayout_4096,        0, 64 },   /* use colors   0-511 */
1360   { REGION_GFX2, 0, &spritelayout,       512, 32 },   /* use colors 512-767 */
1361   { REGION_GFX3, 0, &spelunk2_charlayout,  0, 64 },   /* use colors   0-511 */
1362   { -1 }
1363};
1345static GFXDECODE_START( spelunk2 )
1346   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout_4096,        0, 64 )   /* use colors   0-511 */
1347   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       512, 32 )   /* use colors 512-767 */
1348   GFXDECODE_ENTRY( REGION_GFX3, 0, spelunk2_charlayout,  0, 64 )   /* use colors   0-511 */
1349GFXDECODE_END
13641350
1365static const gfx_decode youjyudn_gfxdecodeinfo[] =
1366{
1367   { REGION_GFX1, 0, &youjyudn_tilelayout,  0, 32 },   /* use colors   0-255 */
1368   { REGION_GFX2, 0, &spritelayout,       256, 32 },   /* use colors 256-511 */
1369   { REGION_GFX3, 0, &kidniki_charlayout, 128, 16 },   /* use colors 128-255 */
1370   { -1 }
1371};
1351static GFXDECODE_START( youjyudn )
1352   GFXDECODE_ENTRY( REGION_GFX1, 0, youjyudn_tilelayout,  0, 32 )   /* use colors   0-255 */
1353   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 32 )   /* use colors 256-511 */
1354   GFXDECODE_ENTRY( REGION_GFX3, 0, kidniki_charlayout, 128, 16 )   /* use colors 128-255 */
1355GFXDECODE_END
13721356
13731357
13741358
r1051r1052
13891373   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13901374   MDRV_SCREEN_SIZE(64*8, 32*8)
13911375   MDRV_SCREEN_VISIBLE_AREA((64*8-384)/2, 64*8-(64*8-384)/2-1, 0*8, 32*8-1)
1392   MDRV_GFXDECODE(ldrun_gfxdecodeinfo)
1376   MDRV_GFXDECODE(ldrun)
13931377   MDRV_PALETTE_LENGTH(512)
13941378
13951379   MDRV_PALETTE_INIT(m62)
r1051r1052
14271411
14281412   /* video hardware */
14291413   MDRV_SCREEN_VISIBLE_AREA((64*8-256)/2, 64*8-(64*8-256)/2-1, 0*8, 32*8-1)
1430   MDRV_GFXDECODE(battroad_gfxdecodeinfo)
1414   MDRV_GFXDECODE(battroad)
14311415   MDRV_PALETTE_LENGTH(544)
14321416
14331417   MDRV_PALETTE_INIT(battroad)
r1051r1052
14601444   MDRV_CPU_IO_MAP(kungfum_readport,ldrun3_writeport)
14611445
14621446   /* video hardware */
1463   MDRV_GFXDECODE(ldrun3_gfxdecodeinfo)
1447   MDRV_GFXDECODE(ldrun3)
14641448
14651449   MDRV_SCREEN_VISIBLE_AREA((64*8-384)/2, 64*8-(64*8-384)/2-1, 0*8, 31*8-1)
14661450MACHINE_DRIVER_END
r1051r1052
14751459   MDRV_CPU_IO_MAP(kungfum_readport,ldrun4_writeport)
14761460
14771461   /* video hardware */
1478   MDRV_GFXDECODE(ldrun3_gfxdecodeinfo)
1462   MDRV_GFXDECODE(ldrun3)
14791463   MDRV_VIDEO_START(ldrun4)
14801464   MDRV_VIDEO_UPDATE(ldrun4)
14811465MACHINE_DRIVER_END
r1051r1052
14891473   MDRV_CPU_PROGRAM_MAP(lotlot_readmem,lotlot_writemem)
14901474
14911475   /* video hardware */
1492   MDRV_GFXDECODE(lotlot_gfxdecodeinfo)
1476   MDRV_GFXDECODE(lotlot)
14931477   MDRV_PALETTE_LENGTH(768)
14941478
14951479   MDRV_PALETTE_INIT(lotlot)
r1051r1052
15071491   MDRV_CPU_IO_MAP(kungfum_readport,kidniki_writeport)
15081492
15091493   /* video hardware */
1510   MDRV_GFXDECODE(kidniki_gfxdecodeinfo)
1494   MDRV_GFXDECODE(kidniki)
15111495
15121496   MDRV_VIDEO_START(kidniki)
15131497   MDRV_VIDEO_UPDATE(kidniki)
r1051r1052
15221506   MDRV_CPU_PROGRAM_MAP(spelunkr_readmem,spelunkr_writemem)
15231507
15241508   /* video hardware */
1525   MDRV_GFXDECODE(spelunkr_gfxdecodeinfo)
1509   MDRV_GFXDECODE(spelunkr)
15261510
15271511   MDRV_VIDEO_START(spelunkr)
15281512   MDRV_VIDEO_UPDATE(spelunkr)
r1051r1052
15371521   MDRV_CPU_PROGRAM_MAP(spelunk2_readmem,spelunk2_writemem)
15381522
15391523   /* video hardware */
1540   MDRV_GFXDECODE(spelunk2_gfxdecodeinfo)
1524   MDRV_GFXDECODE(spelunk2)
15411525   MDRV_PALETTE_LENGTH(768)
15421526
15431527   MDRV_PALETTE_INIT(spelunk2)
r1051r1052
15561540
15571541   /* video hardware */
15581542   MDRV_SCREEN_VISIBLE_AREA((64*8-256)/2, 64*8-(64*8-256)/2-1, 0*8, 32*8-1)
1559   MDRV_GFXDECODE(youjyudn_gfxdecodeinfo)
1543   MDRV_GFXDECODE(youjyudn)
15601544
15611545   MDRV_VIDEO_START(youjyudn)
15621546   MDRV_VIDEO_UPDATE(youjyudn)
src/mame/drivers/megazone.c
r1051r1052
106106   cpunum_set_input_line(2, 0, ASSERT_LINE);
107107}
108108
109WRITE8_HANDLER( i8039_irqen_and_status_w )
109static WRITE8_HANDLER( i8039_irqen_and_status_w )
110110{
111111   if ((data & 0x80) == 0)
112112      cpunum_set_input_line(2, 0, CLEAR_LINE);
r1051r1052
308308   64*8   /* every sprite takes 64 consecutive bytes */
309309};
310310
311static const gfx_decode gfxdecodeinfo[] =
312{
313   { REGION_GFX1, 0, &charlayout,       0, 16 },
314   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
315   { -1 }
316};
311static GFXDECODE_START( megazone )
312   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
313   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
314GFXDECODE_END
317315
318316
319317
r1051r1052
353351   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
354352   MDRV_SCREEN_SIZE(36*8, 32*8)
355353   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
356   MDRV_GFXDECODE(gfxdecodeinfo)
354   MDRV_GFXDECODE(megazone)
357355   MDRV_PALETTE_LENGTH(32)
358356   MDRV_COLORTABLE_LENGTH(16*16+16*16)
359357
src/mame/drivers/deco156.c
r1051r1052
395395   64*8
396396};
397397
398static const gfx_decode gfxdecodeinfo_hvysmsh[] =
399{
400   { REGION_GFX1, 0, &charlayout,          0, 32 },   /* Characters 8x8 */
401   { REGION_GFX1, 0, &tilelayout,          0, 32 },   /* Tiles 16x16 */
402   { REGION_GFX2, 0, &spritelayout,      512, 32 },   /* Sprites 16x16 */
403   { -1 }
404};
398static GFXDECODE_START( hvysmsh )
399   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 32 )   /* Characters 8x8 */
400   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,          0, 32 )   /* Tiles 16x16 */
401   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,      512, 32 )   /* Sprites 16x16 */
402GFXDECODE_END
405403
406404
407405/**********************************************************************************/
r1051r1052
438436   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
439437   MDRV_SCREEN_SIZE(40*8, 32*8)
440438   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
441   MDRV_GFXDECODE(gfxdecodeinfo_hvysmsh)
439   MDRV_GFXDECODE(hvysmsh)
442440   MDRV_PALETTE_LENGTH(1024)
443441
444442   MDRV_VIDEO_START(wcvol95)
r1051r1052
474472   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
475473   MDRV_SCREEN_SIZE(40*8, 32*8)
476474   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
477   MDRV_GFXDECODE(gfxdecodeinfo_hvysmsh)
475   MDRV_GFXDECODE(hvysmsh)
478476   MDRV_PALETTE_LENGTH(1024)
479477
480478   MDRV_VIDEO_START(wcvol95)
src/mame/drivers/pass.c
r1051r1052
260260   4*32
261261};
262262
263static const gfx_decode gfxdecodeinfo[] =
264{
265   { REGION_GFX1, 0, &tiles4x4_fg_layout, 256, 2 },
266   { REGION_GFX2, 0, &tiles8x8_layout, 0, 2 },
267   { -1 }
268};
263static GFXDECODE_START( pass )
264   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles4x4_fg_layout, 256, 2 )
265   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout, 0, 2 )
266GFXDECODE_END
269267
270268/* todo : is this correct? */
271269
r1051r1052
292290   MDRV_SCREEN_SIZE(64*8, 32*8)
293291   MDRV_SCREEN_VISIBLE_AREA(8*8, 48*8-1, 2*8, 30*8-1)
294292   MDRV_PALETTE_LENGTH(0x200)
295   MDRV_GFXDECODE(gfxdecodeinfo)
293   MDRV_GFXDECODE(pass)
296294
297295   MDRV_VIDEO_START(pass)
298296   MDRV_VIDEO_UPDATE(pass)
src/mame/drivers/toki.c
r1051r1052
353353   128*8
354354};
355355
356static const gfx_decode toki_gfxdecodeinfo[] =
357{
358   { REGION_GFX1, 0, &toki_charlayout,  16*16, 16 },
359   { REGION_GFX2, 0, &toki_spritelayout, 0*16, 16 },
360   { REGION_GFX3, 0, &toki_tilelayout,  32*16, 16 },
361   { REGION_GFX4, 0, &toki_tilelayout,  48*16, 16 },
362   { -1 }
363};
356static GFXDECODE_START( toki )
357   GFXDECODE_ENTRY( REGION_GFX1, 0, toki_charlayout,  16*16, 16 )
358   GFXDECODE_ENTRY( REGION_GFX2, 0, toki_spritelayout, 0*16, 16 )
359   GFXDECODE_ENTRY( REGION_GFX3, 0, toki_tilelayout,  32*16, 16 )
360   GFXDECODE_ENTRY( REGION_GFX4, 0, toki_tilelayout,  48*16, 16 )
361GFXDECODE_END
364362
365363static const gfx_layout tokib_charlayout =
366364{
r1051r1052
401399   16*16
402400};
403401
404static const gfx_decode tokib_gfxdecodeinfo[] =
405{
406   { REGION_GFX1, 0, &tokib_charlayout,   16*16, 16 },
407   { REGION_GFX2, 0, &tokib_spriteslayout,  0*16, 16 },
408   { REGION_GFX3, 0, &tokib_tilelayout,   32*16, 16 },
409   { REGION_GFX4, 0, &tokib_tilelayout,   48*16, 16 },
410   { -1 }
411};
402static GFXDECODE_START( tokib )
403   GFXDECODE_ENTRY( REGION_GFX1, 0, tokib_charlayout,   16*16, 16 )
404   GFXDECODE_ENTRY( REGION_GFX2, 0, tokib_spriteslayout,  0*16, 16 )
405   GFXDECODE_ENTRY( REGION_GFX3, 0, tokib_tilelayout,   32*16, 16 )
406   GFXDECODE_ENTRY( REGION_GFX4, 0, tokib_tilelayout,   48*16, 16 )
407GFXDECODE_END
412408
413409
414410/*****************************************************************************/
r1051r1052
441437   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
442438   MDRV_SCREEN_SIZE(32*8, 32*8)
443439   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)   /* verified */
444   MDRV_GFXDECODE(toki_gfxdecodeinfo)
440   MDRV_GFXDECODE(toki)
445441   MDRV_PALETTE_LENGTH(1024)
446442
447443   MDRV_VIDEO_START(toki)
r1051r1052
471467   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
472468   MDRV_SCREEN_SIZE(32*8, 32*8)
473469   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)   /* verified */
474   MDRV_GFXDECODE(tokib_gfxdecodeinfo)
470   MDRV_GFXDECODE(tokib)
475471   MDRV_PALETTE_LENGTH(1024)
476472
477473   MDRV_VIDEO_START(toki)
src/mame/drivers/dwarfd.c
r1051r1052
647647};
648648*/
649649
650static const gfx_decode gfxdecodeinfo[] =
651{
652   { REGION_GFX2, 0, &tiles8x8_layout, 0, 16 },
653   { REGION_GFX2, 0, &tiles8x8_layout0, 0, 16 },
654   { REGION_GFX2, 0, &tiles8x8_layout1, 0, 16 },
655   { REGION_GFX2, 0, &tiles8x8_layout2, 0, 16 },
656   { REGION_GFX2, 0, &tiles8x8_layout3, 0, 16 },
657   { -1 }
658};
650static GFXDECODE_START( dwarfd )
651   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout, 0, 16 )
652   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout0, 0, 16 )
653   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout1, 0, 16 )
654   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout2, 0, 16 )
655   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout3, 0, 16 )
656GFXDECODE_END
659657
660658PALETTE_INIT(dwarfd)
661659{
r1051r1052
699697   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
700698   MDRV_SCREEN_SIZE(272*2, 200)
701699   MDRV_SCREEN_VISIBLE_AREA(0, 272*2-1, 0, 200-1)
702   MDRV_GFXDECODE(gfxdecodeinfo)
700   MDRV_GFXDECODE(dwarfd)
703701   MDRV_PALETTE_LENGTH(0x100)
704702   MDRV_PALETTE_INIT(dwarfd)
705703
src/mame/drivers/40love.c
r1051r1052
10731073};
10741074
10751075
1076static const gfx_decode gfxdecodeinfo[] =
1077{
1078   { REGION_GFX2, 0, &char_layout, 0, 64 },
1079   { REGION_GFX1, 0, &sprite_layout, 0, 64 },
1080   { -1 }
1081};
1076static GFXDECODE_START( 40love )
1077   GFXDECODE_ENTRY( REGION_GFX2, 0, char_layout, 0, 64 )
1078   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout, 0, 64 )
1079GFXDECODE_END
10821080
10831081static struct AY8910interface ay8910_interface =
10841082{
r1051r1052
11201118   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11211119   MDRV_SCREEN_SIZE(64*8, 32*8)
11221120   MDRV_SCREEN_VISIBLE_AREA(128,128+255, 2*8, 30*8-1)
1123   MDRV_GFXDECODE(gfxdecodeinfo)
1121   MDRV_GFXDECODE(40love)
11241122   MDRV_PALETTE_LENGTH(1024)
11251123
11261124   MDRV_PALETTE_INIT(fortyl)
r1051r1052
11661164   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11671165   MDRV_SCREEN_SIZE(64*8, 32*8)
11681166   MDRV_SCREEN_VISIBLE_AREA(128,128+255, 2*8, 30*8-1)
1169   MDRV_GFXDECODE(gfxdecodeinfo)
1167   MDRV_GFXDECODE(40love)
11701168   MDRV_PALETTE_LENGTH(1024)
11711169
11721170   MDRV_PALETTE_INIT(fortyl)
src/mame/drivers/renegade.c
r1051r1052
719719   64*8 /* offset to next tile */
720720};
721721
722static const gfx_decode gfxdecodeinfo[] =
723{
722static GFXDECODE_START( renegade )
724723   /* 8x8 text, 8 colors */
725   { REGION_GFX1, 0x00000, &charlayout,    0, 4 },   /* colors   0- 32 */
724   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,    0, 4 )   /* colors   0- 32 */
726725
727726   /* 16x16 background tiles, 8 colors */
728   { REGION_GFX2, 0x00000, &tileslayout1, 192, 8 },   /* colors 192-255 */
729   { REGION_GFX2, 0x00000, &tileslayout2, 192, 8 },
730   { REGION_GFX2, 0x00000, &tileslayout3, 192, 8 },
731   { REGION_GFX2, 0x00000, &tileslayout4, 192, 8 },
727   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tileslayout1, 192, 8 )   /* colors 192-255 */
728   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tileslayout2, 192, 8 )
729   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tileslayout3, 192, 8 )
730   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tileslayout4, 192, 8 )
732731
733   { REGION_GFX2, 0x18000, &tileslayout1, 192, 8 },
734   { REGION_GFX2, 0x18000, &tileslayout2, 192, 8 },
735   { REGION_GFX2, 0x18000, &tileslayout3, 192, 8 },
736   { REGION_GFX2, 0x18000, &tileslayout4, 192, 8 },
732   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tileslayout1, 192, 8 )
733   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tileslayout2, 192, 8 )
734   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tileslayout3, 192, 8 )
735   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tileslayout4, 192, 8 )
737736
738737   /* 16x16 sprites, 8 colors */
739   { REGION_GFX3, 0x00000, &tileslayout1, 128, 4 },   /* colors 128-159 */
740   { REGION_GFX3, 0x00000, &tileslayout2, 128, 4 },
741   { REGION_GFX3, 0x00000, &tileslayout3, 128, 4 },
742   { REGION_GFX3, 0x00000, &tileslayout4, 128, 4 },
738   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tileslayout1, 128, 4 )   /* colors 128-159 */
739   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tileslayout2, 128, 4 )
740   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tileslayout3, 128, 4 )
741   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tileslayout4, 128, 4 )
743742
744   { REGION_GFX3, 0x18000, &tileslayout1, 128, 4 },
745   { REGION_GFX3, 0x18000, &tileslayout2, 128, 4 },
746   { REGION_GFX3, 0x18000, &tileslayout3, 128, 4 },
747   { REGION_GFX3, 0x18000, &tileslayout4, 128, 4 },
743   GFXDECODE_ENTRY( REGION_GFX3, 0x18000, tileslayout1, 128, 4 )
744   GFXDECODE_ENTRY( REGION_GFX3, 0x18000, tileslayout2, 128, 4 )
745   GFXDECODE_ENTRY( REGION_GFX3, 0x18000, tileslayout3, 128, 4 )
746   GFXDECODE_ENTRY( REGION_GFX3, 0x18000, tileslayout4, 128, 4 )
748747
749   { REGION_GFX3, 0x30000, &tileslayout1, 128, 4 },
750   { REGION_GFX3, 0x30000, &tileslayout2, 128, 4 },
751   { REGION_GFX3, 0x30000, &tileslayout3, 128, 4 },
752   { REGION_GFX3, 0x30000, &tileslayout4, 128, 4 },
748   GFXDECODE_ENTRY( REGION_GFX3, 0x30000, tileslayout1, 128, 4 )
749   GFXDECODE_ENTRY( REGION_GFX3, 0x30000, tileslayout2, 128, 4 )
750   GFXDECODE_ENTRY( REGION_GFX3, 0x30000, tileslayout3, 128, 4 )
751   GFXDECODE_ENTRY( REGION_GFX3, 0x30000, tileslayout4, 128, 4 )
753752
754   { REGION_GFX3, 0x48000, &tileslayout1, 128, 4 },
755   { REGION_GFX3, 0x48000, &tileslayout2, 128, 4 },
756   { REGION_GFX3, 0x48000, &tileslayout3, 128, 4 },
757   { REGION_GFX3, 0x48000, &tileslayout4, 128, 4 },
758   { -1 }
759};
753   GFXDECODE_ENTRY( REGION_GFX3, 0x48000, tileslayout1, 128, 4 )
754   GFXDECODE_ENTRY( REGION_GFX3, 0x48000, tileslayout2, 128, 4 )
755   GFXDECODE_ENTRY( REGION_GFX3, 0x48000, tileslayout3, 128, 4 )
756   GFXDECODE_ENTRY( REGION_GFX3, 0x48000, tileslayout4, 128, 4 )
757GFXDECODE_END
760758
761759
762760
r1051r1052
805803   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
806804   MDRV_SCREEN_SIZE(32*8, 32*8)
807805   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0, 30*8-1)
808   MDRV_GFXDECODE(gfxdecodeinfo)
806   MDRV_GFXDECODE(renegade)
809807   MDRV_PALETTE_LENGTH(256)
810808
811809   MDRV_VIDEO_START(renegade)
src/mame/drivers/sg1000a.c
r1051r1052
8181               no                off
8282not used                               off
8383
84Hold Service + 1P start on power up = test mode
84Hold Service + 1P start = test mode
8585
8686
8787CN1               CN2                       CN3
r1051r1052
116116#include "video/tms9928a.h"
117117#include "machine/segacrpt.h"
118118
119/*************************************
120 *
121 *  CPU memory handlers
122 *
123 *************************************/
124
119125static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
120126   AM_RANGE(0x0000, 0x7FFF) AM_READ(MRA8_ROM)
121127   AM_RANGE(0x8000, 0xbFFF) AM_READ(MRA8_ROM)
r1051r1052
146152   AM_RANGE(0x7f, 0x7F) AM_WRITE(SN76496_0_w)
147153ADDRESS_MAP_END
148154
149INPUT_PORTS_START( chwrestl )
150   PORT_START
151   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
152   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
153   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
154   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
155   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
156   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
157   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
158   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_START2 )
155/*************************************
156 *
157 *  Generic Port definitions
158 *
159 *************************************/
159160
160   PORT_START
161static INPUT_PORTS_START( sg1000 )
162   PORT_START_TAG("IN0")
161163   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
162164   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
163165   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
164166   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
165167   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
166168   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
167   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
168   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
169
170   PORT_START
171   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
172   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
173   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
174   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
175   PORT_DIPSETTING(    0x40, DEF_STR( Off ))
176   PORT_DIPSETTING(    0x00, DEF_STR( On ))
177   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_B ) )
178   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
179   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
180   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
181   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
182INPUT_PORTS_END
183
184
185INPUT_PORTS_START( chboxing )
186   PORT_START
187   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
188   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
189   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
190   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
191   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
192   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
193169   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
194170   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_START2 )
195171
196   PORT_START
172   PORT_START_TAG("IN1")
197173   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
198174   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
199175   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
200176   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
201177   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
202178   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
203   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
204   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
179   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
180   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
205181
206    PORT_START
207    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Language ) )
208   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
209   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
210   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
211   PORT_DIPSETTING(    0x40, DEF_STR( Off ))
212   PORT_DIPSETTING(    0x00, DEF_STR( On ))
213   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_B ) )
182   PORT_START_TAG("DSW")
183   PORT_BIT ( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
184   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:1,2")
214185   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
215186   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
216187   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
217188   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
189   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW:3")
190   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
191   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
192   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("DSW:4")
193   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
194   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
218195INPUT_PORTS_END
219196
220INPUT_PORTS_START( dokidoki )
221   PORT_START
222   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
223   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
224   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
225   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
226   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
227   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
228   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
229   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_START2 )
197/*************************************
198 *
199 *  Port definitions
200 *
201 *************************************/
230202
231   PORT_START
203INPUT_PORTS_START( chwrestl )
204   PORT_INCLUDE( sg1000 )
205
206   PORT_MODIFY("IN0")
232207   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
233208   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
234209   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
235210   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
236211   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
237212   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
238   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
239   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
240213
241   PORT_START
242   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
243   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
245   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
246   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
247   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
248   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
249   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
250   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
251   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
252   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
254   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
255   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
256   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
257   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
258   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
259   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
260   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
261   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
262   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
263   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
214   PORT_MODIFY("IN1")
215   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
216   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
217   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
218   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
219   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
220   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
221INPUT_PORTS_END
222
223
224INPUT_PORTS_START( chboxing )
225   PORT_INCLUDE( sg1000 )
226
227   PORT_MODIFY("DSW")
228   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("DSW:4")
229   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
230   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
231INPUT_PORTS_END
232
233
234INPUT_PORTS_START( dokidoki )
235   PORT_INCLUDE( sg1000 )
236
237   PORT_MODIFY("DSW")
238   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW:4")
264239   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
265240   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
266241INPUT_PORTS_END
267242
268243
269
270244static INTERRUPT_GEN( sg100a_interrupt )
271245{
272246   TMS9928A_interrupt();
r1051r1052
285259   vdp_interrupt
286260};
287261
262/*************************************
263 *
264 *  Machine drivers
265 *
266 *************************************/
267
288268static MACHINE_DRIVER_START( sg1000a )
289269   MDRV_CPU_ADD(Z80, 3579545)       /* 3.579545 Mhz */
290270   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
r1051r1052
303283   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
304284MACHINE_DRIVER_END
305285
286/*************************************
287 *
288 *  ROM definitions
289 *
290 *************************************/
306291
307292ROM_START( chwrestl )
308293   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )
r1051r1052
325310   ROM_LOAD( "epr-7358.ic3",   0x8000, 0x4000, CRC(c6f26b0b) SHA1(3753e05b6e77159832dbe88562ba7a818120d1a3) )
326311ROM_END
327312
313/*************************************
314 *
315 *  Driver initialization
316 *
317 *************************************/
318
328319DRIVER_INIT( sg1000a )
329320{
330321   TMS9928A_configure(&tms9928a_interface);
r1051r1052
336327   regulus_decode();
337328}
338329
330/*************************************
331 *
332 *  Game drivers
333 *
334 *************************************/
335
339336GAME( 1984, chboxing, 0, sg1000a, chboxing, sg1000a,  ROT0, "Sega", "Champion Boxing", 0)
340337GAME( 1985, chwrestl, 0, sg1000a, chwrestl, chwrestl, ROT0, "Sega", "Champion Pro Wrestling", 0)
341338GAME( 1985, dokidoki, 0, sg1000a, dokidoki, sg1000a,  ROT0, "Sega", "Doki Doki Penguin Land", 0)
src/mame/drivers/galaga.c
r1051r1052
15511551   16*8
15521552};
15531553
1554static const gfx_decode gfxdecodeinfo_bosco[] =
1555{
1556   { REGION_GFX1, 0, &charlayout_2bpp,       0, 64 },
1557   { REGION_GFX2, 0, &spritelayout_bosco, 64*4, 64 },
1558   { REGION_GFX3, 0, &dotlayout,     64*4+64*4,  1 },
1559   { -1 }
1560};
1554static GFXDECODE_START( bosco )
1555   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_2bpp,       0, 64 )
1556   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_bosco, 64*4, 64 )
1557   GFXDECODE_ENTRY( REGION_GFX3, 0, dotlayout,     64*4+64*4,  1 )
1558GFXDECODE_END
15611559
1562static const gfx_decode gfxdecodeinfo_galaga[] =
1563{
1564   { REGION_GFX1, 0, &charlayout_2bpp,        0, 64 },
1565   { REGION_GFX2, 0, &spritelayout_galaga, 64*4, 64 },
1566   { -1 }
1567};
1560static GFXDECODE_START( galaga )
1561   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_2bpp,        0, 64 )
1562   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_galaga, 64*4, 64 )
1563GFXDECODE_END
15681564
1569static const gfx_decode gfxdecodeinfo_xevious[] =
1570{
1571   { REGION_GFX1, 0, &charlayout_xevious, 128*4+64*8,  64 },
1572   { REGION_GFX2, 0, &bgcharlayout,                0, 128 },
1573   { REGION_GFX3, 0, &spritelayout_xevious,    128*4,  64 },
1574   { -1 }
1575};
1565static GFXDECODE_START( xevious )
1566   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_xevious, 128*4+64*8,  64 )
1567   GFXDECODE_ENTRY( REGION_GFX2, 0, bgcharlayout,                0, 128 )
1568   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_xevious,    128*4,  64 )
1569GFXDECODE_END
15761570
1577static const gfx_decode gfxdecodeinfo_digdug[] =
1578{
1579   { REGION_GFX1, 0, &charlayout_digdug,         0, 16 },
1580   { REGION_GFX2, 0, &spritelayout_galaga,    16*2, 64 },
1581   { REGION_GFX3, 0, &charlayout_2bpp, 64*4 + 16*2, 64 },
1582   { -1 }
1583};
1571static GFXDECODE_START( digdug )
1572   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_digdug,         0, 16 )
1573   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_galaga,    16*2, 64 )
1574   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout_2bpp, 64*4 + 16*2, 64 )
1575GFXDECODE_END
15841576
15851577
15861578/* The resistance path of the namco sound is 16k compared to
r1051r1052
16651657   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16661658   MDRV_SCREEN_SIZE(36*8, 32*8)
16671659   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
1668   MDRV_GFXDECODE(gfxdecodeinfo_bosco)
1660   MDRV_GFXDECODE(bosco)
16691661   MDRV_PALETTE_LENGTH(64*4+64*4+4+64)
16701662
16711663   MDRV_PALETTE_INIT(bosco)
r1051r1052
16861678
16871679   /* discrete circuit on the 54XX outputs */
16881680   MDRV_SOUND_ADD_TAG("Discrete", DISCRETE, 0)
1689   MDRV_SOUND_CONFIG(bosco_discrete_interface)
1681   MDRV_SOUND_CONFIG_DISCRETE(bosco)
16901682   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
16911683MACHINE_DRIVER_END
16921684
r1051r1052
17231715   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17241716   MDRV_SCREEN_SIZE(36*8, 28*8)
17251717   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1726   MDRV_GFXDECODE(gfxdecodeinfo_galaga)
1718   MDRV_GFXDECODE(galaga)
17271719   MDRV_PALETTE_LENGTH(64*4+64*4+64)
17281720
17291721   MDRV_PALETTE_INIT(galaga)
r1051r1052
17401732
17411733   /* discrete circuit on the 54XX outputs */
17421734   MDRV_SOUND_ADD_TAG("Discrete", DISCRETE, 0)
1743   MDRV_SOUND_CONFIG(galaga_discrete_interface)
1735   MDRV_SOUND_CONFIG_DISCRETE(galaga)
17441736   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
17451737MACHINE_DRIVER_END
17461738
r1051r1052
17961788   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17971789   MDRV_SCREEN_SIZE(36*8, 28*8)
17981790   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1799   MDRV_GFXDECODE(gfxdecodeinfo_xevious)
1791   MDRV_GFXDECODE(xevious)
18001792   MDRV_PALETTE_LENGTH(128*4+64*8+64*2)
18011793
18021794   MDRV_PALETTE_INIT(xevious)
r1051r1052
18121804
18131805   /* discrete circuit on the 54XX outputs */
18141806   MDRV_SOUND_ADD_TAG("Discrete", DISCRETE, 0)
1815   MDRV_SOUND_CONFIG(galaga_discrete_interface)
1807   MDRV_SOUND_CONFIG_DISCRETE(galaga)
18161808   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
18171809MACHINE_DRIVER_END
18181810
r1051r1052
18691861   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18701862   MDRV_SCREEN_SIZE(36*8, 28*8)
18711863   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1872   MDRV_GFXDECODE(gfxdecodeinfo_digdug)
1864   MDRV_GFXDECODE(digdug)
18731865   MDRV_PALETTE_LENGTH(16*2+64*4+64*4)
18741866
18751867   MDRV_PALETTE_INIT(digdug)
r1051r1052
31443136GAME( 1982, digdugat, digdug,  digdug,  digdug,   0,       ROT90, "[Namco] (Atari license)", "Dig Dug (Atari, rev 2)", GAME_SUPPORTS_SAVE )
31453137GAME( 1982, digduga1, digdug,  digdug,  digdug,   0,       ROT90, "[Namco] (Atari license)", "Dig Dug (Atari, rev 1)", GAME_SUPPORTS_SAVE )
31463138GAME( 1982, dzigzag,  digdug,  dzigzag, digdug,   0,       ROT90, "bootleg", "Zig Zag (Dig Dug hardware)", GAME_SUPPORTS_SAVE )
3147GAME( 1982, digsid,   digdug,  digdug, digdug,    0,       ROT90, "bootleg", "Dig Dug (Sidam license)", GAME_SUPPORTS_SAVE ) // still has Namco copyright intact
3139GAME( 1982, digsid,   digdug,  digdug, digdug,    0,       ROT90, "[Namco] (Sidam license)", "Dig Dug (Sidam)", GAME_SUPPORTS_SAVE ) // still has Namco copyright intact
src/mame/drivers/panicr.c
r1051r1052
342342   32*16
343343};
344344
345static const gfx_decode gfxdecodeinfo[] =
346{
347   { REGION_GFX1, 0, &charlayout,   0x000,  8 },
348   { REGION_GFX2, 0, &tilelayout,   0x100, 16 },
349   { REGION_GFX3, 0, &spritelayout, 0x200, 16 },
350   { -1 }
351};
345static GFXDECODE_START( panicr )
346   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x000,  8 )
347   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0x100, 16 )
348   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x200, 16 )
349GFXDECODE_END
352350
353351static MACHINE_DRIVER_START( panicr )
354352   MDRV_CPU_ADD(V20,16000000/2) /* Sony 8623h9 CXQ70116D-8 (V20 compatible) */
r1051r1052
365363   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
366364   MDRV_SCREEN_SIZE(32*8, 32*8)
367365   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
368   MDRV_GFXDECODE(gfxdecodeinfo)
366   MDRV_GFXDECODE(panicr)
369367   MDRV_PALETTE_LENGTH(256)
370368   MDRV_COLORTABLE_LENGTH(256*3)
371369   MDRV_PALETTE_INIT(panicr)
src/mame/drivers/istellar.c
r1051r1052
302302   8*8
303303};
304304
305static const gfx_decode gfxdecodeinfo[] =
306{
307   { REGION_GFX1, 0, &istellar_gfx_layout, 0x0, 0x100 },
308   { -1 }
309};
305static GFXDECODE_START( istellar )
306   GFXDECODE_ENTRY( REGION_GFX1, 0, istellar_gfx_layout, 0x0, 0x100 )
307GFXDECODE_END
310308
311309static MACHINE_START( istellar )
312310{
r1051r1052
360358   MDRV_PALETTE_LENGTH(256)
361359   MDRV_PALETTE_INIT(istellar)
362360
363   MDRV_GFXDECODE(gfxdecodeinfo)
361   MDRV_GFXDECODE(istellar)
364362   MDRV_VIDEO_UPDATE(istellar)
365363
366364/*  sound */
src/mame/drivers/lasso.c
r1051r1052
610610};
611611
612612
613static const gfx_decode lasso_gfxdecodeinfo[] =
614{
615   { REGION_GFX1, 0, &lasso_charlayout,   0, 16 },
616   { REGION_GFX1, 0, &lasso_spritelayout, 0, 16 },
617   { -1 }
618};
613static GFXDECODE_START( lasso )
614   GFXDECODE_ENTRY( REGION_GFX1, 0, lasso_charlayout,   0, 16 )
615   GFXDECODE_ENTRY( REGION_GFX1, 0, lasso_spritelayout, 0, 16 )
616GFXDECODE_END
619617
620static const gfx_decode wwjgtin_gfxdecodeinfo[] =
621{
622   { REGION_GFX1, 0, &lasso_charlayout,       0, 16 },
623   { REGION_GFX1, 0, &lasso_spritelayout,     0, 16 },
624   { REGION_GFX2, 0, &wwjgtin_tracklayout,   4*16, 16 },
625   { -1 }
626};
618static GFXDECODE_START( wwjgtin )
619   GFXDECODE_ENTRY( REGION_GFX1, 0, lasso_charlayout,       0, 16 )
620   GFXDECODE_ENTRY( REGION_GFX1, 0, lasso_spritelayout,     0, 16 )
621   GFXDECODE_ENTRY( REGION_GFX2, 0, wwjgtin_tracklayout,   4*16, 16 )
622GFXDECODE_END
627623
628static const gfx_decode pinbo_gfxdecodeinfo[] =
629{
630   { REGION_GFX1, 0, &pinbo_charlayout,   0, 16 },
631   { REGION_GFX1, 0, &pinbo_spritelayout, 0, 16 },
632   { -1 }
633};
624static GFXDECODE_START( pinbo )
625   GFXDECODE_ENTRY( REGION_GFX1, 0, pinbo_charlayout,   0, 16 )
626   GFXDECODE_ENTRY( REGION_GFX1, 0, pinbo_spritelayout, 0, 16 )
627GFXDECODE_END
634628
635629
636630
r1051r1052
659653   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
660654   MDRV_SCREEN_SIZE(32*8, 32*8)
661655   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
662   MDRV_GFXDECODE(lasso_gfxdecodeinfo)
656   MDRV_GFXDECODE(lasso)
663657   MDRV_PALETTE_LENGTH(0x40)
664658
665659   MDRV_PALETTE_INIT(lasso)
r1051r1052
706700
707701   /* video hardware */
708702   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)   // Smaller visible area?
709   MDRV_GFXDECODE(wwjgtin_gfxdecodeinfo)   // Has 1 additional layer
703   MDRV_GFXDECODE(wwjgtin)   // Has 1 additional layer
710704   MDRV_PALETTE_LENGTH(0x40+1)
711705   MDRV_COLORTABLE_LENGTH(4*16 + 16*16)   // Reserve 1 color for black
712706
r1051r1052
735729   MDRV_MACHINE_START(pinbo)
736730
737731   /* video hardware */
738   MDRV_GFXDECODE(pinbo_gfxdecodeinfo)
732   MDRV_GFXDECODE(pinbo)
739733   MDRV_PALETTE_LENGTH(256)
740734
741735   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/macs.c
r1051r1052
142142   AM_RANGE(0xf0, 0xf0) AM_READ(st0016_dma_r)
143143ADDRESS_MAP_END
144144
145static const gfx_decode gfxdecodeinfo[] =
146{
147//  { 0, 0, &charlayout,      0, 16*4  },
148   { -1 }   /* end of array */
149};
145static GFXDECODE_START( macs )
146//  GFXDECODE_ENTRY( 0, 0, charlayout,      0, 16*4  )
147GFXDECODE_END
150148
151149INPUT_PORTS_START( macs )
152150   /*0*/
r1051r1052
366364   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
367365   MDRV_SCREEN_SIZE(128*8, 128*8)
368366   MDRV_SCREEN_VISIBLE_AREA(0*8, 128*8-1, 0*8, 128*8-1)
369   MDRV_GFXDECODE(gfxdecodeinfo)
367   MDRV_GFXDECODE(macs)
370368   MDRV_PALETTE_LENGTH(16*16*4+1)
371369
372370   MDRV_VIDEO_START(st0016)
src/mame/drivers/sbowling.c
r1051r1052
281281   8*8
282282};
283283
284static const gfx_decode gfxdecodeinfo[] =
285{
286   { REGION_GFX1, 0, &charlayout,   0x18, 1 },
287   { -1 }
288};
284static GFXDECODE_START( sbowling )
285   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x18, 1 )
286GFXDECODE_END
289287
290288
291289static PALETTE_INIT( sbowling )
r1051r1052
334332   MDRV_CPU_IO_MAP(port_map,0)
335333   MDRV_CPU_VBLANK_INT(sbw_interrupt, 2)
336334   MDRV_SCREEN_REFRESH_RATE(60)
337   MDRV_GFXDECODE(gfxdecodeinfo)
335   MDRV_GFXDECODE(sbowling)
338336
339337   /* video hardware */
340338   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/psychic5.c
r1051r1052
451451    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
452452
453453    PORT_START_TAG("DSW0")
454    PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
454    PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
455455    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
456456    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
457457    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
r1051r1052
526526   128*8   /* every char takes 128 consecutive bytes */
527527};
528528
529static const gfx_decode gfxdecodeinfo[] =
530{
531   { REGION_GFX1, 0, &spritelayout,  0*16, 16 },
532   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
533   { REGION_GFX3, 0, &charlayout,   32*16, 16 },
534   { -1 }
535};
529static GFXDECODE_START( psychic5 )
530   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,  0*16, 16 )
531   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
532   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,   32*16, 16 )
533GFXDECODE_END
536534
537535
538536
r1051r1052
569567   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
570568   MDRV_SCREEN_SIZE(32*8, 32*8)
571569   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
572   MDRV_GFXDECODE(gfxdecodeinfo)
570   MDRV_GFXDECODE(psychic5)
573571   MDRV_PALETTE_LENGTH(768)
574572
575573   MDRV_VIDEO_START(psychic5)
src/mame/drivers/taito_h.c
r1051r1052
551551};
552552
553553
554static const gfx_decode syvalion_gfxdecodeinfo[] =
555{
556   { REGION_GFX1, 0, &tilelayout, 0,     32*16 },
557   { -1 }
558};
554static GFXDECODE_START( syvalion )
555   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0,     32*16 )
556GFXDECODE_END
559557
560static const gfx_decode recordbr_gfxdecodeinfo[] =
561{
562   { REGION_GFX1, 0, &tilelayout, 0,     32*16 },
563   { -1 }
564};
558static GFXDECODE_START( recordbr )
559   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0,     32*16 )
560GFXDECODE_END
565561
566static const gfx_decode dleague_gfxdecodeinfo[] =
567{
568   { REGION_GFX1, 0, &tilelayout, 0,     32*16 },
569   { REGION_GFX2, 0, &charlayout, 32*16, 16    },   // seems to be bogus...?
570   { -1 }
571};
562static GFXDECODE_START( dleague )
563   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0,     32*16 )
564   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 32*16, 16    )   // seems to be bogus...?
565GFXDECODE_END
572566
573567
574568static MACHINE_START( taitoh )
r1051r1052
599593   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
600594   MDRV_SCREEN_SIZE(64*16, 64*16)
601595   MDRV_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 3*16, 28*16-1)
602   MDRV_GFXDECODE(syvalion_gfxdecodeinfo)
596   MDRV_GFXDECODE(syvalion)
603597   MDRV_PALETTE_LENGTH(33*16)
604598
605599   MDRV_VIDEO_START(syvalion)
r1051r1052
637631   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
638632   MDRV_SCREEN_SIZE(64*16, 64*16)
639633   MDRV_SCREEN_VISIBLE_AREA(1*16, 21*16-1, 2*16, 17*16-1)
640   MDRV_GFXDECODE(recordbr_gfxdecodeinfo)
634   MDRV_GFXDECODE(recordbr)
641635   MDRV_PALETTE_LENGTH(32*16)
642636
643637   MDRV_VIDEO_START(recordbr)
r1051r1052
675669   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
676670   MDRV_SCREEN_SIZE(64*16, 64*16)
677671   MDRV_SCREEN_VISIBLE_AREA(1*16, 21*16-1, 2*16, 17*16-1)
678   MDRV_GFXDECODE(dleague_gfxdecodeinfo)
672   MDRV_GFXDECODE(dleague)
679673   MDRV_PALETTE_LENGTH(33*16)
680674
681675   MDRV_VIDEO_START(dleague)
src/mame/drivers/good.c
r1051r1052
266266};
267267
268268
269static const gfx_decode gfxdecodeinfo[] =
270{
271   { REGION_GFX1, 0, &good_layout2,  0x100, 16  }, /* fg tiles */
272   { REGION_GFX1, 0, &good_layout2,  0x200, 16  }, /* fg tiles */
273   { -1 }
274};
269static GFXDECODE_START( good )
270   GFXDECODE_ENTRY( REGION_GFX1, 0, good_layout2,  0x100, 16  ) /* fg tiles */
271   GFXDECODE_ENTRY( REGION_GFX1, 0, good_layout2,  0x200, 16  ) /* fg tiles */
272GFXDECODE_END
275273
276274
277275static MACHINE_DRIVER_START( good )
r1051r1052
282280   MDRV_SCREEN_REFRESH_RATE(60)
283281   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
284282
285   MDRV_GFXDECODE(gfxdecodeinfo)
283   MDRV_GFXDECODE(good)
286284
287285   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
288286   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/8080bw.c
r1051r1052
14021402   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
14031403
14041404   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1405   MDRV_SOUND_CONFIG(schaser_discrete_interface)
1405   MDRV_SOUND_CONFIG_DISCRETE(schaser)
14061406   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
14071407
14081408MACHINE_DRIVER_END
r1051r1052
17721772   MDRV_SPEAKER_STANDARD_MONO("mono")
17731773
17741774   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1775   MDRV_SOUND_CONFIG(polaris_discrete_interface)
1775   MDRV_SOUND_CONFIG_DISCRETE(polaris)
17761776   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
17771777
17781778MACHINE_DRIVER_END
r1051r1052
23012301   MDRV_IMPORT_FROM(invaders_samples_audio)
23022302
23032303   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
2304   MDRV_SOUND_CONFIG(indianbt_discrete_interface)
2304   MDRV_SOUND_CONFIG_DISCRETE(indianbt)
23052305   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
23062306
23072307MACHINE_DRIVER_END
src/mame/drivers/othunder.c
r1051r1052
672672   32*8
673673};
674674
675static const gfx_decode othunder_gfxdecodeinfo[] =
676{
677   { REGION_GFX2, 0, &tile16x8_layout, 0, 256 },   /* sprite parts */
678   { REGION_GFX1, 0, &charlayout,      0, 256 },   /* sprites & playfield */
679   { -1 }
680};
675static GFXDECODE_START( othunder )
676   GFXDECODE_ENTRY( REGION_GFX2, 0, tile16x8_layout, 0, 256 )   /* sprite parts */
677   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 256 )   /* sprites & playfield */
678GFXDECODE_END
681679
682680
683681
r1051r1052
728726   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
729727   MDRV_SCREEN_SIZE(40*8, 32*8)
730728   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
731   MDRV_GFXDECODE(othunder_gfxdecodeinfo)
729   MDRV_GFXDECODE(othunder)
732730   MDRV_PALETTE_LENGTH(4096)
733731
734732   MDRV_VIDEO_START(othunder)
src/mame/drivers/ginganin.c
r1051r1052
300300layout8x8  (txtlayout,    0x04000)
301301layout16x16(spritelayout,0x50000)
302302
303static const gfx_decode gfxdecodeinfo[] =
304{
305   { REGION_GFX1, 0, &tilelayout,    256*3, 16 }, /* [0] bg */
306   { REGION_GFX2, 0, &tilelayout,    256*2, 16 }, /* [1] fg */
307   { REGION_GFX3, 0, &txtlayout,    256*0, 16 }, /* [2] txt */
308   { REGION_GFX4, 0, &spritelayout, 256*1, 16 }, /* [3] sprites */
309   { -1 }
310};
303static GFXDECODE_START( ginganin )
304   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,    256*3, 16 ) /* [0] bg */
305   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    256*2, 16 ) /* [1] fg */
306   GFXDECODE_ENTRY( REGION_GFX3, 0, txtlayout,    256*0, 16 ) /* [2] txt */
307   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 256*1, 16 ) /* [3] sprites */
308GFXDECODE_END
311309
312310
313311
r1051r1052
367365   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
368366   MDRV_SCREEN_SIZE(256, 256)
369367   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0 + 16 , 255 - 16)
370   MDRV_GFXDECODE(gfxdecodeinfo)
368   MDRV_GFXDECODE(ginganin)
371369   MDRV_PALETTE_LENGTH(1024)
372370
373371   MDRV_VIDEO_START(ginganin)
src/mame/drivers/tail2nos.c
r1051r1052
237237   128*8
238238};
239239
240static const gfx_decode tail2nos_gfxdecodeinfo[] =
241{
242   { REGION_GFX1, 0, &tail2nos_charlayout,   0, 128 },
243   { REGION_GFX2, 0, &tail2nos_spritelayout, 0, 128 },
244   { -1 }
245};
240static GFXDECODE_START( tail2nos )
241   GFXDECODE_ENTRY( REGION_GFX1, 0, tail2nos_charlayout,   0, 128 )
242   GFXDECODE_ENTRY( REGION_GFX2, 0, tail2nos_spritelayout, 0, 128 )
243GFXDECODE_END
246244
247245
248246
r1051r1052
285283   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
286284   MDRV_SCREEN_SIZE(64*8, 32*8)
287285   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
288   MDRV_GFXDECODE(tail2nos_gfxdecodeinfo)
286   MDRV_GFXDECODE(tail2nos)
289287   MDRV_PALETTE_LENGTH(2048)
290288
291289   MDRV_VIDEO_START(tail2nos)
src/mame/drivers/mrjong.c
r1051r1052
170170   32*8            /* every sprite takes 32 consecutive bytes */
171171};
172172
173static const gfx_decode gfxdecodeinfo[] =
174{
175   { REGION_GFX1, 0x0000, &tilelayout,      0, 32 },
176   { REGION_GFX1, 0x0000, &spritelayout,    0, 32 },
177   { -1 }      /* end of array */
178};
173static GFXDECODE_START( mrjong )
174   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tilelayout,      0, 32 )
175   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,    0, 32 )
176GFXDECODE_END
179177
180178
181179static MACHINE_DRIVER_START( mrjong )
r1051r1052
194192   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
195193   MDRV_SCREEN_SIZE(32*8, 32*8)
196194   MDRV_SCREEN_VISIBLE_AREA(0*8, 30*8-1, 2*8, 30*8-1)
197   MDRV_GFXDECODE(gfxdecodeinfo)
195   MDRV_GFXDECODE(mrjong)
198196   MDRV_PALETTE_LENGTH(16)
199197   MDRV_COLORTABLE_LENGTH(4*32)
200198
src/mame/drivers/quasar.c
r1051r1052
404404   8*8   /* every char takes 8 consecutive bytes */
405405};
406406
407static const gfx_decode gfxdecodeinfo[] =
408{
409   { REGION_GFX1, 0x0000, &charlayout,     0, 256},      /* Rom chars */
410   { REGION_GFX1, 0x0000, &charlayout8colour, 0, 259 },   /* Ram chars (NOT USED) */
411     { REGION_GFX1, 0x0000, &s2636_character10, 2072, 8 },   /* s2636 #1  */
412     { REGION_GFX1, 0x0000, &s2636_character10, 2072, 8 },   /* s2636 #2  */
413     { REGION_GFX1, 0x0000, &s2636_character10, 2072, 8 },   /* s2636 #3  */
414   { -1 }
415};
407static GFXDECODE_START( quasar )
408   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,     0, 256)      /* Rom chars */
409   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout8colour, 0, 259 )   /* Ram chars (NOT USED) */
410     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #1  */
411     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #2  */
412     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #3  */
413GFXDECODE_END
416414
417415static INTERRUPT_GEN( quasar_interrupt )
418416{
r1051r1052
445443   MDRV_SCREEN_SIZE(256, 256)
446444   MDRV_SCREEN_VISIBLE_AREA(1*8+1, 29*8-1, 2*8, 32*8-1)
447445
448   MDRV_GFXDECODE(gfxdecodeinfo)
446   MDRV_GFXDECODE(quasar)
449447   MDRV_PALETTE_LENGTH(1024)
450448   MDRV_COLORTABLE_LENGTH(4096)
451449
src/mame/drivers/slapshot.c
r1051r1052
515515   128*8     /* every sprite takes 128 consecutive bytes */
516516};
517517
518static const gfx_decode slapshot_gfxdecodeinfo[] =
519{
520   { REGION_GFX2, 0x0, &tilelayout,  0, 256 },   /* sprite parts */
521   { REGION_GFX1, 0x0, &slapshot_charlayout,  0, 256 },   /* sprites & playfield */
522   { -1 }
523};
518static GFXDECODE_START( slapshot )
519   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tilelayout,  0, 256 )   /* sprite parts */
520   GFXDECODE_ENTRY( REGION_GFX1, 0x0, slapshot_charlayout,  0, 256 )   /* sprites & playfield */
521GFXDECODE_END
524522
525523
526524
r1051r1052
569567   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
570568   MDRV_SCREEN_SIZE(40*8, 32*8)
571569   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
572   MDRV_GFXDECODE(slapshot_gfxdecodeinfo)
570   MDRV_GFXDECODE(slapshot)
573571   MDRV_PALETTE_LENGTH(8192)
574572
575573   MDRV_VIDEO_START(slapshot)
r1051r1052
609607   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
610608   MDRV_SCREEN_SIZE(40*8, 32*8)
611609   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
612   MDRV_GFXDECODE(slapshot_gfxdecodeinfo)
610   MDRV_GFXDECODE(slapshot)
613611   MDRV_PALETTE_LENGTH(8192)
614612
615613   MDRV_VIDEO_START(slapshot)
src/mame/drivers/xyonix.c
r1051r1052
234234   4*16
235235};
236236
237static const gfx_decode gfxdecodeinfo[] =
238{
239   { REGION_GFX1, 0, &charlayout, 0, 16 },
240   { -1 }
241};
237static GFXDECODE_START( xyonix )
238   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
239GFXDECODE_END
242240
243241/* MACHINE driver *************************************************************/
244242
r1051r1052
259257   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
260258   MDRV_SCREEN_SIZE(80*4, 32*8)
261259   MDRV_SCREEN_VISIBLE_AREA(0, 80*4-1, 0, 28*8-1)
262   MDRV_GFXDECODE(gfxdecodeinfo)
260   MDRV_GFXDECODE(xyonix)
263261   MDRV_PALETTE_LENGTH(256)
264262
265263   MDRV_PALETTE_INIT(xyonix)
src/mame/drivers/1943.c
r1051r1052
238238
239239/* Graphics Decode Info */
240240
241static const gfx_decode gfxdecodeinfo[] =
242{
243   { REGION_GFX1, 0, &charlayout,                  0, 32 },
244   { REGION_GFX2, 0, &tilelayout,               32*4, 16 },
245   { REGION_GFX3, 0, &bgtilelayout,       32*4+16*16, 16 },
246   { REGION_GFX4, 0, &spritelayout, 32*4+16*16+16*16, 16 },
247   { -1 }
248};
241static GFXDECODE_START( 1943 )
242   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,                  0, 32 )
243   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,               32*4, 16 )
244   GFXDECODE_ENTRY( REGION_GFX3, 0, bgtilelayout,       32*4+16*16, 16 )
245   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 32*4+16*16+16*16, 16 )
246GFXDECODE_END
249247
250248/* Machine Driver */
251249
r1051r1052
268266   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
269267   MDRV_SCREEN_SIZE(32*8, 32*8)
270268   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
271   MDRV_GFXDECODE(gfxdecodeinfo)
269   MDRV_GFXDECODE(1943)
272270   MDRV_PALETTE_LENGTH(256)
273271   MDRV_COLORTABLE_LENGTH(32*4+16*16+16*16+16*16)
274272
src/mame/drivers/cninja.c
r1051r1052
798798   64*8
799799};
800800
801static const gfx_decode gfxdecodeinfo[] =
802{
803   { REGION_GFX1, 0, &charlayout,    0, 32 },   /* Characters 8x8 */
804   { REGION_GFX2, 0, &tilelayout,    0, 32 },   /* Tiles 16x16 */
805   { REGION_GFX3, 0, &tilelayout,  512, 64 },   /* Tiles 16x16 */
806   { REGION_GFX4, 0, &spritelayout,768, 32 },   /* Sprites 16x16 */
807   { -1 }
808};
801static GFXDECODE_START( cninja )
802   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 32 )   /* Characters 8x8 */
803   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    0, 32 )   /* Tiles 16x16 */
804   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,  512, 64 )   /* Tiles 16x16 */
805   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,768, 32 )   /* Sprites 16x16 */
806GFXDECODE_END
809807
810static const gfx_decode gfxdecodeinfo_robocop2[] =
811{
812   { REGION_GFX1, 0, &charlayout,    0, 32 },   /* Characters 8x8 */
813   { REGION_GFX2, 0, &tilelayout,    0, 32 },   /* Tiles 16x16 */
814   { REGION_GFX3, 0, &tilelayout,  512, 64 },   /* Tiles 16x16 */
815   { REGION_GFX4, 0, &spritelayout,768, 32 },   /* Sprites 16x16 */
816   { REGION_GFX3, 0, &tilelayout_8bpp,  512, 1 },   /* Tiles 16x16 */
817   { -1 }
818};
808static GFXDECODE_START( robocop2 )
809   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 32 )   /* Characters 8x8 */
810   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    0, 32 )   /* Tiles 16x16 */
811   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,  512, 64 )   /* Tiles 16x16 */
812   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,768, 32 )   /* Sprites 16x16 */
813   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout_8bpp,  512, 1 )   /* Tiles 16x16 */
814GFXDECODE_END
819815
820static const gfx_decode gfxdecodeinfo_mutantf[] =
821{
822   { REGION_GFX1, 0, &charlayout,          0, 64 },   /* Characters 8x8 */
823   { REGION_GFX2, 0, &tilelayout,          0, 64 },   /* Tiles 16x16 */
824   { REGION_GFX3, 0, &tilelayout,          0, 64 },   /* Tiles 16x16 */
825   { REGION_GFX4, 0, &spritelayout,      256, 128 },   /* Sprites 16x16 */
826   { REGION_GFX5, 0, &spritelayout,     1024+768, 16 },   /* Sprites 16x16 */
827   { -1 }
828};
816static GFXDECODE_START( mutantf )
817   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 64 )   /* Characters 8x8 */
818   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,          0, 64 )   /* Tiles 16x16 */
819   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,          0, 64 )   /* Tiles 16x16 */
820   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,      256, 128 )   /* Sprites 16x16 */
821   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout,     1024+768, 16 )   /* Sprites 16x16 */
822GFXDECODE_END
829823
830824/**********************************************************************************/
831825
r1051r1052
884878   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
885879   MDRV_SCREEN_SIZE(32*8, 32*8)
886880   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
887   MDRV_GFXDECODE(gfxdecodeinfo)
881   MDRV_GFXDECODE(cninja)
888882   MDRV_PALETTE_LENGTH(2048)
889883
890884   MDRV_VIDEO_START(cninja)
r1051r1052
930924   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
931925   MDRV_SCREEN_SIZE(32*8, 32*8)
932926   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
933   MDRV_GFXDECODE(gfxdecodeinfo)
927   MDRV_GFXDECODE(cninja)
934928   MDRV_PALETTE_LENGTH(2048)
935929
936930   MDRV_VIDEO_START(stoneage)
r1051r1052
973967   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
974968   MDRV_SCREEN_SIZE(32*8, 32*8)
975969   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
976   MDRV_GFXDECODE(gfxdecodeinfo)
970   MDRV_GFXDECODE(cninja)
977971   MDRV_PALETTE_LENGTH(2048)
978972
979973   MDRV_VIDEO_START(edrandy)
r1051r1052
10191013   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10201014   MDRV_SCREEN_SIZE(40*8, 32*8)
10211015   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
1022   MDRV_GFXDECODE(gfxdecodeinfo_robocop2)
1016   MDRV_GFXDECODE(robocop2)
10231017   MDRV_PALETTE_LENGTH(2048)
10241018
10251019   MDRV_VIDEO_START(robocop2)
r1051r1052
10671061   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
10681062   MDRV_SCREEN_SIZE(40*8, 32*8)
10691063   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
1070   MDRV_GFXDECODE(gfxdecodeinfo_mutantf)
1064   MDRV_GFXDECODE(mutantf)
10711065   MDRV_PALETTE_LENGTH(2048)
10721066
10731067   MDRV_VIDEO_START(mutantf)
src/mame/drivers/pacland.c
r1051r1052
392392   16*8
393393};
394394
395static const gfx_decode gfxdecodeinfo[] =
396{
397   { REGION_GFX1, 0, &charlayout,              0, 256 },
398   { REGION_GFX2, 0, &charlayout,          256*4, 256 },
399   { REGION_GFX3, 0, &spritelayout,  256*4+256*4, 64 },
400   { -1 }
401};
395static GFXDECODE_START( pacland )
396   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,              0, 256 )
397   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,          256*4, 256 )
398   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  256*4+256*4, 64 )
399GFXDECODE_END
402400
403401
404402
r1051r1052
432430   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
433431   MDRV_SCREEN_SIZE(64*8, 32*8)
434432   MDRV_SCREEN_VISIBLE_AREA(3*8, 39*8-1, 2*8, 30*8-1)
435   MDRV_GFXDECODE(gfxdecodeinfo)
433   MDRV_GFXDECODE(pacland)
436434   MDRV_PALETTE_LENGTH(256*4+256*4+64*16)
437435
438436   MDRV_PALETTE_INIT(pacland)
src/mame/drivers/psikyo4.c
r1051r1052
8888   16*16*8
8989};
9090
91static const gfx_decode gfxdecodeinfops4[] =
92{
93   { REGION_GFX1, 0, &layout_16x16x8, 0x000, 0x80 }, // 8bpp tiles
94   { -1 }
95};
91static GFXDECODE_START( ps4 )
92   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8, 0x000, 0x80 ) // 8bpp tiles
93GFXDECODE_END
9694
9795static struct EEPROM_interface eeprom_interface_93C56 =
9896{
r1051r1052
431429
432430   /* video hardware */
433431   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
434   MDRV_GFXDECODE(gfxdecodeinfops4)
432   MDRV_GFXDECODE(ps4)
435433   MDRV_PALETTE_LENGTH((0x2000/4)*2 + 2) /* 0x2000/4 for each screen. 1 for each screen clear colour */
436434   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
437435
src/mame/drivers/wardner.c
r1051r1052
450450};
451451
452452
453static const gfx_decode gfxdecodeinfo[] =
454{
455   { REGION_GFX1, 0x00000, &charlayout,   1536, 32 },   /* colors 1536-1791 */
456   { REGION_GFX2, 0x00000, &tilelayout,   1280, 16 },   /* colors 1280-1535 */
457   { REGION_GFX3, 0x00000, &tilelayout,   1024, 16 },   /* colors 1024-1079 */
458   { REGION_GFX4, 0x00000, &spritelayout,    0, 64 },   /* colors    0-1023 */
459   { -1 }
460};
453static GFXDECODE_START( wardner )
454   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   1536, 32 )   /* colors 1536-1791 */
455   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout,   1280, 16 )   /* colors 1280-1535 */
456   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout,   1024, 16 )   /* colors 1024-1079 */
457   GFXDECODE_ENTRY( REGION_GFX4, 0x00000, spritelayout,    0, 64 )   /* colors    0-1023 */
458GFXDECODE_END
461459
462460
463461static MACHINE_DRIVER_START( wardner )
r1051r1052
488486   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
489487   MDRV_SCREEN_SIZE(64*8, 32*8)
490488   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
491   MDRV_GFXDECODE(gfxdecodeinfo)
489   MDRV_GFXDECODE(wardner)
492490   MDRV_PALETTE_LENGTH(1792)
493491
494492   MDRV_VIDEO_START(toaplan0)
src/mame/drivers/jcross.c
r1051r1052
242242   256
243243};
244244
245static const gfx_decode jcross_gfxdecodeinfo[] =
246{
247   { REGION_GFX1, 0, &tile_layout,   0x080, 8  },
248   { REGION_GFX2, 0, &tile_layout,   0x110, 1  },
249   { REGION_GFX3, 0, &tile_layout,   0x100, 1  },
250   { REGION_GFX4, 0, &sprite_layout,   0x000, 16 }, /* sprites */
251   { -1 }
252};
245static GFXDECODE_START( jcross )
246   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,   0x080, 8  )
247   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,   0x110, 1  )
248   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,   0x100, 1  )
249   GFXDECODE_ENTRY( REGION_GFX4, 0, sprite_layout,   0x000, 16 ) /* sprites */
250GFXDECODE_END
253251
254252
255253/***************************************************************************
r1051r1052
283281   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
284282   MDRV_SCREEN_SIZE(512, 512)
285283   MDRV_SCREEN_VISIBLE_AREA(0, 255,0, 223)
286   MDRV_GFXDECODE(jcross_gfxdecodeinfo)
284   MDRV_GFXDECODE(jcross)
287285   MDRV_PALETTE_LENGTH((16+2)*16)
288286   MDRV_VIDEO_START(jcross)
289287   MDRV_VIDEO_UPDATE(jcross)
src/mame/drivers/nss.c
r1051r1052
446446static struct CustomSound_interface snes_sound_interface =
447447{ snes_sh_start };
448448
449static const gfx_decode gfxdecodeinfo[] =
450{
451   { -1 }
452};
449static GFXDECODE_START( nss )
450GFXDECODE_END
453451
454452static PALETTE_INIT( snes )
455453{
r1051r1052
483481   MDRV_VIDEO_UPDATE( snes )
484482
485483   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
486   MDRV_GFXDECODE(gfxdecodeinfo)
484   MDRV_GFXDECODE(nss)
487485   MDRV_PALETTE_LENGTH(32768)
488486   MDRV_COLORTABLE_LENGTH(257)
489487   MDRV_PALETTE_INIT( snes )
src/mame/drivers/rollrace.c
r1051r1052
221221      32*32    /* every sprite takes 128 consecutive bytes */
222222};
223223
224static const gfx_decode gfxdecodeinfo[] =
225{
226      { REGION_GFX1, 0x0000, &charlayout,   0,   32 }, /* foreground */
227      { REGION_GFX1, 0x0800, &charlayout,   0,   32 },
228      { REGION_GFX1, 0x1000, &charlayout,   0,   32 },
229      { REGION_GFX1, 0x1800, &charlayout,   0,   32 },
230      { REGION_GFX2, 0x0000, &charlayout2,   0,    32 }, /* for the road */
231      { REGION_GFX3, 0x0000, &spritelayout,   0,    32 }, /* sprites */
232      { REGION_GFX4, 0x0000, &spritelayout,   0,   32 },
233      { REGION_GFX5, 0x0000, &spritelayout,   0,   32 },
224static GFXDECODE_START( rollrace )
225      GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0,   32 ) /* foreground */
226      GFXDECODE_ENTRY( REGION_GFX1, 0x0800, charlayout,   0,   32 )
227      GFXDECODE_ENTRY( REGION_GFX1, 0x1000, charlayout,   0,   32 )
228      GFXDECODE_ENTRY( REGION_GFX1, 0x1800, charlayout,   0,   32 )
229      GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout2,   0,    32 ) /* for the road */
230      GFXDECODE_ENTRY( REGION_GFX3, 0x0000, spritelayout,   0,    32 ) /* sprites */
231      GFXDECODE_ENTRY( REGION_GFX4, 0x0000, spritelayout,   0,   32 )
232      GFXDECODE_ENTRY( REGION_GFX5, 0x0000, spritelayout,   0,   32 )
234233
235   { -1 }
236};
234GFXDECODE_END
237235
238236static MACHINE_DRIVER_START( rollrace )
239237
r1051r1052
255253   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
256254   MDRV_SCREEN_SIZE(256, 256)
257255   MDRV_SCREEN_VISIBLE_AREA(16,255,16, 255-16)
258   MDRV_GFXDECODE(gfxdecodeinfo)
256   MDRV_GFXDECODE(rollrace)
259257   MDRV_PALETTE_LENGTH(256)
260258
261259   MDRV_PALETTE_INIT(wiz)
src/mame/drivers/mirage.c
r0r1052
1/* Mirage Youjuu Mahjongden
2
3todo: inputs, eeprom?
4      sound (is mbl-03.10a a bad dump?)
5*/
6
7/*
8
9Mirage Youjuu Mahjongden
10(c)1994 Mitchell
11
12MT4001-2
13DEC-22V0
14all custom chips are surface scratched, but I believe they are DECO156 and mates.
15
16Sound: M6295x2
17OSC  : 28.0000MHz
18
19MBL-00.7A    [2e258b7b]
20
21MBL-01.11A   [895be69a]
22MBL-02.12A   [474f6104]
23
24MBL-03.10A   [afccbc3c]
25
26MBL-04.12K   [b533123d]
27
28MR_00-.2A    [3a53f33d]
29MR_01-.3A    [a0b758aa]
30
31*/
32
33#include "driver.h"
34#include "decocrpt.h"
35#include "decoprot.h"
36#include "deco16ic.h"
37#include "sound/okim6295.h"
38
39#include "deco16ic.h"
40
41static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
42{
43   int offs;
44
45   for (offs = 0;offs < 0x400;offs += 4)
46   {
47      int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
48
49      sprite = spriteram16[offs+1];
50      if (!sprite) continue;
51
52      y = spriteram16[offs];
53      flash=y&0x1000;
54      if (flash && (cpu_getcurrentframe() & 1)) continue;
55
56      x = spriteram16[offs+2];
57      colour = (x >>9) & 0x1f;
58
59      fx = y & 0x2000;
60      fy = y & 0x4000;
61      multi = (1 << ((y & 0x0600) >> 9)) - 1;   /* 1x, 2x, 4x, 8x height */
62
63      x = x & 0x01ff;
64      y = y & 0x01ff;
65      if (x >= 320) x -= 512;
66      if (y >= 256) y -= 512;
67      y = 240 - y;
68        x = 304 - x;
69
70      if (x>320) continue;
71
72      sprite &= ~multi;
73      if (fy)
74         inc = -1;
75      else
76      {
77         sprite += multi;
78         inc = 1;
79      }
80
81      if (flip_screen)
82      {
83         y=240-y;
84         x=304-x;
85         if (fx) fx=0; else fx=1;
86         if (fy) fy=0; else fy=1;
87         mult=16;
88      }
89      else mult=-16;
90
91      while (multi >= 0)
92      {
93         drawgfx(bitmap,machine->gfx[2],
94               sprite - multi * inc,
95               colour,
96               fx,fy,
97               x,y + mult * multi,
98               cliprect,TRANSPARENCY_PEN,0);
99
100         multi--;
101      }
102   }
103}
104
105static int mirage_bank_callback(const int bank)
106{
107   return ((bank>>4)&0x7) * 0x1000;
108}
109
110VIDEO_START(mirage)
111{
112   deco16_1_video_init();
113
114   deco16_set_tilemap_bank_callback(0, mirage_bank_callback);
115   deco16_set_tilemap_bank_callback(1, mirage_bank_callback);
116}
117
118VIDEO_UPDATE(mirage)
119{
120   flip_screen_set( deco16_pf12_control[0]&0x80 );
121   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
122
123   fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */
124
125   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
126   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
127
128   draw_sprites(machine,bitmap,cliprect);
129   return 0;
130}
131
132
133static READ16_HANDLER( mirage_controls_r )
134{
135   return readinputportbytag("SYSTEM_IN");
136}
137
138READ16_HANDLER( random_readers )
139{
140   return mame_rand(Machine);
141}
142
143READ16_HANDLER( mirage_input_r )
144{
145   UINT16 port = readinputportbytag("MIRAGE0");
146   return port;
147}
148
149static ADDRESS_MAP_START( mirage_readmem, ADDRESS_SPACE_PROGRAM, 16 )
150   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM)
151
152   AM_RANGE(0x100000, 0x101fff) AM_READ(MRA16_RAM)
153   AM_RANGE(0x102000, 0x103fff) AM_READ(MRA16_RAM)
154
155   AM_RANGE(0x110000, 0x110bff) AM_READ(MRA16_RAM)
156   AM_RANGE(0x112000, 0x112bff) AM_READ(MRA16_RAM)
157
158   AM_RANGE(0x120000, 0x1207ff) AM_READ(MRA16_RAM)
159
160   AM_RANGE(0x130000, 0x1307ff) AM_READ(MRA16_RAM)
161
162   AM_RANGE(0x140006, 0x140007) AM_READ(random_readers)
163
164   AM_RANGE(0x150006, 0x150007) AM_READ(MRA16_NOP)
165
166   AM_RANGE(0x16c006, 0x16c007) AM_READ(mirage_input_r)
167
168   AM_RANGE(0x16e002, 0x16e003) AM_READ(mirage_controls_r)
169
170   AM_RANGE(0x170000, 0x173fff) AM_READ(MRA16_RAM)
171
172ADDRESS_MAP_END
173
174static ADDRESS_MAP_START( mirage_writemem, ADDRESS_SPACE_PROGRAM, 16 )
175   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM)
176
177   /* tilemaps */
178   AM_RANGE(0x100000, 0x101fff) AM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) // 0x100000 - 0x101fff tested
179   AM_RANGE(0x102000, 0x103fff) AM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) // 0x102000 - 0x102fff tested
180   /* linescroll */
181   AM_RANGE(0x110000, 0x110bff) AM_WRITE(MWA16_RAM) AM_BASE(&deco16_pf1_rowscroll)
182   AM_RANGE(0x112000, 0x112bff) AM_WRITE(MWA16_RAM) AM_BASE(&deco16_pf2_rowscroll)
183
184   AM_RANGE(0x120000, 0x1207ff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16)
185
186   AM_RANGE(0x130000, 0x1307ff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
187
188   AM_RANGE(0x150000, 0x150001) AM_WRITE(MWA16_NOP)
189   AM_RANGE(0x150002, 0x150003) AM_WRITE(MWA16_NOP)
190
191   AM_RANGE(0x160000, 0x160001) AM_WRITE(MWA16_NOP)
192
193   AM_RANGE(0x168000, 0x16800f) AM_WRITE(MWA16_RAM) AM_BASE(&deco16_pf12_control)
194
195   AM_RANGE(0x16a000, 0x16a001) AM_WRITE(MWA16_NOP)
196
197   AM_RANGE(0x16c000, 0x16c001) AM_WRITE(MWA16_NOP)
198   AM_RANGE(0x16c002, 0x16c003) AM_WRITE(MWA16_NOP) // input multiplex?
199   AM_RANGE(0x16c004, 0x16c005) AM_WRITE(MWA16_NOP)
200
201   AM_RANGE(0x16e000, 0x16e001) AM_WRITE(MWA16_NOP)
202
203   AM_RANGE(0x170000, 0x173fff) AM_WRITE(MWA16_RAM)
204ADDRESS_MAP_END
205
206
207
208INPUT_PORTS_START( mirage )
209   PORT_START_TAG("SYSTEM_IN")
210   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
211   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
212    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
213    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
214    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
215    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
216    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
217    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
218   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_VBLANK )
219    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) // eeprom read?
220    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
221    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
222    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
223    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
224    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
225    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
226    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
227    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
228    PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
229    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
230    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
231    PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
232    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
233    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
234    PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
235    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
236    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
237    PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
238    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
239    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
240    PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
241    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
242    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
243    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
244    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
245    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
246    PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
247    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
248    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
249    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
250    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
251    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
252
253   PORT_START_TAG("MIRAGE0")
254    PORT_DIPNAME( 0x0001, 0x0001, "TEST?" )
255    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
256    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
257    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
258    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
259    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
260    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
261    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
262    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
263    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
264    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
265    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
266    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
267    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
268    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
269    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
270    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
271    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
272    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
273    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
274    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
275    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
276    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
277    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
278    PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
279    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
280    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
281    PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
282    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
283    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
284    PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
285    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
286    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
287    PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
288    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
289    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
290    PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
291    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
292    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
293    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
294    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
295    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
296    PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
297    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
298    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
299    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
300    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
301    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
302
303INPUT_PORTS_END
304
305
306static const gfx_layout tile_8x8_layout =
307{
308   8,8,
309   RGN_FRAC(1,2),
310   4,
311   { RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0,RGN_FRAC(0,2)+8,RGN_FRAC(0,2)+0 },
312   { 0, 1, 2, 3, 4, 5, 6, 7 },
313   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
314   8*16
315};
316
317static const gfx_layout tile_16x16_layout =
318{
319   16,16,
320   RGN_FRAC(1,2),
321   4,
322   { RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0,RGN_FRAC(0,2)+8,RGN_FRAC(0,2)+0 },
323   { 256,257,258,259,260,261,262,263,0, 1, 2, 3, 4, 5, 6, 7 },
324   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16 },
325   32*16
326};
327
328static const gfx_layout spritelayout =
329{
330   16,16,
331   RGN_FRAC(1,1),
332   4,
333   { 24,8,16,0 },
334   { 512,513,514,515,516,517,518,519, 0, 1, 2, 3, 4, 5, 6, 7 },
335   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
336     8*32, 9*32,10*32,11*32,12*32,13*32,14*32,15*32},
337   32*32
338};
339
340static GFXDECODE_START( mirage )
341   GFXDECODE_ENTRY(REGION_GFX1, 0, tile_8x8_layout,     0x000, 32)   /* Tiles (8x8) */
342   GFXDECODE_ENTRY(REGION_GFX1, 0, tile_16x16_layout,   0x000, 32)   /* Tiles (16x16) */
343   GFXDECODE_ENTRY(REGION_GFX2, 0, spritelayout,        0x200, 32)   /* Sprites (16x16) */
344GFXDECODE_END
345
346
347
348static MACHINE_DRIVER_START( mirage )
349
350   /* basic machine hardware */
351   MDRV_CPU_ADD(M68000, 28000000/2)
352   MDRV_CPU_PROGRAM_MAP(mirage_readmem,mirage_writemem)
353   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
354
355   MDRV_SCREEN_REFRESH_RATE(58)
356   MDRV_SCREEN_VBLANK_TIME(USEC_TO_SUBSECONDS(529))
357
358   /* video hardware */
359   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
361   MDRV_SCREEN_SIZE(40*8, 32*8)
362   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
363   MDRV_GFXDECODE(mirage)
364   MDRV_PALETTE_LENGTH(1024)
365
366   MDRV_VIDEO_START(mirage)
367   MDRV_VIDEO_UPDATE(mirage)
368
369   /* sound hardware */
370   MDRV_SPEAKER_STANDARD_MONO("mono")
371
372   MDRV_SOUND_ADD(OKIM6295, 1000000)
373   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
374   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
375
376   MDRV_SOUND_ADD(OKIM6295, 1000000)
377   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
378   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
379MACHINE_DRIVER_END
380
381
382ROM_START( mirage )
383   ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 68000 code */
384   ROM_LOAD16_BYTE( "mr_00-.2a", 0x00000, 0x40000, CRC(3a53f33d) SHA1(0f654021dcd64202b41e0ef5ef3cdf5dd274f8a5) )
385   ROM_LOAD16_BYTE( "mr_01-.3a", 0x00001, 0x40000, CRC(a0b758aa) SHA1(7fb5faf6fb57cd72a3ac24b8af1f33e504ac8398) )
386
387   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) /* Tiles - Encrypted */
388   ROM_LOAD( "mbl-00.7a", 0x000000, 0x100000, CRC(2e258b7b) SHA1(2dbd7d16a1eda97ae3de149b67e80e511aa9d0ba) )
389
390   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) /* Sprites */
391     ROM_LOAD16_BYTE( "mbl-01.11a", 0x000001, 0x200000, CRC(895be69a) SHA1(541d8f37fb4cf99312b80a0eb0d729fbbeab5f4f) )
392   ROM_LOAD16_BYTE( "mbl-02.12a", 0x000000, 0x200000, CRC(474f6104) SHA1(ff81b32b90192c3d5f27c436a9246aa6caaeeeee) )
393
394   ROM_REGION( 0x200000, REGION_SOUND1, 0 )   /* M6295 samples (scrambled? bad?) */
395   ROM_LOAD( "mbl-03.10a", 0x000000, 0x200000, CRC(afccbc3c) SHA1(457b7fbd22e723e69b65a989ee9957354b673176) )
396
397   ROM_REGION( 0x200000, REGION_SOUND2, 0 )   /* M6295 samples */
398   ROM_LOAD( "mbl-04.12k", 0x000000, 0x100000, CRC(b533123d) SHA1(2cb2f11331d00c2d282113932ed2836805f4fc6e) )
399ROM_END
400
401static void descramble_sound( int region )
402{
403   UINT8 *rom = memory_region(region);
404   int length = memory_region_length(region);
405   UINT8 *buf1 = malloc_or_die(length);
406   UINT32 x;
407
408   for (x=0;x<length;x++)
409   {
410      UINT32 addr;
411
412      addr = BITSWAP24 (x,23,22,21,0, 20,
413                          19,18,17,16,
414                          15,14,13,12,
415                          11,10,9, 8,
416                          7, 6, 5, 4,
417                          3, 2, 1 );
418
419      buf1[addr] = rom[x];
420   }
421
422   memcpy(rom,buf1,length);
423
424   free (buf1);
425
426#if 0
427   {
428      FILE *fp;
429      fp=fopen("sound.dmp", "w+b");
430      if (fp)
431      {
432         fwrite(rom, length, 1, fp);
433         fclose(fp);
434      }
435   }
436#endif
437
438}
439
440
441static DRIVER_INIT( mirage )
442{
443   deco56_decrypt(REGION_GFX1);
444   descramble_sound(REGION_SOUND1);
445}
446
447GAME( 1994, mirage, 0,        mirage, mirage, mirage, ROT0, "Mitchell", "Mirage Youjuu Mahjongden (Japan)", GAME_NOT_WORKING )
src/mame/drivers/ddrible.c
r1051r1052
315315   32*32
316316};
317317
318static const gfx_decode gfxdecodeinfo[] =
319{
320   { REGION_GFX1, 0x00000, &charlayout,    48,  1 },   /* colors 48-63 */
321   { REGION_GFX2, 0x00000, &charlayout,    16,  1 },   /* colors 16-31 */
322   { REGION_GFX1, 0x20000, &spritelayout,  32,  1 },   /* colors 32-47 */
323   { REGION_GFX2, 0x40000, &spritelayout,  64, 16 },   /* colors  0-15 but using lookup table */
324   { -1 }
325};
318static GFXDECODE_START( ddrible )
319   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,    48,  1 )   /* colors 48-63 */
320   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, charlayout,    16,  1 )   /* colors 16-31 */
321   GFXDECODE_ENTRY( REGION_GFX1, 0x20000, spritelayout,  32,  1 )   /* colors 32-47 */
322   GFXDECODE_ENTRY( REGION_GFX2, 0x40000, spritelayout,  64, 16 )   /* colors  0-15 but using lookup table */
323GFXDECODE_END
326324
327325static struct YM2203interface ym2203_interface =
328326{
r1051r1052
363361   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
364362/*  MDRV_SCREEN_SIZE(64*8, 32*8)
365363    MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) */
366   MDRV_GFXDECODE(gfxdecodeinfo)
364   MDRV_GFXDECODE(ddrible)
367365   MDRV_PALETTE_LENGTH(64)
368366   MDRV_COLORTABLE_LENGTH(64 + 256)
369367
src/mame/drivers/popper.c
r1051r1052
301301   16*2*8
302302};
303303
304static const gfx_decode popper_gfxdecodeinfo[] =
305{
306   { REGION_GFX1, 0, &popper_charlayout,   0, 16 },
307   { REGION_GFX2, 0, &popper_spritelayout, 0, 16 },
308   { -1 }
309};
304static GFXDECODE_START( popper )
305   GFXDECODE_ENTRY( REGION_GFX1, 0, popper_charlayout,   0, 16 )
306   GFXDECODE_ENTRY( REGION_GFX2, 0, popper_spritelayout, 0, 16 )
307GFXDECODE_END
310308
311309static MACHINE_DRIVER_START( popper )
312310
r1051r1052
329327   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
330328   MDRV_SCREEN_SIZE(33*8, 32*8)
331329   MDRV_SCREEN_VISIBLE_AREA(0*8, 33*8-1, 2*8, 30*8-1)
332   MDRV_GFXDECODE(popper_gfxdecodeinfo)
330   MDRV_GFXDECODE(popper)
333331   MDRV_PALETTE_LENGTH(64)
334332
335333   MDRV_PALETTE_INIT(popper)
src/mame/drivers/ladyfrog.c
r1051r1052
272272
273273
274274
275static const gfx_decode gfxdecodeinfo[] =
276{
277   { REGION_GFX1, 0, &charlayout,     0, 16 },
278   { REGION_GFX1, 0, &spritelayout, 256, 16 },
279   { -1 }
280};
275static GFXDECODE_START( ladyfrog )
276   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
277   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 256, 16 )
278GFXDECODE_END
281279
282280static MACHINE_DRIVER_START( ladyfrog )
283281   MDRV_CPU_ADD(Z80,8000000/2)
r1051r1052
305303   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 27*8-1)
306304#endif
307305
308   MDRV_GFXDECODE(gfxdecodeinfo)
306   MDRV_GFXDECODE(ladyfrog)
309307   MDRV_PALETTE_LENGTH(512)
310308
311309   MDRV_VIDEO_START(ladyfrog)
src/mame/drivers/go2000.c
r1051r1052
161161   }
162162   return 0;
163163}
164static const gfx_decode gfxdecodeinfo[] =
165{
166   { REGION_GFX1, 0, &go2000_layout,   0x0, 0x80  }, /* tiles */
167   { -1 }
168};
164static GFXDECODE_START( go2000 )
165   GFXDECODE_ENTRY( REGION_GFX1, 0, go2000_layout,   0x0, 0x80  ) /* tiles */
166GFXDECODE_END
169167
170168
171169static MACHINE_DRIVER_START( go2000 )
r1051r1052
176174   MDRV_SCREEN_REFRESH_RATE(60)
177175   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
178176
179   MDRV_GFXDECODE(gfxdecodeinfo)
177   MDRV_GFXDECODE(go2000)
180178
181179   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
182180   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/djboy.c
r1051r1052
810810   4*8*32
811811};
812812
813static const gfx_decode gfxdecodeinfo[] =
814{
815   { REGION_GFX1, 0, &tile_layout, 0x100, 16 }, /* sprite bank */
816   { REGION_GFX2, 0, &tile_layout, 0x000, 16 }, /* background tiles */
817   { -1 }
818};
813static GFXDECODE_START( djboy )
814   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0x100, 16 ) /* sprite bank */
815   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 0x000, 16 ) /* background tiles */
816GFXDECODE_END
819817
820818/******************************************************************************/
821819
r1051r1052
851849
852850   MDRV_SCREEN_SIZE(256, 256)
853851   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
854   MDRV_GFXDECODE(gfxdecodeinfo)
852   MDRV_GFXDECODE(djboy)
855853   MDRV_PALETTE_LENGTH(0x200)
856854
857855   MDRV_VIDEO_START(djboy)
src/mame/drivers/sidearms.c
r1051r1052
661661   256*8   /* every tile takes 256 consecutive bytes */
662662};
663663
664static const gfx_decode gfxdecodeinfo[] =
665{
666   { REGION_GFX1, 0, &charlayout,   768, 64 }, /* colors 768-1023 */
667   { REGION_GFX2, 0, &tilelayout,     0, 32 }, /* colors   0-511 */
668   { REGION_GFX3, 0, &spritelayout, 512, 16 }, /* colors 512-767 */
669   { -1 }
670};
664static GFXDECODE_START( sidearms )
665   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   768, 64 ) /* colors 768-1023 */
666   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     0, 32 ) /* colors   0-511 */
667   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 512, 16 ) /* colors 512-767 */
668GFXDECODE_END
671669
672670
673671
r1051r1052
692690   256*8   /* every tile takes 256 consecutive bytes */
693691};
694692
695static const gfx_decode turtship_gfxdecodeinfo[] =
696{
697   { REGION_GFX1, 0, &charlayout,          768, 64 },   /* colors 768-1023 */
698   { REGION_GFX2, 0, &turtship_tilelayout,   0, 32 },   /* colors   0-511 */
699   { REGION_GFX3, 0, &spritelayout,        512, 16 },   /* colors 512-767 */
700   { -1 }
701};
693static GFXDECODE_START( turtship )
694   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          768, 64 )   /* colors 768-1023 */
695   GFXDECODE_ENTRY( REGION_GFX2, 0, turtship_tilelayout,   0, 32 )   /* colors   0-511 */
696   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,        512, 16 )   /* colors 512-767 */
697GFXDECODE_END
702698
703699/* handler called by the 2203 emulator when the internal timers cause an IRQ */
704700static void irqhandler(int irq)
r1051r1052
735731   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
736732   MDRV_SCREEN_SIZE(64*8, 32*8)
737733   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
738   MDRV_GFXDECODE(gfxdecodeinfo)
734   MDRV_GFXDECODE(sidearms)
739735   MDRV_PALETTE_LENGTH(1024)
740736
741737   MDRV_VIDEO_START(sidearms)
r1051r1052
779775   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
780776   MDRV_SCREEN_SIZE(64*8, 32*8)
781777   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
782   MDRV_GFXDECODE(turtship_gfxdecodeinfo)
778   MDRV_GFXDECODE(turtship)
783779   MDRV_PALETTE_LENGTH(1024)
784780
785781   MDRV_VIDEO_START(sidearms)
r1051r1052
825821   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
826822   MDRV_SCREEN_SIZE(64*8, 32*8)
827823   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
828   MDRV_GFXDECODE(turtship_gfxdecodeinfo)
824   MDRV_GFXDECODE(turtship)
829825   MDRV_PALETTE_LENGTH(1024)
830826
831827   MDRV_VIDEO_START(sidearms)
src/mame/drivers/taito_x.c
r1051r1052
958958   32*8   /* every sprite takes 64 consecutive bytes */
959959};
960960
961static const gfx_decode superman_gfxdecodeinfo[] =
962{
963   { REGION_GFX1, 0x000000, &tilelayout,    0, 256 },    /* sprites & playfield */
964   { -1 }
965};
961static GFXDECODE_START( superman )
962   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout,    0, 256 )    /* sprites & playfield */
963GFXDECODE_END
966964
967static const gfx_decode ballbros_gfxdecodeinfo[] =
968{
969   { REGION_GFX1, 0x000000, &ballbros_tilelayout,    0, 256 },    /* sprites & playfield */
970   { -1 }
971};
965static GFXDECODE_START( ballbros )
966   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, ballbros_tilelayout,    0, 256 )    /* sprites & playfield */
967GFXDECODE_END
972968
973969
974970/**************************************************************************/
r1051r1052
10291025   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10301026   MDRV_SCREEN_SIZE(52*8, 32*8)
10311027   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
1032   MDRV_GFXDECODE(superman_gfxdecodeinfo)
1028   MDRV_GFXDECODE(superman)
10331029   MDRV_PALETTE_LENGTH(2048)
10341030
10351031   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
10671063   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10681064   MDRV_SCREEN_SIZE(52*8, 32*8)
10691065   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
1070   MDRV_GFXDECODE(superman_gfxdecodeinfo)
1066   MDRV_GFXDECODE(superman)
10711067   MDRV_PALETTE_LENGTH(2048)
10721068
10731069   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
11031099   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11041100   MDRV_SCREEN_SIZE(52*8, 32*8)
11051101   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
1106   MDRV_GFXDECODE(superman_gfxdecodeinfo)
1102   MDRV_GFXDECODE(superman)
11071103   MDRV_PALETTE_LENGTH(2048)
11081104
11091105   MDRV_VIDEO_START(seta_no_layers)
r1051r1052
11421138   MDRV_SCREEN_SIZE(52*8, 32*8)
11431139   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
11441140
1145   MDRV_GFXDECODE(ballbros_gfxdecodeinfo)
1141   MDRV_GFXDECODE(ballbros)
11461142   MDRV_PALETTE_LENGTH(2048)
11471143
11481144   MDRV_VIDEO_START(seta_no_layers)
src/mame/drivers/jack.c
r1051r1052
165165ADDRESS_MAP_END
166166
167167static ADDRESS_MAP_START( joinem_map, ADDRESS_SPACE_PROGRAM, 8 )
168   AM_RANGE(0x0000, 0x5fff) AM_ROM
168   AM_RANGE(0x0000, 0x7fff) AM_ROM
169169   AM_RANGE(0x8000, 0x8fff) AM_RAM
170170   AM_RANGE(0xb000, 0xb0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
171171   AM_RANGE(0xb400, 0xb400) AM_WRITE(jack_sh_command_w)
r1051r1052
754754   8*8   /* every char takes 16 bytes */
755755};
756756
757static const gfx_decode gfxdecodeinfo[] =
758{
759   { REGION_GFX1, 0, &charlayout, 0, 8 },
760   { -1 }
761};
757static GFXDECODE_START( jack )
758   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 8 )
759GFXDECODE_END
762760
763761static const gfx_layout joinem_charlayout =
764762{
r1051r1052
771769   8*8
772770};
773771
774static const gfx_decode joinem_gfxdecodeinfo[] =
775{
776   { REGION_GFX1, 0, &joinem_charlayout, 0, 32 },
777   { -1 }
778};
772static GFXDECODE_START( joinem )
773   GFXDECODE_ENTRY( REGION_GFX1, 0, joinem_charlayout, 0, 32 )
774GFXDECODE_END
779775
780776static struct AY8910interface ay8910_interface =
781777{
r1051r1052
804800   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
805801   MDRV_SCREEN_SIZE(32*8, 32*8)
806802   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
807   MDRV_GFXDECODE(gfxdecodeinfo)
803   MDRV_GFXDECODE(jack)
808804   MDRV_PALETTE_LENGTH(32)
809805
810806   MDRV_VIDEO_START(jack)
r1051r1052
847843   MDRV_CPU_PROGRAM_MAP(joinem_map,0)
848844   MDRV_CPU_VBLANK_INT(joinem_interrupts,3)
849845
850   MDRV_GFXDECODE(joinem_gfxdecodeinfo)
846   MDRV_GFXDECODE(joinem)
851847   MDRV_PALETTE_LENGTH(0x100)
852848
853849   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
r1051r1052
857853   MDRV_VIDEO_UPDATE(joinem)
858854MACHINE_DRIVER_END
859855
856
857static MACHINE_DRIVER_START( loverboy )
858
859   /* basic machine hardware */
860   MDRV_IMPORT_FROM(jack)
861   MDRV_CPU_MODIFY("main")
862   MDRV_CPU_PROGRAM_MAP(joinem_map,0)
863   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
864
865   MDRV_GFXDECODE(joinem)
866   MDRV_PALETTE_LENGTH(0x100)
867
868   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
869
870   MDRV_PALETTE_INIT(joinem)
871   MDRV_VIDEO_START(joinem)
872   MDRV_VIDEO_UPDATE(joinem)
873MACHINE_DRIVER_END
874
860875/***************************************************************************
861876
862877  Game driver(s)
r1051r1052
11101125   ROM_LOAD_NIB_HIGH( "h82s129.12n", 0x0000, 0x100, CRC(2e81c5ff) SHA1(e103c8813af704d5de11fe705de5105ff3a691c3) )
11111126ROM_END
11121127
1128
1129ROM_START( loverboy )
1130   ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* main z80 cpu */
1131   ROM_LOAD( "lover.r0", 0x0000, 0x2000, CRC(ffec4e41) SHA1(65428ebcb3af47071fef70a35388e070a019f692) )
1132   ROM_LOAD( "lover.r2", 0x2000, 0x2000, CRC(04052262) SHA1(056a225c8625e53881753b0b0330f9b277d14a7d) )
1133   ROM_LOAD( "lover.r4", 0x4000, 0x2000, CRC(ce5f3b49) SHA1(cb55e1f7c3df59389ac14b7da4f584ae054abca3) )
1134   ROM_LOAD( "lover.r6", 0x6000, 0x1000, CRC(839d79b7) SHA1(ac1c0fbf23e7d1a53b47dae16170857c55e6ae48) )
1135
1136   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound z80 cpu */
1137   ROM_LOAD( "lover.s0", 0x0000, 0x1000, CRC(ec38111c) SHA1(09efded9e905658bdbcde4ad4f0b4cb9585bdb33) )
1138
1139   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE ) /* gfx - 8x8x3bpp */
1140   ROM_LOAD( "lover.p1", 0x0000, 0x2000, CRC(cda0d87e) SHA1(efff230e994e21705902f252e50ee40a20444c0f) )
1141   ROM_LOAD( "lover.p2", 0x2000, 0x2000, CRC(e465372f) SHA1(345b769ebc33f60daa9692b64e8ef43062552a33) )
1142   ROM_LOAD( "lover.p3", 0x4000, 0x2000, CRC(1a519c8f) SHA1(36f546deaf36e8cd3bd113d84fd5e5f6e98d5de5) )
1143
1144   ROM_REGION( 0x100, REGION_PROMS, 0 ) /* colours - not from this board, from joinem */
1145   ROM_LOAD_NIB_LOW( "l82s129.11n", 0x0000, 0x100, BAD_DUMP CRC(7b724211) SHA1(7396c773e8d48dea856d9482d6c48de966616c83) )
1146   ROM_LOAD_NIB_HIGH( "h82s129.12n", 0x0000, 0x100, BAD_DUMP CRC(2e81c5ff) SHA1(e103c8813af704d5de11fe705de5105ff3a691c3) )
1147ROM_END
1148
1149
11131150/*
11141151
11151152Super Triv
r1051r1052
12841321   timer_rate = 16;
12851322}
12861323
1324static DRIVER_INIT( loverboy )
1325{
1326   /* this doesn't make sense.. the startup code, and irq0 have jumps to 0..
1327       I replace the startup jump with another jump to what appears to be
1328       the start of the game code.
1329
1330       ToDo: Figure out what's really going on */
1331   UINT8 *ROM = memory_region(REGION_CPU1);
1332   ROM[0x13] = 0x01;
1333   ROM[0x12] = 0x9d;
1334
1335   timer_rate = 16;
1336}
1337
1338
12871339static DRIVER_INIT( striv )
12881340{
12891341   UINT8 *ROM = memory_region(REGION_CPU1);
r1051r1052
13331385GAME( 1981, tripool,  0,        tripool, tripool,  jack,     ROT90, "Noma (Casino Tech license)", "Tri-Pool (Casino Tech)", 0 )
13341386GAME( 1981, tripoola, tripool,  tripool, tripool,  jack,     ROT90, "Noma (Costal Games license)", "Tri-Pool (Costal Games)", 0 )
13351387GAME( 1986, joinem,   0,        joinem,  joinem,   zzyzzyxx, ROT90, "Global Corporation", "Joinem", 0 )
1388GAME( 1983, loverboy, 0,        loverboy,joinem,   loverboy, ROT90, "Global Corporation", "Loverboy", 0 )
13361389GAME( 1985, striv,    0,        jack,    striv,    striv,    ROT270,"Hara Industries", "Super Triv", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_COLORS )
src/mame/drivers/tumblep.c
r1051r1052
297297   32*32
298298};
299299
300static const gfx_decode gfxdecodeinfo[] =
301{
302   { REGION_GFX1, 0, &tile_8x8_layout,     0x100, 32 },   /* Tiles (8x8) */
303   { REGION_GFX1, 0, &tile_16x16_layout,   0x100, 32 },   /* Tiles (16x16) */
304   { REGION_GFX2, 0, &spritelayout,        0, 16 },   /* Sprites (16x16) */
305   { -1 }
306};
300static GFXDECODE_START( tumblep )
301   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,     0x100, 32 )   /* Tiles (8x8) */
302   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_16x16_layout,   0x100, 32 )   /* Tiles (16x16) */
303   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,        0, 16 )   /* Sprites (16x16) */
304GFXDECODE_END
307305
308306/***************************************************************************/
309307
r1051r1052
336334   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
337335   MDRV_SCREEN_SIZE(40*8, 32*8)
338336   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-2, 1*8, 31*8-1) // hmm
339   MDRV_GFXDECODE(gfxdecodeinfo)
337   MDRV_GFXDECODE(tumblep)
340338   MDRV_PALETTE_LENGTH(1024)
341339
342340   MDRV_VIDEO_START(tumblep)
src/mame/drivers/dogfgt.c
r1051r1052
229229   16*16
230230};
231231
232static const gfx_decode gfxdecodeinfo[] =
233{
234   { REGION_GFX1, 0, &tilelayout,   16, 4 },
235   { REGION_GFX2, 0, &spritelayout,  0, 2 },
236   { -1 }
237};
232static GFXDECODE_START( dogfgt )
233   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   16, 4 )
234   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  0, 2 )
235GFXDECODE_END
238236
239237
240238
r1051r1052
258256   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
259257   MDRV_SCREEN_SIZE(32*8, 32*8)
260258   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
261   MDRV_GFXDECODE(gfxdecodeinfo)
259   MDRV_GFXDECODE(dogfgt)
262260   MDRV_PALETTE_LENGTH(16+64)
263261
264262   MDRV_PALETTE_INIT(dogfgt)
src/mame/drivers/dietgo.c
r1051r1052
184184   32*32
185185};
186186
187static const gfx_decode gfxdecodeinfo[] =
188{
189   { REGION_GFX1, 0, &tile_8x8_layout,     0, 32 },   /* Tiles (8x8) */
190   { REGION_GFX1, 0, &tile_16x16_layout,   0, 32 },   /* Tiles (16x16) */
191   { REGION_GFX2, 0, &spritelayout,      512, 16 },   /* Sprites (16x16) */
192   { -1 }
193};
187static GFXDECODE_START( dietgo )
188   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,     0, 32 )   /* Tiles (8x8) */
189   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_16x16_layout,   0, 32 )   /* Tiles (16x16) */
190   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,      512, 16 )   /* Sprites (16x16) */
191GFXDECODE_END
194192
195193static void sound_irq(int state)
196194{
r1051r1052
220218   MDRV_SCREEN_SIZE(40*8, 32*8)
221219   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
222220   MDRV_PALETTE_LENGTH(1024)
223   MDRV_GFXDECODE(gfxdecodeinfo)
221   MDRV_GFXDECODE(dietgo)
224222
225223   MDRV_VIDEO_START(dietgo)
226224   MDRV_VIDEO_UPDATE(dietgo)
src/mame/drivers/taitosj.c
r1051r1052
18191819
18201820
18211821
1822static const gfx_decode gfxdecodeinfo[] =
1823{
1824   { 0, 0x9000, &charlayout,   0, 16 },    /* the game dynamically modifies this */
1825   { 0, 0x9000, &spritelayout, 0, 16 },    /* the game dynamically modifies this */
1826   { 0, 0xa800, &charlayout,   0, 16 },    /* the game dynamically modifies this */
1827   { 0, 0xa800, &spritelayout, 0, 16 },    /* the game dynamically modifies this */
1828   { -1 }
1829};
1822static GFXDECODE_START( taitosj )
1823   GFXDECODE_ENTRY( 0, 0x9000, charlayout,   0, 16 )    /* the game dynamically modifies this */
1824   GFXDECODE_ENTRY( 0, 0x9000, spritelayout, 0, 16 )    /* the game dynamically modifies this */
1825   GFXDECODE_ENTRY( 0, 0xa800, charlayout,   0, 16 )    /* the game dynamically modifies this */
1826   GFXDECODE_ENTRY( 0, 0xa800, spritelayout, 0, 16 )    /* the game dynamically modifies this */
1827GFXDECODE_END
18301828
18311829
18321830static UINT8 voltable[256] =
r1051r1052
19241922   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19251923   MDRV_SCREEN_SIZE(32*8, 32*8)
19261924   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1927   MDRV_GFXDECODE(gfxdecodeinfo)
1925   MDRV_GFXDECODE(taitosj)
19281926   MDRV_PALETTE_LENGTH(64)
19291927   MDRV_COLORTABLE_LENGTH(16*8)
19301928
src/mame/drivers/vigilant.c
r1051r1052
544544   16*8
545545};
546546
547static const gfx_decode vigilant_gfxdecodeinfo[] =
548{
549   { REGION_GFX1, 0, &text_layout,   256, 16 },   /* colors 256-511 */
550   { REGION_GFX2, 0, &sprite_layout,   0, 16 },   /* colors   0-255 */
551   { REGION_GFX3, 0, &back_layout,   512,  2 },   /* actually the background uses colors */
547static GFXDECODE_START( vigilant )
548   GFXDECODE_ENTRY( REGION_GFX1, 0, text_layout,   256, 16 )   /* colors 256-511 */
549   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout,   0, 16 )   /* colors   0-255 */
550   GFXDECODE_ENTRY( REGION_GFX3, 0, back_layout,   512,  2 )   /* actually the background uses colors */
552551                                       /* 256-511, but giving it exclusive */
553552                                       /* pens we can handle it more easily. */
554   { -1 }
555};
553GFXDECODE_END
556554
557static const gfx_decode buccanrs_gfxdecodeinfo[] =
558{
559   { REGION_GFX1, 0, &text_layout,   256, 16 },   /* colors 256-511 */
560   { REGION_GFX2, 0, &sprite_layout_buccanrs,   0, 16 },   /* colors   0-255 */
561   { REGION_GFX3, 0, &buccaneer_back_layout,   512,  2 },   /* actually the background uses colors */
555static GFXDECODE_START( buccanrs )
556   GFXDECODE_ENTRY( REGION_GFX1, 0, text_layout,   256, 16 )   /* colors 256-511 */
557   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout_buccanrs,   0, 16 )   /* colors   0-255 */
558   GFXDECODE_ENTRY( REGION_GFX3, 0, buccaneer_back_layout,   512,  2 )   /* actually the background uses colors */
562559                                       /* 256-511, but giving it exclusive */
563560                                       /* pens we can handle it more easily. */
564   { -1 }
565};
561GFXDECODE_END
566562
567static const gfx_decode kikcubic_gfxdecodeinfo[] =
568{
569   { REGION_GFX1, 0, &text_layout,   0, 16 },
570   { REGION_GFX2, 0, &sprite_layout, 0, 16 },
571   { -1 }
572};
563static GFXDECODE_START( kikcubic )
564   GFXDECODE_ENTRY( REGION_GFX1, 0, text_layout,   0, 16 )
565   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 0, 16 )
566GFXDECODE_END
573567
574568
575569
r1051r1052
607601   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
608602   MDRV_SCREEN_SIZE(64*8, 32*8)
609603   MDRV_SCREEN_VISIBLE_AREA(16*8, (64-16)*8-1, 0*8, 32*8-1 )
610   MDRV_GFXDECODE(vigilant_gfxdecodeinfo)
604   MDRV_GFXDECODE(vigilant)
611605   MDRV_PALETTE_LENGTH(512+32)   /* 512 real palette, 32 virtual palette */
612606
613607   MDRV_VIDEO_START(vigilant)
r1051r1052
649643   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
650644   MDRV_SCREEN_SIZE(64*8, 32*8)
651645   MDRV_SCREEN_VISIBLE_AREA(16*8, (64-16)*8-1, 0*8, 32*8-1 )
652   MDRV_GFXDECODE(buccanrs_gfxdecodeinfo)
646   MDRV_GFXDECODE(buccanrs)
653647   MDRV_PALETTE_LENGTH(512+32)   /* 512 real palette, 32 virtual palette */
654648
655649   MDRV_VIDEO_START(vigilant)
r1051r1052
707701   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
708702   MDRV_SCREEN_SIZE(64*8, 32*8)
709703   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 0*8, 32*8-1 )
710   MDRV_GFXDECODE(kikcubic_gfxdecodeinfo)
704   MDRV_GFXDECODE(kikcubic)
711705   MDRV_PALETTE_LENGTH(256)
712706
713707   MDRV_VIDEO_START(vigilant)
src/mame/drivers/kingobox.c
r1051r1052
458458   16*8
459459};
460460
461static const gfx_decode gfxdecodeinfo[] =
462{
463   { REGION_GFX1, 0x00000, &charlayout,   256,  8 },   /* characters */
464   { REGION_GFX1, 0x01000, &charlayout,   256,  8 },   /* characters */
465   { REGION_GFX2, 0x00000, &spritelayout,   0, 32 },   /* sprites */
466   { REGION_GFX3, 0x00000, &tilelayout,     0, 32 },   /* bg tiles */
467   { -1 }
468};
461static GFXDECODE_START( kingobox )
462   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   256,  8 )   /* characters */
463   GFXDECODE_ENTRY( REGION_GFX1, 0x01000, charlayout,   256,  8 )   /* characters */
464   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, spritelayout,   0, 32 )   /* sprites */
465   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tilelayout,     0, 32 )   /* bg tiles */
466GFXDECODE_END
469467
470468/* Ring King */
471469static const gfx_layout rk_charlayout1 =
r1051r1052
530528};
531529
532530
533static const gfx_decode rk_gfxdecodeinfo[] =
534{
535   { REGION_GFX1, 0x00000, &rk_charlayout1,  256,  8 },   /* characters */
536   { REGION_GFX1, 0x00000, &rk_charlayout2,  256,  8 },   /* characters */
537   { REGION_GFX2, 0x00000, &rk_spritelayout,   0, 32 },   /* sprites */
538   { REGION_GFX3, 0x00000, &rk_tilelayout,     0, 32 },   /* sprites/bg tiles */
539   { REGION_GFX4, 0x00000, &rk_bglayout,       0, 32 },   /* bg tiles */
540   { -1 }
541};
531static GFXDECODE_START( rk )
532   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, rk_charlayout1,  256,  8 )   /* characters */
533   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, rk_charlayout2,  256,  8 )   /* characters */
534   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, rk_spritelayout,   0, 32 )   /* sprites */
535   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, rk_tilelayout,     0, 32 )   /* sprites/bg tiles */
536   GFXDECODE_ENTRY( REGION_GFX4, 0x00000, rk_bglayout,       0, 32 )   /* bg tiles */
537GFXDECODE_END
542538
543539static struct AY8910interface ay8910_interface =
544540{
r1051r1052
581577   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
582578   MDRV_SCREEN_SIZE(32*8, 32*8)
583579   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
584   MDRV_GFXDECODE(gfxdecodeinfo)
580   MDRV_GFXDECODE(kingobox)
585581   MDRV_PALETTE_LENGTH(256+8)
586582   MDRV_COLORTABLE_LENGTH(256+8*2)
587583
r1051r1052
632628   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
633629   MDRV_SCREEN_SIZE(32*8, 32*8)
634630   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
635   MDRV_GFXDECODE(rk_gfxdecodeinfo)
631   MDRV_GFXDECODE(rk)
636632   MDRV_PALETTE_LENGTH(256+8)
637633   MDRV_COLORTABLE_LENGTH(256+8*2)
638634
src/mame/drivers/galivan.c
r1051r1052
539539SPRITELAYOUT(1024);
540540
541541
542static const gfx_decode gfxdecodeinfo[] =
543{
544   { REGION_GFX1, 0, &charlayout_512,            0,   8 },
545   { REGION_GFX2, 0, &tilelayout,             8*16,  16 },
546   { REGION_GFX3, 0, &spritelayout_512, 8*16+16*16, 256 },
547   { -1 }
548};
542static GFXDECODE_START( galivan )
543   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_512,            0,   8 )
544   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,             8*16,  16 )
545   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_512, 8*16+16*16, 256 )
546GFXDECODE_END
549547
550static const gfx_decode ninjemak_gfxdecodeinfo[] =
551{
552   { REGION_GFX1, 0, &charlayout_1024,            0,   8 },
553   { REGION_GFX2, 0, &tilelayout,              8*16,  16 },
554   { REGION_GFX3, 0, &spritelayout_1024, 8*16+16*16, 256 },
555   { -1 }
556};
548static GFXDECODE_START( ninjemak )
549   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_1024,            0,   8 )
550   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,              8*16,  16 )
551   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_1024, 8*16+16*16, 256 )
552GFXDECODE_END
557553
558554
559555
r1051r1052
581577   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
582578   MDRV_SCREEN_SIZE(32*8, 32*8)
583579   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
584   MDRV_GFXDECODE(gfxdecodeinfo)
580   MDRV_GFXDECODE(galivan)
585581   MDRV_PALETTE_LENGTH(256)
586582   MDRV_COLORTABLE_LENGTH(8*16+16*16+256*16)
587583
r1051r1052
626622   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
627623   MDRV_SCREEN_SIZE(32*8, 32*8)
628624   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
629   MDRV_GFXDECODE(ninjemak_gfxdecodeinfo)
625   MDRV_GFXDECODE(ninjemak)
630626   MDRV_PALETTE_LENGTH(256)
631627   MDRV_COLORTABLE_LENGTH(8*16+16*16+256*16)
632628
src/mame/drivers/tsamurai.c
r1051r1052
738738   8*8
739739};
740740
741static const gfx_decode gfxdecodeinfo[] =
742{
743   { REGION_GFX1, 0, &tile_layout,   0, 32 },
744   { REGION_GFX2, 0, &char_layout,   0, 32 },
745   { REGION_GFX3, 0, &sprite_layout, 0, 32 },
746   { -1 }
747};
741static GFXDECODE_START( tsamurai )
742   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,   0, 32 )
743   GFXDECODE_ENTRY( REGION_GFX2, 0, char_layout,   0, 32 )
744   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite_layout, 0, 32 )
745GFXDECODE_END
748746
749747
750748/*******************************************************************************/
r1051r1052
773771   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
774772   MDRV_SCREEN_SIZE(32*8, 32*8)
775773   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
776   MDRV_GFXDECODE(gfxdecodeinfo)
774   MDRV_GFXDECODE(tsamurai)
777775   MDRV_PALETTE_LENGTH(256)
778776
779777   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
824822   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
825823   MDRV_SCREEN_SIZE(32*8, 32*8)
826824   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
827   MDRV_GFXDECODE(gfxdecodeinfo)
825   MDRV_GFXDECODE(tsamurai)
828826   MDRV_PALETTE_LENGTH(256)
829827
830828   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
865863   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
866864   MDRV_SCREEN_SIZE(32*8, 32*8)
867865   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
868   MDRV_GFXDECODE(gfxdecodeinfo)
866   MDRV_GFXDECODE(tsamurai)
869867   MDRV_PALETTE_LENGTH(256)
870868
871869   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/igs_m027.c
r1051r1052
349349    16*16*16
350350};
351351
352static const gfx_decode gfxdecodeinfo[] =
353{
354    { REGION_GFX1, 0, &gfxlayout_8x8x4,   0, 16  },
355   // { REGION_GFX2, 0, &gfxlayout_16x16x16, 0, 16  },
356    { -1 }
357};
352static GFXDECODE_START( igs_m027 )
353    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_8x8x4,   0, 16  )
354   // GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_16x16x16, 0, 16  )
355GFXDECODE_END
358356
359357
360358static INTERRUPT_GEN( igs_majhong_interrupt )
r1051r1052
373371   MDRV_CPU_VBLANK_INT(igs_majhong_interrupt,1)
374372   //MDRV_NVRAM_HANDLER(generic_0fill)
375373
376   MDRV_GFXDECODE(gfxdecodeinfo)
374   MDRV_GFXDECODE(igs_m027)
377375
378376   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
379377   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/canyon.c
r1051r1052
223223};
224224
225225
226static const gfx_decode gfxdecodeinfo[] =
227{
228   { REGION_GFX1, 0, &tile_layout,   0, 2 },
229   { REGION_GFX2, 0, &sprite_layout, 0, 2 },
230   { -1 }
231};
226static GFXDECODE_START( canyon )
227   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout,   0, 2 )
228   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 0, 2 )
229GFXDECODE_END
232230
233231
234232
r1051r1052
254252   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
255253   MDRV_SCREEN_SIZE(256, 240)
256254   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
257   MDRV_GFXDECODE(gfxdecodeinfo)
255   MDRV_GFXDECODE(canyon)
258256   MDRV_PALETTE_LENGTH(3)
259257   MDRV_COLORTABLE_LENGTH(4)
260258
r1051r1052
266264   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
267265
268266   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
269   MDRV_SOUND_CONFIG(canyon_discrete_interface)
267   MDRV_SOUND_CONFIG_DISCRETE(canyon)
270268   MDRV_SOUND_ROUTE(0, "left", 1.0)
271269   MDRV_SOUND_ROUTE(1, "right", 1.0)
272270MACHINE_DRIVER_END
src/mame/drivers/ettrivia.c
r1051r1052
160160   8*8
161161};
162162
163static const gfx_decode gfxdecodeinfo[] =
164{
165   { REGION_GFX1, 0, &charlayout,    0, 32 },
166   { REGION_GFX2, 0, &charlayout, 32*4, 32 },
167   { -1 }
168};
163static GFXDECODE_START( ettrivia )
164   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 32 )
165   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 32*4, 32 )
166GFXDECODE_END
169167
170168INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
171169{
r1051r1052
241239   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
242240   MDRV_SCREEN_SIZE(256, 256)
243241   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
244   MDRV_GFXDECODE(gfxdecodeinfo)
242   MDRV_GFXDECODE(ettrivia)
245243   MDRV_PALETTE_LENGTH(256)
246244   MDRV_COLORTABLE_LENGTH(32*4+32*4)
247245
src/mame/drivers/splash.c
r1051r1052
417417   32*8
418418};
419419
420static const gfx_decode gfxdecodeinfo[] =
421{
422   { REGION_GFX1, 0x000000, &tilelayout8 ,0,128 },
423   { REGION_GFX1, 0x000000, &tilelayout16,0,128 },
424   { -1 }
425};
420static GFXDECODE_START( splash )
421   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout8 ,0,128 )
422   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, tilelayout16,0,128 )
423GFXDECODE_END
426424
427425static struct MSM5205interface splash_msm5205_interface =
428426{
r1051r1052
451449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
452450   MDRV_SCREEN_SIZE(64*8, 64*8)
453451   MDRV_SCREEN_VISIBLE_AREA(2*8, 49*8-1, 2*8, 32*8-1)
454   MDRV_GFXDECODE(gfxdecodeinfo)
452   MDRV_GFXDECODE(splash)
455453   MDRV_PALETTE_LENGTH(2048)
456454
457455   MDRV_VIDEO_START(splash)
r1051r1052
500498   MDRV_SCREEN_SIZE(64*8, 64*8)
501499   MDRV_SCREEN_VISIBLE_AREA(2*8, 49*8-1, 2*8, 32*8-1)
502500//  MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 64*8-1)
503   MDRV_GFXDECODE(gfxdecodeinfo)
501   MDRV_GFXDECODE(splash)
504502   MDRV_PALETTE_LENGTH(2048)
505503
506504   MDRV_VIDEO_START(splash)
r1051r1052
537535   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
538536   MDRV_SCREEN_SIZE(64*8, 64*8)
539537   MDRV_SCREEN_VISIBLE_AREA(0*8, 47*8-1, 2*8, 32*8-1)
540   MDRV_GFXDECODE(gfxdecodeinfo)
538   MDRV_GFXDECODE(splash)
541539   MDRV_PALETTE_LENGTH(2048)
542540
543541   MDRV_VIDEO_START(splash)
src/mame/drivers/jalmah.c
r1051r1052
987987   32*32
988988};
989989
990static const gfx_decode jalmah_gfxdecodeinfo[] =
991{
992   { REGION_GFX1, 0, &charlayout, 0x300, 16 },
993   { REGION_GFX2, 0, &tilelayout, 0x200, 16 },
994   { REGION_GFX3, 0, &tilelayout, 0x100, 16 },
995   { REGION_GFX4, 0, &tilelayout, 0x000, 16 },
996   { -1 }
997};
990static GFXDECODE_START( jalmah )
991   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x300, 16 )
992   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x200, 16 )
993   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x100, 16 )
994   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 0x000, 16 )
995GFXDECODE_END
998996
999997static MACHINE_RESET (daireika)
1000998{
r1051r1052
10091007   MDRV_SCREEN_REFRESH_RATE(60)
10101008   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
10111009
1012   MDRV_GFXDECODE(jalmah_gfxdecodeinfo)
1010   MDRV_GFXDECODE(jalmah)
10131011
10141012   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
10151013   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/f1gp.c
r1051r1052
2323#include "video/konamiic.h"
2424#include "f1gp.h"
2525#include "sound/2610intf.h"
26#include "sound/okim6295.h"
2627
2728
28
2929static UINT16 *sharedram;
3030
3131static READ16_HANDLER( sharedram_r )
r1051r1052
8989
9090
9191static ADDRESS_MAP_START( f1gp_readmem1, ADDRESS_SPACE_PROGRAM, 16 )
92   AM_RANGE(0x000000, 0x01ffff) AM_READ(MRA16_ROM)
92   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
9393   AM_RANGE(0x100000, 0x2fffff) AM_READ(extrarom_r)
9494   AM_RANGE(0xa00000, 0xbfffff) AM_READ(extrarom2_r)
9595   AM_RANGE(0xc00000, 0xc3ffff) AM_READ(f1gp_zoomdata_r)
r1051r1052
114114ADDRESS_MAP_END
115115
116116static ADDRESS_MAP_START( f1gp_writemem1, ADDRESS_SPACE_PROGRAM, 16 )
117   AM_RANGE(0x000000, 0x01ffff) AM_WRITE(MWA16_ROM)
117   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM)
118118   AM_RANGE(0xc00000, 0xc3ffff) AM_WRITE(f1gp_zoomdata_w)
119119   AM_RANGE(0xd00000, 0xd01fff) AM_WRITE(f1gp_rozvideoram_w) AM_BASE(&f1gp_rozvideoram)               // BACK VRAM
120120   AM_RANGE(0xd02000, 0xd03fff) AM_WRITE(f1gp_rozvideoram_w)   /* mirror */
r1051r1052
453453   128*8
454454};
455455
456static const gfx_decode f1gp_gfxdecodeinfo[] =
457{
458   { REGION_GFX1, 0, &charlayout,   0x000,  1 },
459   { REGION_GFX2, 0, &spritelayout, 0x100, 16 },
460   { REGION_GFX3, 0, &spritelayout, 0x200, 16 },
461   { REGION_GFX4, 0, &tilelayout,   0x300, 16 },   /* changed at runtime */
462   { -1 }
463};
456static GFXDECODE_START( f1gp )
457   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x000,  1 )
458   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x100, 16 )
459   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x200, 16 )
460   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,   0x300, 16 )   /* changed at runtime */
461GFXDECODE_END
464462
465static const gfx_decode f1gp2_gfxdecodeinfo[] =
466{
467   { REGION_GFX1, 0, &charlayout,   0x000,  1 },
468   { REGION_GFX2, 0, &spritelayout, 0x200, 32 },
469   { REGION_GFX3, 0, &tilelayout,   0x100, 16 },
470   { -1 }
471};
463static GFXDECODE_START( f1gp2 )
464   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x000,  1 )
465   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x200, 32 )
466   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,   0x100, 16 )
467GFXDECODE_END
472468
473469
474470
r1051r1052
510506   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
511507   MDRV_SCREEN_SIZE(64*8, 32*8)
512508   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
513   MDRV_GFXDECODE(f1gp_gfxdecodeinfo)
509   MDRV_GFXDECODE(f1gp)
514510   MDRV_PALETTE_LENGTH(2048)
515511
516512   MDRV_VIDEO_START(f1gp)
r1051r1052
527523   MDRV_SOUND_ROUTE(2, "right", 1.0)
528524MACHINE_DRIVER_END
529525
526
527static MACHINE_DRIVER_START( sf1gp )
528
529   /* basic machine hardware */
530   MDRV_CPU_ADD_TAG("main",M68000,10000000)   /* 10 MHz ??? */
531   MDRV_CPU_PROGRAM_MAP(f1gp_readmem1,f1gp_writemem1)
532   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
533
534   MDRV_CPU_ADD(M68000,10000000)   /* 10 MHz ??? */
535   MDRV_CPU_PROGRAM_MAP(readmem2,writemem2)
536   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
537
538   /* NO sound CPU */
539
540   MDRV_SCREEN_REFRESH_RATE(60)
541   MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */
542
543   /* video hardware */
544   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
545   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
546   MDRV_SCREEN_SIZE(64*8, 32*8)
547   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
548   MDRV_GFXDECODE(f1gp)
549   MDRV_PALETTE_LENGTH(2048)
550
551   MDRV_VIDEO_START(f1gp)
552   MDRV_VIDEO_UPDATE(f1gp)
553
554   /* sound hardware */
555   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
556
557   MDRV_SOUND_ADD(OKIM6295, 1000000)
558   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
559   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
560   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
561MACHINE_DRIVER_END
562
563
530564static MACHINE_DRIVER_START( f1gp2 )
531565
532566   /* basic machine hardware */
r1051r1052
535569   MDRV_CPU_PROGRAM_MAP(f1gp2_readmem1,f1gp2_writemem1)
536570
537571   /* video hardware */
538   MDRV_GFXDECODE(f1gp2_gfxdecodeinfo)
572   MDRV_GFXDECODE(f1gp2)
539573   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
540574
541575   MDRV_VIDEO_START(f1gp2)
r1051r1052
545579
546580
547581ROM_START( f1gp )
548   ROM_REGION( 0x20000, REGION_CPU1, 0 )   /* 68000 code */
582   ROM_REGION( 0x40000, REGION_CPU1, 0 )   /* 68000 code */
549583   ROM_LOAD16_WORD_SWAP( "rom1-a.3",     0x000000, 0x20000, CRC(2d8f785b) SHA1(6eca42ad2d57a31e055496141c89cb537f284378) )
550584
551585   ROM_REGION( 0x200000, REGION_USER1, 0 )   /* extra ROMs mapped at 100000 */
r1051r1052
592626   ROM_LOAD( "rom17-a.08",   0x000000, 0x100000, CRC(ea70303d) SHA1(8de1a0e6d47cd80a622663c1745a1da54cd0ea05) )
593627ROM_END
594628
629/* This is a bootleg of f1gp, produced by Playmark in Italy
630   the video hardware is different, it lacks the sound z80, and has less samples
631 */
632
633ROM_START( sf1gp )
634   ROM_REGION( 0x40000, REGION_CPU1, 0 )   /* 68000 code */
635   /* these have extra data at 0x30000 which isn't preset in the f1gp set, is it related to the changed sound hardware? */
636   ROM_LOAD16_BYTE( "1.ic38",     0x000001, 0x20000, CRC(046dd83a) SHA1(ea65fa88f9d9a79664de666e63594a7a7de86650) )
637   ROM_LOAD16_BYTE( "7.ic39",     0x000000, 0x20000, CRC(960f5db4) SHA1(addc461538e2140afae400e8d7364d0bcc42a0cb) )
638
639   ROM_REGION( 0x200000, REGION_USER1, 0 )   /* extra ROMs mapped at 100000 */
640   ROM_LOAD16_BYTE( "2.ic48",    0x000000, 0x80000, CRC(b3b315c3) SHA1(568592e450401cd95206dbe439e565dd28499dd1) )
641   ROM_LOAD16_BYTE( "8.ic41",    0x000001, 0x80000, CRC(39af8180) SHA1(aa1577195b1463069870db2d64db3b5e61d6bbe8) )
642   ROM_LOAD16_BYTE( "3.ic165",   0x100000, 0x80000, CRC(b7295a30) SHA1(4120dda38673d59343aea0f030d2f275a0ae3d95) )
643   ROM_LOAD16_BYTE( "9.ic166",   0x100001, 0x80000, CRC(bb596d5b) SHA1(f29ed135e8f09d4a15353360a811c13aba681382) )
644
645   ROM_REGION( 0x200000, REGION_USER2, 0 )   /* extra ROMs mapped at a00000 */
646   ROM_LOAD16_BYTE( "4.ic42",    0x000000, 0x80000, CRC(5dbde98a) SHA1(536553eaad0ebfe219e44a4f50a4707209024469) )
647   ROM_LOAD16_BYTE( "10.ic43",   0x000001, 0x80000, CRC(d60e7706) SHA1(23c383e47e6600a68d6fd8bcfc9552fe0d660630) )
648   ROM_LOAD16_BYTE( "5.ic167",   0x100000, 0x80000, CRC(48c36293) SHA1(2a5d92537ba331a99697d13b4394b8d2737eeaf2) )
649   ROM_LOAD16_BYTE( "11.ic168",  0x100001, 0x80000, CRC(92a28e52) SHA1(dc203486b96fdc1930f7e63021e84f203540a64e) )
650
651   ROM_REGION( 0x20000, REGION_CPU2, 0 )   /* 68000 code */
652   ROM_LOAD16_BYTE( "16.u7",     0x000000, 0x10000, CRC(7609d818) SHA1(eb841b8e7b34f1c677f1a79bfeda5dafc1f6849f) )
653   ROM_LOAD16_BYTE( "17.u6",     0x000001, 0x10000, CRC(951befde) SHA1(28754f00ca0fe38fe1d4e68c203a7b401baa9714) )
654
655   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE )
656   ROM_LOAD( "13.ic151",    0x000000, 0x080000, CRC(4238074b) SHA1(a6b169165c7f7da9e746db8f1fb02e15c02c2b60) )
657   ROM_LOAD( "12.ic152",    0x080000, 0x080000, CRC(e97c2b6e) SHA1(3d964999b70af2f39a734eba3feec6d4583261c7) )
658   ROM_LOAD( "15.ic153",    0x100000, 0x080000, CRC(c2867d7f) SHA1(86b1be9672cf9f610e1d7efff90d6a73dc1cdb90) )
659   ROM_LOAD( "14.ic154",    0x180000, 0x080000, CRC(0cd20423) SHA1(cddad02247b898c0a5a2fe061c41f68ecdf04d5c) )
660
661   /*
662    Roms 20 and 21 were missing from the PCB, however the others match perfectly (just with a different data layout)
663    I've reconstructed what should be the correct data for this bootleg.
664
665    Note, the bootleg combines 2 GFX regions into a single set of 4-way interleaved roms, so we load them in a user
666    region and use ROM_COPY.
667    */
668
669   ROM_REGION( 0x200000, REGION_USER3, ROMREGION_DISPOSE )
670   ROMX_LOAD( "rom21",        0x000003, 0x80000, CRC(7a08c3b7) SHA1(369123348a88513c066c239ed6aa4db5ae4ef0ac), ROM_SKIP(3) )
671   ROMX_LOAD( "rom20",        0x000001, 0x80000, CRC(bd1273d0) SHA1(cc7caee231fe3bd87d8403d34059e1292c7f7a00), ROM_SKIP(3) )
672   ROMX_LOAD( "19.ic141",     0x000002, 0x80000, CRC(aa4ebdfe) SHA1(ed117e6a84554c5ed2ad4379b834898a4c40d51e), ROM_SKIP(3) )
673   ROMX_LOAD( "18.ic140",     0x000000, 0x80000, CRC(9b2a4325) SHA1(b2020e08251366686c4c0045f3fd523fa327badf), ROM_SKIP(3) )
674
675   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
676   ROM_COPY(REGION_USER3, 0, 0, 0x100000)
677
678   ROM_REGION( 0x080000, REGION_GFX3, ROMREGION_DISPOSE )
679   ROM_COPY(REGION_USER3, 0x100000, 0, 0x80000)
680
681   ROM_REGION( 0x40000, REGION_GFX4, ROMREGION_ERASE00 )   /* gfx data for the 053936 */
682   /* RAM, not ROM - handled at run time */
683
684   ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* sound samples */
685   ROM_LOAD( "6.ic13",   0x000000, 0x080000, CRC(6e83ffd8) SHA1(618fd6cd6c0844a4be96f77ff22cd41364718d16) )
686ROM_END
687
688
595689ROM_START( f1gp2 )
596690   ROM_REGION( 0x40000, REGION_CPU1, 0 )   /* 68000 code */
597691   ROM_LOAD16_BYTE( "rom12.v1",     0x000000, 0x20000, CRC(c5c5f199) SHA1(56fcbf1d9b15a37204296c578e1585599f76a107) )
r1051r1052
627721   ROM_LOAD( "rom3",         0x000000, 0x100000, CRC(7f8f066f) SHA1(5e051d5feb327ac818e9c7f7ac721dada3a102b6) )
628722ROM_END
629723
724DRIVER_INIT( sf1gp )
725{
726   // no sound z80 to send sound commands to.
727   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff008, 0xfff009, 0, 0, MWA16_NOP);
728}
630729
631730
632GAME( 1991, f1gp,  0, f1gp,  f1gp,  0, ROT90, "Video System Co.", "F-1 Grand Prix",         GAME_NO_COCKTAIL )
633GAME( 1992, f1gp2, 0, f1gp2, f1gp2, 0, ROT90, "Video System Co.", "F-1 Grand Prix Part II", GAME_NO_COCKTAIL )
731GAME( 1991, f1gp,  0,    f1gp,  f1gp,  0, ROT90, "Video System Co.", "F-1 Grand Prix",         GAME_NO_COCKTAIL )
732GAME( 1991, sf1gp, f1gp, sf1gp, f1gp,  sf1gp, ROT90, "[Video System Co.] (Playmark bootleg)", "Super Formula II (bootleg of F-1 Grand Prix)", GAME_NOT_WORKING ) // PCB marked 'Super Formula II', manufactured by Playmark.
733
734GAME( 1992, f1gp2, 0,    f1gp2, f1gp2, 0, ROT90, "Video System Co.", "F-1 Grand Prix Part II", GAME_NO_COCKTAIL )
src/mame/drivers/supdrapo.c
r1051r1052
236236   8*8
237237};
238238
239static const gfx_decode gfxdecodeinfo[] =
240{
241   { REGION_GFX1, 0, &charlayout,   0, 16 },
242   { -1 }
243};
239static GFXDECODE_START( supdrapo )
240   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
241GFXDECODE_END
244242
245243static TILE_GET_INFO( get_tile_info )
246244{
r1051r1052
275273   MDRV_SCREEN_SIZE(256, 256)
276274   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
277275
278   MDRV_GFXDECODE(gfxdecodeinfo)
276   MDRV_GFXDECODE(supdrapo)
279277   MDRV_PALETTE_LENGTH(16)
280278
281279   MDRV_VIDEO_START(supdrapo)
src/mame/drivers/lvcards.c
r1051r1052
455455
456456/* Graphics Decode Information */
457457
458static const gfx_decode gfxdecodeinfo[] =
459{
460   { REGION_GFX1, 0, &charlayout, 0, 16 },
461   { -1 }
462};
458static GFXDECODE_START( lvcards )
459   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
460GFXDECODE_END
463461
464462/* Sound Interfaces */
465463
r1051r1052
486484   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
487485   MDRV_SCREEN_SIZE(32*8, 32*8)
488486   MDRV_SCREEN_VISIBLE_AREA(8*0, 32*8-1, 2*8, 30*8-1)
489   MDRV_GFXDECODE(gfxdecodeinfo)
487   MDRV_GFXDECODE(lvcards)
490488   MDRV_PALETTE_LENGTH(256)
491489
492490   MDRV_PALETTE_INIT(lvcards)
src/mame/drivers/namcos2.c
r1051r1052
14991499   32*32*8
15001500};
15011501
1502static const gfx_decode metlhawk_gfxdecodeinfo[] =
1503{
1504   { REGION_GFX1, 0x000000, &metlhawk_sprite_layout,    0*256, 16 },
1505   { REGION_GFX3, 0x000000, &luckywld_roz_layout,       0*256, 16 },
1506   { REGION_GFX2, 0x000000, &chr_layout,            16*256, 16 },
1507   { -1 }
1508};
1502static GFXDECODE_START( metlhawk )
1503   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, metlhawk_sprite_layout,    0*256, 16 )
1504   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, luckywld_roz_layout,       0*256, 16 )
1505   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, chr_layout,            16*256, 16 )
1506GFXDECODE_END
15091507
1510static const gfx_decode gfxdecodeinfo[] =
1511{
1512   { REGION_GFX1, 0x000000, &obj_layout,  0*256, 16 },
1513   { REGION_GFX1, 0x200000, &obj_layout,  0*256, 16 },
1514   { REGION_GFX2, 0x000000, &chr_layout, 16*256, 16 },
1515   { REGION_GFX3, 0x000000, &roz_layout,  0*256, 16  },
1516   { -1 }
1517};
1508static GFXDECODE_START( namcos2 )
1509   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, obj_layout,  0*256, 16 )
1510   GFXDECODE_ENTRY( REGION_GFX1, 0x200000, obj_layout,  0*256, 16 )
1511   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, chr_layout, 16*256, 16 )
1512   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, roz_layout,  0*256, 16  )
1513GFXDECODE_END
15181514
1519static const gfx_decode finallap_gfxdecodeinfo[] =
1520{
1521   { REGION_GFX1, 0x000000, &obj_layout,  0*256, 16 },
1522   { REGION_GFX1, 0x200000, &obj_layout,  0*256, 16 },
1523   { REGION_GFX2, 0x000000, &chr_layout, 16*256, 16 },
1524   { -1 }
1525};
1515static GFXDECODE_START( finallap )
1516   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, obj_layout,  0*256, 16 )
1517   GFXDECODE_ENTRY( REGION_GFX1, 0x200000, obj_layout,  0*256, 16 )
1518   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, chr_layout, 16*256, 16 )
1519GFXDECODE_END
15261520
1527static const gfx_decode sgunner_gfxdecodeinfo[] =
1528{
1529   { REGION_GFX1, 0x000000, &luckywld_sprite_layout,    0*256, 16 },
1530   { REGION_GFX3, 0x000000, &luckywld_roz_layout,       0*256, 16 },
1531   { REGION_GFX2, 0x000000, &chr_layout,            16*256, 16 },
1532   { -1 }
1533};
1521static GFXDECODE_START( sgunner )
1522   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, luckywld_sprite_layout,    0*256, 16 )
1523   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, luckywld_roz_layout,       0*256, 16 )
1524   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, chr_layout,            16*256, 16 )
1525GFXDECODE_END
15341526
1535static const gfx_decode luckywld_gfxdecodeinfo[] =
1536{
1537   { REGION_GFX1, 0x000000, &luckywld_sprite_layout,    0*256, 16 },
1538   { REGION_GFX3, 0x000000, &luckywld_roz_layout,       0*256, 16 },
1539   { REGION_GFX2, 0x000000, &chr_layout,            16*256, 16 },
1540   { -1 }
1541};
1527static GFXDECODE_START( luckywld )
1528   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, luckywld_sprite_layout,    0*256, 16 )
1529   GFXDECODE_ENTRY( REGION_GFX3, 0x000000, luckywld_roz_layout,       0*256, 16 )
1530   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, chr_layout,            16*256, 16 )
1531GFXDECODE_END
15421532
15431533static struct C140interface C140_interface =
15441534{
r1051r1052
16061596   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16071597   MDRV_SCREEN_SIZE(384, 264)
16081598   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1609   MDRV_GFXDECODE(gfxdecodeinfo)
1599   MDRV_GFXDECODE(namcos2)
16101600   MDRV_PALETTE_LENGTH(0x2000)
16111601
16121602   MDRV_VIDEO_START(namcos2)
r1051r1052
16761666   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16771667   MDRV_SCREEN_SIZE(384, 264)
16781668   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1679   MDRV_GFXDECODE(gfxdecodeinfo)
1669   MDRV_GFXDECODE(namcos2)
16801670   MDRV_PALETTE_LENGTH(0x2000)
16811671
16821672   MDRV_VIDEO_START(namcos2)
r1051r1052
17221712   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17231713   MDRV_SCREEN_SIZE(384, 264)
17241714   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1725   MDRV_GFXDECODE(finallap_gfxdecodeinfo)
1715   MDRV_GFXDECODE(finallap)
17261716   MDRV_PALETTE_LENGTH(0x2000)
17271717
17281718   MDRV_VIDEO_START(finallap)
r1051r1052
17681758   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
17691759   MDRV_SCREEN_SIZE(384, 264)
17701760   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1771   MDRV_GFXDECODE(sgunner_gfxdecodeinfo)
1761   MDRV_GFXDECODE(sgunner)
17721762   MDRV_PALETTE_LENGTH(0x2000)
17731763
17741764   MDRV_VIDEO_START(sgunner)
r1051r1052
18141804   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18151805   MDRV_SCREEN_SIZE(384, 264)
18161806   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1817   MDRV_GFXDECODE(luckywld_gfxdecodeinfo)
1807   MDRV_GFXDECODE(luckywld)
18181808   MDRV_PALETTE_LENGTH(0x2000)
18191809
18201810   MDRV_VIDEO_START(luckywld)
r1051r1052
18601850   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18611851   MDRV_SCREEN_SIZE(384, 264)
18621852   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1863    MDRV_GFXDECODE(metlhawk_gfxdecodeinfo)
1853    MDRV_GFXDECODE(metlhawk)
18641854   MDRV_PALETTE_LENGTH(0x2000)
18651855
18661856   MDRV_VIDEO_START(metlhawk)
src/mame/drivers/tecmosys.c
r1051r1052
344344};
345345
346346
347static const gfx_decode gfxdecodeinfo[] =
348{
349   { REGION_GFX2, 0, &gfxlayout,   0x40*16, 16 },
350   { REGION_GFX3, 0, &gfxlayout2,   0, 16 },
351   { -1 }
352};
347static GFXDECODE_START( tecmosys )
348   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout,   0x40*16, 16 )
349   GFXDECODE_ENTRY( REGION_GFX3, 0, gfxlayout2,   0, 16 )
350GFXDECODE_END
353351
354352
355353
r1051r1052
547545
548546   MDRV_SCREEN_REFRESH_RATE(60)
549547   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
550   MDRV_GFXDECODE(gfxdecodeinfo)
548   MDRV_GFXDECODE(tecmosys)
551549
552550   MDRV_NVRAM_HANDLER(93C46)
553551
src/mame/drivers/polyplay.c
r1051r1052
282282   8*8   /* every char takes 8 consecutive bytes */
283283};
284284
285static const gfx_decode gfxdecodeinfo[] =
286{
287   { REGION_CPU1, 0xe800, &charlayout_1_bit, 0, 1 },
288   { REGION_CPU1, 0xec00, &charlayout_3_bit, 2, 1 },
289   { -1 }   /* end of array */
290};
285static GFXDECODE_START( polyplay )
286   GFXDECODE_ENTRY( REGION_CPU1, 0xe800, charlayout_1_bit, 0, 1 )
287   GFXDECODE_ENTRY( REGION_CPU1, 0xec00, charlayout_3_bit, 2, 1 )
288GFXDECODE_END
291289
292290
293291/* the machine driver */
r1051r1052
310308   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
311309   MDRV_SCREEN_SIZE(64*8, 32*8)
312310   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
313   MDRV_GFXDECODE(gfxdecodeinfo)
311   MDRV_GFXDECODE(polyplay)
314312   MDRV_PALETTE_LENGTH(10)
315313
316314   MDRV_PALETTE_INIT(polyplay)
src/mame/drivers/exzisus.c
r1051r1052
303303   16*8
304304};
305305
306static const gfx_decode exzisus_gfxdecodeinfo[] =
307{
308   { REGION_GFX1, 0, &charlayout,   0, 256 },
309   { REGION_GFX2, 0, &charlayout, 256, 256 },
310   { -1 }
311};
306static GFXDECODE_START( exzisus )
307   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 256 )
308   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 256, 256 )
309GFXDECODE_END
312310
313311
314312
r1051r1052
351349   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
352350   MDRV_SCREEN_SIZE(32*8, 32*8)
353351   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
354   MDRV_GFXDECODE(exzisus_gfxdecodeinfo)
352   MDRV_GFXDECODE(exzisus)
355353   MDRV_PALETTE_LENGTH(1024)
356354
357355   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/tx1.c
r1051r1052
707707   8*8
708708};
709709
710static const gfx_decode bb_gfxdecodeinfo[] =
711{
712   { REGION_GFX1, 0, &char_layout, 0, 256 },
713   { REGION_GFX2, 0, &bb_object_layout, 256, 2048  },
714   { REGION_GFX3, 0, &bb_object_layout, 256, 2048  },
715   { REGION_GFX4, 0, &bb_object_layout, 256, 2048  },
716   { -1 }
717};
710static GFXDECODE_START( bb )
711   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout, 0, 256 )
712   GFXDECODE_ENTRY( REGION_GFX2, 0, bb_object_layout, 256, 2048  )
713   GFXDECODE_ENTRY( REGION_GFX3, 0, bb_object_layout, 256, 2048  )
714   GFXDECODE_ENTRY( REGION_GFX4, 0, bb_object_layout, 256, 2048  )
715GFXDECODE_END
718716
719static const gfx_decode tx1_gfxdecodeinfo[] =
720{
721   { REGION_GFX1, 0, &char_layout, 0, 16 },
722   { REGION_GFX2, 0, &tx1_object_layout, 0, 16 },
723   { REGION_GFX3, 0, &tx1_object_layout, 0, 16 },
724   { -1 }
725};
717static GFXDECODE_START( tx1 )
718   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout, 0, 16 )
719   GFXDECODE_ENTRY( REGION_GFX2, 0, tx1_object_layout, 0, 16 )
720   GFXDECODE_ENTRY( REGION_GFX3, 0, tx1_object_layout, 0, 16 )
721GFXDECODE_END
726722
727723
728724/****************************/
r1051r1052
922918   MDRV_INTERLEAVE(100)
923919
924920   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
925   MDRV_GFXDECODE(tx1_gfxdecodeinfo)
921   MDRV_GFXDECODE(tx1)
926922   MDRV_PALETTE_LENGTH(32768)
927923   MDRV_DEFAULT_LAYOUT(layout_triphsxs)
928924
r1051r1052
975971   MDRV_INTERLEAVE(100)
976972
977973   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
978   MDRV_GFXDECODE(bb_gfxdecodeinfo)
974   MDRV_GFXDECODE(bb)
979975   MDRV_DEFAULT_LAYOUT(layout_triphsxs)
980976
981977   MDRV_SCREEN_ADD("left", 0x000)
r1051r1052
10441040   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10451041   MDRV_SCREEN_SIZE(256, 256)
10461042   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
1047   MDRV_GFXDECODE(bb_gfxdecodeinfo)
1043   MDRV_GFXDECODE(bb)
10481044
10491045   MDRV_PALETTE_LENGTH(256)
10501046   MDRV_COLORTABLE_LENGTH(256+(256*4)+(2048*4))     /* 256 for chars, 2048 for objects */
src/mame/drivers/merit.c
r1051r1052
762762   16*8
763763};
764764
765gfx_decode merit_gfxdecodeinfo[] =
766{
767   { REGION_GFX1, 0, &tiles8x8x3_layout, 0,  32 },
768   { REGION_GFX2, 0, &tiles8x8x1_layout, 0, 128 },
769   { REGION_GFX1, 8, &tiles8x8x3_layout, 0,  32 }, // flipped tiles
770   { REGION_GFX2, 8, &tiles8x8x1_layout, 0, 128 }, // flipped tiles
771   { -1 }
772};
765static GFXDECODE_START( merit )
766   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8x3_layout, 0,  32 )
767   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8x1_layout, 0, 128 )
768   GFXDECODE_ENTRY( REGION_GFX1, 8, tiles8x8x3_layout, 0,  32 ) // flipped tiles
769   GFXDECODE_ENTRY( REGION_GFX2, 8, tiles8x8x1_layout, 0, 128 ) // flipped tiles
770GFXDECODE_END
773771
774772static ppi8255_interface ppi8255_intf =
775773{
r1051r1052
812810   MDRV_SCREEN_SIZE(64*8, 32*8)
813811   MDRV_SCREEN_VISIBLE_AREA(0, 64*8-1, 1*8, 32*8-1)
814812
815   MDRV_GFXDECODE(merit_gfxdecodeinfo)
813   MDRV_GFXDECODE(merit)
816814   MDRV_PALETTE_LENGTH(0x100)
817815
818816   MDRV_VIDEO_START(merit)
src/mame/drivers/dassault.c
r1051r1052
520520   64*8
521521};
522522
523static const gfx_decode gfxdecodeinfo[] =
524{
523static GFXDECODE_START( dassault )
525524   /* REGION_GFX1 is copied to REGION_GFX2 at runtime */
526   { REGION_GFX2, 0, &charlayout,     0,  32 },   /* Characters 8x8 */
527   { REGION_GFX2, 0, &tilelayout,     0,  32 },   /* Tiles 16x16 */
528   { REGION_GFX3, 0, &tilelayout,   512,  32 },   /* Tiles 16x16 */
529   { REGION_GFX4, 0, &tilelayout,  1024,  64 },   /* Sprites 16x16 */
530   { REGION_GFX5, 0, &tilelayout,  2048,  64 },   /* Sprites 16x16 */
531   { -1 }
532};
525   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,     0,  32 )   /* Characters 8x8 */
526   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     0,  32 )   /* Tiles 16x16 */
527   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,   512,  32 )   /* Tiles 16x16 */
528   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,  1024,  64 )   /* Sprites 16x16 */
529   GFXDECODE_ENTRY( REGION_GFX5, 0, tilelayout,  2048,  64 )   /* Sprites 16x16 */
530GFXDECODE_END
533531
534532/**********************************************************************************/
535533
r1051r1052
576574   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
577575   MDRV_SCREEN_SIZE(40*8, 32*8)
578576   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
579   MDRV_GFXDECODE(gfxdecodeinfo)
577   MDRV_GFXDECODE(dassault)
580578   MDRV_PALETTE_LENGTH(4096)
581579
582580   MDRV_VIDEO_START(dassault)
src/mame/drivers/dambustr.c
r1051r1052
137137};
138138
139139
140static gfx_decode dambustr_gfxdecodeinfo[] =
141{
142   { REGION_GFX1, 0x0000, &dambustr_charlayout,   0, 8 },
143   { REGION_GFX1, 0x0000, &dambustr_spritelayout, 0, 8 },
144   { -1 } // end of array
145};
140static GFXDECODE_START( dambustr )
141   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dambustr_charlayout,   0, 8 )
142   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dambustr_spritelayout, 0, 8 )
143GFXDECODE_END
146144
147145
148146DRIVER_INIT(dambustr)
r1051r1052
201199   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
202200   MDRV_SCREEN_SIZE(32*8, 32*8)
203201   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
204   MDRV_GFXDECODE(dambustr_gfxdecodeinfo)
202   MDRV_GFXDECODE(dambustr)
205203   MDRV_PALETTE_LENGTH(32+2+64+8)      /* 32 for the characters, 2 for the bullets, 64 for the stars, 8 for the background */
206204   MDRV_COLORTABLE_LENGTH(8*4)
207205
src/mame/drivers/pingpong.c
r1051r1052
444444   64*8   /* every char takes 64 consecutive bytes */
445445};
446446
447static const gfx_decode gfxdecodeinfo[] =
448{
449   { REGION_GFX1, 0, &charlayout,         0, 64 },
450   { REGION_GFX2, 0, &spritelayout,    64*4, 64 },
451   { -1 }
452};
447static GFXDECODE_START( pingpong )
448   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0, 64 )
449   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,    64*4, 64 )
450GFXDECODE_END
453451
454452
455453
r1051r1052
468466   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
469467   MDRV_SCREEN_SIZE(32*8, 32*8)
470468   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
471   MDRV_GFXDECODE(gfxdecodeinfo)
469   MDRV_GFXDECODE(pingpong)
472470   MDRV_PALETTE_LENGTH(32)
473471   MDRV_COLORTABLE_LENGTH(64*4+64*4)
474472
src/mame/drivers/ssrj.c
r1051r1052
157157   8*8   /* every char takes 8 consecutive bytes */
158158};
159159
160static const gfx_decode gfxdecodeinfo[] =
161{
162   { REGION_GFX1, 0, &charlayout,     0, 8*4 },
163   { -1 }   /* end of array */
164};
160static GFXDECODE_START( ssrj )
161   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 8*4 )
162GFXDECODE_END
165163
166164static struct AY8910interface ay8910_interface =
167165{
r1051r1052
185183   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
186184   MDRV_SCREEN_SIZE(32*8, 32*8)
187185   MDRV_SCREEN_VISIBLE_AREA(2*8, 30*8-1, 3*8, 32*8-1)
188   MDRV_GFXDECODE(gfxdecodeinfo)
186   MDRV_GFXDECODE(ssrj)
189187   MDRV_PALETTE_LENGTH(128)
190188   MDRV_PALETTE_INIT(ssrj)
191189
src/mame/drivers/blstroid.c
r1051r1052
178178};
179179
180180
181static const gfx_decode gfxdecodeinfo[] =
182{
183   { REGION_GFX1, 0, &pflayout,  256, 16 },
184   { REGION_GFX2, 0, &molayout,    0, 16 },
185   { -1 }
186};
181static GFXDECODE_START( blstroid )
182   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout,  256, 16 )
183   GFXDECODE_ENTRY( REGION_GFX2, 0, molayout,    0, 16 )
184GFXDECODE_END
187185
188186
189187
r1051r1052
205203
206204   /* video hardware */
207205   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
208   MDRV_GFXDECODE(gfxdecodeinfo)
206   MDRV_GFXDECODE(blstroid)
209207   MDRV_PALETTE_LENGTH(512)
210208
211209   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/gotya.c
r1051r1052
140140   64*8   /* every char takes 64 consecutive bytes */
141141};
142142
143static const gfx_decode gfxdecodeinfo[] =
144{
145   { REGION_GFX1, 0, &charlayout,   0, 16 },
146   { REGION_GFX2, 0, &spritelayout, 0, 16 },
147   { -1 }
148};
143static GFXDECODE_START( gotya )
144   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
145   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 16 )
146GFXDECODE_END
149147
150148
151149static const char *sample_names[] =
r1051r1052
206204   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
207205   MDRV_SCREEN_SIZE(36*8, 32*8)
208206   MDRV_SCREEN_VISIBLE_AREA(0, 36*8-1, 2*8, 30*8-1)
209   MDRV_GFXDECODE(gfxdecodeinfo)
207   MDRV_GFXDECODE(gotya)
210208   MDRV_PALETTE_LENGTH(8)
211209   MDRV_COLORTABLE_LENGTH(16*4)
212210
src/mame/drivers/tatsumi.c
r1051r1052
474474   8*16
475475};
476476
477static const gfx_decode gfxdecodeinfo_apache3[] =
478{
479   { REGION_GFX1, 0, &roundup5_charlayout,    1024, 128},
480   { REGION_GFX4, 0, &cyclwarr_charlayout,     768, 16},
481   { -1 }
482};
477static GFXDECODE_START( apache3 )
478   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout,    1024, 128)
479   GFXDECODE_ENTRY( REGION_GFX4, 0, cyclwarr_charlayout,     768, 16)
480GFXDECODE_END
483481
484static const gfx_decode roundup5_gfxdecodeinfo[] =
485{
486   { REGION_GFX1, 0, &roundup5_charlayout,     1024, 256},
487   { 0, 0, &roundup5_vramlayout,               0, 16},
488   { -1 }
489};
482static GFXDECODE_START( roundup5 )
483   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout,     1024, 256)
484   GFXDECODE_ENTRY( 0, 0, roundup5_vramlayout,               0, 16)
485GFXDECODE_END
490486
491static const gfx_decode cyclwarr_gfxdecodeinfo[] =
492{
493   { REGION_GFX1, 0, &roundup5_charlayout,    8192, 512},
494   { REGION_GFX5, 0, &cyclwarr_charlayout,    0, 512},
495   { REGION_GFX5, 0, &cyclwarr_charlayout2,   0, 512},
496   { -1 }
497};
487static GFXDECODE_START( cyclwarr )
488   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout,    8192, 512)
489   GFXDECODE_ENTRY( REGION_GFX5, 0, cyclwarr_charlayout,    0, 512)
490   GFXDECODE_ENTRY( REGION_GFX5, 0, cyclwarr_charlayout2,   0, 512)
491GFXDECODE_END
498492
499493/******************************************************************************/
500494
r1051r1052
538532   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
539533   MDRV_SCREEN_SIZE(40*8, 32*8)
540534   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
541   MDRV_GFXDECODE(gfxdecodeinfo_apache3)
535   MDRV_GFXDECODE(apache3)
542536   MDRV_PALETTE_LENGTH(1024 + 4096) /* 1024 real colours, and 4096 arranged as series of cluts */
543537
544538   MDRV_VIDEO_START(apache3)
r1051r1052
580574   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
581575   MDRV_SCREEN_SIZE(40*8, 32*8)
582576   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
583   MDRV_GFXDECODE(roundup5_gfxdecodeinfo)
577   MDRV_GFXDECODE(roundup5)
584578   MDRV_PALETTE_LENGTH(1024 + 4096) /* 1024 real colours, and 4096 arranged as series of cluts */
585579
586580   MDRV_VIDEO_START(roundup5)
r1051r1052
623617   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
624618   MDRV_SCREEN_SIZE(40*8, 32*8)
625619   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
626   MDRV_GFXDECODE(cyclwarr_gfxdecodeinfo)
620   MDRV_GFXDECODE(cyclwarr)
627621   MDRV_PALETTE_LENGTH(8192 + 8192) //todo
628622
629623   MDRV_VIDEO_START(cyclwarr)
src/mame/drivers/supbtime.c
r1051r1052
352352   32*32
353353};
354354
355static const gfx_decode gfxdecodeinfo[] =
356{
357   { REGION_GFX1, 0, &tile_8x8_layout,     0x100, 32 },   /* Tiles (8x8) */
358   { REGION_GFX1, 0, &tile_16x16_layout,   0x100, 32 },   /* Tiles (16x16) */
359   { REGION_GFX2, 0, &spritelayout,        0, 16 },   /* Sprites (16x16) */
360   { -1 }
361};
355static GFXDECODE_START( supbtime )
356   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,     0x100, 32 )   /* Tiles (8x8) */
357   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_16x16_layout,   0x100, 32 )   /* Tiles (16x16) */
358   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,        0, 16 )   /* Sprites (16x16) */
359GFXDECODE_END
362360
363361/******************************************************************************/
364362
r1051r1052
391389   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
392390   MDRV_SCREEN_SIZE(40*8, 32*8)
393391   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
394   MDRV_GFXDECODE(gfxdecodeinfo)
392   MDRV_GFXDECODE(supbtime)
395393   MDRV_PALETTE_LENGTH(1024)
396394
397395   MDRV_VIDEO_START(supbtime)
r1051r1052
430428   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
431429   MDRV_SCREEN_SIZE(40*8, 32*8)
432430   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
433   MDRV_GFXDECODE(gfxdecodeinfo)
431   MDRV_GFXDECODE(supbtime)
434432   MDRV_PALETTE_LENGTH(1024)
435433
436434   MDRV_VIDEO_START(supbtime)
src/mame/drivers/blmbycar.c
r1051r1052
378378};
379379
380380/* Layers both use the first $20 color codes. Sprites the next $10 */
381static const gfx_decode blmbycar_gfxdecodeinfo[] =
382{
383   { REGION_GFX1, 0, &layout_16x16x4, 0x0, 0x30 }, // [0] Layers + Sprites
384   { -1 }
385};
381static GFXDECODE_START( blmbycar )
382   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0x0, 0x30 ) // [0] Layers + Sprites
383GFXDECODE_END
386384
387385
388386
r1051r1052
409407   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
410408   MDRV_SCREEN_SIZE(0x180, 0x100)
411409   MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0x100-1)
412   MDRV_GFXDECODE(blmbycar_gfxdecodeinfo)
410   MDRV_GFXDECODE(blmbycar)
413411   MDRV_PALETTE_LENGTH(0x300)
414412
415413   MDRV_VIDEO_START(blmbycar)
r1051r1052
439437   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
440438   MDRV_SCREEN_SIZE(0x180, 0x100)
441439   MDRV_SCREEN_VISIBLE_AREA(0, 0x180-1, 16, 0x100-1)
442   MDRV_GFXDECODE(blmbycar_gfxdecodeinfo)
440   MDRV_GFXDECODE(blmbycar)
443441   MDRV_PALETTE_LENGTH(0x300)
444442
445443   MDRV_VIDEO_START(blmbycar)
src/mame/drivers/retofinv.c
r1051r1052
353353     64*8
354354};
355355
356static const gfx_decode gfxdecodeinfo[] =
357{
358   { REGION_GFX1, 0, &charlayout,             0, 256 },
359   { REGION_GFX2, 0, &bglayout,     64*16+256*2,  64 },
360   { REGION_GFX3, 0, &spritelayout,       256*2,  64 },
361   { -1 }
362};
356static GFXDECODE_START( retofinv )
357   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,             0, 256 )
358   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,     64*16+256*2,  64 )
359   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,       256*2,  64 )
360GFXDECODE_END
363361
364362
365363
r1051r1052
390388   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
391389   MDRV_SCREEN_SIZE(36*8, 28*8)
392390   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
393   MDRV_GFXDECODE(gfxdecodeinfo)
391   MDRV_GFXDECODE(retofinv)
394392   MDRV_PALETTE_LENGTH(256)
395393   MDRV_COLORTABLE_LENGTH(256*2+64*16+64*16)
396394
src/mame/drivers/meadows.c
r1051r1052
557557};
558558
559559
560static const gfx_decode gfxdecodeinfo[] =
561{
562   { REGION_GFX1, 0, &charlayout,    0, 1 },      /* character generator */
563   { REGION_GFX2, 0, &spritelayout, 0, 1 },      /* sprite prom 1 */
564   { REGION_GFX3, 0, &spritelayout, 0, 1 },      /* sprite prom 2 */
565   { REGION_GFX4, 0, &spritelayout, 0, 1 },      /* sprite prom 3 (unused) */
566   { REGION_GFX5, 0, &spritelayout, 0, 1 },      /* sprite prom 4 (unused) */
567   { -1 }
568};
560static GFXDECODE_START( meadows )
561   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 1 )      /* character generator */
562   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 1 )      /* sprite prom 1 */
563   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0, 1 )      /* sprite prom 2 */
564   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 0, 1 )      /* sprite prom 3 (unused) */
565   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout, 0, 1 )      /* sprite prom 4 (unused) */
566GFXDECODE_END
569567
570568
571static const gfx_decode minferno_gfxdecodeinfo[] =
572{
573   { REGION_GFX1, 0, &charlayout,   0, 4 },
574   { -1 }
575};
569static GFXDECODE_START( minferno )
570   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 4 )
571GFXDECODE_END
576572
577573
578574
r1051r1052
633629   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
634630   MDRV_SCREEN_SIZE(32*8, 30*8)
635631   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
636   MDRV_GFXDECODE(gfxdecodeinfo)
632   MDRV_GFXDECODE(meadows)
637633   MDRV_PALETTE_LENGTH(2)
638634
639635   MDRV_PALETTE_INIT(meadows)
r1051r1052
667663   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
668664   MDRV_SCREEN_SIZE(32*8, 32*8)
669665   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 24*8-1)
670   MDRV_GFXDECODE(minferno_gfxdecodeinfo)
666   MDRV_GFXDECODE(minferno)
671667   MDRV_PALETTE_LENGTH(2)
672668
673669   MDRV_PALETTE_INIT(meadows)
src/mame/drivers/bogeyman.c
r1051r1052
209209
210210/* Graphics Decode Information */
211211
212static const gfx_decode gfxdecodeinfo[] =
213{
214   { REGION_GFX1, 0x00000, &charlayout1,     16, 32 },
215   { REGION_GFX1, 0x00000, &charlayout2,     16, 32 },
216   { REGION_GFX2, 0x00000, &sprites,          0,  2 },
217   { REGION_GFX3, 0x00000, &tiles1a,     16+128,  8 },
218   { REGION_GFX3, 0x00000, &tiles1b,     16+128,  8 },
219   { REGION_GFX3, 0x04000, &tiles1a,     16+128,  8 },
220   { REGION_GFX3, 0x04000, &tiles1b,     16+128,  8 },
212static GFXDECODE_START( bogeyman )
213   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout1,     16, 32 )
214   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout2,     16, 32 )
215   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, sprites,          0,  2 )
216   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tiles1a,     16+128,  8 )
217   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tiles1b,     16+128,  8 )
218   GFXDECODE_ENTRY( REGION_GFX3, 0x04000, tiles1a,     16+128,  8 )
219   GFXDECODE_ENTRY( REGION_GFX3, 0x04000, tiles1b,     16+128,  8 )
221220   // colors 16+192 to 16+255 are currently unassigned
222   { -1 }
223};
221GFXDECODE_END
224222
225223
226224/* Machine Driver */
r1051r1052
240238   MDRV_SCREEN_SIZE(32*8, 32*8)
241239   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
242240
243   MDRV_GFXDECODE(gfxdecodeinfo)
241   MDRV_GFXDECODE(bogeyman)
244242   MDRV_PALETTE_LENGTH(16+256)
245243
246244   MDRV_PALETTE_INIT(bogeyman)
src/mame/drivers/srmp2.c
r1051r1052
10611061   16*16*2
10621062};
10631063
1064static const gfx_decode srmp2_gfxdecodeinfo[] =
1065{
1066   { REGION_GFX1, 0, &charlayout, 0, 64 },
1067   { -1 }
1068};
1064static GFXDECODE_START( srmp2 )
1065   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 )
1066GFXDECODE_END
10691067
1070static const gfx_decode srmp3_gfxdecodeinfo[] =
1071{
1072   { REGION_GFX1, 0, &charlayout, 0, 32 },
1073   { -1 }
1074};
1068static GFXDECODE_START( srmp3 )
1069   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 )
1070GFXDECODE_END
10751071
10761072
10771073static MACHINE_DRIVER_START( srmp2 )
r1051r1052
10921088   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10931089   MDRV_SCREEN_SIZE(464, 256-16)
10941090   MDRV_SCREEN_VISIBLE_AREA(16, 464-1, 8, 256-1-24)
1095   MDRV_GFXDECODE(srmp2_gfxdecodeinfo)
1091   MDRV_GFXDECODE(srmp2)
10961092   MDRV_PALETTE_LENGTH(1024)
10971093   MDRV_COLORTABLE_LENGTH(1024)   /* sprites only */
10981094
r1051r1052
11331129   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11341130   MDRV_SCREEN_SIZE(400, 256-16)
11351131   MDRV_SCREEN_VISIBLE_AREA(16, 400-1, 8, 256-1-24)
1136   MDRV_GFXDECODE(srmp3_gfxdecodeinfo)
1132   MDRV_GFXDECODE(srmp3)
11371133   MDRV_PALETTE_LENGTH(512)   /* sprites only */
11381134
11391135   MDRV_PALETTE_INIT(srmp3)
r1051r1052
11701166   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11711167   MDRV_SCREEN_SIZE(400, 256-16)
11721168   MDRV_SCREEN_VISIBLE_AREA(16, 400-1, 0, 256-1-16)
1173   MDRV_GFXDECODE(srmp3_gfxdecodeinfo)
1169   MDRV_GFXDECODE(srmp3)
11741170   MDRV_PALETTE_LENGTH(512)         /* sprites only */
11751171
11761172   MDRV_VIDEO_UPDATE(mjyuugi)         /* just draw the sprites */
src/mame/drivers/m72.c
r1051r1052
18041804   32*8   /* every sprite takes 32 consecutive bytes */
18051805};
18061806
1807static const gfx_decode m72_gfxdecodeinfo[] =
1808{
1809   { REGION_GFX1, 0, &spritelayout,    0, 16 },
1810   { REGION_GFX2, 0, &tilelayout,    256, 16 },
1811   { REGION_GFX3, 0, &tilelayout,    256, 16 },
1812   { -1 }
1813};
1807static GFXDECODE_START( m72 )
1808   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,    0, 16 )
1809   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    256, 16 )
1810   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,    256, 16 )
1811GFXDECODE_END
18141812
1815static const gfx_decode rtype2_gfxdecodeinfo[] =
1816{
1817   { REGION_GFX1, 0, &spritelayout,     0, 16 },
1818   { REGION_GFX2, 0, &tilelayout,     256, 16 },
1819   { -1 }
1820};
1813static GFXDECODE_START( rtype2 )
1814   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0, 16 )
1815   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     256, 16 )
1816GFXDECODE_END
18211817
1822static const gfx_decode majtitle_gfxdecodeinfo[] =
1823{
1824   { REGION_GFX1, 0, &spritelayout,     0, 16 },
1825   { REGION_GFX2, 0, &tilelayout,     256, 16 },
1826   { REGION_GFX3, 0, &spritelayout,     0, 16 },
1827   { -1 }
1828};
1818static GFXDECODE_START( majtitle )
1819   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0, 16 )
1820   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     256, 16 )
1821   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,     0, 16 )
1822GFXDECODE_END
18291823
18301824
18311825
r1051r1052
18581852   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18591853   MDRV_SCREEN_SIZE(512, 512)
18601854   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
1861   MDRV_GFXDECODE(m72_gfxdecodeinfo)
1855   MDRV_GFXDECODE(m72)
18621856   MDRV_PALETTE_LENGTH(512)
18631857
18641858   MDRV_VIDEO_START(m72)
r1051r1052
18971891   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18981892   MDRV_SCREEN_SIZE(512, 512)
18991893   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
1900   MDRV_GFXDECODE(m72_gfxdecodeinfo)
1894   MDRV_GFXDECODE(m72)
19011895   MDRV_PALETTE_LENGTH(512)
19021896
19031897   MDRV_VIDEO_START(m72)
r1051r1052
19401934   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19411935   MDRV_SCREEN_SIZE(512, 512)
19421936   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
1943   MDRV_GFXDECODE(m72_gfxdecodeinfo)
1937   MDRV_GFXDECODE(m72)
19441938   MDRV_PALETTE_LENGTH(512)
19451939
19461940   MDRV_VIDEO_START(m72)
r1051r1052
19831977   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19841978   MDRV_SCREEN_SIZE(512, 512)
19851979   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
1986   MDRV_GFXDECODE(m72_gfxdecodeinfo)
1980   MDRV_GFXDECODE(m72)
19871981   MDRV_PALETTE_LENGTH(512)
19881982
19891983   MDRV_VIDEO_START(m72)
r1051r1052
20252019   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20262020   MDRV_SCREEN_SIZE(512, 512)
20272021   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2028   MDRV_GFXDECODE(rtype2_gfxdecodeinfo)
2022   MDRV_GFXDECODE(rtype2)
20292023   MDRV_PALETTE_LENGTH(512)
20302024
20312025   MDRV_VIDEO_START(hharry)
r1051r1052
20662060   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20672061   MDRV_SCREEN_SIZE(512, 512)
20682062   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2069   MDRV_GFXDECODE(m72_gfxdecodeinfo)
2063   MDRV_GFXDECODE(m72)
20702064   MDRV_PALETTE_LENGTH(512)
20712065
20722066   MDRV_VIDEO_START(m72)
r1051r1052
21092103   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21102104   MDRV_SCREEN_SIZE(512, 512)
21112105   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2112   MDRV_GFXDECODE(rtype2_gfxdecodeinfo)
2106   MDRV_GFXDECODE(rtype2)
21132107   MDRV_PALETTE_LENGTH(512)
21142108
21152109   MDRV_VIDEO_START(rtype2)
r1051r1052
21512145   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21522146   MDRV_SCREEN_SIZE(512, 512)
21532147   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2154   MDRV_GFXDECODE(majtitle_gfxdecodeinfo)
2148   MDRV_GFXDECODE(majtitle)
21552149   MDRV_PALETTE_LENGTH(512)
21562150
21572151   MDRV_VIDEO_START(majtitle)
r1051r1052
21932187   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21942188   MDRV_SCREEN_SIZE(512, 512)
21952189   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2196   MDRV_GFXDECODE(rtype2_gfxdecodeinfo)
2190   MDRV_GFXDECODE(rtype2)
21972191   MDRV_PALETTE_LENGTH(512)
21982192
21992193   MDRV_VIDEO_START(hharry)
r1051r1052
22362230   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22372231   MDRV_SCREEN_SIZE(512, 512)
22382232   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2239   MDRV_GFXDECODE(rtype2_gfxdecodeinfo)
2233   MDRV_GFXDECODE(rtype2)
22402234   MDRV_PALETTE_LENGTH(512)
22412235
22422236   MDRV_VIDEO_START(rtype2)
r1051r1052
22782272   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22792273   MDRV_SCREEN_SIZE(512, 512)
22802274   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2281   MDRV_GFXDECODE(rtype2_gfxdecodeinfo)
2275   MDRV_GFXDECODE(rtype2)
22822276   MDRV_PALETTE_LENGTH(512)
22832277
22842278   MDRV_VIDEO_START(poundfor)
r1051r1052
23202314   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23212315   MDRV_SCREEN_SIZE(512, 512)
23222316   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 16*8, (64-16)*8-1 )
2323   MDRV_GFXDECODE(rtype2_gfxdecodeinfo)
2317   MDRV_GFXDECODE(rtype2)
23242318   MDRV_PALETTE_LENGTH(512)
23252319
23262320   MDRV_VIDEO_START(poundfor)
src/mame/drivers/ohmygod.c
r1051r1052
320320   128*8
321321};
322322
323static const gfx_decode gfxdecodeinfo[] =
324{
325   { REGION_GFX1, 0, &charlayout,     0, 16 },   /* colors   0-255 */
326   { REGION_GFX2, 0, &spritelayout, 512, 16 },   /* colors 512-767 */
327   { -1 }
328};
323static GFXDECODE_START( ohmygod )
324   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )   /* colors   0-255 */
325   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 512, 16 )   /* colors 512-767 */
326GFXDECODE_END
329327
330328
331329
r1051r1052
347345   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
348346   MDRV_SCREEN_SIZE(64*8, 32*8)
349347   MDRV_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 0*8, 30*8-1 )
350   MDRV_GFXDECODE(gfxdecodeinfo)
348   MDRV_GFXDECODE(ohmygod)
351349   MDRV_PALETTE_LENGTH(1024)
352350
353351   MDRV_VIDEO_START(ohmygod)
src/mame/drivers/pokechmp.c
r1051r1052
238238};
239239
240240
241static const gfx_decode gfxdecodeinfo[] =
242{
243   { REGION_GFX1, 0x00000, &pokechmp_charlayout,   0x100, 32 }, /* chars */
244   { REGION_GFX2, 0x00000, &pokechmp_spritelayout,   0,  32 }, /* sprites */
245   { -1 }
246};
241static GFXDECODE_START( pokechmp )
242   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, pokechmp_charlayout,   0x100, 32 ) /* chars */
243   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, pokechmp_spritelayout,   0,  32 ) /* sprites */
244GFXDECODE_END
247245
248246
249247static MACHINE_DRIVER_START( pokechmp )
r1051r1052
265263   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
266264   MDRV_SCREEN_SIZE(32*8, 32*8)
267265   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
268   MDRV_GFXDECODE(gfxdecodeinfo)
266   MDRV_GFXDECODE(pokechmp)
269267   MDRV_PALETTE_LENGTH(0x400)
270268
271269   MDRV_VIDEO_START(pokechmp)
src/mame/drivers/snk68.c
r1051r1052
660660   8*32   /* every sprite takes 32 consecutive bytes */
661661};
662662
663static const gfx_decode pow_gfxdecodeinfo[] =
664{
665   { REGION_GFX1, 0, &charlayout,       0, 128 },
666   { REGION_GFX2, 0, &pow_spritelayout, 0, 128 },
667   { -1 }
668};
663static GFXDECODE_START( pow )
664   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 128 )
665   GFXDECODE_ENTRY( REGION_GFX2, 0, pow_spritelayout, 0, 128 )
666GFXDECODE_END
669667
670static const gfx_decode searchar_gfxdecodeinfo[] =
671{
672   { REGION_GFX1, 0, &charlayout,           0,  16 },
673   { REGION_GFX2, 0, &searchar_spritelayout, 0, 128 },
674   { -1 }
675};
668static GFXDECODE_START( searchar )
669   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0,  16 )
670   GFXDECODE_ENTRY( REGION_GFX2, 0, searchar_spritelayout, 0, 128 )
671GFXDECODE_END
676672
677static const gfx_decode ikari3_gfxdecodeinfo[] =
678{
679   { REGION_GFX1, 0, &charlayout,         0,   16 },
680   { REGION_GFX2, 0, &ikari3_spritelayout, 0, 128 },
681   { -1 }
682};
673static GFXDECODE_START( ikari3 )
674   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0,   16 )
675   GFXDECODE_ENTRY( REGION_GFX2, 0, ikari3_spritelayout, 0, 128 )
676GFXDECODE_END
683677
684678/******************************************************************************/
685679
r1051r1052
720714   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
721715   MDRV_SCREEN_SIZE(32*8, 32*8)
722716   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
723   MDRV_GFXDECODE(ikari3_gfxdecodeinfo)
717   MDRV_GFXDECODE(ikari3)
724718   MDRV_PALETTE_LENGTH(2048)
725719
726720   MDRV_VIDEO_START(ikari3)
r1051r1052
759753   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
760754   MDRV_SCREEN_SIZE(32*8, 32*8)
761755   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
762   MDRV_GFXDECODE(pow_gfxdecodeinfo)
756   MDRV_GFXDECODE(pow)
763757   MDRV_PALETTE_LENGTH(2048)
764758
765759   MDRV_VIDEO_START(pow)
r1051r1052
798792   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
799793   MDRV_SCREEN_SIZE(32*8, 32*8)
800794   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
801   MDRV_GFXDECODE(searchar_gfxdecodeinfo)
795   MDRV_GFXDECODE(searchar)
802796   MDRV_PALETTE_LENGTH(2048)
803797
804798   MDRV_VIDEO_START(searchar)
r1051r1052
837831   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
838832   MDRV_SCREEN_SIZE(32*8, 32*8)
839833   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
840   MDRV_GFXDECODE(searchar_gfxdecodeinfo)
834   MDRV_GFXDECODE(searchar)
841835   MDRV_PALETTE_LENGTH(2048)
842836
843837   MDRV_VIDEO_START(pow)
src/mame/drivers/madalien.c
r1051r1052
546546};
547547
548548
549static const gfx_decode madalien_gfxdecodeinfo[] =
550{
551   { 0, 0, &charlayout_memory,   0, 8 }, /* characters (the game dynamically modifies them) */
552   { REGION_GFX1, 0, &tilelayout,   0, 8 },   /* background tiles */
553   { -1 }
554};
549static GFXDECODE_START( madalien )
550   GFXDECODE_ENTRY( 0, 0, charlayout_memory,   0, 8 ) /* characters (the game dynamically modifies them) */
551   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0, 8 )   /* background tiles */
552GFXDECODE_END
555553
556554
557555static ADDRESS_MAP_START( madalien_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r1051r1052
672670   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
673671   MDRV_SCREEN_SIZE(32*8, 32*8)
674672   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
675   MDRV_GFXDECODE(madalien_gfxdecodeinfo)
673   MDRV_GFXDECODE(madalien)
676674   MDRV_PALETTE_LENGTH(2*32)
677675   MDRV_PALETTE_INIT(madalien)
678676   MDRV_VIDEO_START(madalien)
src/mame/drivers/aeroboto.c
r1051r1052
236236   16*8
237237};
238238
239static const gfx_decode gfxdecodeinfo[] =
240{
241   { REGION_GFX1, 0, &charlayout,     0,  64 },     /* chars */
242//  { REGION_GFX2, 0, &starlayout,     0, 128 },     /* sky */
243   { REGION_GFX3, 0, &spritelayout,   0,   8 },
244   { -1 }
245};
239static GFXDECODE_START( aeroboto )
240   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0,  64 )     /* chars */
241//  GFXDECODE_ENTRY( REGION_GFX2, 0, starlayout,     0, 128 )     /* sky */
242   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0,   8 )
243GFXDECODE_END
246244
247245
248246
r1051r1052
270268   /* video hardware */
271269   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
272270   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
273   MDRV_GFXDECODE(gfxdecodeinfo)
271   MDRV_GFXDECODE(aeroboto)
274272
275273   MDRV_SCREEN_SIZE(32*8, 32*8)
276274   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 2*8, 30*8-1)
src/mame/drivers/firetrap.c
r1051r1052
522522   32*8
523523};
524524
525static const gfx_decode gfxdecodeinfo[] =
526{
527   { REGION_GFX1, 0, &charlayout,   0x00, 16 },   /* colors 0x00-0x3f */
528   { REGION_GFX2, 0, &tilelayout,   0x80,  4 },   /* colors 0x80-0xbf */
529   { REGION_GFX3, 0, &tilelayout,   0xc0,  4 },   /* colors 0xc0-0xff */
530   { REGION_GFX4, 0, &spritelayout, 0x40,  4 },   /* colors 0x40-0x7f */
531   { -1 }
532};
525static GFXDECODE_START( firetrap )
526   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x00, 16 )   /* colors 0x00-0x3f */
527   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0x80,  4 )   /* colors 0x80-0xbf */
528   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,   0xc0,  4 )   /* colors 0xc0-0xff */
529   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 0x40,  4 )   /* colors 0x40-0x7f */
530GFXDECODE_END
533531
534532
535533
r1051r1052
593591   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
594592   MDRV_SCREEN_SIZE(32*8, 32*8)
595593   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
596   MDRV_GFXDECODE(gfxdecodeinfo)
594   MDRV_GFXDECODE(firetrap)
597595   MDRV_PALETTE_LENGTH(256)
598596
599597   MDRV_PALETTE_INIT(firetrap)
r1051r1052
631629   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
632630   MDRV_SCREEN_SIZE(32*8, 32*8)
633631   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
634   MDRV_GFXDECODE(gfxdecodeinfo)
632   MDRV_GFXDECODE(firetrap)
635633   MDRV_PALETTE_LENGTH(256)
636634
637635   MDRV_PALETTE_INIT(firetrap)
src/mame/drivers/crgolf.c
r1051r1052
427427   ROM_LOAD( "epr5889.5k", 0x2e000, 0x2000, CRC(88357391) SHA1(afdb5ed6555adf60bd64808413fc72fa5c67b6ec) )
428428
429429   ROM_REGION( 0x10000, REGION_CPU2, 0 )
430   ROM_LOAD( "epr6198.1f",  0x0000, 0x2000, CRC(388c33d6) SHA1(42fd19c4b4ec7538d6c437552efb258bf2dcebc0) )
430   ROM_LOAD( "epr6198.1f",  0x0000, 0x1000, CRC(388c33d6) SHA1(42fd19c4b4ec7538d6c437552efb258bf2dcebc0) )
431431   ROM_LOAD( "epr5892.1e",  0x2000, 0x2000, CRC(608dc2e2) SHA1(d906537cffd3e055f52f37a0490b3bb63107b2f9) )
432432   ROM_LOAD( "epr5891a.1d", 0x4000, 0x2000, CRC(f353b585) SHA1(f09dcd0240131f872ceef5ddc9c89ab2fc92d117) )
433433   ROM_LOAD( "epr5890a.1c", 0x6000, 0x2000, CRC(b737c2e8) SHA1(8596abbdff74300230b5ec5bf8acfe222eb3414f) )
r1051r1052
455455   ROM_LOAD( "epr5889.5k", 0x2e000, 0x2000, CRC(88357391) SHA1(afdb5ed6555adf60bd64808413fc72fa5c67b6ec) )
456456
457457   ROM_REGION( 0x10000, REGION_CPU2, 0 )
458   ROM_LOAD( "epr6144.1f",  0x0000, 0x2000, CRC(b677f818) SHA1(d2f4c913a41ec7a935135fb08587257f9e939436) )
458   ROM_LOAD( "epr6144.1f",  0x0000, 0x1000, CRC(3fdc8cd6) SHA1(01d118d56a0e363af66a36ba583c4cbce86ee1d1) )
459459   ROM_LOAD( "epr5892.1e",  0x2000, 0x2000, CRC(608dc2e2) SHA1(d906537cffd3e055f52f37a0490b3bb63107b2f9) )
460460   ROM_LOAD( "epr5891a.1d", 0x4000, 0x2000, CRC(f353b585) SHA1(f09dcd0240131f872ceef5ddc9c89ab2fc92d117) )
461461   ROM_LOAD( "epr5890a.1c", 0x6000, 0x2000, CRC(b737c2e8) SHA1(8596abbdff74300230b5ec5bf8acfe222eb3414f) )
src/mame/drivers/mastboy.c
r1051r1052
835835};
836836
837837
838static const gfx_decode gfxdecodeinfo[] =
839{
840   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
841   { REGION_GFX2,  0, &tiles8x8_layout_2, 0, 16 },
842   { -1 }
843};
838static GFXDECODE_START( mastboy )
839   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
840   GFXDECODE_ENTRY( REGION_GFX2,  0, tiles8x8_layout_2, 0, 16 )
841GFXDECODE_END
844842
845843/* Machine Functions / Driver */
846844
r1051r1052
877875   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
878876   MDRV_SCREEN_SIZE(256, 256)
879877   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
880   MDRV_GFXDECODE(gfxdecodeinfo)
878   MDRV_GFXDECODE(mastboy)
881879   MDRV_PALETTE_LENGTH(0x100)
882880
883881   MDRV_VIDEO_START(mastboy)
src/mame/drivers/thedeep.c
r1051r1052
306306   16*16
307307};
308308
309static const gfx_decode thedeep_gfxdecodeinfo[] =
310{
311   { REGION_GFX1, 0, &layout_16x16x4,   0x080,  8 }, // [0] Sprites
312   { REGION_GFX2, 0, &layout_16x16x4,   0x100, 16 }, // [1] Background Layer
313   { REGION_GFX3, 0, &layout_8x8x2,   0x000, 16 }, // [2] Text Layer
314   { -1 }
315};
309static GFXDECODE_START( thedeep )
310   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,   0x080,  8 ) // [0] Sprites
311   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,   0x100, 16 ) // [1] Background Layer
312   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x2,   0x000, 16 ) // [2] Text Layer
313GFXDECODE_END
316314
317315
318316
r1051r1052
384382   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
385383   MDRV_SCREEN_SIZE(0x100, 0xf8)
386384   MDRV_SCREEN_VISIBLE_AREA(0, 0x100-1, 0, 0xf8-1)
387   MDRV_GFXDECODE(thedeep_gfxdecodeinfo)
385   MDRV_GFXDECODE(thedeep)
388386   MDRV_PALETTE_LENGTH(512)
389387
390388   MDRV_PALETTE_INIT(thedeep)
src/mame/drivers/oneshot.c
r1051r1052
351351};
352352
353353
354static const gfx_decode gfxdecodeinfo[] =
355{
356   { REGION_GFX1, 0, &oneshot16x16_layout,   0x00, 4  }, /* sprites */
357   { REGION_GFX1, 0, &oneshot8x8_layout,     0x00, 4  }, /* sprites */
358   { -1 }
359};
354static GFXDECODE_START( oneshot )
355   GFXDECODE_ENTRY( REGION_GFX1, 0, oneshot16x16_layout,   0x00, 4  ) /* sprites */
356   GFXDECODE_ENTRY( REGION_GFX1, 0, oneshot8x8_layout,     0x00, 4  ) /* sprites */
357GFXDECODE_END
360358
361359static void irq_handler(int irq)
362360{
r1051r1052
381379   MDRV_SCREEN_REFRESH_RATE(60)
382380   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
383381
384   MDRV_GFXDECODE(gfxdecodeinfo)
382   MDRV_GFXDECODE(oneshot)
385383
386384   /* video hardware */
387385   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/stlforce.c
r1051r1052
191191   32*8
192192};
193193
194static const gfx_decode gfxdecodeinfo[] =
195{
196   { REGION_GFX1, 0, &stlforce_bglayout, 0, 256  },
197   { REGION_GFX1, 0, &stlforce_txlayout, 0, 256  },
198   { REGION_GFX2, 0, &stlforce_splayout, 0, 256  },
199   { -1 }
200};
194static GFXDECODE_START( stlforce )
195   GFXDECODE_ENTRY( REGION_GFX1, 0, stlforce_bglayout, 0, 256  )
196   GFXDECODE_ENTRY( REGION_GFX1, 0, stlforce_txlayout, 0, 256  )
197   GFXDECODE_ENTRY( REGION_GFX2, 0, stlforce_splayout, 0, 256  )
198GFXDECODE_END
201199
202200static UINT8 stlforce_default_eeprom[128] = {
203201   0x7e, 0x01, 0x00, 0x00, 0x01, 0x03, 0x05, 0x01, 0x01, 0x00, 0x4e, 0x20, 0x00, 0x00, 0x4a, 0x4d,
r1051r1052
257255   MDRV_SCREEN_SIZE(64*8, 32*8)
258256   MDRV_SCREEN_VISIBLE_AREA(1*8, 47*8-1, 0*8, 30*8-1)
259257
260   MDRV_GFXDECODE(gfxdecodeinfo)
258   MDRV_GFXDECODE(stlforce)
261259   MDRV_PALETTE_LENGTH(0x800)
262260
263261   MDRV_VIDEO_START(stlforce)
src/mame/drivers/rmhaihai.c
r1051r1052
484484   16*8
485485};
486486
487static const gfx_decode gfxdecodeinfo1[] =
488{
489   { REGION_GFX1, 0, &charlayout, 0, 32 },
490   { -1 }
491};
487static GFXDECODE_START( 1 )
488   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 )
489GFXDECODE_END
492490
493static const gfx_decode gfxdecodeinfo2[] =
494{
495   { REGION_GFX1, 0, &charlayout, 0, 64 },
496   { -1 }
497};
491static GFXDECODE_START( 2 )
492   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 )
493GFXDECODE_END
498494
499495
500496
r1051r1052
528524   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
529525   MDRV_SCREEN_SIZE(64*8, 32*8)
530526   MDRV_SCREEN_VISIBLE_AREA(4*8, 60*8-1, 2*8, 30*8-1)
531   MDRV_GFXDECODE(gfxdecodeinfo1)
527   MDRV_GFXDECODE(1)
532528   MDRV_PALETTE_LENGTH(0x100)
533529
534530   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
553549   MDRV_IMPORT_FROM(rmhaihai)
554550
555551   /* video hardware */
556   MDRV_GFXDECODE(gfxdecodeinfo2)
552   MDRV_GFXDECODE(2)
557553   MDRV_PALETTE_LENGTH(0x200)
558554MACHINE_DRIVER_END
559555
r1051r1052
569565   MDRV_MACHINE_RESET(themj)
570566
571567   /* video hardware */
572   MDRV_GFXDECODE(gfxdecodeinfo2)
568   MDRV_GFXDECODE(2)
573569   MDRV_PALETTE_LENGTH(0x200)
574570MACHINE_DRIVER_END
575571
src/mame/drivers/topspeed.c
r1051r1052
643643   32*8   /* every sprite takes 32 consecutive bytes */
644644};
645645
646static const gfx_decode topspeed_gfxdecodeinfo[] =
647{
648   { REGION_GFX2, 0x0, &tile16x8_layout,  0, 256 },   /* sprite parts */
649   { REGION_GFX1, 0x0, &charlayout,  0, 256 },      /* sprites & playfield */
646static GFXDECODE_START( topspeed )
647   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x8_layout,  0, 256 )   /* sprite parts */
648   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,  0, 256 )      /* sprites & playfield */
650649   // Road Lines gfxdecodable ?
651   { -1 }
652};
650GFXDECODE_END
653651
654652
655653/**************************************************************
r1051r1052
716714   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
717715   MDRV_SCREEN_SIZE(40*8, 32*8)
718716   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
719   MDRV_GFXDECODE(topspeed_gfxdecodeinfo)
717   MDRV_GFXDECODE(topspeed)
720718   MDRV_PALETTE_LENGTH(8192)
721719
722720   MDRV_VIDEO_START(topspeed)
src/mame/drivers/amspdwy.c
r1051r1052
243243   8*8
244244};
245245
246static const gfx_decode amspdwy_gfxdecodeinfo[] =
247{
248   { REGION_GFX1, 0, &layout_8x8x2,   0, 8 }, // [0] Layer & Sprites
249   { -1 }
250};
246static GFXDECODE_START( amspdwy )
247   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x2,   0, 8 ) // [0] Layer & Sprites
248GFXDECODE_END
251249
252250
253251
r1051r1052
290288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
291289   MDRV_SCREEN_SIZE(256, 256)
292290   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
293   MDRV_GFXDECODE(amspdwy_gfxdecodeinfo)
291   MDRV_GFXDECODE(amspdwy)
294292   MDRV_PALETTE_LENGTH(32)
295293
296294   MDRV_VIDEO_START(amspdwy)
src/mame/drivers/segae.c
r1051r1052
308308static struct sms_vdp *vdp2;
309309static struct sms_vdp *vdp1;
310310
311static struct sms_vdp *md_sms_vdp;
312
311313/* All Accesses to VRAM go through here for safety */
312314#define SMS_VDP_VRAM(address) chip->vram[(address)&0x3fff]
313315
r1051r1052
589591   return 0;
590592}
591593
594int sms_vdp_cpu1_irq_callback(int status)
595{
596   if (status==1)
597   {
598      cpunum_set_input_line(1,0,HOLD_LINE);
599   }
600   else
601   {
602      cpunum_set_input_line(1,0,CLEAR_LINE);
603   }
604
605   return 0;
606}
607
608
592609int sms_vdp_cpu2_irq_callback(int status)
593610{
594611   if (status==1)
r1051r1052
716733   return chip;
717734}
718735
736/* stop timer and clear ram.. used on megatech when we switch between genesis and sms mode */
737void segae_md_sms_stop_scanline_timer(void)
738{
739   mame_timer_adjust_ptr(md_sms_vdp->sms_scanline_timer,  time_never, time_never);
740   memset(md_sms_vdp->vram,0x00,0x4000);
741}
719742
743
720744#ifdef UNUSED_FUNCTION
721745static READ8_HANDLER( z80_unmapped_r )
722746{
r1051r1052
917941   }
918942}
919943
944/* for the Genesis */
920945
946READ8_HANDLER( md_sms_vdp_vcounter_r )
947{
948   return vcounter_r(md_sms_vdp);
949}
921950
951READ8_HANDLER( md_sms_vdp_data_r )
952{
953   return vdp_data_r(md_sms_vdp);
954}
922955
956WRITE8_HANDLER( md_sms_vdp_data_w )
957{
958   vdp_data_w(data, md_sms_vdp);
959}
923960
961READ8_HANDLER( md_sms_vdp_ctrl_r )
962{
963   return vdp_ctrl_r(md_sms_vdp);
964}
965
966WRITE8_HANDLER( md_sms_vdp_ctrl_w )
967{
968   vdp_ctrl_w(data, md_sms_vdp);
969}
970
971
924972/* Read / Write Handlers - call other functions */
925973
926974READ8_HANDLER( sms_vcounter_r )
r1051r1052
14021450      visarea.min_y = 0;
14031451      visarea.max_y = sms_mode_table[chip->screen_mode].sms2_height-1;
14041452
1405      // this doesn't seem to be allowed in 113u2
1406      //video_screen_configure(0, 256, sms_mode_table[chip->screen_mode].sms2_height, &visarea, chip->sms_framerate);
1453      if (chip->chip_id==3) video_screen_configure(0, 256, 256, &visarea, HZ_TO_SUBSECONDS(chip->sms_framerate));
1454
14071455   }
14081456   else /* 160x144 */
14091457   {
r1051r1052
14121460      visarea.max_x = (256-160)/2+160-1;
14131461      visarea.min_y = (192-144)/2;
14141462      visarea.max_y = (192-144)/2+144-1;
1415
1416      // this doesn't seem to be allowed in 113u2
1417      //video_screen_configure(0, 256, sms_mode_table[chip->screen_mode].sms2_height, &visarea, chip->sms_framerate);
1418
14191463   }
14201464
14211465
r1051r1052
19051949   mame_timer_adjust_ptr(vdp2->sms_scanline_timer, time_zero, time_zero);
19061950}
19071951
1952MACHINE_RESET(megatech_md_sms)
1953{
1954   mame_timer_adjust_ptr(md_sms_vdp->sms_scanline_timer, time_zero, time_zero);
1955}
1956
19081957MACHINE_RESET(megatech_bios)
19091958{
19101959   mame_timer_adjust_ptr(vdp1->sms_scanline_timer, time_zero, time_zero);
r1051r1052
19161965   end_of_frame(vdp2);
19171966}
19181967
1968
1969VIDEO_EOF(megatech_md_sms)
1970{
1971   end_of_frame(md_sms_vdp);
1972}
1973
19191974VIDEO_EOF(megatech_bios)
19201975{
19211976   end_of_frame(vdp1);
19221977}
19231978
1979VIDEO_UPDATE(megatech_md_sms)
1980{
1981   int x,y;
19241982
1983   for (y=0;y<224;y++)
1984   {
1985      UINT16* lineptr = BITMAP_ADDR16(bitmap, y, 0);
1986      UINT16* srcptr =  BITMAP_ADDR16(md_sms_vdp->r_bitmap, y, 0);
1987
1988      for (x=0;x<256;x++)
1989      {
1990         lineptr[x]=srcptr[x]&0x7fff;
1991      }
1992   }
1993
1994   return 0;
1995}
1996
1997
19251998VIDEO_UPDATE(megatech_bios)
19261999{
19272000   int x,y;
r1051r1052
21602233   init_ports_systeme();
21612234}
21622235
2236void init_for_megadrive(void)
2237{
2238   md_sms_vdp = start_vdp(Machine, GEN_VDP);
2239   md_sms_vdp->set_irq = sms_vdp_cpu1_irq_callback;
2240   md_sms_vdp->is_pal = 0;
2241   md_sms_vdp->sms_total_scanlines = 262;
2242   md_sms_vdp->sms_framerate = 60;
2243   md_sms_vdp->chip_id = 3;
2244}
21632245
2246
2247
21642248DRIVER_INIT( megatech_bios )
21652249{
21662250//  init_systeme_map();
src/mame/drivers/fantland.c
r1051r1052
682682   16*16*6
683683};
684684
685static const gfx_decode fantland_gfxdecodeinfo[] =
686{
687   { REGION_GFX1, 0, &layout16x16x6, 0, 4 }, // [0] Sprites
688   { -1 }
689};
685static GFXDECODE_START( fantland )
686   GFXDECODE_ENTRY( REGION_GFX1, 0, layout16x16x6, 0, 4 ) // [0] Sprites
687GFXDECODE_END
690688
691689/***************************************************************************
692690
r1051r1052
735733   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
736734   MDRV_SCREEN_SIZE(352,256)
737735   MDRV_SCREEN_VISIBLE_AREA(0, 352-1, 0, 256-1)
738   MDRV_GFXDECODE(fantland_gfxdecodeinfo)
736   MDRV_GFXDECODE(fantland)
739737   MDRV_PALETTE_LENGTH(256)
740738
741739   MDRV_VIDEO_UPDATE(fantland)
r1051r1052
784782   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
785783   MDRV_SCREEN_SIZE(352,256)
786784   MDRV_SCREEN_VISIBLE_AREA(0, 352-1, 0, 256-1)
787   MDRV_GFXDECODE(fantland_gfxdecodeinfo)
785   MDRV_GFXDECODE(fantland)
788786   MDRV_PALETTE_LENGTH(256)
789787
790788   MDRV_VIDEO_UPDATE(fantland)
r1051r1052
836834   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
837835   MDRV_SCREEN_SIZE(352,256)
838836   MDRV_SCREEN_VISIBLE_AREA(0, 352-1, 0, 256-1)
839   MDRV_GFXDECODE(fantland_gfxdecodeinfo)
837   MDRV_GFXDECODE(fantland)
840838   MDRV_PALETTE_LENGTH(256)
841839
842840   MDRV_VIDEO_UPDATE(fantland)
src/mame/drivers/dominob.c
r0r1052
1/***************************************************************************
2 Domino Block
3
4 Driver by Tomasz Slanina
5 some bits by David Haywood
6
7 based on the Arkanoid driver
8
9 This is a hacked up version of Arkanoid with high colour backgrounds
10 and gameplay modifications.  It runs on custom Korean hardware.
11
12 Button 1 = 'use Domino' - The ball will bounce along the bricks in a
13                           horizontal line, without coming down
14
15 Button 2 = 'use Rocked' - Your paddle will jump to the top of the screen
16                           then back down, destroying everything in its
17                           path
18
19***************************************************************************/
20
21#include "driver.h"
22#include "cpu/z80/z80.h"
23#include "sound/ay8910.h"
24
25VIDEO_START( dominob )
26{
27   machine->gfx[0]->color_granularity=8;
28}
29
30static UINT8 *bgram;
31
32static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
33{
34   int offs;
35
36   for (offs = 0;offs < spriteram_size;offs += 4)
37   {
38      int sx,sy,code;
39
40      sx = spriteram[offs];
41      sy = 248 - spriteram[offs + 1];
42      if (flip_screen_x) sx = 248 - sx;
43      if (flip_screen_y) sy = 248 - sy;
44
45      code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8)  ;
46
47      drawgfx(bitmap,machine->gfx[0],
48            2 * code,
49            ((spriteram[offs + 2] & 0xf8) >> 3)  ,
50            flip_screen_x,flip_screen_y,
51            sx,sy + (flip_screen_y ? 8 : -8),
52            cliprect,TRANSPARENCY_PEN,0);
53      drawgfx(bitmap,machine->gfx[0],
54            2 * code + 1,
55            ((spriteram[offs + 2] & 0xf8) >> 3)  ,
56            flip_screen_x,flip_screen_y,
57            sx,sy,
58            cliprect,TRANSPARENCY_PEN,0);
59   }
60}
61
62
63VIDEO_UPDATE( dominob )
64{
65   /* Convert to tilemaps? */
66   {
67      int x,y;
68      int index=0;
69      for(y=0;y<256/32;y++)
70          for(x=0;x<256/32;x++)
71          {
72             drawgfx(   bitmap,
73                           machine->gfx[1],
74                           bgram[index]+256*(bgram[index+1]&0xf),
75                  bgram[index+1]>>4,
76                  0, 0,
77                  x*32,y*32,
78                  cliprect,
79                  TRANSPARENCY_NONE,0);
80            index+=2;
81          }
82   }
83
84
85
86   {
87      int x,y;
88      for(y=0;y<32;y++)
89          for(x=0;x<32;x++)
90          {
91             drawgfx(   bitmap,
92                  machine->gfx[0],
93                  videoram[(y*32+x)*2+1]+(videoram[(y*32+x)*2]&7)*256,
94                  (videoram[(y*32+x)*2]>>3),
95                  0, 0,
96                  x*8,y*8,
97                  cliprect,
98                  TRANSPARENCY_PEN,0);
99          }
100   }
101   draw_sprites(machine, bitmap, cliprect);
102
103   return 0;
104}
105
106
107/* Input Ports */
108INPUT_PORTS_START( dominob )
109   PORT_START_TAG("IN0")
110   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
111   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) // works, but still gives 1 player game
112   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) // only service coin (from arkanoid) works, is it coin1 on this?
113   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
114   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
115   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
116   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_SPECIAL )
117   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )
118
119   PORT_START_TAG("IN1")
120   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
121   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
122   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
123   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN )
124
125   PORT_START_TAG("IN2")      /* Spinner Player 1 */
126   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15)
127
128   PORT_START_TAG("IN3")      /* Spinner Player 2  */ /* no player 2? */
129   //PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_COCKTAIL
130
131   PORT_START_TAG("DSW")
132   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
133   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
134   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
135   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
136   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
137   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
138   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
139   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
140   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
141   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
142   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
143   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
144   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
145   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
146   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
147   PORT_DIPNAME( 0x0060, 0x0040, DEF_STR( Lives ) )
148   PORT_DIPSETTING(      0x0060, "1" )
149   PORT_DIPSETTING(      0x0040, "3" )
150   PORT_DIPSETTING(      0x0020, "5" )
151   PORT_DIPSETTING(      0x0000, "7" )
152   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
153   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
154   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
155INPUT_PORTS_END
156
157
158//UINT8 dominob_paddle_select;
159//UINT8 arkanoid_paddle_value;
160
161WRITE8_HANDLER( dominob_d008_w )
162{
163   /* is there a purpose on this? */
164}
165
166READ8_HANDLER( dominob_input_2_r )
167{
168   return input_port_2_r(offset);
169}
170
171
172static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 )
173   AM_RANGE(0x0000, 0xbfff) AM_READWRITE(MRA8_ROM, MWA8_NOP) // there are some garbage writes to ROM
174   AM_RANGE(0xc000, 0xc7ff) AM_RAM
175
176   AM_RANGE(0xd000, 0xd000) AM_WRITE(AY8910_control_port_0_w)
177   AM_RANGE(0xd001, 0xd001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
178   AM_RANGE(0xd008, 0xd008) AM_WRITE(dominob_d008_w)
179   AM_RANGE(0xd00c, 0xd00c) AM_READ(input_port_0_r)
180   AM_RANGE(0xd010, 0xd010) AM_READWRITE(input_port_1_r, MWA8_NOP)
181   AM_RANGE(0xd018, 0xd018) AM_READ(dominob_input_2_r) AM_WRITENOP
182
183   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&videoram)
184   AM_RANGE(0xe800, 0xe83f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
185   AM_RANGE(0xe840, 0xefff) AM_RAM
186   AM_RANGE(0xf000, 0xf07f) AM_RAM AM_BASE(&bgram)
187   AM_RANGE(0xf080, 0xf7ff) AM_RAM
188   AM_RANGE(0xf800, 0xfbff) AM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_READ(MRA8_RAM) AM_BASE(&paletteram)
189   AM_RANGE(0xfc00, 0xffff) AM_RAM
190ADDRESS_MAP_END
191
192/* I don't know if this has a purpose */
193READ8_HANDLER( dominob_unk_port02_r )
194{
195   return 0xff;//mame_rand(Machine);
196}
197
198static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 )
199   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
200   AM_RANGE(0x02, 0x02) AM_READ(dominob_unk_port02_r)
201ADDRESS_MAP_END
202
203
204
205static const gfx_layout charlayout =
206{
207   8,8,
208   RGN_FRAC(1,3),
209   3,
210   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3)},
211   { 0, 1, 2, 3, 4, 5, 6, 7 },
212   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
213   8*8
214};
215
216static const gfx_layout bglayout =
217{
218   32,32,
219   RGN_FRAC(1,4),
220   4,
221   {
222      RGN_FRAC(3,4),
223      RGN_FRAC(2,4),
224      RGN_FRAC(1,4),
225      RGN_FRAC(0,4) },
226   { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 },
227   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 ,8*32,9*32,10*32,11*32,12*32,13*32,14*32,15*32,
228      16*32,17*32,18*32,19*32,20*32,21*32,22*32,23*32,24*32,25*32,26*32,27*32,28*32,29*32,30*32,31*32},
229   16*32*2
230};
231
232static GFXDECODE_START( dominob )
233   GFXDECODE_ENTRY(REGION_GFX1, 0, charlayout,   0, 0x20)
234   GFXDECODE_ENTRY(REGION_GFX2, 0, bglayout,     0x100, 0x10)
235GFXDECODE_END
236
237
238static struct AY8910interface ay8910_interface =
239{
240   input_port_5_r,
241   input_port_4_r
242};
243
244
245static MACHINE_DRIVER_START( dominob )
246
247   /* basic machine hardware */
248   MDRV_CPU_ADD(Z80,8000000/2)
249   MDRV_CPU_PROGRAM_MAP(memmap, 0)
250   MDRV_CPU_IO_MAP(portmap,0)
251   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
252
253   MDRV_SCREEN_REFRESH_RATE(60)
254   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
255
256   /* video hardware */
257   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
258   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
259   MDRV_SCREEN_SIZE(32*8, 32*8)
260   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 32*8-1)
261   MDRV_GFXDECODE(dominob)
262   MDRV_PALETTE_LENGTH(512)
263
264   MDRV_VIDEO_START(dominob)
265   MDRV_VIDEO_UPDATE(dominob)
266
267   /* sound hardware */
268   MDRV_SPEAKER_STANDARD_MONO("mono")
269   MDRV_SOUND_ADD(AY8910, 8000000/4 /* guess */)
270   MDRV_SOUND_CONFIG(ay8910_interface)
271   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
272MACHINE_DRIVER_END
273
274/***************************************************************************
275
276  Game driver(s)
277
278***************************************************************************/
279
280ROM_START( dominob )
281   ROM_REGION( 0x10000, REGION_CPU1, 0 )
282   ROM_LOAD( "u81",   0x0000, 0x10000, CRC(709b7a29) SHA1(7c95cbaf669a0885101a48e937868c245f87567e) )
283
284   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
285   ROM_LOAD( "u33",   0x00000, 0x8000, CRC(359c98de) SHA1(5c96dfb538c6b25530582f8c2a0cb20d85c39f68) )
286   ROM_LOAD( "u34",   0x08000, 0x8000, CRC(0031f713) SHA1(9341f84081e2d8954e476236e93e49b4d8819b8f) )
287   ROM_LOAD( "u35",   0x10000, 0x8000, CRC(6eb87657) SHA1(40ff9d6f21ade48b16f0cefea08a9364a4ee9144) )
288
289   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
290   ROM_LOAD( "u111",   0x00000, 0x40000, CRC(b835be84) SHA1(bbb744a28df00017f81d6eac12b00b5f3aca3a8b) )
291   ROM_CONTINUE(0x00000,0x40000) // 1ST AND 2ND HALF IDENTICAL
292   ROM_LOAD( "u112",   0x40000, 0x40000, CRC(60d7bfd7) SHA1(9f6475ce717e3d5a42aaaacc3ec340e74b7e40b4) )
293   ROM_CONTINUE(0x40000,0x40000) // 1ST AND 2ND HALF IDENTICAL
294   ROM_LOAD( "u113",   0x80000, 0x40000, CRC(3c999d1e) SHA1(e10c61d7868d9c902e337c9947506761878e31a5) )
295   ROM_CONTINUE(0x80000,0x40000) // 1ST AND 2ND HALF IDENTICAL
296   ROM_LOAD( "u114",   0xc0000, 0x40000, CRC(2364124e) SHA1(55dc6c46f54655c574a96f5c920e4e1f2e05fd5d) )
297   ROM_CONTINUE(0xc0000,0x40000) // 1ST AND 2ND HALF IDENTICAL
298ROM_END
299
300GAME( 1990, dominob,  0,       dominob,  dominob,  0, ROT0, "Wonwoo Systems", "Domino Block", 0 )
src/mame/drivers/ksys573.c
r1051r1052
254254static int chiptype[ 2 ];
255255static int has_ds2401[ 2 ];
256256
257#define REGION_USER9 ( REGION_GFX1 )
258#define REGION_USER10 ( REGION_GFX2 )
259#define REGION_USER11 ( REGION_GFX3 )
260
261257/* EEPROM handlers */
262258
263259static void (*nvram_handler_security_cart_0)( running_machine *machine, mame_file *file, int read_or_write );
src/mame/drivers/atarig1.c
r1051r1052
391391};
392392
393393
394static const gfx_decode gfxdecodeinfo[] =
395{
396   { REGION_GFX1, 0, &pflayout, 0x300, 8 },
397   { REGION_GFX2, 0, &anlayout, 0x100, 16 },
398   { REGION_GFX1, 0, &pftoplayout, 0x300, 8 },
399   { -1 }
400};
394static GFXDECODE_START( atarig1 )
395   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout, 0x300, 8 )
396   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout, 0x100, 16 )
397   GFXDECODE_ENTRY( REGION_GFX1, 0, pftoplayout, 0x300, 8 )
398GFXDECODE_END
401399
402400
403401
r1051r1052
419417
420418   /* video hardware */
421419   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
422   MDRV_GFXDECODE(gfxdecodeinfo)
420   MDRV_GFXDECODE(atarig1)
423421   MDRV_PALETTE_LENGTH(1280)
424422
425423   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/sbrkout.c
r1051r1052
247247};
248248
249249
250static const gfx_decode gfxdecodeinfo[] =
251{
252   { REGION_GFX1, 0, &charlayout, 0, 1 },
253   { REGION_GFX2, 0, &balllayout, 0, 1 },
254   { -1 }
255};
250static GFXDECODE_START( sbrkout )
251   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 1 )
252   GFXDECODE_ENTRY( REGION_GFX2, 0, balllayout, 0, 1 )
253GFXDECODE_END
256254
257255
258256
r1051r1052
279277   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
280278   MDRV_SCREEN_SIZE(32*8, 28*8)
281279   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
282   MDRV_GFXDECODE(gfxdecodeinfo)
280   MDRV_GFXDECODE(sbrkout)
283281   MDRV_PALETTE_LENGTH(2)
284282
285283   MDRV_PALETTE_INIT(sbrkout)
src/mame/drivers/segae.h
r1051r1052
33#include "driver.h"
44
55extern VIDEO_UPDATE(megatech_bios);
6extern VIDEO_UPDATE(megatech_md_sms);
67extern DRIVER_INIT( megatech_bios );
78extern MACHINE_RESET(megatech_bios);
9extern MACHINE_RESET(megatech_md_sms);
810extern VIDEO_EOF(megatech_bios);
11extern VIDEO_EOF(megatech_md_sms);
912
1013extern READ8_HANDLER( sms_vcounter_r );
1114extern READ8_HANDLER( sms_vdp_data_r );
1215extern WRITE8_HANDLER( sms_vdp_data_w );
1316extern READ8_HANDLER( sms_vdp_ctrl_r );
1417extern WRITE8_HANDLER( sms_vdp_ctrl_w );
18
19extern void init_for_megadrive(void);
20extern void segae_md_sms_stop_scanline_timer(void);
21
22
23extern READ8_HANDLER( md_sms_vdp_vcounter_r );
24extern READ8_HANDLER( md_sms_vdp_data_r );
25extern WRITE8_HANDLER( md_sms_vdp_data_w );
26extern READ8_HANDLER( md_sms_vdp_ctrl_r );
27extern WRITE8_HANDLER( md_sms_vdp_ctrl_w );
28extern WRITE8_HANDLER( sms_sn76496_w );
29
src/mame/drivers/bladestl.c
r1051r1052
404404   32*8         /* every sprite takes 32 consecutive bytes */
405405};
406406
407static const gfx_decode gfxdecodeinfo[] =
408{
409   { REGION_GFX1, 0x000000, &charlayout,     0,   2 },   /* colors 00..31 */
410   { REGION_GFX1, 0x040000, &spritelayout,   32,   16 },   /* colors 32..47 but using lookup table */
411   { -1 }
412};
407static GFXDECODE_START( bladestl )
408   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, charlayout,     0,   2 )   /* colors 00..31 */
409   GFXDECODE_ENTRY( REGION_GFX1, 0x040000, spritelayout,   32,   16 )   /* colors 32..47 but using lookup table */
410GFXDECODE_END
413411
414412/***************************************************************************
415413
r1051r1052
450448   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
451449   MDRV_SCREEN_SIZE(32*8, 32*8)
452450   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
453   MDRV_GFXDECODE(gfxdecodeinfo)
451   MDRV_GFXDECODE(bladestl)
454452   MDRV_PALETTE_LENGTH(48)
455453   MDRV_COLORTABLE_LENGTH(48 + 16*16)
456454
src/mame/drivers/toobin.c
r1051r1052
222222};
223223
224224
225static const gfx_decode gfxdecodeinfo[] =
226{
227   { REGION_GFX1, 0, &pflayout,     0, 16 },
228   { REGION_GFX2, 0, &molayout,   256, 16 },
229   { REGION_GFX3, 0, &anlayout,   512, 64 },
230   { -1 }
231};
225static GFXDECODE_START( toobin )
226   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout,     0, 16 )
227   GFXDECODE_ENTRY( REGION_GFX2, 0, molayout,   256, 16 )
228   GFXDECODE_ENTRY( REGION_GFX3, 0, anlayout,   512, 64 )
229GFXDECODE_END
232230
233231
234232
r1051r1052
255253   /* the vert size is copied from atarisy2.c.  Needs to be verified */
256254   MDRV_SCREEN_SIZE(64*8, 420)
257255   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 48*8-1)
258   MDRV_GFXDECODE(gfxdecodeinfo)
256   MDRV_GFXDECODE(toobin)
259257   MDRV_PALETTE_LENGTH(1024)
260258
261259   MDRV_VIDEO_START(toobin)
src/mame/drivers/srumbler.c
r1051r1052
248248};
249249
250250
251static const gfx_decode gfxdecodeinfo[] =
252{
253   { REGION_GFX1, 0, &charlayout,   448, 16 }, /* colors 448 - 511 */
254   { REGION_GFX2, 0, &tilelayout,   128,  8 }, /* colors 128 - 255 */
255   { REGION_GFX3, 0, &spritelayout, 256,  8 }, /* colors 256 - 383 */
256   { -1 }
257};
251static GFXDECODE_START( srumbler )
252   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   448, 16 ) /* colors 448 - 511 */
253   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   128,  8 ) /* colors 128 - 255 */
254   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 256,  8 ) /* colors 256 - 383 */
255GFXDECODE_END
258256
259257
260258
r1051r1052
280278   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
281279   MDRV_SCREEN_SIZE(64*8, 32*8)
282280   MDRV_SCREEN_VISIBLE_AREA(10*8, (64-10)*8-1, 1*8, 31*8-1 )
283   MDRV_GFXDECODE(gfxdecodeinfo)
281   MDRV_GFXDECODE(srumbler)
284282   MDRV_PALETTE_LENGTH(512)
285283
286284   MDRV_VIDEO_START(srumbler)
src/mame/drivers/legionna.c
r1051r1052
34303430   128*8
34313431};
34323432
3433static const gfx_decode legionna_gfxdecodeinfo[] =
3434{
3435   { REGION_GFX1, 0, &legionna_charlayout,   48*16, 16 },
3436   { REGION_GFX3, 0, &legionna_tilelayout,    0*16, 16 },
3437   { REGION_GFX4, 0, &legionna_char2layout,  32*16, 16 },   /* example BK3 decode */
3438   { REGION_GFX2, 0, &legionna_spritelayout,  0*16, 8*16 },
3439   { REGION_GFX5, 0, &legionna_tilelayout,   32*16, 16 },   /* this should be the BK3 decode */
3440   { REGION_GFX6, 0, &legionna_tilelayout,   16*16, 16 },
3441   { -1 }
3442};
3433static GFXDECODE_START( legionna )
3434   GFXDECODE_ENTRY( REGION_GFX1, 0, legionna_charlayout,   48*16, 16 )
3435   GFXDECODE_ENTRY( REGION_GFX3, 0, legionna_tilelayout,    0*16, 16 )
3436   GFXDECODE_ENTRY( REGION_GFX4, 0, legionna_char2layout,  32*16, 16 )   /* example BK3 decode */
3437   GFXDECODE_ENTRY( REGION_GFX2, 0, legionna_spritelayout,  0*16, 8*16 )
3438   GFXDECODE_ENTRY( REGION_GFX5, 0, legionna_tilelayout,   32*16, 16 )   /* this should be the BK3 decode */
3439   GFXDECODE_ENTRY( REGION_GFX6, 0, legionna_tilelayout,   16*16, 16 )
3440GFXDECODE_END
34433441
3444static const gfx_decode heatbrl_gfxdecodeinfo[] =
3445{
3446   { REGION_GFX1, 0, &heatbrl_charlayout,    48*16, 16 },
3447   { REGION_GFX3, 0, &legionna_tilelayout,    0*16, 16 },
3448   { REGION_GFX4, 0, &legionna_char2layout,  32*16, 16 },   /* unused */
3449   { REGION_GFX2, 0, &legionna_spritelayout,  0*16, 8*16 },
3450   { REGION_GFX5, 0, &legionna_tilelayout,   32*16, 16 },
3451   { REGION_GFX6, 0, &legionna_tilelayout,   16*16, 16 },
3452   { -1 }
3453};
3442static GFXDECODE_START( heatbrl )
3443   GFXDECODE_ENTRY( REGION_GFX1, 0, heatbrl_charlayout,    48*16, 16 )
3444   GFXDECODE_ENTRY( REGION_GFX3, 0, legionna_tilelayout,    0*16, 16 )
3445   GFXDECODE_ENTRY( REGION_GFX4, 0, legionna_char2layout,  32*16, 16 )   /* unused */
3446   GFXDECODE_ENTRY( REGION_GFX2, 0, legionna_spritelayout,  0*16, 8*16 )
3447   GFXDECODE_ENTRY( REGION_GFX5, 0, legionna_tilelayout,   32*16, 16 )
3448   GFXDECODE_ENTRY( REGION_GFX6, 0, legionna_tilelayout,   16*16, 16 )
3449GFXDECODE_END
34543450
3455static const gfx_decode sdgndmrb_gfxdecodeinfo[] =
3456{
3457   { REGION_GFX1, 0, &heatbrl_charlayout,    48*16, 16 },
3458   { REGION_GFX3, 0, &legionna_tilelayout,    0*16, 16 },
3459   { REGION_GFX4, 0, &legionna_char2layout,  32*16, 16 },   /* unused */
3460   { REGION_GFX2, 0, &legionna_spritelayout,  0*16, 8*16 },
3461   { REGION_GFX5, 0, &legionna_tilelayout,   32*16, 16 },
3462   { REGION_GFX6, 0, &legionna_tilelayout,   16*16, 16 },
3463   { -1 }
3464};
3451static GFXDECODE_START( sdgndmrb )
3452   GFXDECODE_ENTRY( REGION_GFX1, 0, heatbrl_charlayout,    48*16, 16 )
3453   GFXDECODE_ENTRY( REGION_GFX3, 0, legionna_tilelayout,    0*16, 16 )
3454   GFXDECODE_ENTRY( REGION_GFX4, 0, legionna_char2layout,  32*16, 16 )   /* unused */
3455   GFXDECODE_ENTRY( REGION_GFX2, 0, legionna_spritelayout,  0*16, 8*16 )
3456   GFXDECODE_ENTRY( REGION_GFX5, 0, legionna_tilelayout,   32*16, 16 )
3457   GFXDECODE_ENTRY( REGION_GFX6, 0, legionna_tilelayout,   16*16, 16 )
3458GFXDECODE_END
34653459
34663460/*****************************************************************************/
34673461
r1051r1052
34903484   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
34913485   MDRV_SCREEN_SIZE(32*8, 32*8)
34923486   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3493   MDRV_GFXDECODE(legionna_gfxdecodeinfo)
3487   MDRV_GFXDECODE(legionna)
34943488   MDRV_PALETTE_LENGTH(128*16)
34953489
34963490   MDRV_VIDEO_START(legionna)
r1051r1052
35193513   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
35203514   MDRV_SCREEN_SIZE(32*8, 32*8)
35213515   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
3522   MDRV_GFXDECODE(heatbrl_gfxdecodeinfo)
3516   MDRV_GFXDECODE(heatbrl)
35233517   MDRV_PALETTE_LENGTH(128*16)
35243518
35253519   MDRV_VIDEO_START(legionna)
r1051r1052
35473541   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
35483542   MDRV_SCREEN_SIZE(40*8, 32*8)
35493543   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3550   MDRV_GFXDECODE(heatbrl_gfxdecodeinfo)
3544   MDRV_GFXDECODE(heatbrl)
35513545   MDRV_PALETTE_LENGTH(128*16)
35523546
35533547   MDRV_VIDEO_START(legionna)
r1051r1052
35753569   MDRV_SCREEN_REFRESH_RATE(61)
35763570   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
35773571   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 32*8-1)
3578   MDRV_GFXDECODE(heatbrl_gfxdecodeinfo)
3572   MDRV_GFXDECODE(heatbrl)
35793573   MDRV_PALETTE_LENGTH(128*16)
35803574
35813575   MDRV_VIDEO_START(denjinmk)
r1051r1052
36033597   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
36043598   MDRV_SCREEN_SIZE(40*8, 32*8)
36053599   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 32*8-1)
3606   MDRV_GFXDECODE(sdgndmrb_gfxdecodeinfo)
3600   MDRV_GFXDECODE(sdgndmrb)
36073601   MDRV_PALETTE_LENGTH(128*16)
36083602
36093603   MDRV_VIDEO_START(legionna)
r1051r1052
36323626   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
36333627   MDRV_SCREEN_SIZE(40*8, 32*8)
36343628   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3635   MDRV_GFXDECODE(heatbrl_gfxdecodeinfo)
3629   MDRV_GFXDECODE(heatbrl)
36363630   MDRV_PALETTE_LENGTH(128*16)
36373631
36383632   MDRV_VIDEO_START(cupsoc)
r1051r1052
36653659   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
36663660   MDRV_SCREEN_SIZE(40*8, 32*8)
36673661   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 32*8-1)
3668   MDRV_GFXDECODE(heatbrl_gfxdecodeinfo)
3662   MDRV_GFXDECODE(heatbrl)
36693663   MDRV_PALETTE_LENGTH(128*16)
36703664
36713665   MDRV_VIDEO_START(cupsoc)
src/mame/drivers/midas.c
r1051r1052
283283
284284};
285285
286static const gfx_decode gfxdecodeinfo[] =
287{
288   { REGION_GFX1, 0x000000, &layout16x16,  0, 0x100 },
289   { REGION_GFX2, 0x000000, &layout8x8_2,  0, 0x80 },
290   { -1 }
291};
286static GFXDECODE_START( midas )
287   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, layout16x16,  0, 0x100 )
288   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, layout8x8_2,  0, 0x80 )
289GFXDECODE_END
292290
293291
294292INPUT_PORTS_START( livequiz )
r1051r1052
454452   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
455453   MDRV_SCREEN_SIZE(320, 256)
456454   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-16-1)
457   MDRV_GFXDECODE(gfxdecodeinfo)
455   MDRV_GFXDECODE(midas)
458456   MDRV_PALETTE_LENGTH(0x10000)
459457
460458   MDRV_VIDEO_START(livequiz)
src/mame/drivers/ampoker.c
r1051r1052
260260   16*8
261261};
262262
263static const gfx_decode gfxdecodeinfo[] =
264{
265   { REGION_GFX1, 0x0000, &charlayout,      0, 16 },
266   { -1 }
267};
263static GFXDECODE_START( ampoker )
264   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 )
265GFXDECODE_END
268266
269267static struct AY8910interface ay8910_interface =
270268{
r1051r1052
291289   MDRV_SCREEN_SIZE(64*8, 32*8)
292290   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
293291
294   MDRV_GFXDECODE(gfxdecodeinfo)
292   MDRV_GFXDECODE(ampoker)
295293   MDRV_PALETTE_LENGTH(32)
296294   MDRV_COLORTABLE_LENGTH(32)
297295
src/mame/drivers/mcr68.c
r1051r1052
828828   128
829829};
830830
831static const gfx_decode gfxdecodeinfo[] =
832{
833   { REGION_GFX1, 0, &mcr_bg_layout,     0, 4, 2, 2 },
834   { REGION_GFX2, 0, &mcr_sprite_layout, 0, 4 },
835   { -1 }
836};
831static GFXDECODE_START( mcr68 )
832   GFXDECODE_SCALE( REGION_GFX1, 0, mcr_bg_layout,     0, 4, 2, 2 )
833   GFXDECODE_ENTRY( REGION_GFX2, 0, mcr_sprite_layout, 0, 4 )
834GFXDECODE_END
837835
838static const gfx_decode zwackery_gfxdecodeinfo[] =
839{
840   { REGION_GFX1, 0, &zwackery_layout,       0, 16 },
841   { REGION_GFX2, 0, &mcr_sprite_layout, 0x800, 32 },
842   { REGION_GFX1, 0, &zwackery_layout,       0, 16 },   /* yes, an extra copy */
843   { -1 }
844};
836static GFXDECODE_START( zwackery )
837   GFXDECODE_ENTRY( REGION_GFX1, 0, zwackery_layout,       0, 16 )
838   GFXDECODE_ENTRY( REGION_GFX2, 0, mcr_sprite_layout, 0x800, 32 )
839   GFXDECODE_ENTRY( REGION_GFX1, 0, zwackery_layout,       0, 16 )   /* yes, an extra copy */
840GFXDECODE_END
845841
846842
847843
r1051r1052
897893   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
898894   MDRV_SCREEN_SIZE(32*16, 30*16)
899895   MDRV_SCREEN_VISIBLE_AREA(0, 32*16-1, 0, 30*16-1)
900   MDRV_GFXDECODE(zwackery_gfxdecodeinfo)
896   MDRV_GFXDECODE(zwackery)
901897   MDRV_PALETTE_LENGTH(4096)
902898
903899   MDRV_VIDEO_START(zwackery)
r1051r1052
926922   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
927923   MDRV_SCREEN_SIZE(32*16, 30*16)
928924   MDRV_SCREEN_VISIBLE_AREA(0, 32*16-1, 0, 30*16-1)
929   MDRV_GFXDECODE(gfxdecodeinfo)
925   MDRV_GFXDECODE(mcr68)
930926   MDRV_PALETTE_LENGTH(64)
931927
932928   MDRV_VIDEO_START(mcr68)
src/mame/drivers/pbaction.c
r1051r1052
247247
248248
249249
250static const gfx_decode gfxdecodeinfo[] =
251{
252   { REGION_GFX1, 0x00000, &charlayout1,    0, 16 },   /*   0-127 characters */
253   { REGION_GFX2, 0x00000, &charlayout2,  128,  8 },   /* 128-255 background */
254   { REGION_GFX3, 0x00000, &spritelayout1,  0, 16 },   /*   0-127 normal sprites */
255   { REGION_GFX3, 0x01000, &spritelayout2,  0, 16 },   /*   0-127 large sprites */
256   { -1 }
257};
250static GFXDECODE_START( pbaction )
251   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout1,    0, 16 )   /*   0-127 characters */
252   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, charlayout2,  128,  8 )   /* 128-255 background */
253   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, spritelayout1,  0, 16 )   /*   0-127 normal sprites */
254   GFXDECODE_ENTRY( REGION_GFX3, 0x01000, spritelayout2,  0, 16 )   /*   0-127 large sprites */
255GFXDECODE_END
258256
259257
260258INTERRUPT_GEN( pbaction_interrupt )
r1051r1052
284282   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
285283   MDRV_SCREEN_SIZE(32*8, 32*8)
286284   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
287   MDRV_GFXDECODE(gfxdecodeinfo)
285   MDRV_GFXDECODE(pbaction)
288286   MDRV_PALETTE_LENGTH(256)
289287
290288   MDRV_VIDEO_START(pbaction)
src/mame/drivers/funworld.c
r1051r1052
13471347* Graphics Decode Information *
13481348******************************/
13491349
1350static const gfx_decode gfxdecodeinfo[] =
1351{
1352   { REGION_GFX1, 0x0000, &charlayout, 0, 16 },
1353   { -1 }
1354};
1350static GFXDECODE_START( funworld )
1351   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 16 )
1352GFXDECODE_END
13551353
1356static const gfx_decode sn10_gfxdecodeinfo[] =
1357{
1358   { REGION_GFX1, 0x0000, &sn10_charlayout, 0, 16 },
1359   { -1 }
1360};
1354static GFXDECODE_START( sn10 )
1355   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sn10_charlayout, 0, 16 )
1356GFXDECODE_END
13611357
13621358
13631359/***********************
r1051r1052
14231419   MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)      // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1).
14241420   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)   // Taken from MC6845 init, registers 01 & 06.
14251421
1426   MDRV_GFXDECODE(gfxdecodeinfo)
1422   MDRV_GFXDECODE(funworld)
14271423
14281424   MDRV_DEFAULT_LAYOUT(layout_funworld)
14291425
r1051r1052
14591455   MDRV_SCREEN_VISIBLE_AREA(0*4, 112*4-1, 0*8, 34*8-1)   // Taken from MC6845 init, registers 01 & 06.
14601456//  MDRV_SCREEN_VISIBLE_AREA(0*4, 98*4-1, 0*8, 32*8-1)     // adjusted to screen for testing purposes.
14611457
1462   MDRV_GFXDECODE(gfxdecodeinfo)
1458   MDRV_GFXDECODE(funworld)
14631459   MDRV_VIDEO_START(magiccrd)
14641460
14651461   MDRV_SOUND_REPLACE("ay8910", AY8910, MASTER_CLOCK/8)   // 2MHz
r1051r1052
15021498   MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)
15031499   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)
15041500
1505   MDRV_GFXDECODE(sn10_gfxdecodeinfo)
1501   MDRV_GFXDECODE(sn10)
15061502
15071503//  MDRV_DEFAULT_LAYOUT(layout_funworld)
15081504
src/mame/drivers/overdriv.c
r1051r1052
378378   8*8*4
379379};
380380
381static const gfx_decode gfxdecodeinfo[] =
382{
383   { REGION_GFX4, 0, &charlayout, 0, 0x80 },
384   { REGION_GFX5, 0, &charlayout, 0, 0x80 },
385   { -1 }
386};
381static GFXDECODE_START( overdriv )
382   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout, 0, 0x80 )
383   GFXDECODE_ENTRY( REGION_GFX5, 0, charlayout, 0, 0x80 )
384GFXDECODE_END
387385
388386
389387
r1051r1052
423421   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
424422   MDRV_SCREEN_SIZE(64*8, 32*8)
425423   MDRV_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 0*8, 32*8-1 )
426   MDRV_GFXDECODE(gfxdecodeinfo)
424   MDRV_GFXDECODE(overdriv)
427425   MDRV_PALETTE_LENGTH(2048)
428426
429427   MDRV_VIDEO_START(overdriv)
src/mame/drivers/jackpool.c
r1051r1052
161161}
162162
163163
164static const gfx_decode gfxdecodeinfo[] =
165{
166   { REGION_GFX1, 0, &tiles8x8_layout,   0x000, 256  }, /* sprites */
167   { -1 }
168};
164static GFXDECODE_START( jackpool )
165   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout,   0x000, 256  ) /* sprites */
166GFXDECODE_END
169167
170168/* verify */
171169static INTERRUPT_GEN( jackpool_interrupt )
r1051r1052
182180   MDRV_SCREEN_REFRESH_RATE(60)
183181   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
184182
185   MDRV_GFXDECODE(gfxdecodeinfo)
183   MDRV_GFXDECODE(jackpool)
186184
187185   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
188186   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/spcforce.c
r1051r1052
222222};
223223
224224
225static const gfx_decode gfxdecodeinfo[] =
226{
227   { REGION_GFX1, 0, &charlayout, 0, 8 },
228   { -1 }
229};
225static GFXDECODE_START( spcforce )
226   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 8 )
227GFXDECODE_END
230228
231229
232230/* 1-bit RGB palette */
r1051r1052
270268   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
271269   MDRV_SCREEN_SIZE(32*8, 32*8)
272270   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
273   MDRV_GFXDECODE(gfxdecodeinfo)
271   MDRV_GFXDECODE(spcforce)
274272   MDRV_PALETTE_LENGTH(8)
275273   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
276274
src/mame/drivers/gsword.c
r1051r1052
662662   64*8*4    /* every sprite takes (64*8=16x6)*4) bytes */
663663};
664664
665static const gfx_decode gfxdecodeinfo[] =
666{
667   { REGION_GFX1, 0, &gsword_text,         0, 64 },
668   { REGION_GFX2, 0, &gsword_sprites1,  64*4, 64 },
669   { REGION_GFX3, 0, &gsword_sprites2,  64*4, 64 },
670   { -1 }
671};
665static GFXDECODE_START( gsword )
666   GFXDECODE_ENTRY( REGION_GFX1, 0, gsword_text,         0, 64 )
667   GFXDECODE_ENTRY( REGION_GFX2, 0, gsword_sprites1,  64*4, 64 )
668   GFXDECODE_ENTRY( REGION_GFX3, 0, gsword_sprites2,  64*4, 64 )
669GFXDECODE_END
672670
673671
674672
r1051r1052
719717   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
720718   MDRV_SCREEN_SIZE(32*8, 32*8)
721719   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
722   MDRV_GFXDECODE(gfxdecodeinfo)
720   MDRV_GFXDECODE(gsword)
723721   MDRV_PALETTE_LENGTH(256)
724722   MDRV_COLORTABLE_LENGTH(64*4+64*4)
725723
r1051r1052
767765   MDRV_SCREEN_SIZE(32*8, 32*8)
768766   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
769767
770   MDRV_GFXDECODE(gfxdecodeinfo)
768   MDRV_GFXDECODE(gsword)
771769   MDRV_PALETTE_LENGTH(256)
772770   MDRV_COLORTABLE_LENGTH(64*4+64*4)
773771
src/mame/drivers/nmg5.c
r1051r1052
945945   32*8
946946};
947947
948static const gfx_decode nmg5_gfxdecodeinfo[] =
949{
950   { REGION_GFX1, 0, &nmg5_layout_8x8x8, 0x000,  2 },
951   { REGION_GFX2, 0, &layout_16x16x5,     0x200, 16 },
952   { -1 }
953};
948static GFXDECODE_START( nmg5 )
949   GFXDECODE_ENTRY( REGION_GFX1, 0, nmg5_layout_8x8x8, 0x000,  2 )
950   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x5,     0x200, 16 )
951GFXDECODE_END
954952
955static const gfx_decode pclubys_gfxdecodeinfo[] =
956{
957   { REGION_GFX1, 0, &pclubys_layout_8x8x8, 0x000,  2 },
958   { REGION_GFX2, 0, &layout_16x16x5,       0x200, 16 },
959   { -1 }
960};
953static GFXDECODE_START( pclubys )
954   GFXDECODE_ENTRY( REGION_GFX1, 0, pclubys_layout_8x8x8, 0x000,  2 )
955   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x5,       0x200, 16 )
956GFXDECODE_END
961957
962958
963959static void soundirq(int state)
r1051r1052
10071003   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10081004   MDRV_SCREEN_SIZE(320, 256)
10091005   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1010   MDRV_GFXDECODE(nmg5_gfxdecodeinfo)
1006   MDRV_GFXDECODE(nmg5)
10111007   MDRV_PALETTE_LENGTH(0x400)
10121008
10131009   MDRV_VIDEO_START(nmg5)
r1051r1052
10471043   MDRV_CPU_MODIFY("sound")
10481044   MDRV_CPU_PROGRAM_MAP(pclubys_sound_map,0)
10491045
1050   MDRV_GFXDECODE(pclubys_gfxdecodeinfo)
1046   MDRV_GFXDECODE(pclubys)
10511047MACHINE_DRIVER_END
10521048
10531049static MACHINE_DRIVER_START( searchp2 )
r1051r1052
10561052
10571053   MDRV_SCREEN_REFRESH_RATE(55) // !
10581054
1059   MDRV_GFXDECODE(pclubys_gfxdecodeinfo)
1055   MDRV_GFXDECODE(pclubys)
10601056MACHINE_DRIVER_END
10611057
10621058static MACHINE_DRIVER_START( 7ordi )
src/mame/drivers/mario.c
r1051r1052
346346
347347
348348
349static const gfx_decode gfxdecodeinfo[] =
350{
351   { REGION_GFX1, 0, &charlayout,      0, 16 },
352   { REGION_GFX2, 0, &spritelayout, 16*4, 32 },
353   { -1 }
354};
349static GFXDECODE_START( mario )
350   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 16 )
351   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*4, 32 )
352GFXDECODE_END
355353
356354
357355
r1051r1052
420418   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
421419   MDRV_SCREEN_SIZE(32*8, 32*8)
422420   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
423   MDRV_GFXDECODE(gfxdecodeinfo)
421   MDRV_GFXDECODE(mario)
424422   MDRV_PALETTE_LENGTH(256)
425423   MDRV_COLORTABLE_LENGTH(16*4+32*8)
426424
r1051r1052
460458   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
461459   MDRV_SCREEN_SIZE(32*8, 32*8)
462460   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
463   MDRV_GFXDECODE(gfxdecodeinfo)
461   MDRV_GFXDECODE(mario)
464462   MDRV_PALETTE_LENGTH(256)
465463   MDRV_COLORTABLE_LENGTH(16*4+32*8)
466464
src/mame/drivers/atarifb.c
r1051r1052
501501};
502502
503503
504static const gfx_decode gfxdecodeinfo[] =
505{
506   { REGION_GFX1, 0, &charlayout,  0x00, 0x01 }, /* offset into colors, # of colors */
507   { REGION_GFX2, 0, &fieldlayout, 0x02, 0x01 }, /* offset into colors, # of colors */
508   { -1 }
509};
504static GFXDECODE_START( atarifb )
505   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0x00, 0x01 ) /* offset into colors, # of colors */
506   GFXDECODE_ENTRY( REGION_GFX2, 0, fieldlayout, 0x02, 0x01 ) /* offset into colors, # of colors */
507GFXDECODE_END
510508
511509
512static const gfx_decode soccer_gfxdecodeinfo[] =
513{
514   { REGION_GFX1, 0x0000, &charlayout,         0x00, 0x01 }, /* offset into colors, # of colors */
515   { REGION_GFX3, 0x0400, &soccer_fieldlayout, 0x06, 0x01 }, /* offset into colors, # of colors */
516   { REGION_GFX2, 0x0000, &spritelayout,       0x02, 0x02 }, /* offset into colors, # of colors */
517   { REGION_GFX3, 0x0000, &spritemasklayout,   0x06, 0x03 }, /* offset into colors, # of colors */
518   { -1 }
519};
510static GFXDECODE_START( soccer )
511   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,         0x00, 0x01 ) /* offset into colors, # of colors */
512   GFXDECODE_ENTRY( REGION_GFX3, 0x0400, soccer_fieldlayout, 0x06, 0x01 ) /* offset into colors, # of colors */
513   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,       0x02, 0x02 ) /* offset into colors, # of colors */
514   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, spritemasklayout,   0x06, 0x03 ) /* offset into colors, # of colors */
515GFXDECODE_END
520516
521517
522518
r1051r1052
541537   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
542538   MDRV_SCREEN_SIZE(38*8, 32*8)
543539   MDRV_SCREEN_VISIBLE_AREA(0*8, 38*8-1, 1*8, 31*8-1)
544   MDRV_GFXDECODE(gfxdecodeinfo)
540   MDRV_GFXDECODE(atarifb)
545541   MDRV_PALETTE_LENGTH(4)
546542   MDRV_COLORTABLE_LENGTH(sizeof(colortable_source) / sizeof(colortable_source[0]))
547543
r1051r1052
553549   MDRV_SPEAKER_STANDARD_MONO("mono")
554550
555551   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
556   MDRV_SOUND_CONFIG(atarifb_discrete_interface)
552   MDRV_SOUND_CONFIG_DISCRETE(atarifb)
557553   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
558554MACHINE_DRIVER_END
559555
r1051r1052
565561
566562   /* sound hardware */
567563   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
568   MDRV_SOUND_CONFIG(abaseb_discrete_interface)
564   MDRV_SOUND_CONFIG_DISCRETE(abaseb)
569565   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
570566MACHINE_DRIVER_END
571567
r1051r1052
579575
580576   /* video hardware */
581577   MDRV_SCREEN_VISIBLE_AREA(0*8, 38*8-1, 2*8, 32*8-1)
582   MDRV_GFXDECODE(soccer_gfxdecodeinfo)
578   MDRV_GFXDECODE(soccer)
583579MACHINE_DRIVER_END
584580
585581
src/mame/drivers/silkroad.c
r1051r1052
363363   16*32
364364};
365365
366static const gfx_decode gfxdecodeinfo[] =
367{
368   { REGION_GFX1, 0, &tiles16x16x6_layout,  0x0000, 256 },
369   { -1 }
370};
366static GFXDECODE_START( silkroad )
367   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16x6_layout,  0x0000, 256 )
368GFXDECODE_END
371369
372370static MACHINE_DRIVER_START( silkroad )
373371
r1051r1052
384382   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
385383   MDRV_SCREEN_SIZE(64*8, 32*8)
386384   MDRV_SCREEN_VISIBLE_AREA(6*8+2, 64*8-1-(10*8)-2, 2*8, 32*8-1-(2*8))
387   MDRV_GFXDECODE(gfxdecodeinfo)
385   MDRV_GFXDECODE(silkroad)
388386   MDRV_PALETTE_LENGTH(0x2000)
389387
390388   MDRV_VIDEO_START(silkroad)
src/mame/drivers/wink.c
r1051r1052
289289   8*8 /* every char takes 8 consecutive bytes */
290290};
291291
292static const gfx_decode gfxdecodeinfo[] =
293{
294   { REGION_GFX1, 0, &charlayout, 0, 4 },
295   { -1 }
296};
292static GFXDECODE_START( wink )
293   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 4 )
294GFXDECODE_END
297295
298296static READ8_HANDLER( sound_r )
299297{
r1051r1052
339337   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
340338   MDRV_SCREEN_SIZE(32*8, 32*8)
341339   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
342   MDRV_GFXDECODE(gfxdecodeinfo)
340   MDRV_GFXDECODE(wink)
343341   MDRV_PALETTE_LENGTH(32)
344342
345343   MDRV_VIDEO_START(wink)
src/mame/drivers/lethal.c
r1051r1052
643643};
644644
645645/* we use this decode instead of the one done by the sprite video start due to it being 6bpp */
646static const gfx_decode gfxdecodeinfo[] =
647{
648   { REGION_GFX2, 0, &lethal_6bpp,   0x000/*0x400*/, 256  }, /* sprites tiles */
649   { -1 }
650};
646static GFXDECODE_START( lethal )
647   GFXDECODE_ENTRY( REGION_GFX2, 0, lethal_6bpp,   0x000/*0x400*/, 256  ) /* sprites tiles */
648GFXDECODE_END
651649
652650static MACHINE_DRIVER_START( lethalen )
653651   /* basic machine hardware */
r1051r1052
667665
668666   MDRV_NVRAM_HANDLER(lethalen)
669667
670   MDRV_GFXDECODE(gfxdecodeinfo)
668   MDRV_GFXDECODE(lethal)
671669
672670
673671   /* video hardware */
src/mame/drivers/videopin.c
r1051r1052
323323};
324324
325325
326static const gfx_decode videopin_gfxdecodeinfo[] =
327{
328   { REGION_GFX1, 0x0000, &tile_layout, 0, 1 },
329   { REGION_GFX2, 0x0000, &ball_layout, 0, 1 },
330   { -1 }
331};
326static GFXDECODE_START( videopin )
327   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tile_layout, 0, 1 )
328   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, ball_layout, 0, 1 )
329GFXDECODE_END
332330
333331
334332
r1051r1052
352350   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
353351   MDRV_SCREEN_SIZE(304, 263)
354352   MDRV_SCREEN_VISIBLE_AREA(0, 303, 0, 255)
355   MDRV_GFXDECODE(videopin_gfxdecodeinfo)
353   MDRV_GFXDECODE(videopin)
356354   MDRV_PALETTE_LENGTH(2)
357355
358356   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
363361   MDRV_SPEAKER_STANDARD_MONO("mono")
364362
365363   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
366   MDRV_SOUND_CONFIG(videopin_discrete_interface)
364   MDRV_SOUND_CONFIG_DISCRETE(videopin)
367365   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
368366MACHINE_DRIVER_END
369367
src/mame/drivers/exprraid.c
r1051r1052
262262};
263263
264264
265static const gfx_decode gfxdecodeinfo[] =
266{
267   { REGION_GFX1, 0x00000, &charlayout,   128, 2 }, /* characters */
268   { REGION_GFX2, 0x00000, &spritelayout,  64, 8 }, /* sprites */
269   { REGION_GFX3, 0x00000, &tile1,          0, 4 }, /* background tiles */
270   { REGION_GFX3, 0x00000, &tile2,          0, 4 },
271   { REGION_GFX3, 0x04000, &tile1,          0, 4 },
272   { REGION_GFX3, 0x04000, &tile2,          0, 4 },
273   { REGION_GFX3, 0x08000, &tile1,          0, 4 },
274   { REGION_GFX3, 0x08000, &tile2,          0, 4 },
275   { REGION_GFX3, 0x0c000, &tile1,          0, 4 },
276   { REGION_GFX3, 0x0c000, &tile2,          0, 4 },
277   { -1 }
278};
265static GFXDECODE_START( exprraid )
266   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   128, 2 ) /* characters */
267   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, spritelayout,  64, 8 ) /* sprites */
268   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tile1,          0, 4 ) /* background tiles */
269   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, tile2,          0, 4 )
270   GFXDECODE_ENTRY( REGION_GFX3, 0x04000, tile1,          0, 4 )
271   GFXDECODE_ENTRY( REGION_GFX3, 0x04000, tile2,          0, 4 )
272   GFXDECODE_ENTRY( REGION_GFX3, 0x08000, tile1,          0, 4 )
273   GFXDECODE_ENTRY( REGION_GFX3, 0x08000, tile2,          0, 4 )
274   GFXDECODE_ENTRY( REGION_GFX3, 0x0c000, tile1,          0, 4 )
275   GFXDECODE_ENTRY( REGION_GFX3, 0x0c000, tile2,          0, 4 )
276GFXDECODE_END
279277
280278
281279
r1051r1052
321319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
322320   MDRV_SCREEN_SIZE(32*8, 32*8)
323321   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
324   MDRV_GFXDECODE(gfxdecodeinfo)
322   MDRV_GFXDECODE(exprraid)
325323   MDRV_PALETTE_LENGTH(256)
326324
327325   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/tecmo16.c
r1051r1052
417417   32*8   /* every sprite takes 32 consecutive bytes */
418418};
419419
420static const gfx_decode gfxdecodeinfo[] =
421{
422   { REGION_GFX1, 0, &charlayout,   1*16*16, 16   },
423   { REGION_GFX2, 0, &tilelayout,   2*16*16, 16*2 },
424   { REGION_GFX3, 0, &spritelayout, 0*16*16, 16   },
425   { -1 }
426};
420static GFXDECODE_START( tecmo16 )
421   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   1*16*16, 16   )
422   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   2*16*16, 16*2 )
423   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0*16*16, 16   )
424GFXDECODE_END
427425
428426/******************************************************************************/
429427
r1051r1052
459457   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
460458   MDRV_SCREEN_SIZE(32*8, 32*8)
461459   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
462   MDRV_GFXDECODE(gfxdecodeinfo)
460   MDRV_GFXDECODE(tecmo16)
463461   MDRV_PALETTE_LENGTH(4096)
464462
465463   MDRV_VIDEO_START(fstarfrc)
r1051r1052
499497   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
500498   MDRV_SCREEN_SIZE(32*8, 32*8)
501499   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
502   MDRV_GFXDECODE(gfxdecodeinfo)
500   MDRV_GFXDECODE(tecmo16)
503501   MDRV_PALETTE_LENGTH(4096)
504502
505503   MDRV_VIDEO_START(ginkun)
src/mame/drivers/2mindril.c
r1051r1052
168168    32*8
169169};
170170
171static const gfx_decode gfxdecodeinfo[] =
172{
173   { REGION_GFX1, 0, &drill_layout,  0, 256  },
174   { 0,            0, &vramlayout,   0, 256 },
175   { -1 }
176};
171static GFXDECODE_START( 2mindril )
172   GFXDECODE_ENTRY( REGION_GFX1, 0, drill_layout,  0, 256  )
173   GFXDECODE_ENTRY( 0,            0, vramlayout,   0, 256 )
174GFXDECODE_END
177175
178176
179177static INTERRUPT_GEN( drill_interrupt )
r1051r1052
199197   MDRV_CPU_VBLANK_INT(drill_interrupt,1)
200198   MDRV_SCREEN_REFRESH_RATE(60)
201199   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
202   MDRV_GFXDECODE(gfxdecodeinfo)
200   MDRV_GFXDECODE(2mindril)
203201   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
204202   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
205203   MDRV_SCREEN_SIZE(128*16, 64*8)
src/mame/drivers/csk.c
r1051r1052
565565   4*16*8   /* every char takes 32 consecutive bytes */
566566};
567567
568static const gfx_decode gfxdecodeinfo[] =
569{
570   { REGION_GFX1, 0x00000, &charlayout,   0, 16 },
571   { REGION_GFX2, 0x04000, &charlayout2,  0, 16 },
572   { REGION_GFX2, 0x08000, &charlayout2,  0, 16 },
573   { REGION_GFX2, 0x0c000, &charlayout2,  0, 16 },
574   { REGION_GFX2, 0x00000, &charlayout2,  0, 16 },
575   { -1 }
576};
568static GFXDECODE_START( csk )
569   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   0, 16 )
570   GFXDECODE_ENTRY( REGION_GFX2, 0x04000, charlayout2,  0, 16 )
571   GFXDECODE_ENTRY( REGION_GFX2, 0x08000, charlayout2,  0, 16 )
572   GFXDECODE_ENTRY( REGION_GFX2, 0x0c000, charlayout2,  0, 16 )
573   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, charlayout2,  0, 16 )
574GFXDECODE_END
577575
578576static MACHINE_DRIVER_START( csk227it )
579577
r1051r1052
592590   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
593591   MDRV_SCREEN_SIZE(64*8, 32*8)
594592   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1)
595   MDRV_GFXDECODE(gfxdecodeinfo)
593   MDRV_GFXDECODE(csk)
596594   MDRV_PALETTE_LENGTH(2048)
597595   MDRV_COLORTABLE_LENGTH(2048)
598596
src/mame/drivers/naughtyb.c
r1051r1052
344344
345345
346346
347static const gfx_decode gfxdecodeinfo[] =
348{
349   { REGION_GFX1, 0, &charlayout,     0, 32 },
350   { REGION_GFX2, 0, &charlayout, 32*4, 32 },
351   { -1 }
352};
347static GFXDECODE_START( naughtyb )
348   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 32 )
349   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 32*4, 32 )
350GFXDECODE_END
353351
354352
355353
r1051r1052
393391   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
394392   MDRV_SCREEN_SIZE(36*8, 28*8)
395393   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
396   MDRV_GFXDECODE(gfxdecodeinfo)
394   MDRV_GFXDECODE(naughtyb)
397395   MDRV_PALETTE_LENGTH(256)
398396   MDRV_COLORTABLE_LENGTH(32*4+32*4)
399397
r1051r1052
431429   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
432430   MDRV_SCREEN_SIZE(36*8, 28*8)
433431   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
434   MDRV_GFXDECODE(gfxdecodeinfo)
432   MDRV_GFXDECODE(naughtyb)
435433   MDRV_PALETTE_LENGTH(256)
436434   MDRV_COLORTABLE_LENGTH(32*4+32*4)
437435
src/mame/drivers/runaway.c
r1051r1052
327327};
328328
329329
330static const gfx_decode runaway_gfxdecodeinfo[] =
331{
332   { REGION_GFX1, 0x000, &runaway_tile_layout,   0, 1 },
333   { REGION_GFX1, 0x800, &runaway_sprite_layout, 8, 1 },
334   { -1 }
335};
330static GFXDECODE_START( runaway )
331   GFXDECODE_ENTRY( REGION_GFX1, 0x000, runaway_tile_layout,   0, 1 )
332   GFXDECODE_ENTRY( REGION_GFX1, 0x800, runaway_sprite_layout, 8, 1 )
333GFXDECODE_END
336334
337335
338static const gfx_decode qwak_gfxdecodeinfo[] =
339{
340   { REGION_GFX1, 0x800, &qwak_tile_layout,   0, 1 },
341   { REGION_GFX1, 0x000, &qwak_sprite_layout, 0, 1 },
342   { -1 }
343};
336static GFXDECODE_START( qwak )
337   GFXDECODE_ENTRY( REGION_GFX1, 0x800, qwak_tile_layout,   0, 1 )
338   GFXDECODE_ENTRY( REGION_GFX1, 0x000, qwak_sprite_layout, 0, 1 )
339GFXDECODE_END
344340
345341
346342static struct POKEYinterface pokey_interface_1 =
r1051r1052
371367   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
372368   MDRV_SCREEN_SIZE(256, 263)
373369   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
374   MDRV_GFXDECODE(runaway_gfxdecodeinfo)
370   MDRV_GFXDECODE(runaway)
375371   MDRV_PALETTE_LENGTH(16)
376372
377373   MDRV_VIDEO_START(runaway)
r1051r1052
396392   MDRV_IMPORT_FROM(runaway)
397393
398394   /* video hardware */
399   MDRV_GFXDECODE(qwak_gfxdecodeinfo)
395   MDRV_GFXDECODE(qwak)
400396
401397   MDRV_VIDEO_START(qwak)
402398   MDRV_VIDEO_UPDATE(qwak)
src/mame/drivers/taitowlf.c
r1051r1052
351351    8*8                     /* every char takes 8 bytes */
352352};
353353
354static const gfx_decode CGA_gfxdecodeinfo[] =
355{
354static GFXDECODE_START( CGA )
356355/* Support up to four CGA fonts */
357   { REGION_GFX1, 0x0000, &CGA_charlayout,              0, 256 },   /* Font 0 */
358   { REGION_GFX1, 0x0800, &CGA_charlayout,              0, 256 },   /* Font 1 */
359   { REGION_GFX1, 0x1000, &CGA_charlayout,              0, 256 },   /* Font 2 */
360   { REGION_GFX1, 0x1800, &CGA_charlayout,              0, 256 },   /* Font 3*/
361    { -1 }
362};
356   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, CGA_charlayout,              0, 256 )   /* Font 0 */
357   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, CGA_charlayout,              0, 256 )   /* Font 1 */
358   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, CGA_charlayout,              0, 256 )   /* Font 2 */
359   GFXDECODE_ENTRY( REGION_GFX1, 0x1800, CGA_charlayout,              0, 256 )   /* Font 3*/
360GFXDECODE_END
363361
364362#define AT_KEYB_HELPER(bit, text, key1) \
365363   PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(text) PORT_CODE(key1)
r1051r1052
433431   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
434432   MDRV_SCREEN_SIZE(640, 480)
435433   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 199)
436   MDRV_GFXDECODE(CGA_gfxdecodeinfo)
434   MDRV_GFXDECODE(CGA)
437435   MDRV_PALETTE_LENGTH(16)
438436
439437   MDRV_VIDEO_START(taitowlf)
src/mame/drivers/toypop.c
r1051r1052
550550   64*8
551551};
552552
553static const gfx_decode gfxdecodeinfo[] =
554{
555   { REGION_GFX1, 0, &charlayout,       0, 128 },
556   { REGION_GFX2, 0, &spritelayout, 128*4,  64 },
557   { -1 }
558};
553static GFXDECODE_START( toypop )
554   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 128 )
555   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 128*4,  64 )
556GFXDECODE_END
559557
560558
561559
r1051r1052
594592   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
595593   MDRV_SCREEN_SIZE(36*8, 28*8)
596594   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
597   MDRV_GFXDECODE(gfxdecodeinfo)
595   MDRV_GFXDECODE(toypop)
598596   MDRV_PALETTE_LENGTH(128*4+64*4+16*2)
599597
600598   MDRV_PALETTE_INIT(toypop)
src/mame/drivers/tumbleb.c
r1051r1052
297297WRITE16_HANDLER( fncywld_pf1_data_w );
298298WRITE16_HANDLER( fncywld_pf2_data_w );
299299WRITE16_HANDLER( tumblepb_control_0_w );
300WRITE16_HANDLER( semicom_soundcmd_w );
300static WRITE16_HANDLER( semicom_soundcmd_w );
301301WRITE16_HANDLER( pangpang_pf1_data_w );
302302WRITE16_HANDLER( pangpang_pf2_data_w );
303303
r1051r1052
846846}
847847#endif
848848
849WRITE16_HANDLER( semicom_soundcmd_w )
849static WRITE16_HANDLER( semicom_soundcmd_w )
850850{
851851   if (ACCESSING_LSB)
852852   {
r1051r1052
19941994
19951995
19961996
1997static const gfx_decode gfxdecodeinfo[] =
1998{
1999   { REGION_GFX1, 0, &tcharlayout, 256, 16 },   /* Characters 8x8 */
2000   { REGION_GFX1, 0, &tlayout,     512, 16 },   /* Tiles 16x16 */
2001   { REGION_GFX1, 0, &tlayout,     256, 16 },   /* Tiles 16x16 */
2002   { REGION_GFX2, 0, &tlayout,       0, 16 },   /* Sprites 16x16 */
2003   { -1 }
2004};
1997static GFXDECODE_START( tumbleb )
1998   GFXDECODE_ENTRY( REGION_GFX1, 0, tcharlayout, 256, 16 )   /* Characters 8x8 */
1999   GFXDECODE_ENTRY( REGION_GFX1, 0, tlayout,     512, 16 )   /* Tiles 16x16 */
2000   GFXDECODE_ENTRY( REGION_GFX1, 0, tlayout,     256, 16 )   /* Tiles 16x16 */
2001   GFXDECODE_ENTRY( REGION_GFX2, 0, tlayout,       0, 16 )   /* Sprites 16x16 */
2002GFXDECODE_END
20052003
2006static const gfx_decode suprtrio_gfxdecodeinfo[] =
2007{
2008   { REGION_GFX1, 0, &tcharlayout, 256, 16 },   /* Characters 8x8 */
2009   { REGION_GFX1, 0, &suprtrio_tlayout,     512, 16 },   /* Tiles 16x16 */
2010   { REGION_GFX1, 0, &suprtrio_tlayout,     256, 16 },   /* Tiles 16x16 */
2011   { REGION_GFX2, 0, &tlayout,       0, 16 },   /* Sprites 16x16 */
2012   { -1 }
2013};
2004static GFXDECODE_START( suprtrio )
2005   GFXDECODE_ENTRY( REGION_GFX1, 0, tcharlayout, 256, 16 )   /* Characters 8x8 */
2006   GFXDECODE_ENTRY( REGION_GFX1, 0, suprtrio_tlayout,     512, 16 )   /* Tiles 16x16 */
2007   GFXDECODE_ENTRY( REGION_GFX1, 0, suprtrio_tlayout,     256, 16 )   /* Tiles 16x16 */
2008   GFXDECODE_ENTRY( REGION_GFX2, 0, tlayout,       0, 16 )   /* Sprites 16x16 */
2009GFXDECODE_END
20142010
2015static const gfx_decode fncywld_gfxdecodeinfo[] =
2016{
2017   { REGION_GFX1, 0, &tcharlayout, 0x400, 0x40 },   /* Characters 8x8 */
2018   { REGION_GFX1, 0, &tlayout,     0x400, 0x40 },   /* Tiles 16x16 */
2019   { REGION_GFX1, 0, &tlayout,     0x200, 0x40 },   /* Tiles 16x16 */
2020   { REGION_GFX2, 0, &tlayout,       0, 0x40 },   /* Sprites 16x16 */
2021   { -1 }
2022};
2011static GFXDECODE_START( fncywld )
2012   GFXDECODE_ENTRY( REGION_GFX1, 0, tcharlayout, 0x400, 0x40 )   /* Characters 8x8 */
2013   GFXDECODE_ENTRY( REGION_GFX1, 0, tlayout,     0x400, 0x40 )   /* Tiles 16x16 */
2014   GFXDECODE_ENTRY( REGION_GFX1, 0, tlayout,     0x200, 0x40 )   /* Tiles 16x16 */
2015   GFXDECODE_ENTRY( REGION_GFX2, 0, tlayout,       0, 0x40 )   /* Sprites 16x16 */
2016GFXDECODE_END
20232017
2024static const gfx_decode jumppop_gfxdecodeinfo[] =
2025{
2026   { REGION_GFX1, 0, &jumppop_tcharlayout, 0x100, 0x40 },   /* Characters 8x8 */
2027   { REGION_GFX1, 0, &jumpop_tlayout,     0x100, 0x40 },   /* Tiles 16x16 */
2028   { REGION_GFX1, 0, &jumpop_tlayout,     0x100, 0x40 },   /* Tiles 16x16 */
2029   { REGION_GFX2, 0, &tlayout,       0, 0x40 },   /* Sprites 16x16 */
2030   { -1 }
2031};
2018static GFXDECODE_START( jumppop )
2019   GFXDECODE_ENTRY( REGION_GFX1, 0, jumppop_tcharlayout, 0x100, 0x40 )   /* Characters 8x8 */
2020   GFXDECODE_ENTRY( REGION_GFX1, 0, jumpop_tlayout,     0x100, 0x40 )   /* Tiles 16x16 */
2021   GFXDECODE_ENTRY( REGION_GFX1, 0, jumpop_tlayout,     0x100, 0x40 )   /* Tiles 16x16 */
2022   GFXDECODE_ENTRY( REGION_GFX2, 0, tlayout,       0, 0x40 )   /* Sprites 16x16 */
2023GFXDECODE_END
20322024
20332025
20342026/******************************************************************************/
r1051r1052
20492041   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20502042   MDRV_SCREEN_SIZE(40*8, 32*8)
20512043   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2052   MDRV_GFXDECODE(gfxdecodeinfo)
2044   MDRV_GFXDECODE(tumbleb)
20532045   MDRV_PALETTE_LENGTH(1024)
20542046
20552047   MDRV_VIDEO_START(tumblepb)
r1051r1052
20792071   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20802072   MDRV_SCREEN_SIZE(40*8, 32*8)
20812073   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2082   MDRV_GFXDECODE(gfxdecodeinfo)
2074   MDRV_GFXDECODE(tumbleb)
20832075   MDRV_PALETTE_LENGTH(1024)
20842076
20852077   MDRV_VIDEO_START(tumblepb)
r1051r1052
21122104   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21132105   MDRV_SCREEN_SIZE(40*8, 32*8)
21142106   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2115   MDRV_GFXDECODE(gfxdecodeinfo)
2107   MDRV_GFXDECODE(tumbleb)
21162108   MDRV_PALETTE_LENGTH(1024)
21172109
21182110   MDRV_VIDEO_START(tumblepb)
r1051r1052
21402132   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21412133   MDRV_SCREEN_SIZE(40*8, 32*8)
21422134   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2143   MDRV_GFXDECODE(fncywld_gfxdecodeinfo)
2135   MDRV_GFXDECODE(fncywld)
21442136   MDRV_PALETTE_LENGTH(0x800)
21452137
21462138   MDRV_VIDEO_START(fncywld)
r1051r1052
22052197   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22062198   MDRV_SCREEN_SIZE(40*8, 32*8)
22072199   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2208   MDRV_GFXDECODE(gfxdecodeinfo)
2200   MDRV_GFXDECODE(tumbleb)
22092201   MDRV_PALETTE_LENGTH(1024)
22102202
22112203   MDRV_VIDEO_START(tumblepb)
r1051r1052
22812273   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22822274   MDRV_SCREEN_SIZE(40*8, 32*8)
22832275   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2284   MDRV_GFXDECODE(jumppop_gfxdecodeinfo)
2276   MDRV_GFXDECODE(jumppop)
22852277   MDRV_PALETTE_LENGTH(1024)
22862278
22872279   MDRV_VIDEO_START(jumppop)
r1051r1052
23182310   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23192311   MDRV_SCREEN_SIZE(40*8, 32*8)
23202312   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8-1, 31*8-2)
2321   MDRV_GFXDECODE(suprtrio_gfxdecodeinfo)
2313   MDRV_GFXDECODE(suprtrio)
23222314   MDRV_PALETTE_LENGTH(1024)
23232315
23242316   MDRV_VIDEO_START(suprtrio)
r1051r1052
23482340   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23492341   MDRV_SCREEN_SIZE(40*8, 32*8)
23502342   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2351   MDRV_GFXDECODE(gfxdecodeinfo)
2343   MDRV_GFXDECODE(tumbleb)
23522344   MDRV_PALETTE_LENGTH(1024)
23532345
23542346   MDRV_VIDEO_START(pangpang)
src/mame/drivers/momoko.c
r1051r1052
234234   8*1
235235};
236236
237static const gfx_decode gfxdecodeinfo[] =
238{
239   { REGION_GFX1, 0x0000, &charlayout1,      0,  24 }, /* TEXT */
240   { REGION_GFX2, 0x0000, &tilelayout,     256,  16 }, /* BG */
241   { REGION_GFX3, 0x0000, &charlayout,       0,   1 }, /* FG */
242   { REGION_GFX4, 0x0000, &spritelayout,   128,   8 }, /* sprite */
243   { -1 }
244};
237static GFXDECODE_START( momoko )
238   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout1,      0,  24 ) /* TEXT */
239   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, tilelayout,     256,  16 ) /* BG */
240   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, charlayout,       0,   1 ) /* FG */
241   GFXDECODE_ENTRY( REGION_GFX4, 0x0000, spritelayout,   128,   8 ) /* sprite */
242GFXDECODE_END
245243
246244/****************************************************************************/
247245
r1051r1052
269267   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
270268   MDRV_SCREEN_SIZE(32*8, 32*8)
271269   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 29*8-1)
272   MDRV_GFXDECODE(gfxdecodeinfo)
270   MDRV_GFXDECODE(momoko)
273271   MDRV_PALETTE_LENGTH(512)
274272
275273   MDRV_VIDEO_START(generic)
src/mame/drivers/kchamp.c
r1051r1052
387387   16*8   /* ofset to next tile */
388388};
389389
390static const gfx_decode gfxdecodeinfo[] =
391{
392   { REGION_GFX1, 0x00000, &tilelayout,   32*4, 32 },
393   { REGION_GFX2, 0x08000, &spritelayout,   0, 16 },
394   { REGION_GFX2, 0x04000, &spritelayout,   0, 16 },
395   { REGION_GFX2, 0x00000, &spritelayout,   0, 16 },
396   { -1 }
397};
390static GFXDECODE_START( kchamp )
391   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, tilelayout,   32*4, 32 )
392   GFXDECODE_ENTRY( REGION_GFX2, 0x08000, spritelayout,   0, 16 )
393   GFXDECODE_ENTRY( REGION_GFX2, 0x04000, spritelayout,   0, 16 )
394   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, spritelayout,   0, 16 )
395GFXDECODE_END
398396
399397
400398
r1051r1052
461459   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
462460   MDRV_SCREEN_SIZE(32*8, 32*8)
463461   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
464   MDRV_GFXDECODE(gfxdecodeinfo)
462   MDRV_GFXDECODE(kchamp)
465463   MDRV_PALETTE_LENGTH(256)
466464   MDRV_COLORTABLE_LENGTH(256)
467465
r1051r1052
510508   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
511509   MDRV_SCREEN_SIZE(32*8, 32*8)
512510   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
513   MDRV_GFXDECODE(gfxdecodeinfo)
511   MDRV_GFXDECODE(kchamp)
514512   MDRV_PALETTE_LENGTH(256)
515513   MDRV_COLORTABLE_LENGTH(256)
516514
src/mame/drivers/olibochu.c
r1051r1052
352352   32*8
353353};
354354
355static const gfx_decode gfxdecodeinfo[] =
356{
357   { REGION_GFX1, 0, &charlayout,     0, 64 },
358   { REGION_GFX2, 0, &spritelayout, 256, 64 },
359   { -1 }
360};
355static GFXDECODE_START( olibochu )
356   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 64 )
357   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 256, 64 )
358GFXDECODE_END
361359
362360
363361
r1051r1052
390388   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
391389   MDRV_SCREEN_SIZE(32*8, 32*8)
392390   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
393   MDRV_GFXDECODE(gfxdecodeinfo)
391   MDRV_GFXDECODE(olibochu)
394392   MDRV_PALETTE_LENGTH(32)
395393   MDRV_COLORTABLE_LENGTH(512)
396394
src/mame/drivers/ultratnk.c
r1051r1052
285285};
286286
287287
288static const gfx_decode gfxdecodeinfo[] =
289{
290   { REGION_GFX1, 0, &gfx_8x8x1, 0, 5 },
291   { REGION_GFX2, 0, &motion_layout, 0, 5 },
292   { -1 }
293};
288static GFXDECODE_START( ultratnk )
289   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x1, 0, 5 )
290   GFXDECODE_ENTRY( REGION_GFX2, 0, motion_layout, 0, 5 )
291GFXDECODE_END
294292
295293
296294static MACHINE_DRIVER_START( ultratnk )
r1051r1052
306304   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
307305   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
308306   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, 0, 256, VTOTAL, 0, 224)
309   MDRV_GFXDECODE(gfxdecodeinfo)
307   MDRV_GFXDECODE(ultratnk)
310308   MDRV_PALETTE_LENGTH(4)
311309   MDRV_COLORTABLE_LENGTH(10)
312310
r1051r1052
319317   MDRV_SPEAKER_STANDARD_MONO("mono")
320318
321319   MDRV_SOUND_ADD(DISCRETE, 0)
322   MDRV_SOUND_CONFIG(ultratnk_discrete_interface)
320   MDRV_SOUND_CONFIG_DISCRETE(ultratnk)
323321   MDRV_SOUND_ROUTE(0, "mono", 1.0)
324322
325323MACHINE_DRIVER_END
src/mame/drivers/m90.c
r1051r1052
632632   32*8
633633};
634634
635static const gfx_decode gfxdecodeinfo[] =
636{
637   { REGION_GFX1, 0, &charlayout,     0, 16 },
638   { REGION_GFX1, 0, &spritelayout, 256, 16 },
639   { -1 }
640};
635static GFXDECODE_START( m90 )
636   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
637   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 256, 16 )
638GFXDECODE_END
641639
642640/*****************************************************************************/
643641
r1051r1052
682680   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
683681   MDRV_SCREEN_SIZE(64*8, 64*8)
684682   MDRV_SCREEN_VISIBLE_AREA(6*8, 54*8-1, 17*8, 47*8-1)
685   MDRV_GFXDECODE(gfxdecodeinfo)
683   MDRV_GFXDECODE(m90)
686684   MDRV_PALETTE_LENGTH(512)
687685
688686   MDRV_VIDEO_START(m90)
r1051r1052
731729   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
732730   MDRV_SCREEN_SIZE(64*8, 64*8)
733731   MDRV_SCREEN_VISIBLE_AREA(10*8, 50*8-1, 17*8, 47*8-1)
734   MDRV_GFXDECODE(gfxdecodeinfo)
732   MDRV_GFXDECODE(m90)
735733   MDRV_PALETTE_LENGTH(512)
736734
737735   MDRV_VIDEO_START(m90)
r1051r1052
773771   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
774772   MDRV_SCREEN_SIZE(64*8, 64*8)
775773   MDRV_SCREEN_VISIBLE_AREA(10*8, 50*8-1, 17*8, 47*8-1)
776   MDRV_GFXDECODE(gfxdecodeinfo)
774   MDRV_GFXDECODE(m90)
777775   MDRV_PALETTE_LENGTH(512)
778776
779777   MDRV_VIDEO_START(m90)
r1051r1052
822820   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
823821   MDRV_SCREEN_SIZE(320, 240)
824822   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
825   MDRV_GFXDECODE(gfxdecodeinfo)
823   MDRV_GFXDECODE(m90)
826824   MDRV_PALETTE_LENGTH(512)
827825
828826   MDRV_VIDEO_START(m90)
src/mame/drivers/tugboat.c
r1051r1052
362362   8*8
363363};
364364
365static const gfx_decode gfxdecodeinfo[] =
366{
367   { REGION_GFX1, 0, &charlayout, 0x80, 16 },
368   { REGION_GFX2, 0, &charlayout, 0x80, 16 },
369   { REGION_GFX3, 0, &charlayout, 0x00, 16 },
370   { REGION_GFX4, 0, &charlayout, 0x00, 16 },
371   { -1 }
372};
365static GFXDECODE_START( tugboat )
366   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x80, 16 )
367   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0x80, 16 )
368   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout, 0x00, 16 )
369   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout, 0x00, 16 )
370GFXDECODE_END
373371
374372
375373static MACHINE_DRIVER_START( tugboat )
r1051r1052
386384   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
387385   MDRV_SCREEN_SIZE(32*8,32*8)
388386   MDRV_SCREEN_VISIBLE_AREA(1*8,31*8-1,2*8,30*8-1)
389   MDRV_GFXDECODE(gfxdecodeinfo)
387   MDRV_GFXDECODE(tugboat)
390388   MDRV_PALETTE_LENGTH(256)
391389
392390   MDRV_PALETTE_INIT(tugboat)
src/mame/drivers/gunbustr.c
r1051r1052
318318   128*8     /* every sprite takes 128 consecutive bytes */
319319};
320320
321static const gfx_decode gunbustr_gfxdecodeinfo[] =
322{
323   { REGION_GFX2, 0x0, &tile16x16_layout,  0, 512 },
324   { REGION_GFX1, 0x0, &charlayout,        0, 512 },
325   { -1 }
326};
321static GFXDECODE_START( gunbustr )
322   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x16_layout,  0, 512 )
323   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,        0, 512 )
324GFXDECODE_END
327325
328326
329327/***********************************************************
r1051r1052
393391   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
394392   MDRV_SCREEN_SIZE(40*8, 32*8)
395393   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 2*8, 32*8-1)
396   MDRV_GFXDECODE(gunbustr_gfxdecodeinfo)
394   MDRV_GFXDECODE(gunbustr)
397395   MDRV_PALETTE_LENGTH(8192)
398396
399397   MDRV_VIDEO_START(gunbustr)
src/mame/drivers/scotrsht.c
r1051r1052
215215   128*8   /* every sprite takes 128 consecutive bytes */
216216};
217217
218static const gfx_decode gfxdecodeinfo[] =
219{
220   { REGION_GFX1, 0, &charlayout,         0, 16*8 }, /* characters */
221   { REGION_GFX2, 0, &spritelayout, 16*16*8, 16*8 }, /* sprites */
222   { -1 }
223};
218static GFXDECODE_START( scotrsht )
219   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0, 16*8 ) /* characters */
220   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16*8, 16*8 ) /* sprites */
221GFXDECODE_END
224222
225223static MACHINE_DRIVER_START( scotrsht )
226224
r1051r1052
242240   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
243241   MDRV_SCREEN_SIZE(32*8, 32*8)
244242   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
245   MDRV_GFXDECODE(gfxdecodeinfo)
243   MDRV_GFXDECODE(scotrsht)
246244   MDRV_PALETTE_LENGTH(256)
247245   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
248246
src/mame/drivers/taito_z.c
r1051r1052
27112711   128*8     /* every sprite takes 128 consecutive bytes */
27122712};
27132713
2714static const gfx_decode taitoz_gfxdecodeinfo[] =
2715{
2716   { REGION_GFX2, 0x0, &tile16x8_layout,  0, 256 },   /* sprite parts */
2717   { REGION_GFX1, 0x0, &charlayout,  0, 256 },      /* sprites & playfield */
2718   { -1 }
2719};
2714static GFXDECODE_START( taitoz )
2715   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x8_layout,  0, 256 )   /* sprite parts */
2716   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,  0, 256 )      /* sprites & playfield */
2717GFXDECODE_END
27202718
27212719/* taitoic.c TC0100SCN routines expect scr stuff to be in second gfx
27222720   slot, so 2nd batch of obj must be placed third */
27232721
2724static const gfx_decode chasehq_gfxdecodeinfo[] =
2725{
2726   { REGION_GFX2, 0x0, &tile16x16_layout,  0, 256 },   /* sprite parts */
2727   { REGION_GFX1, 0x0, &charlayout,  0, 256 },      /* sprites & playfield */
2728   { REGION_GFX4, 0x0, &tile16x16_layout,  0, 256 },   /* sprite parts */
2729   { -1 }
2730};
2722static GFXDECODE_START( chasehq )
2723   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x16_layout,  0, 256 )   /* sprite parts */
2724   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,  0, 256 )      /* sprites & playfield */
2725   GFXDECODE_ENTRY( REGION_GFX4, 0x0, tile16x16_layout,  0, 256 )   /* sprite parts */
2726GFXDECODE_END
27312727
2732static const gfx_decode dblaxle_gfxdecodeinfo[] =
2733{
2734   { REGION_GFX2, 0x0, &tile16x8_layout,  0, 256 },   /* sprite parts */
2735   { REGION_GFX1, 0x0, &dblaxle_charlayout,  0, 256 },   /* sprites & playfield */
2736   { -1 }
2737};
2728static GFXDECODE_START( dblaxle )
2729   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x8_layout,  0, 256 )   /* sprite parts */
2730   GFXDECODE_ENTRY( REGION_GFX1, 0x0, dblaxle_charlayout,  0, 256 )   /* sprites & playfield */
2731GFXDECODE_END
27382732
27392733
27402734
r1051r1052
28602854   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
28612855   MDRV_SCREEN_SIZE(40*8, 32*8)
28622856   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 3*8, 31*8-1)
2863   MDRV_GFXDECODE(taitoz_gfxdecodeinfo)
2857   MDRV_GFXDECODE(taitoz)
28642858   MDRV_PALETTE_LENGTH(4096)
28652859
28662860   MDRV_VIDEO_START(taitoz)
r1051r1052
29052899   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29062900   MDRV_SCREEN_SIZE(40*8, 32*8)
29072901   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
2908   MDRV_GFXDECODE(chasehq_gfxdecodeinfo)
2902   MDRV_GFXDECODE(chasehq)
29092903   MDRV_PALETTE_LENGTH(4096)
29102904
29112905   MDRV_VIDEO_START(taitoz)
r1051r1052
29502944   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29512945   MDRV_SCREEN_SIZE(40*8, 32*8)
29522946   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 31*8-1)
2953   MDRV_GFXDECODE(taitoz_gfxdecodeinfo)
2947   MDRV_GFXDECODE(taitoz)
29542948   MDRV_PALETTE_LENGTH(4096)
29552949
29562950   MDRV_VIDEO_START(taitoz)
r1051r1052
29922986   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29932987   MDRV_SCREEN_SIZE(40*8, 32*8)
29942988   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
2995   MDRV_GFXDECODE(taitoz_gfxdecodeinfo)
2989   MDRV_GFXDECODE(taitoz)
29962990   MDRV_PALETTE_LENGTH(4096)
29972991
29982992   MDRV_VIDEO_START(taitoz)
r1051r1052
30363030   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30373031   MDRV_SCREEN_SIZE(40*8, 32*8)
30383032   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
3039   MDRV_GFXDECODE(taitoz_gfxdecodeinfo)
3033   MDRV_GFXDECODE(taitoz)
30403034   MDRV_PALETTE_LENGTH(4096)
30413035
30423036   MDRV_VIDEO_START(taitoz)
r1051r1052
30803074   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30813075   MDRV_SCREEN_SIZE(40*8, 32*8)
30823076   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
3083   MDRV_GFXDECODE(chasehq_gfxdecodeinfo)
3077   MDRV_GFXDECODE(chasehq)
30843078   MDRV_PALETTE_LENGTH(4096)
30853079
30863080   MDRV_VIDEO_START(taitoz)
r1051r1052
31253119   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
31263120   MDRV_SCREEN_SIZE(40*8, 32*8)
31273121   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
3128   MDRV_GFXDECODE(taitoz_gfxdecodeinfo)
3122   MDRV_GFXDECODE(taitoz)
31293123   MDRV_PALETTE_LENGTH(4096)
31303124
31313125   MDRV_VIDEO_START(taitoz)
r1051r1052
31663160   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
31673161   MDRV_SCREEN_SIZE(40*8, 32*8)
31683162   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
3169   MDRV_GFXDECODE(taitoz_gfxdecodeinfo)
3163   MDRV_GFXDECODE(taitoz)
31703164   MDRV_PALETTE_LENGTH(4096)
31713165
31723166   MDRV_VIDEO_START(spacegun)
r1051r1052
32103204   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32113205   MDRV_SCREEN_SIZE(40*8, 32*8)
32123206   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
3213   MDRV_GFXDECODE(dblaxle_gfxdecodeinfo)
3207   MDRV_GFXDECODE(dblaxle)
32143208   MDRV_PALETTE_LENGTH(4096)
32153209
32163210   MDRV_VIDEO_START(taitoz)
r1051r1052
32543248   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32553249   MDRV_SCREEN_SIZE(40*8, 32*8)
32563250   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
3257   MDRV_GFXDECODE(dblaxle_gfxdecodeinfo)
3251   MDRV_GFXDECODE(dblaxle)
32583252   MDRV_PALETTE_LENGTH(4096)
32593253
32603254   MDRV_VIDEO_START(taitoz)
r1051r1052
36983692
36993693ROM_START( sci )
37003694   ROM_REGION( 0x80000, REGION_CPU1, 0 )   /* 512K for 68000 code (CPU A) */
3701   ROM_LOAD16_BYTE( "c09-37.37", 0x00000, 0x20000, CRC(0fecea17) SHA1(0ad4454eee6646b0f978b1ba83206d64c1f6d081) )
3695   ROM_LOAD16_BYTE( "c09-37.43", 0x00000, 0x20000, CRC(0fecea17) SHA1(0ad4454eee6646b0f978b1ba83206d64c1f6d081) )
37023696   ROM_LOAD16_BYTE( "c09-38.40", 0x00001, 0x20000, CRC(e46ebd9b) SHA1(52b0c1f95e8a664076d8fbc0f6204ca55893e281) )
37033697   ROM_LOAD16_BYTE( "c09-42.38", 0x40000, 0x20000, CRC(f4404f87) SHA1(8f051f1ffbf323cb3d613bc22afa53676590f29c) )
37043698   ROM_LOAD16_BYTE( "c09-39.41", 0x40001, 0x20000, CRC(de87bcb9) SHA1(b5537a25871ea90294f3b6f0b6386a883cfdf991) )
src/mame/drivers/phoenix.c
r1051r1052
615615   8*8 /* every char takes 8 consecutive bytes */
616616};
617617
618static const gfx_decode phoenix_gfxdecodeinfo[] =
619{
620   { REGION_GFX1, 0, &charlayout,     0, 16 },
621   { REGION_GFX2, 0, &charlayout, 16*4, 16 },
622   { -1 }
623};
618static GFXDECODE_START( phoenix )
619   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
620   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 16*4, 16 )
621GFXDECODE_END
624622
625static const gfx_decode pleiads_gfxdecodeinfo[] =
626{
627   { REGION_GFX1, 0, &charlayout,     0, 32 },
628   { REGION_GFX2, 0, &charlayout, 32*4, 32 },
629   { -1 }
630};
623static GFXDECODE_START( pleiads )
624   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 32 )
625   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 32*4, 32 )
626GFXDECODE_END
631627
632628
633629static struct TMS36XXinterface phoenix_tms36xx_interface =
r1051r1052
689685   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
690686   MDRV_SCREEN_SIZE(32*8, 32*8)
691687   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 26*8-1)
692   MDRV_GFXDECODE(phoenix_gfxdecodeinfo)
688   MDRV_GFXDECODE(phoenix)
693689   MDRV_PALETTE_LENGTH(256)
694690   MDRV_COLORTABLE_LENGTH(16*4+16*4)
695691
r1051r1052
709705   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4)
710706
711707   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 120000)
712   MDRV_SOUND_CONFIG(phoenix_discrete_interface)
708   MDRV_SOUND_CONFIG_DISCRETE(phoenix)
713709   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6)
714710MACHINE_DRIVER_END
715711
r1051r1052
722718   MDRV_CPU_PROGRAM_MAP(pleiads_readmem,pleiads_writemem)
723719
724720   /* video hardware */
725   MDRV_GFXDECODE(pleiads_gfxdecodeinfo)
721   MDRV_GFXDECODE(pleiads)
726722   MDRV_COLORTABLE_LENGTH(32*4+32*4)
727723
728724   MDRV_PALETTE_INIT(pleiads)
r1051r1052
756752   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
757753   MDRV_SCREEN_SIZE(32*8, 32*8)
758754   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 26*8-1)
759   MDRV_GFXDECODE(phoenix_gfxdecodeinfo)
755   MDRV_GFXDECODE(phoenix)
760756   MDRV_PALETTE_LENGTH(256)
761757   MDRV_COLORTABLE_LENGTH(16*4+16*4)
762758
src/mame/drivers/markham.c
r1051r1052
202202   8*8*4
203203};
204204
205static const gfx_decode gfxdecodeinfo[] =
206{
207   { REGION_GFX2, 0x0000, &charlayout,   512, 64 },
208   { REGION_GFX1, 0x0000, &spritelayout, 0,   64 },
209   { -1 }
210};
205static GFXDECODE_START( markham )
206   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   512, 64 )
207   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0,   64 )
208GFXDECODE_END
211209
212210
213211static MACHINE_DRIVER_START( markham )
r1051r1052
230228   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
231229   MDRV_SCREEN_SIZE(32*8, 32*8)
232230   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
233   MDRV_GFXDECODE(gfxdecodeinfo)
231   MDRV_GFXDECODE(markham)
234232   MDRV_PALETTE_LENGTH(256)
235233   MDRV_COLORTABLE_LENGTH(1024)
236234
src/mame/drivers/msisaac.c
r1051r1052
510510   32*8
511511};
512512
513static const gfx_decode gfxdecodeinfo[] =
514{
515   { REGION_GFX1, 0, &char_layout, 0, 64 },
516   { REGION_GFX2, 0, &char_layout, 0, 64 },
517   { REGION_GFX1, 0, &tile_layout, 0, 64 },
518   { REGION_GFX2, 0, &tile_layout, 0, 64 },
519   { -1 }
520};
513static GFXDECODE_START( msisaac )
514   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout, 0, 64 )
515   GFXDECODE_ENTRY( REGION_GFX2, 0, char_layout, 0, 64 )
516   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0, 64 )
517   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 0, 64 )
518GFXDECODE_END
521519
522520static struct MSM5232interface msm5232_interface =
523521{
r1051r1052
554552   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
555553   MDRV_SCREEN_SIZE(32*8, 32*8)
556554   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 1*8, 31*8-1)
557   MDRV_GFXDECODE(gfxdecodeinfo)
555   MDRV_GFXDECODE(msisaac)
558556   MDRV_PALETTE_LENGTH(1024)
559557
560558   MDRV_VIDEO_START(msisaac)
src/mame/drivers/superqix.c
r1051r1052
849849};
850850
851851
852static const gfx_decode pbillian_gfxdecodeinfo[] =
853{
854   { REGION_GFX1, 0, &pbillian_charlayout, 16*16, 16 },
855   { REGION_GFX1, 0, &spritelayout,            0, 16 },
856   { -1 }
857};
852static GFXDECODE_START( pbillian )
853   GFXDECODE_ENTRY( REGION_GFX1, 0, pbillian_charlayout, 16*16, 16 )
854   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,            0, 16 )
855GFXDECODE_END
858856
859static const gfx_decode sqix_gfxdecodeinfo[] =
860{
861   { REGION_GFX1, 0x00000, &sqix_charlayout,   0, 16 },   /* Chars */
862   { REGION_GFX2, 0x00000, &sqix_charlayout,   0, 16 },   /* Background tiles */
863   { REGION_GFX3, 0x00000, &spritelayout,      0, 16 },   /* Sprites */
864   { -1 }
865};
857static GFXDECODE_START( sqix )
858   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, sqix_charlayout,   0, 16 )   /* Chars */
859   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, sqix_charlayout,   0, 16 )   /* Background tiles */
860   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, spritelayout,      0, 16 )   /* Sprites */
861GFXDECODE_END
866862
867863
868864
r1051r1052
943939   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
944940   MDRV_SCREEN_SIZE(256, 256)
945941   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
946   MDRV_GFXDECODE(pbillian_gfxdecodeinfo)
942   MDRV_GFXDECODE(pbillian)
947943   MDRV_PALETTE_LENGTH(512)
948944
949945   MDRV_VIDEO_START(pbillian)
r1051r1052
977973   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
978974   MDRV_SCREEN_SIZE(256, 256)
979975   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
980   MDRV_GFXDECODE(pbillian_gfxdecodeinfo)
976   MDRV_GFXDECODE(pbillian)
981977   MDRV_PALETTE_LENGTH(512)
982978
983979   MDRV_VIDEO_START(pbillian)
r1051r1052
10151011   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10161012   MDRV_SCREEN_SIZE(32*8, 32*8)
10171013   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1018   MDRV_GFXDECODE(sqix_gfxdecodeinfo)
1014   MDRV_GFXDECODE(sqix)
10191015   MDRV_PALETTE_LENGTH(256)
10201016
10211017   MDRV_VIDEO_START(superqix)
r1051r1052
10501046   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10511047   MDRV_SCREEN_SIZE(32*8, 32*8)
10521048   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1053   MDRV_GFXDECODE(sqix_gfxdecodeinfo)
1049   MDRV_GFXDECODE(sqix)
10541050   MDRV_PALETTE_LENGTH(256)
10551051
10561052   MDRV_VIDEO_START(superqix)
src/mame/drivers/dday.c
r1051r1052
246246   8*8     /* every char takes 8 consecutive bytes */
247247};
248248
249static const gfx_decode gfxdecodeinfo[] =
250{
251   { REGION_GFX1, 0, &layout_3bpp, 0,       256/8 },   /* background */
252   { REGION_GFX2, 0, &layout_2bpp, 8*4,     8 },      /* foreground */
253   { REGION_GFX3, 0, &layout_2bpp, 8*4+8*4, 8 },      /* text */
254   { REGION_GFX4, 0, &layout_1bpp, 254,     1 },      /* searchlight */
255   { -1 }
256};
249static GFXDECODE_START( dday )
250   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_3bpp, 0,       256/8 )   /* background */
251   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_2bpp, 8*4,     8 )      /* foreground */
252   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_2bpp, 8*4+8*4, 8 )      /* text */
253   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_1bpp, 254,     1 )      /* searchlight */
254GFXDECODE_END
257255
258256
259257
r1051r1052
269267   /* video hardware */
270268   MDRV_SCREEN_SIZE(32*8, 32*8)
271269   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
272   MDRV_GFXDECODE(gfxdecodeinfo)
270   MDRV_GFXDECODE(dday)
273271   MDRV_PALETTE_LENGTH(256)
274272   MDRV_COLORTABLE_LENGTH(256)//8*8+8*4+8*4,
275273   MDRV_PALETTE_INIT(dday)
src/mame/drivers/playch10.c
r1051r1052
709709    8*8     /* every char takes 8 consecutive bytes */
710710};
711711
712static const gfx_decode gfxdecodeinfo[] =
713{
714   { REGION_GFX1, 0, &bios_charlayout,   0,  32 },
715   { -1 }
716};
712static GFXDECODE_START( playch10 )
713   GFXDECODE_ENTRY( REGION_GFX1, 0, bios_charlayout,   0,  32 )
714GFXDECODE_END
717715
718716static INTERRUPT_GEN( playch10_interrupt ) {
719717
r1051r1052
746744
747745   // video hardware
748746   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
749   MDRV_GFXDECODE(gfxdecodeinfo)
747   MDRV_GFXDECODE(playch10)
750748   MDRV_PALETTE_LENGTH(256+8*4*16)
751749   MDRV_DEFAULT_LAYOUT(layout_dualhuov)
752750
src/mame/drivers/cyberbal.c
r1051r1052
219219 *
220220 *************************************/
221221
222ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
222static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
223223   AM_RANGE(0x0000, 0x1fff) AM_RAM
224224   AM_RANGE(0x2000, 0x2000) AM_READWRITE(YM2151_status_port_0_r, YM2151_register_port_0_w)
225225   AM_RANGE(0x2001, 0x2001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
r1051r1052
408408   16*8
409409};
410410
411static const gfx_decode gfxdecodeinfo[] =
412{
413   { REGION_GFX2, 0, &pfanlayout,     0, 128 },
414   { REGION_GFX1, 0, &molayout,   0x600, 16 },
415   { REGION_GFX3, 0, &pfanlayout, 0x780, 8 },
416   { -1 }
417};
411static GFXDECODE_START( cyberbal )
412   GFXDECODE_ENTRY( REGION_GFX2, 0, pfanlayout,     0, 128 )
413   GFXDECODE_ENTRY( REGION_GFX1, 0, molayout,   0x600, 16 )
414   GFXDECODE_ENTRY( REGION_GFX3, 0, pfanlayout, 0x780, 8 )
415GFXDECODE_END
418416
419static const gfx_decode gfxdecodeinfo_interleaved[] =
420{
421   { REGION_GFX2, 0, &pfanlayout_interleaved,     0, 128 },
422   { REGION_GFX1, 0, &molayout,               0x600, 16 },
423   { REGION_GFX3, 0, &pfanlayout_interleaved, 0x780, 8 },
424   { -1 }
425};
417static GFXDECODE_START( interleaved )
418   GFXDECODE_ENTRY( REGION_GFX2, 0, pfanlayout_interleaved,     0, 128 )
419   GFXDECODE_ENTRY( REGION_GFX1, 0, molayout,               0x600, 16 )
420   GFXDECODE_ENTRY( REGION_GFX3, 0, pfanlayout_interleaved, 0x780, 8 )
421GFXDECODE_END
426422
427423
428424
r1051r1052
470466
471467   /* video hardware */
472468   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
473   MDRV_GFXDECODE(gfxdecodeinfo_interleaved)
469   MDRV_GFXDECODE(interleaved)
474470   MDRV_PALETTE_LENGTH(4096)
475471
476472   MDRV_SCREEN_ADD("left", 0x000)
r1051r1052
516512
517513   /* video hardware */
518514   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
519   MDRV_GFXDECODE(gfxdecodeinfo)
515   MDRV_GFXDECODE(cyberbal)
520516   MDRV_PALETTE_LENGTH(2048)
521517
522518   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/lockon.c
r1051r1052
551551};
552552
553553
554static const gfx_decode gfxdecodeinfo[] =
555{
556   { REGION_GFX1, 0, &object_layout,  0, 16 },
557   { REGION_GFX2, 0, &object_layout,  0, 16 },
558   { REGION_GFX3, 0, &object_layout,  0, 16 },
559   { REGION_GFX4, 0, &object_layout,  0, 16 },
560   { REGION_GFX5, 0, &char_layout,    0, 16 },
561   { REGION_GFX6, 0, &scene_layout,   0, 16 },
562   { REGION_GFX7, 0, &hud_layout,     0, 16 },
563   { REGION_GFX8, 0, &ground_layout,  0, 16 },
564   { -1 }
565};
554static GFXDECODE_START( lockon )
555   GFXDECODE_ENTRY( REGION_GFX1, 0, object_layout,  0, 16 )
556   GFXDECODE_ENTRY( REGION_GFX2, 0, object_layout,  0, 16 )
557   GFXDECODE_ENTRY( REGION_GFX3, 0, object_layout,  0, 16 )
558   GFXDECODE_ENTRY( REGION_GFX4, 0, object_layout,  0, 16 )
559   GFXDECODE_ENTRY( REGION_GFX5, 0, char_layout,    0, 16 )
560   GFXDECODE_ENTRY( REGION_GFX6, 0, scene_layout,   0, 16 )
561   GFXDECODE_ENTRY( REGION_GFX7, 0, hud_layout,     0, 16 )
562   GFXDECODE_ENTRY( REGION_GFX8, 0, ground_layout,  0, 16 )
563GFXDECODE_END
566564
567565static void YM2203_irq(int irq)
568566{
r1051r1052
609607   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
610608   MDRV_SCREEN_SIZE(320, 240)
611609   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
612   MDRV_GFXDECODE(gfxdecodeinfo)
610   MDRV_GFXDECODE(lockon)
613611
614612   MDRV_PALETTE_LENGTH(1024)
615613
src/mame/drivers/mappy.c
r1051r1052
15371537
15381538
15391539
1540static const gfx_decode gfxdecodeinfo_superpac[] =
1541{
1542   { REGION_GFX1, 0, &charlayout,           0, 64 },
1543   { REGION_GFX2, 0, &spritelayout_2bpp, 64*4, 64 },
1544   { -1 }
1545};
1540static GFXDECODE_START( superpac )
1541   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0, 64 )
1542   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_2bpp, 64*4, 64 )
1543GFXDECODE_END
15461544
1547static const gfx_decode gfxdecodeinfo_phozon[] =
1548{
1549   { REGION_GFX1, 0, &charlayout,          0, 64 },
1550   { REGION_GFX2, 0, &spritelayout_8x8, 64*4, 64 },
1551   { -1 } /* end of table */
1552};
1545static GFXDECODE_START( phozon )
1546   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,          0, 64 )
1547   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_8x8, 64*4, 64 )
1548GFXDECODE_END
15531549
1554static const gfx_decode gfxdecodeinfo_mappy[] =
1555{
1556   { REGION_GFX1, 0, &charlayout,           0, 64 },
1557   { REGION_GFX2, 0, &spritelayout_4bpp, 64*4, 16 },
1558   { -1 }
1559};
1550static GFXDECODE_START( mappy )
1551   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0, 64 )
1552   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_4bpp, 64*4, 16 )
1553GFXDECODE_END
15601554
1561static const gfx_decode gfxdecodeinfo_todruaga[] =
1562{
1563   { REGION_GFX1, 0, &charlayout,           0, 64 },
1564   { REGION_GFX2, 0, &spritelayout_4bpp, 64*4, 64 },
1565   { -1 }
1566};
1555static GFXDECODE_START( todruaga )
1556   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0, 64 )
1557   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_4bpp, 64*4, 64 )
1558GFXDECODE_END
15671559
15681560
15691561
r1051r1052
15931585
15941586   /* video hardware */
15951587   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1596   MDRV_GFXDECODE(gfxdecodeinfo_superpac)
1588   MDRV_GFXDECODE(superpac)
15971589   MDRV_PALETTE_LENGTH(64*4+64*4)
15981590
15991591   MDRV_SCREEN_ADD("main", 0)
r1051r1052
16451637
16461638   /* video hardware */
16471639   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1648   MDRV_GFXDECODE(gfxdecodeinfo_phozon)
1640   MDRV_GFXDECODE(phozon)
16491641   MDRV_PALETTE_LENGTH(64*4+64*4)
16501642
16511643   MDRV_SCREEN_ADD("main", 0)
r1051r1052
16831675
16841676   /* video hardware */
16851677   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1686   MDRV_GFXDECODE(gfxdecodeinfo_mappy)
1678   MDRV_GFXDECODE(mappy)
16871679   MDRV_PALETTE_LENGTH(64*4+16*16)
16881680
16891681   MDRV_SCREEN_ADD("main", 0)
r1051r1052
17151707   MDRV_IMPORT_FROM( mappy )
17161708
17171709   /* video hardware */
1718   MDRV_GFXDECODE(gfxdecodeinfo_todruaga)
1710   MDRV_GFXDECODE(todruaga)
17191711   MDRV_PALETTE_LENGTH(64*4+64*16)
17201712MACHINE_DRIVER_END
17211713
src/mame/drivers/safarir.c
r1051r1052
104104};
105105
106106
107static const gfx_decode gfxdecodeinfo[] =
108{
109   { REGION_GFX1, 0, &charlayout, 0, 8 },
110   { REGION_GFX2, 0, &charlayout, 0, 8 },
111   { -1 }
112};
107static GFXDECODE_START( safarir )
108   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 8 )
109   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 8 )
110GFXDECODE_END
113111
114112
115113static PALETTE_INIT( safarir )
r1051r1052
277275   MDRV_PALETTE_LENGTH(8)
278276   MDRV_PALETTE_INIT(safarir)
279277   MDRV_COLORTABLE_LENGTH(2*8)
280   MDRV_GFXDECODE(gfxdecodeinfo)
278   MDRV_GFXDECODE(safarir)
281279
282280   MDRV_SCREEN_ADD("main", 0)
283281   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/rastan.c
r1051r1052
350350   32*16
351351};
352352
353static const gfx_decode gfxdecodeinfo[] =
354{
355   { REGION_GFX1, 0, &tilelayout,   0, 0x80 },
356   { REGION_GFX2, 0, &spritelayout, 0, 0x80 },
357   { -1 }
358};
353static GFXDECODE_START( rastan )
354   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0, 0x80 )
355   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 0x80 )
356GFXDECODE_END
359357
360358
361359
r1051r1052
398396   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
399397   MDRV_SCREEN_SIZE(40*8, 32*8)
400398   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
401   MDRV_GFXDECODE(gfxdecodeinfo)
399   MDRV_GFXDECODE(rastan)
402400   MDRV_PALETTE_LENGTH(8192)
403401
404402   MDRV_VIDEO_START(rastan)
src/mame/drivers/gijoe.c
r1051r1052
405405
406406ROM_START( gijoeu )
407407   ROM_REGION( 0x100000, REGION_CPU1, 0 )
408   ROM_LOAD16_BYTE("069b03", 0x000000,  0x40000, CRC(25ff77d2) SHA1(bea2ae975718806698fd35ef1217bd842b2b69ec) )
409   ROM_LOAD16_BYTE("069b02", 0x000001,  0x40000, CRC(31cced1c) SHA1(3df1def671966b3c3d8117ac1b68adeeef9d98c0) )
410   ROM_LOAD16_BYTE("069a12", 0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
411   ROM_LOAD16_BYTE("069a11", 0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
408   ROM_LOAD16_BYTE("069uab03", 0x000000,  0x40000, CRC(25ff77d2) SHA1(bea2ae975718806698fd35ef1217bd842b2b69ec) )
409   ROM_LOAD16_BYTE("069uab02", 0x000001,  0x40000, CRC(31cced1c) SHA1(3df1def671966b3c3d8117ac1b68adeeef9d98c0) )
410   ROM_LOAD16_BYTE("069a12",   0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
411   ROM_LOAD16_BYTE("069a11",   0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
412412
413413   ROM_REGION( 0x010000, REGION_CPU2, 0 )
414414   ROM_LOAD( "069a01", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
src/mame/drivers/tigeroad.c
r1051r1052
517517   32*8
518518};
519519
520static const gfx_decode gfxdecodeinfo[] =
521{
522   { REGION_GFX1, 0, &text_layout,   512, 16 },   /* colors 512-575 */
523   { REGION_GFX2, 0, &tile_layout,     0, 16 },   /* colors   0-255 */
524   { REGION_GFX3, 0, &sprite_layout, 256, 16 },   /* colors 256-511 */
525   { -1 }
526};
520static GFXDECODE_START( tigeroad )
521   GFXDECODE_ENTRY( REGION_GFX1, 0, text_layout,   512, 16 )   /* colors 512-575 */
522   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,     0, 16 )   /* colors   0-255 */
523   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite_layout, 256, 16 )   /* colors 256-511 */
524GFXDECODE_END
527525
528526
529527
r1051r1052
565563   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
566564   MDRV_SCREEN_SIZE(32*8, 32*8)
567565   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
568   MDRV_GFXDECODE(gfxdecodeinfo)
566   MDRV_GFXDECODE(tigeroad)
569567   MDRV_PALETTE_LENGTH(576)
570568
571569   MDRV_VIDEO_START(tigeroad)
src/mame/drivers/wilytowr.c
r1051r1052
488488   16*8
489489};
490490
491static const gfx_decode gfxdecodeinfo[] =
492{
493   { REGION_GFX1, 0, &charlayout,   256, 1 },
494   { REGION_GFX2, 0, &tilelayout,     0, 32 },
495   { REGION_GFX3, 0, &spritelayout,   0, 32 },
496   { -1 }
497};
491static GFXDECODE_START( wilytowr )
492   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   256, 1 )
493   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,     0, 32 )
494   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0, 32 )
495GFXDECODE_END
498496
499static const gfx_decode fghtbskt_gfxdecodeinfo[] =
500{
501   { REGION_GFX1, 0, &charlayout,   16, 1 },
502   { REGION_GFX2, 0, &tilelayout,    0, 32 },
503   { REGION_GFX3, 0, &spritelayout,  0, 32 },
504   { -1 }
505};
497static GFXDECODE_START( fghtbskt )
498   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   16, 1 )
499   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,    0, 32 )
500   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,  0, 32 )
501GFXDECODE_END
506502
507503
508504static struct Samplesinterface custom_interface =
r1051r1052
533529   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
534530   MDRV_SCREEN_SIZE(32*8, 32*8)
535531   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
536   MDRV_GFXDECODE(gfxdecodeinfo)
532   MDRV_GFXDECODE(wilytowr)
537533   MDRV_PALETTE_LENGTH(256+4)
538534
539535   MDRV_PALETTE_INIT(wilytowr)
r1051r1052
570566   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
571567   MDRV_SCREEN_SIZE(32*8, 32*8)
572568   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
573   MDRV_GFXDECODE(fghtbskt_gfxdecodeinfo)
569   MDRV_GFXDECODE(fghtbskt)
574570   MDRV_PALETTE_LENGTH(256)
575571
576572   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/looping.c
r1051r1052
542542};
543543
544544
545static const gfx_decode looping_gfxdecodeinfo[] =
546{
547   { REGION_GFX1, 0, &gfx_8x8x2_planar, 0, 8 },
548   { REGION_GFX1, 0, &sprite_layout,    0, 8 },
549   { -1 }
550};
545static GFXDECODE_START( looping )
546   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x2_planar, 0, 8 )
547   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout,    0, 8 )
548GFXDECODE_END
551549
552550
553551
r1051r1052
598596   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
599597   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
600598   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
601   MDRV_GFXDECODE(looping_gfxdecodeinfo)
599   MDRV_GFXDECODE(looping)
602600   MDRV_PALETTE_LENGTH(32)
603601
604602   MDRV_PALETTE_INIT(looping)
src/mame/drivers/segas32.c
r1051r1052
19791979};
19801980
19811981
1982static const gfx_decode gfxdecodeinfo[] =
1983{
1984   { REGION_GFX1, 0, &bgcharlayout,   0x00, 0x3ff  },
1985   { -1 }
1986};
1982static GFXDECODE_START( segas32 )
1983   GFXDECODE_ENTRY( REGION_GFX1, 0, bgcharlayout,   0x00, 0x3ff  )
1984GFXDECODE_END
19871985
19881986
19891987
r1051r1052
20592057
20602058   /* video hardware */
20612059   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
2062   MDRV_GFXDECODE(gfxdecodeinfo)
2060   MDRV_GFXDECODE(segas32)
20632061   MDRV_PALETTE_LENGTH(0x4000)
20642062
20652063   MDRV_SCREEN_ADD("main", 0x000)
r1051r1052
21142112
21152113   /* video hardware */
21162114   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
2117   MDRV_GFXDECODE(gfxdecodeinfo)
2115   MDRV_GFXDECODE(segas32)
21182116   MDRV_PALETTE_LENGTH(0x8000)
21192117   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
21202118
src/mame/drivers/1945kiii.c
r1051r1052
249249   16*128
250250};
251251
252static const gfx_decode gfxdecodeinfo[] =
253{
254   { REGION_GFX1, 0, &k3_layout,   0x0, 2  }, /* bg tiles */
255   { REGION_GFX2, 0, &k3_layout,   0x0, 2  }, /* bg tiles */
256   { -1 }
257};
252static GFXDECODE_START( 1945kiii )
253   GFXDECODE_ENTRY( REGION_GFX1, 0, k3_layout,   0x0, 2  ) /* bg tiles */
254   GFXDECODE_ENTRY( REGION_GFX2, 0, k3_layout,   0x0, 2  ) /* bg tiles */
255GFXDECODE_END
258256
259257
260258static MACHINE_DRIVER_START( k3 )
r1051r1052
265263   MDRV_SCREEN_REFRESH_RATE(60)
266264   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
267265
268   MDRV_GFXDECODE(gfxdecodeinfo)
266   MDRV_GFXDECODE(1945kiii)
269267
270268   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
271269   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/badlands.c
r1051r1052
422422};
423423
424424
425static const gfx_decode gfxdecodeinfo[] =
426{
427   { REGION_GFX1, 0, &pflayout,    0, 8 },
428   { REGION_GFX2, 0, &molayout,  128, 8 },
429   { -1 }
430};
425static GFXDECODE_START( badlands )
426   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout,    0, 8 )
427   GFXDECODE_ENTRY( REGION_GFX2, 0, molayout,  128, 8 )
428GFXDECODE_END
431429
432430
433431
r1051r1052
452450
453451   /* video hardware */
454452   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
455   MDRV_GFXDECODE(gfxdecodeinfo)
453   MDRV_GFXDECODE(badlands)
456454   MDRV_PALETTE_LENGTH(256)
457455
458456   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/slapfght.c
r1051r1052
816816};
817817
818818
819static const gfx_decode perfrman_gfxdecodeinfo[] =
820{
821   { REGION_GFX1, 0, &perfrman_charlayout,     0, 16 },
822   { REGION_GFX2, 0, &perfrman_spritelayout, 128, 16 },
823   { -1 }
824};
819static GFXDECODE_START( perfrman )
820   GFXDECODE_ENTRY( REGION_GFX1, 0, perfrman_charlayout,     0, 16 )
821   GFXDECODE_ENTRY( REGION_GFX2, 0, perfrman_spritelayout, 128, 16 )
822GFXDECODE_END
825823
826static const gfx_decode gfxdecodeinfo[] =
827{
828   { REGION_GFX1, 0, &charlayout,   0,  64 },
829   { REGION_GFX2, 0, &tilelayout,   0,  16 },
830   { REGION_GFX3, 0, &spritelayout, 0,  16 },
831   { -1 }
832};
824static GFXDECODE_START( slapfght )
825   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0,  64 )
826   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0,  16 )
827   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0,  16 )
828GFXDECODE_END
833829
834830
835831
r1051r1052
873869   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
874870   MDRV_SCREEN_SIZE(64*8, 32*8)
875871   MDRV_SCREEN_VISIBLE_AREA(1*8, 34*8-1, 2*8, 32*8-1)
876   MDRV_GFXDECODE(perfrman_gfxdecodeinfo)
872   MDRV_GFXDECODE(perfrman)
877873   MDRV_PALETTE_LENGTH(256)
878874
879875   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
917913   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
918914   MDRV_SCREEN_SIZE(64*8, 32*8)
919915   MDRV_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
920   MDRV_GFXDECODE(gfxdecodeinfo)
916   MDRV_GFXDECODE(slapfght)
921917   MDRV_PALETTE_LENGTH(256)
922918
923919   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
963959   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
964960   MDRV_SCREEN_SIZE(64*8, 32*8)
965961   MDRV_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
966   MDRV_GFXDECODE(gfxdecodeinfo)
962   MDRV_GFXDECODE(slapfght)
967963   MDRV_PALETTE_LENGTH(256)
968964
969965   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
10061002   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10071003   MDRV_SCREEN_SIZE(64*8, 32*8)
10081004   MDRV_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
1009   MDRV_GFXDECODE(gfxdecodeinfo)
1005   MDRV_GFXDECODE(slapfght)
10101006   MDRV_PALETTE_LENGTH(256)
10111007
10121008   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/psikyosh.c
r1051r1052
313313   16*16*8
314314};
315315
316static const gfx_decode gfxdecodeinfo[] =
317{
318   { REGION_GFX1, 0, &layout_16x16x4, 0x000, 0x100 }, // 4bpp tiles
319   { REGION_GFX1, 0, &layout_16x16x8, 0x000, 0x100 }, // 8bpp tiles
320   { -1 }
321};
316static GFXDECODE_START( psikyosh )
317   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0x000, 0x100 ) // 4bpp tiles
318   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8, 0x000, 0x100 ) // 8bpp tiles
319GFXDECODE_END
322320
323321static struct EEPROM_interface eeprom_interface_93C56 =
324322{
r1051r1052
611609   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
612610   MDRV_SCREEN_SIZE(64*8, 32*8)
613611   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 28*8-1)
614   MDRV_GFXDECODE(gfxdecodeinfo)
612   MDRV_GFXDECODE(psikyosh)
615613   MDRV_PALETTE_LENGTH(0x5000/4)
616614
617615   MDRV_VIDEO_START(psikyosh)
src/mame/drivers/boogwing.c
r1051r1052
255255};
256256
257257
258static const gfx_decode gfxdecodeinfo[] =
259{
260   { REGION_GFX1, 0, &tile_8x8_layout,            0, 16 },   /* Tiles (8x8) */
261   { REGION_GFX2, 0, &tile_16x16_layout_5bpp, 0x100, 16 },   /* Tiles (16x16) */
262   { REGION_GFX3, 0, &tile_16x16_layout,      0x300, 32 },   /* Tiles (16x16) */
263   { REGION_GFX4, 0, &spritelayout,           0x500, 32 },   /* Sprites (16x16) */
264   { REGION_GFX5, 0, &spritelayout,           0x700, 16 },   /* Sprites (16x16) */
265   { -1 }
266};
258static GFXDECODE_START( boogwing )
259   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,            0, 16 )   /* Tiles (8x8) */
260   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_16x16_layout_5bpp, 0x100, 16 )   /* Tiles (16x16) */
261   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_16x16_layout,      0x300, 32 )   /* Tiles (16x16) */
262   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,           0x500, 32 )   /* Sprites (16x16) */
263   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout,           0x700, 16 )   /* Sprites (16x16) */
264GFXDECODE_END
267265
268266/**********************************************************************************/
269267
r1051r1052
304302   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
305303
306304   MDRV_PALETTE_LENGTH(2048)
307   MDRV_GFXDECODE(gfxdecodeinfo)
305   MDRV_GFXDECODE(boogwing)
308306
309307   MDRV_VIDEO_START(boogwing)
310308   MDRV_VIDEO_UPDATE(boogwing)
src/mame/drivers/quizdna.c
r1051r1052
436436   16*16*4
437437};
438438
439static const gfx_decode quizdna_gfxdecodeinfo[] =
440{
441   { REGION_GFX1, 0x0000, &fglayout,  0x7e0,  16 },
442   { REGION_GFX2, 0x0000, &bglayout,  0x000, 128 },
443   { REGION_GFX3, 0x0000, &objlayout, 0x600,  32 },
444   { -1 }
445};
439static GFXDECODE_START( quizdna )
440   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, fglayout,  0x7e0,  16 )
441   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, bglayout,  0x000, 128 )
442   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, objlayout, 0x600,  32 )
443GFXDECODE_END
446444
447445
448446static struct YM2203interface ym2203_interface =
r1051r1052
468466   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
469467   MDRV_SCREEN_SIZE(64*8, 32*8)
470468   MDRV_SCREEN_VISIBLE_AREA(8*8, 56*8-1, 2*8, 30*8-1)
471   MDRV_GFXDECODE(quizdna_gfxdecodeinfo)
469   MDRV_GFXDECODE(quizdna)
472470   MDRV_PALETTE_LENGTH(2048)
473471
474472   MDRV_VIDEO_START(quizdna)
src/mame/drivers/darkhors.c
r1051r1052
572572   16*16*2
573573};
574574
575static gfx_decode darkhors_gfxdecodeinfo[] =
576{
577   { REGION_GFX1, 0, &layout_16x16x8, 0, 0x10000/64 },   // color codes should be doubled
578   { -1 }
579};
575static GFXDECODE_START( darkhors )
576   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8, 0, 0x10000/64 )   // color codes should be doubled
577GFXDECODE_END
580578
581579/***************************************************************************
582580
r1051r1052
611609   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
612610   MDRV_SCREEN_SIZE(0x190, 0x100)
613611   MDRV_SCREEN_VISIBLE_AREA(0, 0x190-1, 8, 0x100-8-1)
614   MDRV_GFXDECODE(darkhors_gfxdecodeinfo)
612   MDRV_GFXDECODE(darkhors)
615613   MDRV_PALETTE_LENGTH(0x10000)
616614
617615   MDRV_VIDEO_START(darkhors)
src/mame/drivers/mpatrol.c
r1051r1052
392392
393393
394394
395static const gfx_decode gfxdecodeinfo[] =
396{
397   { REGION_GFX1, 0x0000, &charlayout,                0, 128 },
398   { REGION_GFX2, 0x0000, &spritelayout,          128*4,  16 },
399   { REGION_GFX3, 0x0000, &bgcharlayout, 128*4+16*4+0*4,   1 },
400   { REGION_GFX4, 0x0000, &bgcharlayout, 128*4+16*4+1*4,   1 },
401   { REGION_GFX5, 0x0000, &bgcharlayout, 128*4+16*4+2*4,   1 },
402   { -1 }
403};
395static GFXDECODE_START( mpatrol )
396   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,                0, 128 )
397   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,          128*4,  16 )
398   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, bgcharlayout, 128*4+16*4+0*4,   1 )
399   GFXDECODE_ENTRY( REGION_GFX4, 0x0000, bgcharlayout, 128*4+16*4+1*4,   1 )
400   GFXDECODE_ENTRY( REGION_GFX5, 0x0000, bgcharlayout, 128*4+16*4+2*4,   1 )
401GFXDECODE_END
404402
405403
406404
r1051r1052
422420   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
423421   MDRV_SCREEN_SIZE(32*8, 32*8)
424422   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 32*8-1)
425   MDRV_GFXDECODE(gfxdecodeinfo)
423   MDRV_GFXDECODE(mpatrol)
426424   MDRV_PALETTE_LENGTH(512+32+32)
427425   MDRV_COLORTABLE_LENGTH(128*4+16*4+3*4)
428426
r1051r1052
453451   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
454452   MDRV_SCREEN_SIZE(32*8, 32*8)
455453   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 32*8-1)
456//  MDRV_GFXDECODE(gfxdecodeinfo_alpha1v)
457   MDRV_GFXDECODE(gfxdecodeinfo)
454//  MDRV_GFXDECODE(alpha1v)
455   MDRV_GFXDECODE(mpatrol)
458456   MDRV_PALETTE_LENGTH(512+32+32)
459457   MDRV_COLORTABLE_LENGTH(128*4+16*4+3*4)
460458
src/mame/drivers/bishjan.c
r1051r1052
308308   8*8*8
309309};
310310
311static const gfx_decode bishjan_gfxdecodeinfo[] =
312{
313   { REGION_GFX1, 0, &bishjan_8x8_layout, 0, 1 },
314   { -1 }
315};
311static GFXDECODE_START( bishjan )
312   GFXDECODE_ENTRY( REGION_GFX1, 0, bishjan_8x8_layout, 0, 1 )
313GFXDECODE_END
316314
317315
318316/***************************************************************************
r1051r1052
450448   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
451449   MDRV_SCREEN_SIZE( 512, 256 )
452450   MDRV_SCREEN_VISIBLE_AREA( 0, 512-1, 0, 256-16-1 )
453   MDRV_GFXDECODE(bishjan_gfxdecodeinfo)
451   MDRV_GFXDECODE(bishjan)
454452   MDRV_PALETTE_LENGTH( 256 )
455453   MDRV_SCREEN_REFRESH_RATE( 60 )
456454
src/mame/drivers/offtwall.c
r1051r1052
374374};
375375
376376
377static const gfx_decode gfxdecodeinfo[] =
378{
379   { REGION_GFX1, 0, &pfmolayout,  256, 32 },      /* sprites & playfield */
380   { -1 }
381};
377static GFXDECODE_START( offtwall )
378   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  256, 32 )      /* sprites & playfield */
379GFXDECODE_END
382380
383381
384382
r1051r1052
399397
400398   /* video hardware */
401399   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
402   MDRV_GFXDECODE(gfxdecodeinfo)
400   MDRV_GFXDECODE(offtwall)
403401   MDRV_PALETTE_LENGTH(2048)
404402
405403   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/equites.c
r1051r1052
631631   64*8
632632};
633633
634static const gfx_decode equites_gfxdecodeinfo[] =
635{
636   { REGION_GFX1, 0, &eq_charlayout,     0, 32 }, // chars
637   { REGION_GFX2, 0, &eq_tilelayout,   128, 16 }, // tile set0
638   { REGION_GFX3, 0, &eq_tilelayout,   128, 16 }, // tile set1
639   { REGION_GFX4, 0, &eq_spritelayout, 256, 16 }, // sprite set0
640   { REGION_GFX5, 0, &eq_spritelayout, 256, 16 }, // sprite set1
641   { -1 } // end of array
642};
634static GFXDECODE_START( equites )
635   GFXDECODE_ENTRY( REGION_GFX1, 0, eq_charlayout,     0, 32 ) // chars
636   GFXDECODE_ENTRY( REGION_GFX2, 0, eq_tilelayout,   128, 16 ) // tile set0
637   GFXDECODE_ENTRY( REGION_GFX3, 0, eq_tilelayout,   128, 16 ) // tile set1
638   GFXDECODE_ENTRY( REGION_GFX4, 0, eq_spritelayout, 256, 16 ) // sprite set0
639   GFXDECODE_ENTRY( REGION_GFX5, 0, eq_spritelayout, 256, 16 ) // sprite set1
640GFXDECODE_END
643641
644642// Splendor Blast Hardware
645643static const gfx_layout sp_charlayout =
r1051r1052
675673   8*32*8
676674};
677675
678static const gfx_decode splndrbt_gfxdecodeinfo[] =
679{
680   { REGION_GFX1, 0, &sp_charlayout,     0, 256/4 }, // 512 4-color chars
681   { REGION_GFX2, 0, &sp_tilelayout,   256, 256/4 }, // 256 4-color tiles
682   { REGION_GFX3, 0, &sp_tilelayout,   256, 256/4 }, // 256 4-color tiles
683   { REGION_GFX4, 0, &sp_spritelayout, 512, 256/8 }, // 256 8-color sprites
684   { -1 } // end of array
685};
676static GFXDECODE_START( splndrbt )
677   GFXDECODE_ENTRY( REGION_GFX1, 0, sp_charlayout,     0, 256/4 ) // 512 4-color chars
678   GFXDECODE_ENTRY( REGION_GFX2, 0, sp_tilelayout,   256, 256/4 ) // 256 4-color tiles
679   GFXDECODE_ENTRY( REGION_GFX3, 0, sp_tilelayout,   256, 256/4 ) // 256 4-color tiles
680   GFXDECODE_ENTRY( REGION_GFX4, 0, sp_spritelayout, 512, 256/8 ) // 256 8-color sprites
681GFXDECODE_END
686682
687683/******************************************************************************/
688684// Hardware Definitions
r1051r1052
703699   MDRV_SCREEN_SIZE(256 +BMPAD*2, 256 +BMPAD*2)
704700   MDRV_SCREEN_VISIBLE_AREA(0 +BMPAD, 256-1 +BMPAD, 24 +BMPAD, 232-1 +BMPAD)
705701   MDRV_PALETTE_LENGTH(384)
706   MDRV_GFXDECODE(equites_gfxdecodeinfo)
702   MDRV_GFXDECODE(equites)
707703
708704   MDRV_PALETTE_INIT(equites)
709705   MDRV_VIDEO_START(equites)
r1051r1052
731727   MDRV_SCREEN_SIZE(256, 256)
732728   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 64, 256-1)
733729   MDRV_PALETTE_LENGTH(1536)
734   MDRV_GFXDECODE(splndrbt_gfxdecodeinfo)
730   MDRV_GFXDECODE(splndrbt)
735731
736732   MDRV_PALETTE_INIT(splndrbt)
737733   MDRV_VIDEO_START(splndrbt)
src/mame/drivers/esh.c
r0r1052
1/*
2Funai / Gakken Esh's Aurunmilla laserdisc hardware
3Driver by Andrew Gardner with help from Daphne Source
4
5Notes:
6    (dumper's note) Esh's Aurunmilla can be played in an Interstellar cabinet by swapping the
7                    main pcb and the laserdisc. Sound & video pcbs are the same. Control panel is different however.
8                    Esh's Aurunmilla can be a 2 player game, while Interstellar is a 1 player only game.
9    Hold down TEST while resetting the machine - pops up test mode where...
10    The DIPs are software-controlled.
11    Two joysticks appear in the IO TEST, but the photos of the control panel I've seen show only 1.
12    Eshb has some junk in the IO TEST screen.  Maybe a bad dump?
13
14Todo:
15    - LD TROUBLE message pops up after each cycle in attract.  NMI-related?
16    - Convert to tilemaps (see next ToDo for feasibility).
17    - Apparently some tiles blink (in at least two different ways).
18    - 0xfe and 0xff are pretty obviously not NMI enables.  They're likely LED's.  Do the NMI right (somehow).
19    - Rumor has it there's an analog beep hanging off 0xf5?  Implement it and finish off 0xf5 bits.
20    - NVRAM range 0xe000-0xe800 might be too large.  It doesn't seem to write past 0xe600...
21    - Maybe some of the IPT_UNKNOWNs do something?
22    - Hook up LED's to the MAME lamp system.
23*/
24
25#include "driver.h"
26#include "render.h"
27#include "machine/laserdsc.h"
28
29/* From daphne */
30#define PCB_CLOCK (18432000)
31
32
33/* Misc variables */
34static laserdisc_info *discinfo;
35
36static UINT8 *tile_ram;
37static UINT8 *tile_control_ram;
38
39static UINT8 ld_video_visible;
40
41/* VIDEO GOODS */
42static VIDEO_UPDATE( esh )
43{
44   int charx, chary;
45
46   /* clear */
47   fillbitmap(bitmap, 0, cliprect);
48
49   /* display disc information */
50   if (discinfo != NULL && ld_video_visible)
51      popmessage("%s", laserdisc_describe_state(discinfo));
52
53   /* Draw tiles */
54   for (charx = 0; charx < 32; charx++)
55   {
56      for (chary = 0; chary < 32; chary++)
57      {
58         int current_screen_character = (chary*32) + charx;
59
60         int palIndex  = (tile_control_ram[current_screen_character] & 0x0f);
61         int tileOffs  = (tile_control_ram[current_screen_character] & 0x10) >> 4;
62         //int blinkLine = (tile_control_ram[current_screen_character] & 0x40) >> 6;
63         //int blinkChar = (tile_control_ram[current_screen_character] & 0x80) >> 7;
64
65         drawgfx(bitmap, machine->gfx[0],
66               tile_ram[current_screen_character] + (0x100 * tileOffs),
67               palIndex,
68               0, 0, charx*8, chary*8, cliprect, TRANSPARENCY_PEN, 0);
69      }
70   }
71
72   /* Draw sprites */
73   return 0;
74}
75
76
77
78/* MEMORY HANDLERS */
79static READ8_HANDLER(ldp_read)
80{
81   return laserdisc_data_r(discinfo);
82}
83
84static WRITE8_HANDLER(ldp_write)
85{
86   laserdisc_data_w(discinfo,data);
87}
88
89static WRITE8_HANDLER(misc_write)
90{
91   /* Bit 0 unknown */
92
93   if (data & 0x02)
94      logerror("BEEP!\n");
95
96   /* Bit 2 unknown */
97   ld_video_visible = !((data & 0x08) >> 3);
98
99   /* Bits 4-7 unknown */
100   /* They cycle through a repeating pattern though */
101}
102
103static WRITE8_HANDLER(led_writes)
104{
105   switch(offset)
106   {
107   case 0x00:
108      logerror("WRITING 0x%x to P1's START LED\n", data);
109      break;
110   case 0x01:
111      logerror("WRITING 0x%x to P2's START LED\n", data);
112      break;
113   case 0x02:
114      logerror("WRITING 0x%x to P1's BUTTON1 LED\n", data);
115      break;
116   case 0x03:
117      logerror("WRITING 0x%x to P1's BUTTON2 LED\n", data);
118      break;
119   case 0x04:
120      logerror("WRITING 0x%x to P2's BUTTON1 LED\n", data);
121      break;
122   case 0x05:
123      logerror("WRITING 0x%x to P2's BUTTON2 LED\n", data);
124      break;
125   case 0x06:
126      /* Likely coming soon */
127      break;
128   case 0x07:
129      /* Likely coming soon */
130      break;
131   }
132}
133
134static WRITE8_HANDLER(nmi_line_w)
135{
136   if (data == 0x00)
137      cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE);
138   if (data == 0x01)
139      cpunum_set_input_line(0, INPUT_LINE_NMI, CLEAR_LINE);
140
141   if (data != 0x00 && data != 0x01)
142      logerror("NMI line got a weird value!\n");
143}
144
145
146/* PROGRAM MAPS */
147static ADDRESS_MAP_START( z80_0_mem, ADDRESS_SPACE_PROGRAM, 8 )
148   AM_RANGE(0x0000,0x3fff) AM_ROM
149   AM_RANGE(0xe000,0xe7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
150   AM_RANGE(0xf000,0xf3ff) AM_RAM AM_BASE(&tile_ram)
151   AM_RANGE(0xf400,0xf7ff) AM_RAM AM_BASE(&tile_control_ram)
152ADDRESS_MAP_END
153
154
155/* IO MAPS */
156static ADDRESS_MAP_START( z80_0_io, ADDRESS_SPACE_IO, 8 )
157   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
158   AM_RANGE(0xf0,0xf0) AM_READ_PORT("IN0")
159   AM_RANGE(0xf1,0xf1) AM_READ_PORT("IN1")
160   AM_RANGE(0xf2,0xf2) AM_READ_PORT("IN2")
161   AM_RANGE(0xf3,0xf3) AM_READ_PORT("IN3")
162   AM_RANGE(0xf4,0xf4) AM_READWRITE(ldp_read,ldp_write)
163   AM_RANGE(0xf5,0xf5) AM_WRITE(misc_write)   /* Continuously writes repeating patterns */
164   AM_RANGE(0xf8,0xfd) AM_WRITE(led_writes)
165   AM_RANGE(0xfe,0xfe) AM_WRITE(nmi_line_w)   /* Both 0xfe and 0xff flip quickly between 0 and 1 */
166   AM_RANGE(0xff,0xff) AM_NOP               /*   (they're probably not NMI enables - likely LED's like their neighbors :) */
167ADDRESS_MAP_END                           /*   (someday 0xf8-0xff will probably be a single handler) */
168
169
170/* PORTS */
171INPUT_PORTS_START( esh )
172   PORT_START_TAG("IN0")
173   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
174   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
175   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
176   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
177   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "TEST" ) PORT_CODE( KEYCODE_T )
178   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
179   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
180   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
181
182   PORT_START_TAG("IN1")
183   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
184   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
185   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
186   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
187   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
188   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
189   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
190   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
191
192   PORT_START_TAG("IN2")
193   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
194   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
195   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
196   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
197   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
198   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
199   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
200   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
201
202   PORT_START_TAG("IN3")
203   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
204   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
205   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
206   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
207   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
208   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
209   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
210   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
211INPUT_PORTS_END
212
213PALETTE_INIT( esh )
214{
215   int i;
216
217   /* Oddly enough, the top 4 bits of each byte is 0 */
218   for (i = 0; i < machine->drv->total_colors; i++)
219   {
220      int r,g,b;
221      int bit0,bit1,bit2;
222
223      /* Presumably resistor values would help here */
224
225      /* red component */
226      bit0 = (color_prom[i+0x100] >> 0) & 0x01;
227      bit1 = (color_prom[i+0x100] >> 1) & 0x01;
228      bit2 = (color_prom[i+0x100] >> 2) & 0x01;
229      r = (0x97 * bit2) + (0x47 * bit1) + (0x21 * bit0);
230
231      /* green component */
232      bit0 = 0;
233      bit1 = (color_prom[i+0x100] >> 3) & 0x01;
234      bit2 = (color_prom[i+0x100] >> 4) & 0x01;
235      g = (0x97 * bit2) + (0x47 * bit1) + (0x21 * bit0);
236
237      /* blue component */
238      bit0 = 0;
239      bit1 = (color_prom[i+0x100] >> 5) & 0x01;
240      bit2 = (color_prom[i+0x100] >> 6) & 0x01;
241      b = (0x97 * bit2) + (0x47 * bit1) + (0x21 * bit0);
242
243      palette_set_color(machine,i,MAKE_RGB(r,g,b));
244   }
245}
246
247static const gfx_layout esh_gfx_layout =
248{
249   8,8,
250   0x1000/8,
251   3,
252   { 0, 0x1000*8, 0x2000*8 },
253   { 0,1,2,3,4,5,6,7 },
254   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
255   8*8
256};
257
258static GFXDECODE_START( esh )
259   GFXDECODE_ENTRY(REGION_GFX1, 0, esh_gfx_layout, 0x0, 0x100)
260GFXDECODE_END
261
262static MACHINE_START( esh )
263{
264   discinfo = laserdisc_init(LASERDISC_TYPE_LDV1000, get_disk_handle(0), 0);
265   return;
266}
267
268static TIMER_CALLBACK( irq_stop )
269{
270   cpunum_set_input_line(0, 0, CLEAR_LINE);
271}
272
273static INTERRUPT_GEN( vblank_callback_esh )
274{
275   // IRQ
276   cpunum_set_input_line(0, 0, ASSERT_LINE);
277   mame_timer_set(MAME_TIME_IN_USEC(50), 0, irq_stop);
278
279   laserdisc_vsync(discinfo);
280}
281
282
283/* DRIVER */
284static MACHINE_DRIVER_START( esh )
285/*  main cpu */
286   MDRV_CPU_ADD(Z80, PCB_CLOCK/6)                  /* The denominator is a Daphne guess based on PacMan's hardware */
287   MDRV_CPU_PROGRAM_MAP(z80_0_mem,0)
288   MDRV_CPU_IO_MAP(z80_0_io,0)
289   MDRV_CPU_VBLANK_INT(vblank_callback_esh, 1)
290
291   MDRV_MACHINE_START(esh)
292   MDRV_NVRAM_HANDLER(generic_0fill)
293
294/*  video */
295   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
296
297   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
298   MDRV_SCREEN_REFRESH_RATE(60)
299   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
300   MDRV_SCREEN_SIZE(32*8, 32*8)
301   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
302
303   MDRV_PALETTE_LENGTH(256)
304   MDRV_PALETTE_INIT(esh)
305
306   MDRV_GFXDECODE(esh)
307   MDRV_VIDEO_UPDATE(esh)
308
309/*  sound */
310MACHINE_DRIVER_END
311
312
313ROM_START( esh )
314   /* Main program CPU */
315   ROM_REGION( 0x4000, REGION_CPU1, 0 )
316   ROM_LOAD( "is1.h8", 0x0000, 0x2000, CRC(114c912b) SHA1(7c033a102d046199f3e2c6787579dac5b5295d50) )
317   ROM_LOAD( "is2.f8", 0x2000, 0x2000, CRC(0e3b6e62) SHA1(5e8160180e20705e727329f9d70305fcde176a25) )
318
319   /* Tiles */
320   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
321   ROM_LOAD( "a.m3", 0x0000, 0x1000, CRC(a04736d8) SHA1(3b642b5d7168cf4a09328eee54c532be815d2bcf) )
322   ROM_LOAD( "b.l3", 0x1000, 0x1000, CRC(9366dde7) SHA1(891db65384d47d13355b2eea37f57c34bc775c8f) )
323   ROM_LOAD( "c.k3", 0x2000, 0x1000, CRC(a936ef01) SHA1(bcacb281ccb72ceb57fb6a79380cc3a9688743c4) )
324
325   /* Color (+other) PROMs */
326   ROM_REGION( 0x400, REGION_PROMS, 0 )
327   ROM_LOAD( "rgb.j1", 0x000, 0x200, CRC(1e9f795f) SHA1(61a58694929fa39b2412bc9244e5681d65a0eacb) )
328   ROM_LOAD( "h.c5",   0x200, 0x100, CRC(abde5e4b) SHA1(9dd3a7fd523b519ac613b9f08ae9cc962992cf5d) )   /* Video timing? */
329   ROM_LOAD( "v.c6",   0x300, 0x100, CRC(7157ba22) SHA1(07355f30efe46196d216356eda48a59fc622e43f) )
330ROM_END
331
332ROM_START( esha )
333   /* Main program CPU */
334   ROM_REGION( 0x4000, REGION_CPU1, 0 )
335   ROM_LOAD( "is1.h8", 0x0000, 0x2000, CRC(114c912b) SHA1(7c033a102d046199f3e2c6787579dac5b5295d50) )
336   ROM_LOAD( "is2.f8", 0x2000, 0x2000, CRC(7a562f49) SHA1(acfa49b3b3d96b001a5dbdee39cbb0ca80be1763) )
337
338   /* Tiles */
339   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
340   ROM_LOAD( "a.m3", 0x0000, 0x1000, CRC(a04736d8) SHA1(3b642b5d7168cf4a09328eee54c532be815d2bcf) )
341   ROM_LOAD( "b.l3", 0x1000, 0x1000, CRC(9366dde7) SHA1(891db65384d47d13355b2eea37f57c34bc775c8f) )
342   ROM_LOAD( "c.k3", 0x2000, 0x1000, CRC(a936ef01) SHA1(bcacb281ccb72ceb57fb6a79380cc3a9688743c4) )
343
344   /* Color (+other) PROMs */
345   ROM_REGION( 0x400, REGION_PROMS, 0 )
346   ROM_LOAD( "rgb.j1", 0x000, 0x200, CRC(1e9f795f) SHA1(61a58694929fa39b2412bc9244e5681d65a0eacb) )
347   ROM_LOAD( "h.c5",   0x200, 0x100, CRC(abde5e4b) SHA1(9dd3a7fd523b519ac613b9f08ae9cc962992cf5d) )   /* Video timing? */
348   ROM_LOAD( "v.c6",   0x300, 0x100, CRC(7157ba22) SHA1(07355f30efe46196d216356eda48a59fc622e43f) )
349ROM_END
350
351ROM_START( eshb )
352   /* Main program CPU */
353   ROM_REGION( 0x4000, REGION_CPU1, 0 )
354   ROM_LOAD( "1.h8",   0x0000, 0x2000, CRC(8d27d363) SHA1(529d8e4283e736edb5a9193df1ed8d0164471864) )   /* Hand-written ROM label */
355   ROM_LOAD( "is2.f8", 0x2000, 0x2000, CRC(0e3b6e62) SHA1(5e8160180e20705e727329f9d70305fcde176a25) )
356
357   /* Tiles */
358   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
359   ROM_LOAD( "a.m3", 0x0000, 0x1000, CRC(a04736d8) SHA1(3b642b5d7168cf4a09328eee54c532be815d2bcf) )
360   ROM_LOAD( "b.l3", 0x1000, 0x1000, CRC(9366dde7) SHA1(891db65384d47d13355b2eea37f57c34bc775c8f) )
361   ROM_LOAD( "c.k3", 0x2000, 0x1000, CRC(a936ef01) SHA1(bcacb281ccb72ceb57fb6a79380cc3a9688743c4) )
362
363   /* Color (+other) PROMs */
364   ROM_REGION( 0x400, REGION_PROMS, 0 )
365   ROM_LOAD( "rgb.j1", 0x000, 0x200, CRC(1e9f795f) SHA1(61a58694929fa39b2412bc9244e5681d65a0eacb) )
366   ROM_LOAD( "h.c5",   0x200, 0x100, CRC(abde5e4b) SHA1(9dd3a7fd523b519ac613b9f08ae9cc962992cf5d) )   /* Video timing? */
367   ROM_LOAD( "v.c6",   0x300, 0x100, CRC(7157ba22) SHA1(07355f30efe46196d216356eda48a59fc622e43f) )
368ROM_END
369
370
371static DRIVER_INIT( esh )
372{
373}
374
375/*    YEAR  NAME  PARENT   MACHINE  INPUT  INIT  MONITOR  COMPANY          FULLNAME                     FLAGS) */
376GAME( 1983, esh,  0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla",          GAME_NOT_WORKING|GAME_NO_SOUND)
377GAME( 1983, esha, 0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 2)",  GAME_NOT_WORKING|GAME_NO_SOUND)
378GAME( 1983, eshb, 0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 3)",  GAME_NOT_WORKING|GAME_NO_SOUND)
src/mame/drivers/mirax.c
r1051r1052
165165   8*8
166166};
167167
168static gfx_decode gfxdecodeinfo[] =
169{
170   { REGION_GFX1, 0, &layout8,     0, 1 },
171   { REGION_GFX2, 0, &layout16,    0, 1 },
172   { REGION_GFX3, 0, &layout16,    0, 1 },
173   { -1 }   /* end of array */
174};
168static GFXDECODE_START( mirax )
169   GFXDECODE_ENTRY( REGION_GFX1, 0, layout8,     0, 1 )
170   GFXDECODE_ENTRY( REGION_GFX2, 0, layout16,    0, 1 )
171   GFXDECODE_ENTRY( REGION_GFX3, 0, layout16,    0, 1 )
172GFXDECODE_END
175173
176174INPUT_PORTS_START( mirax )
177175
r1051r1052
193191   MDRV_SCREEN_SIZE(256, 256)
194192   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
195193   MDRV_PALETTE_LENGTH(256)
196   MDRV_GFXDECODE(gfxdecodeinfo)
194   MDRV_GFXDECODE(mirax)
197195   MDRV_VIDEO_START(mirax)
198196   MDRV_VIDEO_UPDATE(mirax)
199197
src/mame/drivers/cardline.c
r1051r1052
161161   8*8*8
162162};
163163
164static gfx_decode gfxdecodeinfo[] =
165{
166   { REGION_GFX1, 0, &charlayout,     0, 2 },
167   { -1 }   /* end of array */
168};
164static GFXDECODE_START( cardline )
165   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 2 )
166GFXDECODE_END
169167
170168PALETTE_INIT(cardline)
171169{
r1051r1052
209207   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
210208   MDRV_SCREEN_SIZE(64*8, 35*8)
211209   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
212   MDRV_GFXDECODE(gfxdecodeinfo)
210   MDRV_GFXDECODE(cardline)
213211   MDRV_PALETTE_LENGTH(512)
214212   MDRV_PALETTE_INIT(cardline)
215213
src/mame/drivers/decocass.c
r1051r1052
344344   objlayout_yoffset
345345};
346346
347static const gfx_decode decocass_gfxdecodeinfo[] =
348{
349   { 0, 0x6000, &charlayout,       0, 4 },  /* char set #1 */
350   { 0, 0x6000, &spritelayout,     0, 4 },  /* sprites */
351   { 0, 0xd000, &tilelayout,      32, 2 },  /* background tiles */
352   { 0, 0xd800, &objlayout,      48, 4 },  /* object */
353   { -1 }
354};
347static GFXDECODE_START( decocass )
348   GFXDECODE_ENTRY( 0, 0x6000, charlayout,       0, 4 )  /* char set #1 */
349   GFXDECODE_ENTRY( 0, 0x6000, spritelayout,     0, 4 )  /* sprites */
350   GFXDECODE_ENTRY( 0, 0xd000, tilelayout,      32, 2 )  /* background tiles */
351   GFXDECODE_ENTRY( 0, 0xd800, objlayout,      48, 4 )  /* object */
352GFXDECODE_END
355353
356354static PALETTE_INIT( decocass )
357355{
r1051r1052
403401   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
404402   MDRV_SCREEN_SIZE(32*8, 32*8)
405403   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
406   MDRV_GFXDECODE(decocass_gfxdecodeinfo)
404   MDRV_GFXDECODE(decocass)
407405   MDRV_PALETTE_LENGTH(32)
408406   MDRV_COLORTABLE_LENGTH(32+2*8+2*4)
409407
src/mame/drivers/mystwarr.c
r1051r1052
841841   16*128
842842};
843843
844static const gfx_decode gfxdecodeinfo_gaiapols[] =
845{
846   { REGION_GFX3, 0, &bglayout_4bpp, 0x0000, 128 },
847   { -1 }
848};
844static GFXDECODE_START( gaiapols )
845   GFXDECODE_ENTRY( REGION_GFX3, 0, bglayout_4bpp, 0x0000, 128 )
846GFXDECODE_END
849847
850static const gfx_decode gfxdecodeinfo_dadandrn[] =
851{
852   { REGION_GFX3, 0, &bglayout_8bpp, 0x0000, 8 },
853   { -1 }
854};
848static GFXDECODE_START( dadandrn )
849   GFXDECODE_ENTRY( REGION_GFX3, 0, bglayout_8bpp, 0x0000, 8 )
850GFXDECODE_END
855851
856852static MACHINE_START( mystwarr )
857853{
r1051r1052
10201016   MDRV_CPU_VBLANK_INT(ddd_interrupt, 1)
10211017   MDRV_SCREEN_VBLANK_TIME(USEC_TO_SUBSECONDS(600))
10221018
1023   MDRV_GFXDECODE(gfxdecodeinfo_dadandrn)
1019   MDRV_GFXDECODE(dadandrn)
10241020
10251021   /* video hardware */
10261022   MDRV_VIDEO_START(dadandrn)
r1051r1052
10401036   MDRV_CPU_VBLANK_INT(ddd_interrupt, 1)
10411037   MDRV_SCREEN_VBLANK_TIME(USEC_TO_SUBSECONDS(600))
10421038
1043   MDRV_GFXDECODE(gfxdecodeinfo_gaiapols)
1039   MDRV_GFXDECODE(gaiapols)
10441040
10451041   MDRV_NVRAM_HANDLER(gaiapols)
10461042
src/mame/drivers/fromance.c
r1051r1052
10281028};
10291029
10301030
1031static const gfx_decode fromance_gfxdecodeinfo[] =
1032{
1033   { REGION_GFX1, 0, &bglayout,   0, 128 },
1034   { REGION_GFX2, 0, &bglayout,   0, 128 },
1035   { -1 }
1036};
1031static GFXDECODE_START( fromance )
1032   GFXDECODE_ENTRY( REGION_GFX1, 0, bglayout,   0, 128 )
1033   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,   0, 128 )
1034GFXDECODE_END
10371035
10381036
10391037
r1051r1052
10761074   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10771075   MDRV_SCREEN_SIZE(512, 256)
10781076   MDRV_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1)
1079   MDRV_GFXDECODE(fromance_gfxdecodeinfo)
1077   MDRV_GFXDECODE(fromance)
10801078   MDRV_PALETTE_LENGTH(1024)
10811079
10821080   MDRV_VIDEO_START(nekkyoku)
r1051r1052
11141112   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11151113   MDRV_SCREEN_SIZE(512, 256)
11161114   MDRV_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1)
1117   MDRV_GFXDECODE(fromance_gfxdecodeinfo)
1115   MDRV_GFXDECODE(fromance)
11181116   MDRV_PALETTE_LENGTH(2048)
11191117
11201118   MDRV_VIDEO_START(fromance)
r1051r1052
11521150   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11531151   MDRV_SCREEN_SIZE(512, 256)
11541152   MDRV_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1)
1155   MDRV_GFXDECODE(fromance_gfxdecodeinfo)
1153   MDRV_GFXDECODE(fromance)
11561154   MDRV_PALETTE_LENGTH(2048)
11571155
11581156   MDRV_VIDEO_START(fromance)
src/mame/drivers/dlair.c
r1051r1052
773773};
774774
775775
776static const gfx_decode gfxdecodeinfo[] =
777{
778   { REGION_GFX1, 0x0000, &charlayout, 0, 8 },
779   { -1 }
780};
776static GFXDECODE_START( dlair )
777   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 8 )
778GFXDECODE_END
781779
782780
783781
r1051r1052
859857   MDRV_SCREEN_SIZE(32*8, 32*8)
860858   MDRV_SCREEN_VISIBLE_AREA(0, 199, 0, 239)
861859
862   MDRV_GFXDECODE(gfxdecodeinfo)
860   MDRV_GFXDECODE(dlair)
863861   MDRV_PALETTE_LENGTH(9)
864862   MDRV_COLORTABLE_LENGTH(16)
865863
src/mame/drivers/jollyjgr.c
r1051r1052
386386   32*8
387387};
388388
389static const gfx_decode jollyjgr_gfxdecodeinfo[] =
390{
391   { REGION_GFX1, 0, &jollyjgr_charlayout,   0, 8 },
392   { REGION_GFX2, 0, &jollyjgr_spritelayout, 0, 8 },
393   { -1 }
394};
389static GFXDECODE_START( jollyjgr )
390   GFXDECODE_ENTRY( REGION_GFX1, 0, jollyjgr_charlayout,   0, 8 )
391   GFXDECODE_ENTRY( REGION_GFX2, 0, jollyjgr_spritelayout, 0, 8 )
392GFXDECODE_END
395393
396394static INTERRUPT_GEN( jollyjgr_interrupt )
397395{
r1051r1052
413411   MDRV_SCREEN_SIZE(256, 256)
414412   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
415413
416   MDRV_GFXDECODE(jollyjgr_gfxdecodeinfo)
414   MDRV_GFXDECODE(jollyjgr)
417415   MDRV_PALETTE_LENGTH(32+8) /* 32 for tilemap and sprites + 8 for the bitmap */
418416
419417   MDRV_PALETTE_INIT(jollyjgr)
src/mame/drivers/irobot.c
r1051r1052
268268};
269269
270270
271static const gfx_decode gfxdecodeinfo[] =
272{
273    { REGION_GFX1, 0, &charlayout, 64, 16 },
274   { -1 }
275};
271static GFXDECODE_START( irobot )
272    GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 64, 16 )
273GFXDECODE_END
276274
277275
278276
r1051r1052
313311   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
314312   MDRV_SCREEN_SIZE(32*8, 32*8)
315313   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1)
316   MDRV_GFXDECODE(gfxdecodeinfo)
314   MDRV_GFXDECODE(irobot)
317315   MDRV_PALETTE_LENGTH(64 + 32)
318316   MDRV_COLORTABLE_LENGTH(64 + 32)   /* 64 for polygons, 32 for text */
319317
src/mame/drivers/skykid.c
r1051r1052
347347   64*8
348348};
349349
350static const gfx_decode gfxdecodeinfo[] =
351{
352   { REGION_GFX1, 0, &text_layout,   0, 64 },
353   { REGION_GFX2, 0, &tile_layout,   64*4, 128 },
354   { REGION_GFX3, 0, &sprite_layout, 64*4+128*4, 64 },
355   {-1 }
356};
350static GFXDECODE_START( skykid )
351   GFXDECODE_ENTRY( REGION_GFX1, 0, text_layout,   0, 64 )
352   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,   64*4, 128 )
353   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite_layout, 64*4+128*4, 64 )
354GFXDECODE_END
357355
358356
359357
r1051r1052
387385   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
388386   MDRV_SCREEN_SIZE(36*8, 28*8)
389387   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
390   MDRV_GFXDECODE(gfxdecodeinfo)
388   MDRV_GFXDECODE(skykid)
391389   MDRV_PALETTE_LENGTH(256)
392390   MDRV_COLORTABLE_LENGTH(64*4+128*4+64*8)
393391
src/mame/drivers/klax.c
r1051r1052
180180};
181181
182182
183static const gfx_decode gfxdecodeinfo[] =
184{
185   { REGION_GFX1, 0, &pfmolayout,  256, 16 },      /* sprites & playfield */
186   { REGION_GFX2, 0, &pfmolayout,    0, 16 },      /* sprites & playfield */
187   { -1 }
188};
183static GFXDECODE_START( klax )
184   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  256, 16 )      /* sprites & playfield */
185   GFXDECODE_ENTRY( REGION_GFX2, 0, pfmolayout,    0, 16 )      /* sprites & playfield */
186GFXDECODE_END
189187
190188
191189
r1051r1052
207205
208206   /* video hardware */
209207   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
210   MDRV_GFXDECODE(gfxdecodeinfo)
208   MDRV_GFXDECODE(klax)
211209   MDRV_PALETTE_LENGTH(512)
212210
213211   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/quizpani.c
r1051r1052
235235   32*32
236236};
237237
238static const gfx_decode gfxdecodeinfo[] =
239{
240   { REGION_GFX1, 0, &tilelayout, 0x100, 16 }, /* Background */
241   { REGION_GFX2, 0, &tilelayout, 0x000, 16 }, /* Text */
242   { -1 }
243};
238static GFXDECODE_START( quizpani )
239   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0x100, 16 ) /* Background */
240   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x000, 16 ) /* Text */
241GFXDECODE_END
244242
245243
246244static MACHINE_DRIVER_START( quizpani )
r1051r1052
252250   MDRV_SCREEN_REFRESH_RATE(60)
253251   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
254252
255   MDRV_GFXDECODE(gfxdecodeinfo)
253   MDRV_GFXDECODE(quizpani)
256254   MDRV_PALETTE_LENGTH(0x200)
257255
258256   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/gomoku.c
r1051r1052
155155   16*8      /* every char takes 16 consecutive bytes */
156156};
157157
158static const gfx_decode gfxdecodeinfo[] =
159{
160   { REGION_GFX1, 0, &charlayout, 0, 32 },
161   { -1 }
162};
158static GFXDECODE_START( gomoku )
159   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 )
160GFXDECODE_END
163161
164162
165163static struct CustomSound_interface custom_interface =
r1051r1052
181179   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
182180   MDRV_SCREEN_SIZE(256, 256)
183181   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
184   MDRV_GFXDECODE(gfxdecodeinfo)
182   MDRV_GFXDECODE(gomoku)
185183   MDRV_PALETTE_LENGTH(64)
186184
187185   MDRV_PALETTE_INIT(gomoku)
src/mame/drivers/djmain.c
r1051r1052
11401140   16*16*4
11411141};
11421142
1143static const gfx_decode gfxdecodeinfo[] =
1144{
1145   { REGION_GFX1, 0, &spritelayout, 0,  (0x4440/4)/16 },
1146   { -1 }
1147};
1143static GFXDECODE_START( djmain )
1144   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0,  (0x4440/4)/16 )
1145GFXDECODE_END
11481146
11491147
11501148
r1051r1052
12381236   MDRV_SCREEN_SIZE(64*8, 64*8)
12391237   MDRV_SCREEN_VISIBLE_AREA(12, 512-12-1, 0, 384-1)
12401238   MDRV_PALETTE_LENGTH(0x4440/4)
1241   MDRV_GFXDECODE(gfxdecodeinfo)
1239   MDRV_GFXDECODE(djmain)
12421240   MDRV_VIDEO_START(djmain)
12431241   MDRV_VIDEO_UPDATE(djmain)
12441242
src/mame/drivers/firetrk.c
r1051r1052
10261026};
10271027
10281028
1029static const gfx_decode firetrk_gfxdecodeinfo[] =
1030{
1031   { REGION_GFX1, 0, &firetrk_text_layout, 26, 1 },
1032   { REGION_GFX2, 0, &firetrk_tile_layout, 0, 8 },
1033   { REGION_GFX2, 0, &firetrk_tile_layout, 16, 3 },
1034   { REGION_GFX3, 0, &firetrk_car_layout1, 22, 2 },
1035   { REGION_GFX3, 0, &firetrk_car_layout2, 22, 2 },
1036   { REGION_GFX4, 0, &firetrk_trailer_layout, 22, 2 },
1037   { -1 }
1038};
1029static GFXDECODE_START( firetrk )
1030   GFXDECODE_ENTRY( REGION_GFX1, 0, firetrk_text_layout, 26, 1 )
1031   GFXDECODE_ENTRY( REGION_GFX2, 0, firetrk_tile_layout, 0, 8 )
1032   GFXDECODE_ENTRY( REGION_GFX2, 0, firetrk_tile_layout, 16, 3 )
1033   GFXDECODE_ENTRY( REGION_GFX3, 0, firetrk_car_layout1, 22, 2 )
1034   GFXDECODE_ENTRY( REGION_GFX3, 0, firetrk_car_layout2, 22, 2 )
1035   GFXDECODE_ENTRY( REGION_GFX4, 0, firetrk_trailer_layout, 22, 2 )
1036GFXDECODE_END
10391037
10401038
1041static const gfx_decode superbug_gfxdecodeinfo[] =
1042{
1043   { REGION_GFX1, 0, &superbug_text_layout, 26, 1 },
1044   { REGION_GFX2, 0, &superbug_tile_layout, 0, 8 },
1045   { REGION_GFX2, 0, &superbug_tile_layout, 16, 3 },
1046   { REGION_GFX3, 0, &superbug_car_layout1, 22, 2 },
1047   { REGION_GFX3, 0, &superbug_car_layout2, 22, 2 },
1048   { -1 }
1049};
1039static GFXDECODE_START( superbug )
1040   GFXDECODE_ENTRY( REGION_GFX1, 0, superbug_text_layout, 26, 1 )
1041   GFXDECODE_ENTRY( REGION_GFX2, 0, superbug_tile_layout, 0, 8 )
1042   GFXDECODE_ENTRY( REGION_GFX2, 0, superbug_tile_layout, 16, 3 )
1043   GFXDECODE_ENTRY( REGION_GFX3, 0, superbug_car_layout1, 22, 2 )
1044   GFXDECODE_ENTRY( REGION_GFX3, 0, superbug_car_layout2, 22, 2 )
1045GFXDECODE_END
10501046
10511047
1052static const gfx_decode montecar_gfxdecodeinfo[] =
1053{
1054   { REGION_GFX1, 0, &montecar_text_layout, 44, 1 },
1055   { REGION_GFX2, 0, &firetrk_tile_layout, 0, 8 },
1056   { REGION_GFX2, 0, &firetrk_tile_layout, 16, 4 },
1057   { REGION_GFX3, 0, &montecar_car_layout, 24, 1 },
1058   { REGION_GFX4, 0, &montecar_car_layout, 28, 4 },
1059   { -1 }
1060};
1048static GFXDECODE_START( montecar )
1049   GFXDECODE_ENTRY( REGION_GFX1, 0, montecar_text_layout, 44, 1 )
1050   GFXDECODE_ENTRY( REGION_GFX2, 0, firetrk_tile_layout, 0, 8 )
1051   GFXDECODE_ENTRY( REGION_GFX2, 0, firetrk_tile_layout, 16, 4 )
1052   GFXDECODE_ENTRY( REGION_GFX3, 0, montecar_car_layout, 24, 1 )
1053   GFXDECODE_ENTRY( REGION_GFX4, 0, montecar_car_layout, 28, 4 )
1054GFXDECODE_END
10611055
10621056
10631057static MACHINE_DRIVER_START( firetrk )
r1051r1052
10771071   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10781072   MDRV_SCREEN_SIZE(320, 262)
10791073   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
1080   MDRV_GFXDECODE(firetrk_gfxdecodeinfo)
1074   MDRV_GFXDECODE(firetrk)
10811075
10821076   MDRV_PALETTE_INIT(firetrk)
10831077   MDRV_PALETTE_LENGTH(4)
r1051r1052
10911085   MDRV_SPEAKER_STANDARD_MONO("mono")
10921086
10931087   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1094   MDRV_SOUND_CONFIG(firetrk_discrete_interface)
1088   MDRV_SOUND_CONFIG_DISCRETE(firetrk)
10951089   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10961090MACHINE_DRIVER_END
10971091
r1051r1052
11041098   MDRV_CPU_PROGRAM_MAP(superbug_map, 0)
11051099
11061100   /* video hardware */
1107   MDRV_GFXDECODE(superbug_gfxdecodeinfo)
1101   MDRV_GFXDECODE(superbug)
11081102
11091103   MDRV_PALETTE_INIT(firetrk)
11101104   MDRV_PALETTE_LENGTH(4)
r1051r1052
11121106
11131107   /* sound hardware */
11141108   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
1115   MDRV_SOUND_CONFIG(superbug_discrete_interface)
1109   MDRV_SOUND_CONFIG_DISCRETE(superbug)
11161110   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
11171111MACHINE_DRIVER_END
11181112
r1051r1052
11251119   MDRV_CPU_PROGRAM_MAP(montecar_map, 0)
11261120
11271121   /* video hardware */
1128   MDRV_GFXDECODE(montecar_gfxdecodeinfo)
1122   MDRV_GFXDECODE(montecar)
11291123
11301124   MDRV_PALETTE_INIT(montecar)
11311125   MDRV_PALETTE_LENGTH(26)
r1051r1052
11331127
11341128   /* sound hardware */
11351129   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
1136   MDRV_SOUND_CONFIG(montecar_discrete_interface)
1130   MDRV_SOUND_CONFIG_DISCRETE(montecar)
11371131   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
11381132MACHINE_DRIVER_END
11391133
src/mame/drivers/mustache.c
r1051r1052
176176   16*16
177177};
178178
179static const gfx_decode gfxdecodeinfo[] =
180{
181   { REGION_GFX1, 0, &charlayout,   0x00, 16 },
182   { REGION_GFX2, 0, &spritelayout, 0x80, 8 },
183   { -1 }
184};
179static GFXDECODE_START( mustache )
180   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x00, 16 )
181   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x80, 8 )
182GFXDECODE_END
185183
186184static TIMER_CALLBACK( clear_irq_cb )
187185{
r1051r1052
222220   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
223221   MDRV_SCREEN_SIZE(32*8, 32*8)
224222   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0, 31*8-1)
225   MDRV_GFXDECODE(gfxdecodeinfo)
223   MDRV_GFXDECODE(mustache)
226224   MDRV_PALETTE_LENGTH(8*16+16*8)
227225
228226   MDRV_PALETTE_INIT(mustache)
src/mame/drivers/ddayjlc.c
r1051r1052
325325   16*16,
326326};
327327
328static const gfx_decode gfxdecodeinfo[] =
329{
330   { REGION_GFX1, 0, &spritelayout,   0, 16 },
331   { REGION_GFX2, 0, &charlayout,     0, 16 },
332   { REGION_GFX3, 0, &charlayout,     0, 16 },
328static GFXDECODE_START( ddayjlc )
329   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,   0, 16 )
330   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,     0, 16 )
331   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,     0, 16 )
333332
334   { -1 }
335};
333GFXDECODE_END
336334
337335static TILE_GET_INFO( get_tile_info_bg )
338336{
r1051r1052
418416   MDRV_SCREEN_SIZE(32*8, 32*8)
419417   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
420418
421   MDRV_GFXDECODE(gfxdecodeinfo)
419   MDRV_GFXDECODE(ddayjlc)
422420   MDRV_PALETTE_LENGTH(32)
423421
424422   MDRV_VIDEO_START(ddayjlc)
src/mame/drivers/segas16a.c
r1051r1052
17741774};
17751775
17761776
1777static const gfx_decode gfxdecodeinfo[] =
1778{
1779   { REGION_GFX1, 0, &charlayout,   0, 1024 },
1780   { -1 }
1781};
1777static GFXDECODE_START( segas16a )
1778   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1024 )
1779GFXDECODE_END
17821780
17831781
17841782
r1051r1052
18151813   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18161814   MDRV_SCREEN_SIZE(342,262)   /* to be verified */
18171815   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1818   MDRV_GFXDECODE(gfxdecodeinfo)
1816   MDRV_GFXDECODE(segas16a)
18191817   MDRV_PALETTE_LENGTH(2048*3)
18201818
18211819   MDRV_VIDEO_START(system16a)
src/mame/drivers/konamigx.c
r1051r1052
12931293};
12941294
12951295/* type 1 (opengolf + racinfrc) use 6 and 8 bpp planar layouts for the 53936 */
1296static const gfx_decode gfxdecodeinfo_opengolf[] =
1297{
1298   { REGION_GFX3, 0, &t1_charlayout8, 0x0000, 8 },
1299   { REGION_GFX4, 0, &t1_charlayout6, 0x0000, 8 },
1300   { -1 }
1301};
1296static GFXDECODE_START( opengolf )
1297   GFXDECODE_ENTRY( REGION_GFX3, 0, t1_charlayout8, 0x0000, 8 )
1298   GFXDECODE_ENTRY( REGION_GFX4, 0, t1_charlayout6, 0x0000, 8 )
1299GFXDECODE_END
13021300
1303static const gfx_decode gfxdecodeinfo_racinfrc[] =
1304{
1305   { REGION_GFX3, 0, &t1_charlayout6, 0x0000, 8 },
1306   { REGION_GFX4, 0, &t1_charlayout6, 0x0000, 8 },
1307   { -1 }
1308};
1301static GFXDECODE_START( racinfrc )
1302   GFXDECODE_ENTRY( REGION_GFX3, 0, t1_charlayout6, 0x0000, 8 )
1303   GFXDECODE_ENTRY( REGION_GFX4, 0, t1_charlayout6, 0x0000, 8 )
1304GFXDECODE_END
13091305
13101306/* type 3 & 4 games use a simple 8bpp decode for the 53936 */
1311static const gfx_decode gfxdecodeinfo_type34[] =
1312{
1313   { REGION_GFX3, 0, &bglayout_8bpp, 0x0000, 8 },
1314   { -1 }
1315};
1307static GFXDECODE_START( type34 )
1308   GFXDECODE_ENTRY( REGION_GFX3, 0, bglayout_8bpp, 0x0000, 8 )
1309GFXDECODE_END
13161310
13171311static MACHINE_DRIVER_START( konamigx )
13181312   /* basic machine hardware */
r1051r1052
13851379static MACHINE_DRIVER_START( opengolf )
13861380   MDRV_IMPORT_FROM(konamigx)
13871381   MDRV_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
1388   MDRV_GFXDECODE(gfxdecodeinfo_opengolf)
1382   MDRV_GFXDECODE(opengolf)
13891383   MDRV_VIDEO_START(opengolf)
13901384
13911385   MDRV_CPU_MODIFY("main")
r1051r1052
13951389static MACHINE_DRIVER_START( racinfrc )
13961390   MDRV_IMPORT_FROM(konamigx)
13971391   MDRV_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1)
1398   MDRV_GFXDECODE(gfxdecodeinfo_racinfrc)
1392   MDRV_GFXDECODE(racinfrc)
13991393   MDRV_VIDEO_START(racinfrc)
14001394
14011395   MDRV_CPU_MODIFY("main")
r1051r1052
14131407   MDRV_PALETTE_LENGTH(16384)
14141408   MDRV_SCREEN_SIZE(64*8, 32*8)
14151409   MDRV_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
1416   MDRV_GFXDECODE(gfxdecodeinfo_type34)
1410   MDRV_GFXDECODE(type34)
14171411MACHINE_DRIVER_END
14181412
14191413static MACHINE_DRIVER_START( gxtype4 )
r1051r1052
14261420   MDRV_SCREEN_SIZE(64*8, 32*8)
14271421   MDRV_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
14281422   MDRV_PALETTE_LENGTH(16384)
1429   MDRV_GFXDECODE(gfxdecodeinfo_type34)
1423   MDRV_GFXDECODE(type34)
14301424   MDRV_VIDEO_START(konamigx_type4)
14311425MACHINE_DRIVER_END
14321426
src/mame/drivers/segahang.c
r1051r1052
827827};
828828
829829
830static const gfx_decode gfxdecodeinfo[] =
831{
832   { REGION_GFX1, 0, &charlayout,   0, 1024 },
833   { -1 }
834};
830static GFXDECODE_START( segahang )
831   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1024 )
832GFXDECODE_END
835833
836834
837835
r1051r1052
858856
859857   /* video hardware */
860858   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
861   MDRV_GFXDECODE(gfxdecodeinfo)
859   MDRV_GFXDECODE(segahang)
862860   MDRV_PALETTE_LENGTH(2048*3)
863861
864862   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/sprcros2.c
r1051r1052
265265   8*8*2
266266};
267267
268static const gfx_decode sprcros2_gfxdecodeinfo[] =
269{
270   { REGION_GFX1, 0, &sprcros2_bglayout,     0,   16 },
271   { REGION_GFX2, 0, &sprcros2_spritelayout, 256, 6  },
272   { REGION_GFX3, 0, &sprcros2_fglayout,     512, 64 },
273   { -1 }
274};
268static GFXDECODE_START( sprcros2 )
269   GFXDECODE_ENTRY( REGION_GFX1, 0, sprcros2_bglayout,     0,   16 )
270   GFXDECODE_ENTRY( REGION_GFX2, 0, sprcros2_spritelayout, 256, 6  )
271   GFXDECODE_ENTRY( REGION_GFX3, 0, sprcros2_fglayout,     512, 64 )
272GFXDECODE_END
275273
276274static INTERRUPT_GEN( sprcros2_m_interrupt )
277275{
r1051r1052
322320   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
323321   MDRV_SCREEN_SIZE(32*8, 32*8)
324322   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
325   MDRV_GFXDECODE(sprcros2_gfxdecodeinfo)
323   MDRV_GFXDECODE(sprcros2)
326324   MDRV_PALETTE_LENGTH(18)
327325   MDRV_COLORTABLE_LENGTH(768)
328326
src/mame/drivers/statriv2.c
r1051r1052
594594   16*8
595595};
596596
597static const gfx_decode gfxdecodeinfo[] =
598{
599   { REGION_GFX1, 0, &statriv2_tiles8x16_layout, 0, 64 },
600   { -1 }
601};
597static GFXDECODE_START( statriv2 )
598   GFXDECODE_ENTRY( REGION_GFX1, 0, statriv2_tiles8x16_layout, 0, 64 )
599GFXDECODE_END
602600
603601
604602static INTERRUPT_GEN( statriv2_interrupt )
r1051r1052
623621   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
624622   MDRV_SCREEN_SIZE(64*8, 32*8)
625623   MDRV_SCREEN_VISIBLE_AREA(4*8, 38*8-1, 0, 32*8-1)
626   MDRV_GFXDECODE(gfxdecodeinfo)
624   MDRV_GFXDECODE(statriv2)
627625   MDRV_PALETTE_LENGTH(8)
628626   MDRV_COLORTABLE_LENGTH(2*64)
629627
src/mame/drivers/carrera.c
r1051r1052
238238   8*8
239239};
240240
241static const gfx_decode gfxdecodeinfo[] =
242{
243   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
244   { -1 }
245};
241static GFXDECODE_START( carrera )
242   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
243GFXDECODE_END
246244
247245VIDEO_START(carrera)
248246{
r1051r1052
303301   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
304302   MDRV_SCREEN_SIZE(512, 256)
305303   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
306   MDRV_GFXDECODE(gfxdecodeinfo)
304   MDRV_GFXDECODE(carrera)
307305   MDRV_PALETTE_LENGTH(32)
308306   MDRV_PALETTE_INIT(carrera)
309307   MDRV_VIDEO_START(carrera)
src/mame/drivers/thunderj.c
r1051r1052
311311};
312312
313313
314static const gfx_decode gfxdecodeinfo[] =
315{
316   { REGION_GFX1, 0, &pfmolayout,  512,  96 },   /* sprites & playfield */
317   { REGION_GFX2, 0, &pfmolayout,  256, 112 },   /* sprites & playfield */
318   { REGION_GFX3, 0, &anlayout,      0, 512 },   /* characters 8x8 */
319   { -1 }
320};
314static GFXDECODE_START( thunderj )
315   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  512,  96 )   /* sprites & playfield */
316   GFXDECODE_ENTRY( REGION_GFX2, 0, pfmolayout,  256, 112 )   /* sprites & playfield */
317   GFXDECODE_ENTRY( REGION_GFX3, 0, anlayout,      0, 512 )   /* characters 8x8 */
318GFXDECODE_END
321319
322320
323321
r1051r1052
342340
343341   /* video hardware */
344342   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
345   MDRV_GFXDECODE(gfxdecodeinfo)
343   MDRV_GFXDECODE(thunderj)
346344   MDRV_PALETTE_LENGTH(2048)
347345
348346   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/ladybug.c
r1051r1052
613613   8*8   /* every char takes 8 consecutive bytes */
614614};
615615
616static const gfx_decode gfxdecodeinfo[] =
617{
618   { REGION_GFX1, 0, &charlayout,      0,  8 },
619   { REGION_GFX2, 0, &spritelayout,  4*8, 16 },
620   { REGION_GFX2, 0, &spritelayout2, 4*8, 16 },
621   { -1 }
622};
616static GFXDECODE_START( ladybug )
617   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0,  8 )
618   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  4*8, 16 )
619   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout2, 4*8, 16 )
620GFXDECODE_END
623621
624static const gfx_decode sraider_gfxdecodeinfo[] =
625{
626   { REGION_GFX1, 0, &charlayout,      0,  8 },
627   { REGION_GFX2, 0, &spritelayout,  4*8, 16 },
628   { REGION_GFX2, 0, &spritelayout2, 4*8, 16 },
629   { REGION_USER1, 0, &gridlayout, 32+64, 1 },
630   { REGION_USER1, 0, &gridlayout2, 32+64, 1 },
631   { -1 }
632};
622static GFXDECODE_START( sraider )
623   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0,  8 )
624   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,  4*8, 16 )
625   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout2, 4*8, 16 )
626   GFXDECODE_ENTRY( REGION_USER1, 0, gridlayout, 32+64, 1 )
627   GFXDECODE_ENTRY( REGION_USER1, 0, gridlayout2, 32+64, 1 )
628GFXDECODE_END
633629
634630
635631static MACHINE_DRIVER_START( ladybug )
r1051r1052
647643   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
648644   MDRV_SCREEN_SIZE(32*8, 32*8)
649645   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
650   MDRV_GFXDECODE(gfxdecodeinfo)
646   MDRV_GFXDECODE(ladybug)
651647   MDRV_PALETTE_LENGTH(32)
652648   MDRV_COLORTABLE_LENGTH(4*24)
653649
r1051r1052
724720   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
725721   MDRV_SCREEN_SIZE(32*8, 32*8)
726722   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
727   MDRV_GFXDECODE(sraider_gfxdecodeinfo)
723   MDRV_GFXDECODE(sraider)
728724   MDRV_PALETTE_LENGTH(65)
729725   MDRV_COLORTABLE_LENGTH(32+64+2)
730726
src/mame/drivers/quantum.c
r1051r1052
141141 *
142142 *************************************/
143143
144ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
144static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
145145   AM_RANGE(0x000000, 0x013fff) AM_ROM
146146   AM_RANGE(0x018000, 0x01cfff) AM_RAM
147147   AM_RANGE(0x800000, 0x801fff) AM_RAM AM_BASE(&quantum_vectorram) AM_SIZE(&vectorram_size)
src/mame/drivers/yamato.c
r1051r1052
515515};
516516
517517
518static const gfx_decode gfxdecodeinfo[] =
519{
520   { REGION_GFX1, 0x0000, &charlayout,      0, 16 }, /* char set #1 */
521   { REGION_GFX1, 0x2000, &charlayout,      0, 16 }, /* char set #2 */
522   { REGION_GFX2, 0x0000, &bscharlayout, 16*4,  8 }, /* big sprite char set */
523   { REGION_GFX1, 0x0000, &spritelayout,    0, 16 }, /* sprite set #1 */
524   { REGION_GFX1, 0x2000, &spritelayout,    0, 16 }, /* sprite set #2 */
525   { -1 }
526};
518static GFXDECODE_START( yamato )
519   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 ) /* char set #1 */
520   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout,      0, 16 ) /* char set #2 */
521   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, bscharlayout, 16*4,  8 ) /* big sprite char set */
522   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,    0, 16 ) /* sprite set #1 */
523   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, spritelayout,    0, 16 ) /* sprite set #2 */
524GFXDECODE_END
527525
528static gfx_decode tr_gfxdecodeinfo[] =
529{
530   { REGION_GFX1, 0x0000, &trcharlayout,      0, 40 },
531   { REGION_GFX2, 0x0000, &trcharlayout,      0, 40 },
532   { REGION_GFX1, 0x0000, &trspritelayout,    0, 40 },
533   { REGION_GFX3, 0x0000, &trcharlayout,       0, 40 },
534   { -1 }
535};
526static GFXDECODE_START( tr )
527   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, trcharlayout,      0, 40 )
528   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, trcharlayout,      0, 40 )
529   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, trspritelayout,    0, 40 )
530   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, trcharlayout,       0, 40 )
531GFXDECODE_END
536532
537533static MACHINE_DRIVER_START( yamato )
538534
r1051r1052
555551   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
556552   MDRV_SCREEN_SIZE(32*8, 32*8)
557553   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
558   MDRV_GFXDECODE(gfxdecodeinfo)
554   MDRV_GFXDECODE(yamato)
559555   MDRV_PALETTE_LENGTH(96+256)
560556   MDRV_COLORTABLE_LENGTH(16*4+8*4)
561557
r1051r1052
590586   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
591587   MDRV_SCREEN_SIZE(32*8, 32*8)
592588   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
593   MDRV_GFXDECODE(tr_gfxdecodeinfo)
589   MDRV_GFXDECODE(tr)
594590   MDRV_PALETTE_LENGTH(32*5)
595591   MDRV_PALETTE_INIT(toprollr)
596592
src/mame/drivers/blueprnt.c
r1051r1052
269269
270270/* Graphics Decode Info */
271271
272static const gfx_decode gfxdecodeinfo[] =
273{
274   { REGION_GFX1, 0, &gfx_8x8x2_planar,     0, 128 },
275   { REGION_GFX2, 0, &spritelayout,     128*4,   1 },
276   { -1 }
277};
272static GFXDECODE_START( blueprnt )
273   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x2_planar,     0, 128 )
274   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,     128*4,   1 )
275GFXDECODE_END
278276
279277/* Sound Interfaces */
280278
r1051r1052
312310   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
313311   MDRV_SCREEN_SIZE(32*8, 32*8)
314312   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
315   MDRV_GFXDECODE(gfxdecodeinfo)
313   MDRV_GFXDECODE(blueprnt)
316314   MDRV_PALETTE_LENGTH(16)
317315   MDRV_COLORTABLE_LENGTH(128*4+8)
318316
src/mame/drivers/combatsc.c
r1051r1052
627627   8*8*4
628628};
629629
630static const gfx_decode combasc_gfxdecodeinfo[] =
631{
632   { REGION_GFX1, 0x00000, &gfxlayout, 0, 8*16 },
633   { REGION_GFX2, 0x00000, &gfxlayout, 0, 8*16 },
634   { -1 }
635};
630static GFXDECODE_START( combasc )
631   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, gfxlayout, 0, 8*16 )
632   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, gfxlayout, 0, 8*16 )
633GFXDECODE_END
636634
637static const gfx_decode combascb_gfxdecodeinfo[] =
638{
639   { REGION_GFX1, 0x00000, &tile_layout,   0, 8*16 },
640   { REGION_GFX1, 0x40000, &tile_layout,   0, 8*16 },
641   { REGION_GFX2, 0x00000, &sprite_layout, 0, 8*16 },
642   { REGION_GFX2, 0x40000, &sprite_layout, 0, 8*16 },
643   { -1 }
644};
635static GFXDECODE_START( combascb )
636   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, tile_layout,   0, 8*16 )
637   GFXDECODE_ENTRY( REGION_GFX1, 0x40000, tile_layout,   0, 8*16 )
638   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, sprite_layout, 0, 8*16 )
639   GFXDECODE_ENTRY( REGION_GFX2, 0x40000, sprite_layout, 0, 8*16 )
640GFXDECODE_END
645641
646642static struct YM2203interface ym2203_interface =
647643{
r1051r1052
682678   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
683679   MDRV_SCREEN_SIZE(32*8, 32*8)
684680   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
685   MDRV_GFXDECODE(combasc_gfxdecodeinfo)
681   MDRV_GFXDECODE(combasc)
686682   MDRV_PALETTE_LENGTH(128)
687683   MDRV_COLORTABLE_LENGTH(8*16*16)
688684
r1051r1052
725721   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
726722   MDRV_SCREEN_SIZE(32*8, 32*8)
727723   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
728   MDRV_GFXDECODE(combascb_gfxdecodeinfo)
724   MDRV_GFXDECODE(combascb)
729725   MDRV_PALETTE_LENGTH(128)
730726   MDRV_COLORTABLE_LENGTH(8*16*16)
731727
src/mame/drivers/rockrage.c
r1051r1052
272272   32*8         /* every sprite takes 32 consecutive bytes */
273273};
274274
275static const gfx_decode gfxdecodeinfo[] =
276{
277   { REGION_GFX1, 0, &charlayout,   64, 32 },   /* colors 00..31, but using 2 lookup tables */
278   { REGION_GFX2, 0, &spritelayout, 32,  1 },   /* colors 32..63 */
279   { -1 }
280};
275static GFXDECODE_START( rockrage )
276   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   64, 32 )   /* colors 00..31, but using 2 lookup tables */
277   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 32,  1 )   /* colors 32..63 */
278GFXDECODE_END
281279
282280/***************************************************************************
283281
r1051r1052
310308   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
311309   MDRV_SCREEN_SIZE(32*8, 32*8)
312310   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
313   MDRV_GFXDECODE(gfxdecodeinfo)
311   MDRV_GFXDECODE(rockrage)
314312   MDRV_PALETTE_LENGTH(64)
315313   MDRV_COLORTABLE_LENGTH(64 + 2*16*16)
316314
src/mame/drivers/egghunt.c
r1051r1052
371371   16*16
372372};
373373
374static const gfx_decode gfxdecodeinfo[] =
375{
376   { REGION_GFX1, 0, &tiles8x8_layout, 0, 64 },
377   { REGION_GFX2, 0, &tiles16x16_layout, 0, 64 },
378   { -1 }
379};
374static GFXDECODE_START( egghunt )
375   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 64 )
376   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16_layout, 0, 64 )
377GFXDECODE_END
380378
381379
382380static MACHINE_RESET( egghunt )
r1051r1052
405403   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
406404   MDRV_SCREEN_SIZE(64*8, 32*8)
407405   MDRV_SCREEN_VISIBLE_AREA(8*8, 56*8-1, 1*8, 31*8-1)
408   MDRV_GFXDECODE(gfxdecodeinfo)
406   MDRV_GFXDECODE(egghunt)
409407   MDRV_PALETTE_LENGTH(0x800)
410408
411409   MDRV_VIDEO_START(egghunt)
src/mame/drivers/buggychl.c
r1051r1052
377377   8
378378};
379379
380static const gfx_decode gfxdecodeinfo[] =
381{
382   { 0,           0, &charlayout,   0, 8 }, /* decoded at runtime */
380static GFXDECODE_START( buggychl )
381   GFXDECODE_ENTRY( 0,           0, charlayout,   0, 8 ) /* decoded at runtime */
383382   /* sprites are drawn pixel by pixel by draw_sprites() */
384   { REGION_GFX1, 0, &spritelayout, 0, 8 },
385   { -1 }
386};
383   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0, 8 )
384GFXDECODE_END
387385
388386
389387
r1051r1052
451449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
452450   MDRV_SCREEN_SIZE(32*8, 32*8)
453451   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
454   MDRV_GFXDECODE(gfxdecodeinfo)
452   MDRV_GFXDECODE(buggychl)
455453   MDRV_PALETTE_LENGTH(128+128)
456454
457455   MDRV_PALETTE_INIT(buggychl)
src/mame/drivers/gotcha.c
r1051r1052
252252   16*16
253253};
254254
255static const gfx_decode gfxdecodeinfo[] =
256{
257   { REGION_GFX1, 0, &tilelayout,   0x100, 32 },
258   { REGION_GFX2, 0, &spritelayout, 0x000, 16 },
259   { -1 }
260};
255static GFXDECODE_START( gotcha )
256   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0x100, 32 )
257   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x000, 16 )
258GFXDECODE_END
261259
262260
263261
r1051r1052
293291   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
294292   MDRV_SCREEN_SIZE(40*8, 32*8)
295293   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
296   MDRV_GFXDECODE(gfxdecodeinfo)
294   MDRV_GFXDECODE(gotcha)
297295   MDRV_PALETTE_LENGTH(768)
298296
299297   MDRV_VIDEO_START(gotcha)
src/mame/drivers/starshp1.c
r1051r1052
321321};
322322
323323
324static const gfx_decode gfxdecodeinfo[] =
325{
326   { REGION_GFX1, 0, &tilelayout,   0, 1 },
327   { REGION_GFX2, 0, &spritelayout, 2, 2 },
328   { REGION_GFX3, 0, &shiplayout,   6, 2 },
329   { -1 }
330};
324static GFXDECODE_START( starshp1 )
325   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   0, 1 )
326   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 2, 2 )
327   GFXDECODE_ENTRY( REGION_GFX3, 0, shiplayout,   6, 2 )
328GFXDECODE_END
331329
332330
333331static MACHINE_DRIVER_START( starshp1 )
r1051r1052
343341   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
344342   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
345343   MDRV_SCREEN_RAW_PARAMS(STARSHP1_PIXEL_CLOCK, STARSHP1_HTOTAL, STARSHP1_HBEND, STARSHP1_HBSTART, STARSHP1_VTOTAL, STARSHP1_VBEND, STARSHP1_VBSTART)
346   MDRV_GFXDECODE(gfxdecodeinfo)
344   MDRV_GFXDECODE(starshp1)
347345   MDRV_PALETTE_LENGTH(8)
348346   MDRV_COLORTABLE_LENGTH(14)
349347   MDRV_PALETTE_INIT(starshp1)
src/mame/drivers/bigstrkb.c
r1051r1052
212212
213213
214214
215static const gfx_decode gfxdecodeinfo[] =
216{
217   { REGION_GFX1, 0, &bigstrkb_charlayout,   0x200, 16 },
218   { REGION_GFX2, 0, &bigstrkb_char16layout,   0, 32 },
219   { REGION_GFX3, 0, &bigstrkb_char16layout,   0x300, 16 },
220   { -1 }
221};
215static GFXDECODE_START( bigstrkb )
216   GFXDECODE_ENTRY( REGION_GFX1, 0, bigstrkb_charlayout,   0x200, 16 )
217   GFXDECODE_ENTRY( REGION_GFX2, 0, bigstrkb_char16layout,   0, 32 )
218   GFXDECODE_ENTRY( REGION_GFX3, 0, bigstrkb_char16layout,   0x300, 16 )
219GFXDECODE_END
222220
223221
224222/* Machine Driver */
r1051r1052
231229   MDRV_SCREEN_REFRESH_RATE(60)
232230   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
233231
234   MDRV_GFXDECODE(gfxdecodeinfo)
232   MDRV_GFXDECODE(bigstrkb)
235233
236234   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
237235   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/pandoras.c
r1051r1052
361361   32*4*8
362362};
363363
364static const gfx_decode gfxdecodeinfo[] =
365{
366   { REGION_GFX1, 0, &charlayout,       0, 16 },
367   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
368   { -1 }
369};
364static GFXDECODE_START( pandoras )
365   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
366   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
367GFXDECODE_END
370368
371369/***************************************************************************
372370
r1051r1052
427425   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
428426   MDRV_SCREEN_SIZE(32*8, 32*8)
429427   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
430   MDRV_GFXDECODE(gfxdecodeinfo)
428   MDRV_GFXDECODE(pandoras)
431429   MDRV_PALETTE_LENGTH(32)
432430   MDRV_COLORTABLE_LENGTH(16*16+16*16)
433431
src/mame/drivers/taito_f2.c
r1051r1052
37733773   32*8   /* every sprite takes 32 consecutive bytes */
37743774};
37753775
3776static const gfx_decode finalb_gfxdecodeinfo[] =
3777{
3778   { REGION_GFX2, 0, &finalb_tilelayout,  0, 64 },   /* sprites & playfield, 6-bit deep */
3779   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* sprites & playfield */
3780   { -1 }
3781};
3776static GFXDECODE_START( finalb )
3777   GFXDECODE_ENTRY( REGION_GFX2, 0, finalb_tilelayout,  0, 64 )   /* sprites & playfield, 6-bit deep */
3778   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* sprites & playfield */
3779GFXDECODE_END
37823780
3783static const gfx_decode taitof2_gfxdecodeinfo[] =
3784{
3785   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites & playfield */
3786   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* sprites & playfield */
3787   { -1 }
3788};
3781static GFXDECODE_START( taitof2 )
3782   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites & playfield */
3783   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* sprites & playfield */
3784GFXDECODE_END
37893785
3790static const gfx_decode pivot_gfxdecodeinfo[] =
3791{
3792   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites & playfield */
3793   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* sprites & playfield */
3794   { REGION_GFX3, 0, &pivotlayout, 0, 256 },   /* sprites & playfield */
3795   { -1 }
3796};
3786static GFXDECODE_START( pivot )
3787   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites & playfield */
3788   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* sprites & playfield */
3789   GFXDECODE_ENTRY( REGION_GFX3, 0, pivotlayout, 0, 256 )   /* sprites & playfield */
3790GFXDECODE_END
37973791
3798static const gfx_decode yuyugogo_gfxdecodeinfo[] =
3799{
3800   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites & playfield */
3801   { REGION_GFX1, 0, &yuyugogo_charlayout,  0, 256 },   /* sprites & playfield */
3802   { -1 }
3803};
3792static GFXDECODE_START( yuyugogo )
3793   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites & playfield */
3794   GFXDECODE_ENTRY( REGION_GFX1, 0, yuyugogo_charlayout,  0, 256 )   /* sprites & playfield */
3795GFXDECODE_END
38043796
3805static const gfx_decode thundfox_gfxdecodeinfo[] =
3806{
3807   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites & playfield */
3808   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* TC0100SCN #1 */
3809   { REGION_GFX3, 0, &charlayout,  0, 256 },   /* TC0100SCN #2 */
3810   { -1 }
3811};
3797static GFXDECODE_START( thundfox )
3798   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites & playfield */
3799   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* TC0100SCN #1 */
3800   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,  0, 256 )   /* TC0100SCN #2 */
3801GFXDECODE_END
38123802
38133803static const gfx_layout deadconx_charlayout =
38143804{
r1051r1052
38213811   128*8     /* every sprite takes 128 consecutive bytes */
38223812};
38233813
3824static const gfx_decode deadconx_gfxdecodeinfo[] =
3825{
3826   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites & playfield */
3827   { REGION_GFX1, 0, &deadconx_charlayout,  0, 256 },   /* sprites & playfield */
3828   { -1 }
3829};
3814static GFXDECODE_START( deadconx )
3815   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites & playfield */
3816   GFXDECODE_ENTRY( REGION_GFX1, 0, deadconx_charlayout,  0, 256 )   /* sprites & playfield */
3817GFXDECODE_END
38303818
38313819
38323820/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
r1051r1052
38953883   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
38963884   MDRV_SCREEN_SIZE(40*8, 32*8)
38973885   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
3898   MDRV_GFXDECODE(taitof2_gfxdecodeinfo)
3886   MDRV_GFXDECODE(taitof2)
38993887   MDRV_PALETTE_LENGTH(4096)
39003888
39013889   MDRV_VIDEO_START(taitof2_default)
r1051r1052
39223910   MDRV_CPU_PROGRAM_MAP(finalb_readmem,finalb_writemem)
39233911
39243912   /* video hardware */
3925   MDRV_GFXDECODE(finalb_gfxdecodeinfo)
3913   MDRV_GFXDECODE(finalb)
39263914   MDRV_VIDEO_START(taitof2_finalb)
39273915   MDRV_VIDEO_EOF(taitof2_partial_buffer_delayed)
39283916MACHINE_DRIVER_END
r1051r1052
39363924   MDRV_CPU_PROGRAM_MAP(dondokod_readmem,dondokod_writemem)
39373925
39383926   /* video hardware */
3939   MDRV_GFXDECODE(pivot_gfxdecodeinfo)
3927   MDRV_GFXDECODE(pivot)
39403928   MDRV_VIDEO_START(taitof2_dondokod)
39413929   MDRV_VIDEO_EOF(taitof2_partial_buffer_delayed)
39423930   MDRV_VIDEO_UPDATE(taitof2_pri_roz)
r1051r1052
39643952   MDRV_CPU_PROGRAM_MAP(thundfox_readmem,thundfox_writemem)
39653953
39663954   /* video hardware */
3967   MDRV_GFXDECODE(thundfox_gfxdecodeinfo)
3955   MDRV_GFXDECODE(thundfox)
39683956   MDRV_VIDEO_START(taitof2_thundfox)
39693957   MDRV_VIDEO_EOF(taitof2_partial_buffer_delayed_thundfox)
39703958   MDRV_VIDEO_UPDATE(thundfox)
r1051r1052
39793967   MDRV_CPU_PROGRAM_MAP(cameltry_readmem,cameltry_writemem)
39803968
39813969   /* video hardware */
3982   MDRV_GFXDECODE(pivot_gfxdecodeinfo)
3970   MDRV_GFXDECODE(pivot)
39833971   MDRV_VIDEO_START(taitof2_dondokod)
39843972   MDRV_VIDEO_UPDATE(taitof2_pri_roz)
39853973MACHINE_DRIVER_END
r1051r1052
39933981   MDRV_CPU_PROGRAM_MAP(qtorimon_readmem,qtorimon_writemem)
39943982
39953983   /* video hardware */
3996   MDRV_GFXDECODE(yuyugogo_gfxdecodeinfo)
3984   MDRV_GFXDECODE(yuyugogo)
39973985   MDRV_VIDEO_EOF(taitof2_partial_buffer_delayed)
39983986MACHINE_DRIVER_END
39993987
r1051r1052
40204008   MDRV_CPU_PROGRAM_MAP(quizhq_readmem,quizhq_writemem)
40214009
40224010   /* video hardware */
4023   MDRV_GFXDECODE(yuyugogo_gfxdecodeinfo)
4011   MDRV_GFXDECODE(yuyugogo)
40244012   MDRV_VIDEO_EOF(taitof2_partial_buffer_delayed)
40254013MACHINE_DRIVER_END
40264014
r1051r1052
40854073   MDRV_CPU_PROGRAM_MAP(footchmp_readmem,footchmp_writemem)
40864074
40874075   /* video hardware */
4088   MDRV_GFXDECODE(deadconx_gfxdecodeinfo)
4076   MDRV_GFXDECODE(deadconx)
40894077   MDRV_VIDEO_START(taitof2_footchmp)
40904078   MDRV_VIDEO_EOF(taitof2_full_buffer_delayed)
40914079   MDRV_VIDEO_UPDATE(deadconx)
r1051r1052
41004088   MDRV_CPU_PROGRAM_MAP(footchmp_readmem,footchmp_writemem)
41014089
41024090   /* video hardware */
4103   MDRV_GFXDECODE(deadconx_gfxdecodeinfo)
4091   MDRV_GFXDECODE(deadconx)
41044092   MDRV_VIDEO_START(taitof2_hthero)
41054093   MDRV_VIDEO_EOF(taitof2_full_buffer_delayed)
41064094   MDRV_VIDEO_UPDATE(deadconx)
r1051r1052
41304118   MDRV_MACHINE_RESET(qcrayon)
41314119
41324120   /* video hardware */
4133   MDRV_GFXDECODE(yuyugogo_gfxdecodeinfo)
4121   MDRV_GFXDECODE(yuyugogo)
41344122   MDRV_VIDEO_START(taitof2_yuyugogo)
41354123   MDRV_VIDEO_UPDATE(yesnoj)
41364124MACHINE_DRIVER_END
r1051r1052
41824170   MDRV_CPU_PROGRAM_MAP(pulirula_readmem,pulirula_writemem)
41834171
41844172   /* video hardware */
4185   MDRV_GFXDECODE(pivot_gfxdecodeinfo)
4173   MDRV_GFXDECODE(pivot)
41864174   MDRV_VIDEO_START(taitof2_pulirula)
41874175   MDRV_VIDEO_UPDATE(taitof2_pri_roz)
41884176MACHINE_DRIVER_END
r1051r1052
41964184   MDRV_CPU_PROGRAM_MAP(metalb_readmem,metalb_writemem)
41974185
41984186   /* video hardware */
4199   MDRV_GFXDECODE(deadconx_gfxdecodeinfo)
4187   MDRV_GFXDECODE(deadconx)
42004188   MDRV_PALETTE_LENGTH(8192)
42014189   MDRV_VIDEO_START(taitof2_metalb)
42024190   MDRV_VIDEO_UPDATE(metalb)
r1051r1052
42244212   MDRV_CPU_PROGRAM_MAP(yesnoj_readmem,yesnoj_writemem)
42254213
42264214   /* video hardware */
4227   MDRV_GFXDECODE(yuyugogo_gfxdecodeinfo)
4215   MDRV_GFXDECODE(yuyugogo)
42284216   MDRV_VIDEO_START(taitof2_yesnoj)
42294217   MDRV_VIDEO_UPDATE(yesnoj)
42304218MACHINE_DRIVER_END
r1051r1052
42384226   MDRV_CPU_PROGRAM_MAP(deadconx_readmem,deadconx_writemem)
42394227
42404228   /* video hardware */
4241   MDRV_GFXDECODE(deadconx_gfxdecodeinfo)
4229   MDRV_GFXDECODE(deadconx)
42424230   MDRV_VIDEO_START(taitof2_deadconx)
42434231   MDRV_VIDEO_UPDATE(deadconx)
42444232MACHINE_DRIVER_END
r1051r1052
42524240   MDRV_CPU_PROGRAM_MAP(deadconx_readmem,deadconx_writemem)
42534241
42544242   /* video hardware */
4255   MDRV_GFXDECODE(deadconx_gfxdecodeinfo)
4243   MDRV_GFXDECODE(deadconx)
42564244   MDRV_VIDEO_START(taitof2_deadconj)
42574245   MDRV_VIDEO_UPDATE(deadconx)
42584246MACHINE_DRIVER_END
r1051r1052
43224310   MDRV_CPU_PROGRAM_MAP(driftout_readmem,driftout_writemem)
43234311
43244312   /* video hardware */
4325   MDRV_GFXDECODE(pivot_gfxdecodeinfo)
4313   MDRV_GFXDECODE(pivot)
43264314   MDRV_VIDEO_START(taitof2_driftout)
43274315   MDRV_VIDEO_UPDATE(taitof2_pri_roz)
43284316MACHINE_DRIVER_END
r1051r1052
43474335   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
43484336   MDRV_SCREEN_SIZE(40*8, 32*8)
43494337   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
4350   MDRV_GFXDECODE(pivot_gfxdecodeinfo)
4338   MDRV_GFXDECODE(pivot)
43514339   MDRV_PALETTE_LENGTH(4096)
43524340
43534341   MDRV_VIDEO_START(taitof2_dondokod)
r1051r1052
43894377   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
43904378   MDRV_SCREEN_SIZE(40*8, 32*8)
43914379   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
4392   MDRV_GFXDECODE(pivot_gfxdecodeinfo)
4380   MDRV_GFXDECODE(pivot)
43934381   MDRV_PALETTE_LENGTH(4096)
43944382
43954383   MDRV_VIDEO_START(taitof2_driftout)
src/mame/drivers/gberet.c
r1051r1052
517517
518518/* Graphics Decode Information */
519519
520static const gfx_decode gfxdecodeinfo[] =
521{
522   { REGION_GFX1, 0, &charlayout,       0, 16 },
523   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
524   { -1 }
525};
520static GFXDECODE_START( gberet )
521   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
522   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
523GFXDECODE_END
526524
527static const gfx_decode gberetb_gfxdecodeinfo[] =
528{
529   { REGION_GFX1, 0, &gberetb_charlayout,       0, 16 },
530   { REGION_GFX2, 0, &gberetb_spritelayout, 16*16, 16 },
531   { -1 }
532};
525static GFXDECODE_START( gberetb )
526   GFXDECODE_ENTRY( REGION_GFX1, 0, gberetb_charlayout,       0, 16 )
527   GFXDECODE_ENTRY( REGION_GFX2, 0, gberetb_spritelayout, 16*16, 16 )
528GFXDECODE_END
533529
534530/* Interrupt Generators */
535531
r1051r1052
564560   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
565561   MDRV_SCREEN_SIZE(32*8, 32*8)
566562   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
567   MDRV_GFXDECODE(gfxdecodeinfo)
563   MDRV_GFXDECODE(gberet)
568564   MDRV_PALETTE_LENGTH(32)
569565   MDRV_COLORTABLE_LENGTH(2*16*16)
570566
r1051r1052
591587   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
592588
593589   // video hardware
594   MDRV_GFXDECODE(gberetb_gfxdecodeinfo)
590   MDRV_GFXDECODE(gberetb)
595591
596592   MDRV_VIDEO_UPDATE(gberetb)
597593MACHINE_DRIVER_END
src/mame/drivers/stfight.c
r1051r1052
468468};
469469
470470
471static const gfx_decode gfxdecodeinfo[] =
472{
473   { REGION_GFX1, 0x0000, &charlayout,   0,                16 },
474   { REGION_GFX2, 0x0000, &fglayout,     16*4,             16 },
475   { REGION_GFX3, 0x0000, &bglayout,     16*4+16*16,       16 },
476   { REGION_GFX3, 0x0020, &bglayout,     16*4+16*16,       16 },
477   { REGION_GFX4, 0x0000, &spritelayout, 16*4+16*16+16*16, 16 },
478   { -1 }
479};
471static GFXDECODE_START( stfight )
472   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0,                16 )
473   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, fglayout,     16*4,             16 )
474   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, bglayout,     16*4+16*16,       16 )
475   GFXDECODE_ENTRY( REGION_GFX3, 0x0020, bglayout,     16*4+16*16,       16 )
476   GFXDECODE_ENTRY( REGION_GFX4, 0x0000, spritelayout, 16*4+16*16+16*16, 16 )
477GFXDECODE_END
480478
481479static struct MSM5205interface msm5205_interface =
482480{
r1051r1052
507505   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
508506   MDRV_SCREEN_SIZE(32*8, 32*8)
509507   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
510   MDRV_GFXDECODE(gfxdecodeinfo)
508   MDRV_GFXDECODE(stfight)
511509   MDRV_PALETTE_LENGTH(256+1)
512510   MDRV_COLORTABLE_LENGTH(16*4+16*16+16*16+16*16)
513511
src/mame/drivers/gottlieb.c
r1051r1052
14201420   32*8
14211421};
14221422
1423static const gfx_decode charRAM_gfxdecodeinfo[] =
1424{
1425   { 0,           0x4000, &charRAMlayout, 0, 1 },   /* the game dynamically modifies this */
1426   { REGION_GFX2, 0x0000, &spritelayout,  0, 1 },
1427   { -1 }
1428};
1423static GFXDECODE_START( charRAM )
1424   GFXDECODE_ENTRY( 0,           0x4000, charRAMlayout, 0, 1 )   /* the game dynamically modifies this */
1425   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,  0, 1 )
1426GFXDECODE_END
14291427
1430static const gfx_decode charROM_gfxdecodeinfo[] =
1431{
1432   { REGION_GFX1, 0x0000, &charROMlayout, 0, 1 },
1433   { REGION_GFX2, 0x0000, &spritelayout,  0, 1 },
1434   { -1 }
1435};
1428static GFXDECODE_START( charROM )
1429   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charROMlayout, 0, 1 )
1430   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,  0, 1 )
1431GFXDECODE_END
14361432
14371433
14381434static const char *reactor_sample_names[] =
r1051r1052
15271523#define gottlieb_samples_interface qbert_samples_interface   /* not used */
15281524#define krull_samples_interface qbert_samples_interface      /* not used */
15291525
1530struct sp0250_interface sp0250_interface =
1526static struct sp0250_interface sp0250_interface =
15311527{
15321528   stooges_sp0250_drq
15331529};
r1051r1052
15691565   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15701566   MDRV_SCREEN_SIZE(32*8, 32*8)
15711567   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
1572   MDRV_GFXDECODE(charROM_gfxdecodeinfo)
1568   MDRV_GFXDECODE(charROM)
15731569   MDRV_PALETTE_LENGTH(16)
15741570
15751571   MDRV_VIDEO_START(gottlieb)
r1051r1052
15931589   MDRV_NVRAM_HANDLER(NULL)
15941590
15951591   /* video hardware */
1596   MDRV_GFXDECODE(charRAM_gfxdecodeinfo)
1592   MDRV_GFXDECODE(charRAM)
15971593
15981594   MDRV_SOUND_ADD(SAMPLES, 0)
15991595   MDRV_SOUND_CONFIG(reactor_samples_interface)
r1051r1052
16191615   MDRV_IMPORT_FROM(gottlieb)
16201616
16211617   /* video hardware */
1622   MDRV_GFXDECODE(charRAM_gfxdecodeinfo)
1618   MDRV_GFXDECODE(charRAM)
16231619MACHINE_DRIVER_END
16241620
16251621
r1051r1052
16501646   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16511647   MDRV_SCREEN_SIZE(32*8, 32*8)
16521648   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
1653   MDRV_GFXDECODE(charROM_gfxdecodeinfo)
1649   MDRV_GFXDECODE(charROM)
16541650   MDRV_PALETTE_LENGTH(16)
16551651
16561652   MDRV_VIDEO_START(gottlieb)
r1051r1052
16811677
16821678   /* basic machine hardware */
16831679   MDRV_IMPORT_FROM(gottlieb2)
1684   MDRV_GFXDECODE(charRAM_gfxdecodeinfo)
1680   MDRV_GFXDECODE(charRAM)
16851681MACHINE_DRIVER_END
16861682
16871683static MACHINE_DRIVER_START( vidvince )
src/mame/drivers/sandscrp.c
r1051r1052
335335};
336336
337337
338static const gfx_decode sandscrp_gfxdecodeinfo[] =
339{
340   { REGION_GFX1, 0, &layout_16x16x4,   0x000, 0x10 }, // [0] Sprites
341   { REGION_GFX2, 0, &layout_16x16x4_2, 0x400, 0x40 }, // [1] Layers
342   { -1 }
343};
338static GFXDECODE_START( sandscrp )
339   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,   0x000, 0x10 ) // [0] Sprites
340   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4_2, 0x400, 0x40 ) // [1] Layers
341GFXDECODE_END
344342
345343
346344
r1051r1052
387385   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
388386   MDRV_SCREEN_SIZE(256, 256)
389387   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
390   MDRV_GFXDECODE(sandscrp_gfxdecodeinfo)
388   MDRV_GFXDECODE(sandscrp)
391389   MDRV_PALETTE_LENGTH(2048)
392390
393391   MDRV_VIDEO_START(sandscrp_1xVIEW2)
src/mame/drivers/ddragon.c
r1051r1052
915915   64*8
916916};
917917
918static const gfx_decode gfxdecodeinfo[] =
919{
920   { REGION_GFX1, 0, &char_layout,   0, 8 },   /* colors   0-127 */
921   { REGION_GFX2, 0, &tile_layout, 128, 8 },   /* colors 128-255 */
922   { REGION_GFX3, 0, &tile_layout, 256, 8 },   /* colors 256-383 */
923   { -1 }
924};
918static GFXDECODE_START( ddragon )
919   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,   0, 8 )   /* colors   0-127 */
920   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 128, 8 )   /* colors 128-255 */
921   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout, 256, 8 )   /* colors 256-383 */
922GFXDECODE_END
925923
926924/*****************************************************************************/
927925
r1051r1052
991989   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
992990   MDRV_SCREEN_SIZE(32*8, 32*8)
993991   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
994   MDRV_GFXDECODE(gfxdecodeinfo)
992   MDRV_GFXDECODE(ddragon)
995993   MDRV_PALETTE_LENGTH(384)
996994
997995   MDRV_VIDEO_START(ddragon)
r1051r1052
10421040   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10431041   MDRV_SCREEN_SIZE(32*8, 32*8)
10441042   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1045   MDRV_GFXDECODE(gfxdecodeinfo)
1043   MDRV_GFXDECODE(ddragon)
10461044   MDRV_PALETTE_LENGTH(512)
10471045
10481046   MDRV_VIDEO_START(ddragon)
r1051r1052
10911089   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10921090   MDRV_SCREEN_SIZE(32*8, 32*8)
10931091   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
1094   MDRV_GFXDECODE(gfxdecodeinfo)
1092   MDRV_GFXDECODE(ddragon)
10951093   MDRV_PALETTE_LENGTH(384)
10961094
10971095   MDRV_VIDEO_START(ddragon)
r1051r1052
11391137   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11401138   MDRV_SCREEN_SIZE(32*8, 32*8)
11411139   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
1142   MDRV_GFXDECODE(gfxdecodeinfo)
1140   MDRV_GFXDECODE(ddragon)
11431141   MDRV_PALETTE_LENGTH(384)
11441142
11451143   MDRV_VIDEO_START(ddragon)
r1051r1052
11771175   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11781176   MDRV_SCREEN_SIZE(32*8, 32*8)
11791177   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
1180   MDRV_GFXDECODE(gfxdecodeinfo)
1178   MDRV_GFXDECODE(ddragon)
11811179   MDRV_PALETTE_LENGTH(384)
11821180
11831181   MDRV_VIDEO_START(ddragon)
src/mame/drivers/acommand.c
r1051r1052
499499   32*32
500500};
501501
502static const gfx_decode acommand_gfxdecodeinfo[] =
503{
504   { REGION_GFX1, 0, &charlayout, 0x2700, 16 }, /*???*/
505   { REGION_GFX2, 0, &tilelayout, 0x1800, 256 },
506   { REGION_GFX3, 0, &tilelayout, 0x1800, 256 },
507   { -1 }
508};
502static GFXDECODE_START( acommand )
503   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x2700, 16 ) /*???*/
504   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x1800, 256 )
505   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x1800, 256 )
506GFXDECODE_END
509507
510508static INTERRUPT_GEN( acommand_irq )
511509{
r1051r1052
530528   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
531529   MDRV_SCREEN_SIZE(32*8, 32*8)
532530   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
533   MDRV_GFXDECODE(acommand_gfxdecodeinfo)
531   MDRV_GFXDECODE(acommand)
534532   MDRV_PALETTE_LENGTH(0x4000)
535533
536534   MDRV_VIDEO_START(acommand)
src/mame/drivers/tubep.c
r1051r1052
682682   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
683683   8*8 /* every char takes 8 consecutive bytes */
684684};
685static const gfx_decode tubep_gfxdecodeinfo[] =
686{
687   { REGION_GFX1,      0, &charlayout,       0, 32 },   /* 32 color codes */
688   { -1 }
689};
685static GFXDECODE_START( tubep )
686   GFXDECODE_ENTRY( REGION_GFX1,      0, charlayout,       0, 32 )   /* 32 color codes */
687GFXDECODE_END
690688
691static const gfx_decode rjammer_gfxdecodeinfo[] =
692{
693   { REGION_GFX1,      0, &charlayout,       0, 16 },   /* 16 color codes */
694   { -1 }
695};
689static GFXDECODE_START( rjammer )
690   GFXDECODE_ENTRY( REGION_GFX1,      0, charlayout,       0, 16 )   /* 16 color codes */
691GFXDECODE_END
696692
697693static struct AY8910interface ay8910_interface_1 =
698694{
r1051r1052
758754   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
759755   MDRV_SCREEN_SIZE(32*8, 32*8)
760756   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
761   MDRV_GFXDECODE(tubep_gfxdecodeinfo)
757   MDRV_GFXDECODE(tubep)
762758   MDRV_PALETTE_LENGTH(32 + 256*64)
763759   MDRV_COLORTABLE_LENGTH(32*2)
764760
r1051r1052
817813   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
818814   MDRV_SCREEN_SIZE(32*8, 32*8)
819815   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
820   MDRV_GFXDECODE(rjammer_gfxdecodeinfo)
816   MDRV_GFXDECODE(rjammer)
821817   MDRV_PALETTE_LENGTH(64)
822818   MDRV_COLORTABLE_LENGTH(2*16 + 16*2)
823819
src/mame/drivers/ppmast93.c
r1051r1052
303303   32*8
304304};
305305
306static const gfx_decode gfxdecodeinfo[] =
307{
308   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
309   { -1 }
310};
306static GFXDECODE_START( ppmast93 )
307   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
308GFXDECODE_END
311309
312310static TILE_GET_INFO( get_ppmast93_bg_tile_info )
313311{
r1051r1052
364362   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
365363   MDRV_SCREEN_SIZE(256, 256)
366364   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
367   MDRV_GFXDECODE(gfxdecodeinfo)
365   MDRV_GFXDECODE(ppmast93)
368366
369367   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
370368   MDRV_PALETTE_LENGTH(0x100)
src/mame/drivers/homedata.c
r1051r1052
11971197   32*8
11981198};
11991199
1200static const gfx_decode mrokumei_gfxdecodeinfo[] =
1201{
1202   { REGION_GFX1, 0, &char_layout, 0x6000, 0x100 },
1203   { REGION_GFX2, 0, &char_layout, 0x7000, 0x100 },
1204   { -1 }
1205};
1200static GFXDECODE_START( mrokumei )
1201   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout, 0x6000, 0x100 )
1202   GFXDECODE_ENTRY( REGION_GFX2, 0, char_layout, 0x7000, 0x100 )
1203GFXDECODE_END
12061204
12071205static const gfx_layout tile_layout =
12081206{
r1051r1052
12151213   64*8
12161214};
12171215
1218static const gfx_decode reikaids_gfxdecodeinfo[] =
1219{
1220   { REGION_GFX1, 0, &tile_layout, 0x6000, 0x20 },
1221   { REGION_GFX2, 0, &tile_layout, 0x4000, 0x20 },
1222   { REGION_GFX3, 0, &tile_layout, 0x2000, 0x20 },
1223   { REGION_GFX4, 0, &tile_layout, 0x0000, 0x20 },
1224   { -1 }
1225};
1216static GFXDECODE_START( reikaids )
1217   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0x6000, 0x20 )
1218   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 0x4000, 0x20 )
1219   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout, 0x2000, 0x20 )
1220   GFXDECODE_ENTRY( REGION_GFX4, 0, tile_layout, 0x0000, 0x20 )
1221GFXDECODE_END
12261222
1227static const gfx_decode pteacher_gfxdecodeinfo[] =
1228{
1229   { REGION_GFX1, 0, &tile_layout, 0x0000, 0x40 },
1230   { REGION_GFX2, 0, &tile_layout, 0x4000, 0x40 },
1231   { -1 }
1232};
1223static GFXDECODE_START( pteacher )
1224   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0x0000, 0x40 )
1225   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 0x4000, 0x40 )
1226GFXDECODE_END
12331227
12341228static const gfx_layout tile_layout_4bpp_hi =
12351229{
r1051r1052
12531247   64*8
12541248};
12551249
1256static const gfx_decode lemnangl_gfxdecodeinfo[] =
1257{
1258   { REGION_GFX1, 0, &tile_layout_4bpp_hi, 0x0000, 0x200 },
1259   { REGION_GFX1, 0, &tile_layout_4bpp_lo, 0x2000, 0x200 },
1260   { REGION_GFX2, 0, &tile_layout_4bpp_lo, 0x4000, 0x200 },
1261   { REGION_GFX2, 0, &tile_layout_4bpp_hi, 0x6000, 0x200 },
1262   { -1 }
1263};
1250static GFXDECODE_START( lemnangl )
1251   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout_4bpp_hi, 0x0000, 0x200 )
1252   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout_4bpp_lo, 0x2000, 0x200 )
1253   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout_4bpp_lo, 0x4000, 0x200 )
1254   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout_4bpp_hi, 0x6000, 0x200 )
1255GFXDECODE_END
12641256
12651257
12661258
r1051r1052
12851277   MDRV_SCREEN_SIZE(64*8, 32*8)
12861278   // visible area can be changed at runtime
12871279   MDRV_SCREEN_VISIBLE_AREA(0*8, 54*8-1, 2*8, 30*8-1)
1288   MDRV_GFXDECODE(mrokumei_gfxdecodeinfo)
1280   MDRV_GFXDECODE(mrokumei)
12891281   MDRV_PALETTE_LENGTH(0x8000)
12901282
12911283   MDRV_PALETTE_INIT(mrokumei)
r1051r1052
13461338   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13471339   MDRV_SCREEN_SIZE(256, 256)
13481340   MDRV_SCREEN_VISIBLE_AREA(0, 255, 16, 256-1-16)
1349   MDRV_GFXDECODE(reikaids_gfxdecodeinfo)
1341   MDRV_GFXDECODE(reikaids)
13501342   MDRV_PALETTE_LENGTH(0x8000)
13511343
13521344   MDRV_PALETTE_INIT(reikaids)
r1051r1052
13971389   MDRV_SCREEN_SIZE(64*8, 32*8)
13981390   // visible area can be changed at runtime
13991391   MDRV_SCREEN_VISIBLE_AREA(0*8, 54*8-1, 2*8, 30*8-1)
1400   MDRV_GFXDECODE(pteacher_gfxdecodeinfo)
1392   MDRV_GFXDECODE(pteacher)
14011393   MDRV_PALETTE_LENGTH(0x8000)
14021394
14031395   MDRV_PALETTE_INIT(pteacher)
r1051r1052
14271419   MDRV_IMPORT_FROM(pteacher)
14281420
14291421   /* video hardware */
1430   MDRV_GFXDECODE(lemnangl_gfxdecodeinfo)
1422   MDRV_GFXDECODE(lemnangl)
14311423
14321424   MDRV_VIDEO_START(lemnangl)
14331425MACHINE_DRIVER_END
src/mame/drivers/exidy.c
r1051r1052
772772};
773773
774774
775static const gfx_decode gfxdecodeinfo_1bpp[] =
776{
777   { REGION_CPU1, 0x4800, &charlayout_1bpp, 0, 4 },   /* the game dynamically modifies this */
778   { REGION_GFX1, 0x0000, &spritelayout,    8, 2 },
779   { -1 }
780};
775static GFXDECODE_START( 1bpp )
776   GFXDECODE_ENTRY( REGION_CPU1, 0x4800, charlayout_1bpp, 0, 4 )   /* the game dynamically modifies this */
777   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,    8, 2 )
778GFXDECODE_END
781779
782780
783static const gfx_decode gfxdecodeinfo_2bpp[] =
784{
785   { REGION_CPU1, 0x6000, &charlayout_2bpp, 0, 4 },   /* the game dynamically modifies this */
786   { REGION_GFX1, 0x0000, &spritelayout,   16, 2 },
787   { -1 }
788};
781static GFXDECODE_START( 2bpp )
782   GFXDECODE_ENTRY( REGION_CPU1, 0x6000, charlayout_2bpp, 0, 4 )   /* the game dynamically modifies this */
783   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,   16, 2 )
784GFXDECODE_END
789785
790786
791787
r1051r1052
839835   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
840836   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
841837   MDRV_SCREEN_RAW_PARAMS(EXIDY_PIXEL_CLOCK, EXIDY_HTOTAL, EXIDY_HBEND, EXIDY_HBSTART, EXIDY_VTOTAL, EXIDY_VBEND, EXIDY_VBSTART)
842   MDRV_GFXDECODE(gfxdecodeinfo_1bpp)
838   MDRV_GFXDECODE(1bpp)
843839   MDRV_PALETTE_LENGTH(PALETTE_LEN)
844840   MDRV_COLORTABLE_LENGTH(COLORTABLE_LEN)
845841
r1051r1052
916912   MDRV_CPU_PROGRAM_MAP(common_map,pepper2_map)
917913
918914   /* video hardware */
919   MDRV_GFXDECODE(gfxdecodeinfo_2bpp)
915   MDRV_GFXDECODE(2bpp)
920916MACHINE_DRIVER_END
921917
922918
src/mame/drivers/xxmissio.c
r1051r1052
261261   64*8
262262};
263263
264static const gfx_decode gfxdecodeinfo[] =
265{
266   { REGION_GFX1, 0x0000, &charlayout,   256,  8 }, /* FG */
267   { REGION_GFX1, 0x0000, &spritelayout,   0,  8 }, /* sprite */
268   { REGION_GFX2, 0x0000, &bglayout,     512, 16 }, /* BG */
269   { -1 }
270};
264static GFXDECODE_START( xxmissio )
265   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   256,  8 ) /* FG */
266   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,   0,  8 ) /* sprite */
267   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, bglayout,     512, 16 ) /* BG */
268GFXDECODE_END
271269
272270/****************************************************************************/
273271
r1051r1052
307305   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
308306   MDRV_SCREEN_SIZE(64*8, 32*8)
309307   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 4*8, 28*8-1)
310   MDRV_GFXDECODE(gfxdecodeinfo)
308   MDRV_GFXDECODE(xxmissio)
311309   MDRV_PALETTE_LENGTH(768)
312310
313311   MDRV_VIDEO_START(generic)
src/mame/drivers/mugsmash.c
r1051r1052
411411   32*8
412412};
413413
414static const gfx_decode gfxdecodeinfo[] =
415{
416   { REGION_GFX1, 0, &mugsmash_layout,   0x00, 16  }, /* sprites */
417   { REGION_GFX2, 0, &mugsmash2_layout,  0x100, 256  }, /* bg tiles */
418   { -1 }
419};
414static GFXDECODE_START( mugsmash )
415   GFXDECODE_ENTRY( REGION_GFX1, 0, mugsmash_layout,   0x00, 16  ) /* sprites */
416   GFXDECODE_ENTRY( REGION_GFX2, 0, mugsmash2_layout,  0x100, 256  ) /* bg tiles */
417GFXDECODE_END
420418
421419static void irq_handler(int irq)
422420{
r1051r1052
440438   MDRV_SCREEN_REFRESH_RATE(60)
441439   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
442440
443   MDRV_GFXDECODE(gfxdecodeinfo)
441   MDRV_GFXDECODE(mugsmash)
444442
445443   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
446444   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/pcktgal.c
r1051r1052
213213   32*8   /* every char takes 8 consecutive bytes */
214214};
215215
216static const gfx_decode gfxdecodeinfo[] =
217{
218   { REGION_GFX1, 0x00000, &charlayout,   256, 16 }, /* chars */
219   { REGION_GFX2, 0x00000, &spritelayout,   0,  8 }, /* sprites */
220   { -1 }
221};
216static GFXDECODE_START( pcktgal )
217   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   256, 16 ) /* chars */
218   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, spritelayout,   0,  8 ) /* sprites */
219GFXDECODE_END
222220
223static const gfx_decode bootleg_gfxdecodeinfo[] =
224{
225   { REGION_GFX1, 0x00000, &bootleg_charlayout,   256, 16 }, /* chars */
226   { REGION_GFX2, 0x00000, &bootleg_spritelayout,   0,  8 }, /* sprites */
227   { -1 }
228};
221static GFXDECODE_START( bootleg )
222   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, bootleg_charlayout,   256, 16 ) /* chars */
223   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, bootleg_spritelayout,   0,  8 ) /* sprites */
224GFXDECODE_END
229225
230226/***************************************************************************/
231227
r1051r1052
257253   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
258254   MDRV_SCREEN_SIZE(32*8, 32*8)
259255   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
260   MDRV_GFXDECODE(gfxdecodeinfo)
256   MDRV_GFXDECODE(pcktgal)
261257   MDRV_PALETTE_LENGTH(512)
262258
263259   MDRV_PALETTE_INIT(pcktgal)
r1051r1052
281277
282278static MACHINE_DRIVER_START( bootleg )
283279   MDRV_IMPORT_FROM(pcktgal)
284   MDRV_GFXDECODE(bootleg_gfxdecodeinfo)
280   MDRV_GFXDECODE(bootleg)
285281MACHINE_DRIVER_END
286282
287283/***************************************************************************/
src/mame/drivers/hng64.c
r1051r1052
12621262};
12631263
12641264
1265static const gfx_decode gfxdecodeinfo[] =
1266{
1267   { REGION_GFX1, 0, &hng64_4_even_layout, 0x0, 0x100 }, /* scrolltiles */
1268   { REGION_GFX1, 0, &hng64_4_odd_layout,  0x0, 0x100 }, /* scrolltiles */
1269   { REGION_GFX1, 0, &hng64_layout,        0x0, 0x10 }, /* scrolltiles */
1270   { REGION_GFX1, 0, &hng64_16_layout,     0x0, 0x10 }, /* scroll tiles */
1271   { REGION_GFX2, 0, &hng64_4_16_layout,   0x0, 0x100 }, /* sprite tiles */
1272   { REGION_GFX2, 0, &hng64_16_layout,     0x0, 0x10 }, /* sprite tiles */
1273   { -1 }
1274};
1265static GFXDECODE_START( hng64 )
1266   GFXDECODE_ENTRY( REGION_GFX1, 0, hng64_4_even_layout, 0x0, 0x100 ) /* scrolltiles */
1267   GFXDECODE_ENTRY( REGION_GFX1, 0, hng64_4_odd_layout,  0x0, 0x100 ) /* scrolltiles */
1268   GFXDECODE_ENTRY( REGION_GFX1, 0, hng64_layout,        0x0, 0x10 ) /* scrolltiles */
1269   GFXDECODE_ENTRY( REGION_GFX1, 0, hng64_16_layout,     0x0, 0x10 ) /* scroll tiles */
1270   GFXDECODE_ENTRY( REGION_GFX2, 0, hng64_4_16_layout,   0x0, 0x100 ) /* sprite tiles */
1271   GFXDECODE_ENTRY( REGION_GFX2, 0, hng64_16_layout,     0x0, 0x10 ) /* sprite tiles */
1272GFXDECODE_END
12751273
12761274DRIVER_INIT( hng64 )
12771275{
r1051r1052
13981396   MDRV_SCREEN_REFRESH_RATE(60)
13991397   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
14001398
1401   MDRV_GFXDECODE(gfxdecodeinfo)
1399   MDRV_GFXDECODE(hng64)
14021400   MDRV_MACHINE_RESET(hyperneo)
14031401
14041402   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
src/mame/drivers/solomon.c
r1051r1052
194194   32*8   /* every sprite takes 32 consecutive bytes */
195195};
196196
197static const gfx_decode gfxdecodeinfo[] =
198{
199   { REGION_GFX1, 0, &charlayout,     0, 8 },   /* colors   0-127 */
200   { REGION_GFX2, 0, &charlayout,   128, 8 },   /* colors 128-255 */
201   { REGION_GFX3, 0, &spritelayout,   0, 8 },   /* colors   0-127 */
202   { -1 }
203};
197static GFXDECODE_START( solomon )
198   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 8 )   /* colors   0-127 */
199   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   128, 8 )   /* colors 128-255 */
200   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0, 8 )   /* colors   0-127 */
201GFXDECODE_END
204202
205203static MACHINE_DRIVER_START( solomon )
206204
r1051r1052
222220   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
223221   MDRV_SCREEN_SIZE(32*8, 32*8)
224222   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
225   MDRV_GFXDECODE(gfxdecodeinfo)
223   MDRV_GFXDECODE(solomon)
226224   MDRV_PALETTE_LENGTH(256)
227225
228226   MDRV_VIDEO_START(solomon)
src/mame/drivers/macrossp.c
r1051r1052
22
33Macross Plus                        (c)1996 Banpresto
44Quiz Bisyoujo Senshi Sailor Moon    (c)1997 Banpresto
5
56Driver by David Haywood
67
78TODO:
r1051r1052
1718- palette fade on macrossp Banpresto logo screen (and black on some screen
1819  transitions). quizmoon doesn't use that register.
1920- All Other Unused Reads / Writes
20- Correct DSWs / Ports
21- Correct unknown ports if/as needed
2122- Clean Up
23- Flip Screen support (both games have a dipswitch for it's selection)
2224
2325 Notes:
2426
25 Whats the BIOS rom? should it be in the 68020 map, its different between
26 games.
27 Whats the BIOS rom? should it be in the 68020 map, its different between games.
2728
2829 68020 interrupts
2930 lev 1 : 0x64 : 0000 084c - unknown..
r1051r1052
5758DIPS: 2x 8-Position
5859
5960
60(Typed directly from original sheet supplied with PCB)
61DIPSW-1
62------------------------------------------------------------------
63    DipSwitch Title   | Function | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
64------------------------------------------------------------------
65                      | 1cn/1pl  |off|off|off|off|               |*
66                      | 1cn/2pl  |on |off|off|off|               |
67                      | 1cn/3pl  |off|on |off|off|               |
68                      | 1cn/4pl  |on |on |off|off|               |
69                      | 1cn/5pl  |off|off|on |off|               |
70                      | 1cn/6pl  |on |off|on |off|               |
71     Coin Chute A     | 1cn/7pl  |off|on |on |off|               |
72                      | 2cn/1pl  |on |on |on |off|               |
73                      | 2cn/3pl  |off|off|off|on |               |
74                      | 2cn/5pl  |on |off|off|on |               |
75                      | 3cn/1pl  |off|on |off|on |               |
76                      | 3cn/2pl  |on |on |off|on |               |
77                      | 3cn/4pl  |off|off|on |on |               |
78                      | 4cn/1pl  |on |off|on |on |               |
79                      | 4cn/3pl  |off|on |on |on |               |
80                      |  Free    |on |on |on |on |               |
81------------------------------------------------------------------
82                      | 1cn/1pl  |               |off|off|off|off|*
83                      | 1cn/2pl  |               |on |off|off|off|
84                      | 1cn/3pl  |               |off|on |off|off|
85                      | 1cn/4pl  |               |on |on |off|off|
86                      | 1cn/5pl  |               |off|off|on |off|
87                      | 1cn/6pl  |               |on |off|on |off|
88     Coin Chute B     | 1cn/7pl  |               |off|on |on |off|
89                      | 2cn/1pl  |               |on |on |on |off|
90                      | 2cn/3pl  |               |off|off|off|on |
91                      | 2cn/5pl  |               |on |off|off|on |
92                      | 3cn/1pl  |               |off|on |off|on |
93                      | 3cn/2pl  |               |on |on |off|on |
94                      | 3cn/4pl  |               |off|off|on |on |
95                      | 4cn/1pl  |               |on |off|on |on |
96                      | 4cn/3pl  |               |off|on |on |on |
97                      | 5cn/3pl  |               |on |on |on |on |
98------------------------------------------------------------------
6199
62SW1:
63100
64            1   2   3   4   5   6   7   8
65-------------------------------------------------------------------------------------
66COIN A  1COIN 1PLAY OFF OFF OFF OFF
67    1C2P        ON  OFF OFF OFF
68    1C3P        OFF ON  OFF OFF
69    1C4P        ON  ON  OFF OFF
70    1C5P        OFF OFF ON  OFF
71    1C6P        ON  OFF ON  OFF
72    1C7P        OFF ON  ON  OFF
73    2C1P        ON  ON  ON  OFF
74    2C3P        OFF OFF OFF ON
75    2C5P        ON  OFF OFF ON
76    3C1P        OFF ON  OFF ON
77    3C2P        ON  ON  OFF ON
78    3C4P        OFF OFF ON  ON
79    4C1P        ON  OFF ON  ON
80    4C3P        OFF ON  ON  ON
81    FREEPLAY    ON  ON  ON  ON
101DIPSW-2
102------------------------------------------------------------------
103    DipSwitch Title   | Function | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
104------------------------------------------------------------------
105                      |  Normal  |off|off|                       |*
106      Difficulty      |   Easy   |on |off|                       |
107        Level         |   Hard   |off|on |                       |
108                      |  V.Hard  |on |on |                       |
109------------------------------------------------------------------
110                      |     3    |       |off|off|               |*
111    Players Count     |     4    |       |on |off|               |
112                      |     5    |       |off|on |               |
113                      |     2    |       |on |on |               |
114------------------------------------------------------------------
115      Demo Sound      |   Play   |               |off|           |*
116                      |   Mute   |               |on |           |
117------------------------------------------------------------------
118      Screen Flip     |    Off   |                   |off|       |*
119                      |    On    |                   |on |       |
120------------------------------------------------------------------
121Title Screen Language | Japanese |                       |off|   |*#
122                      | English  |                       |on |   |
123------------------------------------------------------------------
124   Test / Game Mode   |   Game   |                           |off|*
125                      |   Test   |                           |on |
126------------------------------------------------------------------
82127
83COIN B  1COIN 1PLAY                 OFF OFF OFF OFF
84    1C2P                        ON  OFF OFF OFF
85    1C3P                        OFF ON  OFF OFF
86    1C4P                        ON  ON  OFF OFF
87    1C5P                        OFF OFF ON  OFF
88    1C6P                        ON  OFF ON  OFF
89    1C7P                        OFF ON  ON  OFF
90    2C1P                        ON  ON  ON  OFF
91    2C3P                        OFF OFF OFF ON
92    2C5P                        ON  OFF OFF ON
93    3C1P                        OFF ON  OFF ON
94    3C2P                        ON  ON  OFF ON
95    3C4P                        OFF OFF ON  ON
96    4C1P                        ON  OFF ON  ON
97    4C3P                        OFF ON  ON  ON
98    5C3P                        ON  ON  ON  ON
128* Denotes Factory Defualts
129# English title page doesn't display the Japanese translation of the word "Macross"
99130
100FACTORY SETTING = ALL OFF
101131
102
103SW2
104
105            1   2   3   4   5   6   7   8
106--------------------------------------------------------------------------------------
107DIFFICULTY  NORMAL  OFF OFF
108        EASY    ON  OFF
109        HARD    OFF ON
110        HARDEST ON  ON
111
112PLAYERS     3           OFF OFF
113                4                       ON  OFF
114                5                       OFF ON
115                2                       ON  ON
116
117DEMO SOUND  YES                 OFF
118        NO                  ON
119
120SCREEN F/F  PLAY                        OFF
121        MUTE                        ON
122
123NOT USED                                OFF
124
125MODE        GAME                                OFF
126        TEST                                ON
127
128
129FACTORY SETTING = ALL OFF
130
131
132132ROMs:  (Filename = ROM label, extension also on ROM label)
133133
134134TOP ROM PCB
r1051r1052
387387   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
388388   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
389389
390   PORT_START
390   PORT_START_TAG("KEYS")
391391   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
392392   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
393393   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
394394   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 )
395   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
396   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
397   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
395   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) /* Unknown use */
398396   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
399   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
400   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
401   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
402   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
403   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
404   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
405   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
406   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
407   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
408   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
409   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
410   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
411   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
412   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
413   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
414   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
415   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
416   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
417   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
418   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
419   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
420   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
421   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
422   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
423   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
424   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
425   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
426   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
427   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
428   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
397   PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED ) /* Unknown use */
429398
430   PORT_START   /* DSW */
431   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
399   PORT_START_TAG("DSW")   /* DSW */
400   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
432401   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
433402   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
434403   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
r1051r1052
445414   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
446415   PORT_DIPSETTING(      0x0009, "1 Coins/7 Credits" )
447416   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play) )
448   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )
417   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
449418   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_1C ) )
450419   PORT_DIPSETTING(      0x0050, DEF_STR( 3C_1C ) )
451420   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
r1051r1052
462431   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ) )
463432   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )
464433   PORT_DIPSETTING(      0x0090, "1 Coins/7 Credits" )
465   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
434   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
466435   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
467436   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
468437   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
469438   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
470   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) )
439   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
471440   PORT_DIPSETTING(      0x0000, "2" )
472441   PORT_DIPSETTING(      0x0c00, "3" )
473442   PORT_DIPSETTING(      0x0800, "4" )
474443   PORT_DIPSETTING(      0x0400, "5" )
475   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Demo_Sounds ) )
444   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")
476445   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
477446   PORT_DIPSETTING(      0x1000, DEF_STR( On ) )
478   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )   // See above for manual listing....
447   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:6")  /* See above for dips listing.... also in Quiz game's test screens */
479448   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
480449   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
481   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Language ) )   // See title page for difference :-)
450   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:7")  /* See title page for difference :-)  The Manual shows this as UNUSED */
482451   PORT_DIPSETTING(      0x4000, DEF_STR( Japanese ) )
483452   PORT_DIPSETTING(      0x0000, DEF_STR( English ) )
484   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
453   PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" )
485454
486455   PORT_START
487   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
488   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
489   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
490   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
491   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
492   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
493   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
494   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
495   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
496   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
497   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
498   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
499   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
500   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
501   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
502   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
503   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
504   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
505   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
506   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
507   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
508   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
509   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
510   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
511   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
512   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
513   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
514   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
515   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
516   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
517   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
518   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
519   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
520   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
521   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
522   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
523   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
524   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
525   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
526   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
527   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
528   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
529   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
530   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
531   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
532   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
533   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
534   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
456   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) /* Unknown use, but not dipswitches */
535457
536458INPUT_PORTS_END
537459
538460
539461INPUT_PORTS_START( quizmoon )
540   PORT_START
541   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
542   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
543   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
544   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
545   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
546   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
547   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
548   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
549   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
550   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
551   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
552   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
553   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
554   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
555   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
556   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
462   PORT_INCLUDE(macrossp)
557463
558   PORT_START
559   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
560   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
561   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
562   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 )
464   PORT_MODIFY("KEYS")
563465   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Test ) )
564466   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
565467   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
566   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
567468   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Tilt ) )
568469   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
569470   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
570   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
571   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
572   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
573   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
574   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
575   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
576   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
577   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
578   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
579   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
580   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
581   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
582   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
583   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
584   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
585   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
586   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
587   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
588   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
589   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
590   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
591   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
592   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
593   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
594   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
595   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
596   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
597471
598   PORT_START   /* DSW */
599   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
600   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
601   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
602   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
603   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_2C ) )
604   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_3C ) )
605   PORT_DIPSETTING(      0x000f, DEF_STR( 1C_1C ) )
606   PORT_DIPSETTING(      0x0003, DEF_STR( 3C_4C ) )
607   PORT_DIPSETTING(      0x0007, DEF_STR( 2C_3C ) )
608   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_2C ) )
609   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_5C ) )
610   PORT_DIPSETTING(      0x000d, DEF_STR( 1C_3C ) )
611   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )
612   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ) )
613   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
614   PORT_DIPSETTING(      0x0009, "1 Coins/7 Credits" )
615   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play) )
616   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )
617   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_1C ) )
618   PORT_DIPSETTING(      0x0050, DEF_STR( 3C_1C ) )
619   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
620   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_3C ) )
621   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_2C ) )
622   PORT_DIPSETTING(      0x0010, DEF_STR( 4C_3C ) )
623   PORT_DIPSETTING(      0x00f0, DEF_STR( 1C_1C ) )
624   PORT_DIPSETTING(      0x0030, DEF_STR( 3C_4C ) )
625   PORT_DIPSETTING(      0x0070, DEF_STR( 2C_3C ) )
626   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_2C ) )
627   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_5C ) )
628   PORT_DIPSETTING(      0x00d0, DEF_STR( 1C_3C ) )
629   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )
630   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ) )
631   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )
632   PORT_DIPSETTING(      0x0090, "1 Coins/7 Credits" )
633   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
634   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
635   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
636   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
637   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
638   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) )
639   PORT_DIPSETTING(      0x0000, "2" )
640   PORT_DIPSETTING(      0x0c00, "3" )
641   PORT_DIPSETTING(      0x0800, "4" )
642   PORT_DIPSETTING(      0x0400, "5" )
643   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Demo_Sounds ) )
644   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
645   PORT_DIPSETTING(      0x1000, DEF_STR( On ) )
646   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Flip_Screen ) )   // See in test mode ok but not working....
647   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
648   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
649   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) )
650   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
651   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
652   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
472   PORT_MODIFY("DSW")
473   PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) /* no Language dipswitch for this game */
653474
654475   PORT_START
655   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
656   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
657   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
658   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
659   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
660   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
661   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
662   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
663   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
664   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
665   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
666   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
667   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
668   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
669   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
670   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
671   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
672   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
673   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
674   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
675   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
676   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
677   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
678   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
679   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
680   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
681   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
682   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
683   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
684   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
685   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
686   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
687   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
688   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
689   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
690   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
691   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
692   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
693   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
694   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
695   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
696   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
697   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
698   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
699   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
700   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
701   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
702   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
476   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) /* Unknown use, but not dipswitches */
703477
704478INPUT_PORTS_END
705479
r1051r1052
729503   16*128
730504};
731505
732static const gfx_decode gfxdecodeinfo[] =
733{
734   { REGION_GFX1, 0, &macrossp_char16x16x8layout,   0x000, 0x20 },   /* 8bpp but 6bpp granularity */
735   { REGION_GFX2, 0, &macrossp_char16x16x8layout,   0x800, 0x20 },   /* 8bpp but 6bpp granularity */
736   { REGION_GFX3, 0, &macrossp_char16x16x8layout,   0x800, 0x20 },   /* 8bpp but 6bpp granularity */
737   { REGION_GFX4, 0, &macrossp_char16x16x8layout,   0x800, 0x20 },   /* 8bpp but 6bpp granularity */
738   { REGION_GFX5, 0, &macrossp_char16x16x4layout,   0x800, 0x80 },
739   { -1 }
740};
506static GFXDECODE_START( macrossp )
507   GFXDECODE_ENTRY( REGION_GFX1, 0, macrossp_char16x16x8layout,   0x000, 0x20 )   /* 8bpp but 6bpp granularity */
508   GFXDECODE_ENTRY( REGION_GFX2, 0, macrossp_char16x16x8layout,   0x800, 0x20 )   /* 8bpp but 6bpp granularity */
509   GFXDECODE_ENTRY( REGION_GFX3, 0, macrossp_char16x16x8layout,   0x800, 0x20 )   /* 8bpp but 6bpp granularity */
510   GFXDECODE_ENTRY( REGION_GFX4, 0, macrossp_char16x16x8layout,   0x800, 0x20 )   /* 8bpp but 6bpp granularity */
511   GFXDECODE_ENTRY( REGION_GFX5, 0, macrossp_char16x16x4layout,   0x800, 0x80 )
512GFXDECODE_END
741513
742514/*** MACHINE DRIVER **********************************************************/
743515
r1051r1052
778550   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
779551   MDRV_SCREEN_SIZE(32*16, 16*16)
780552   MDRV_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 0*16, 15*16-1)
781   MDRV_GFXDECODE(gfxdecodeinfo)
553   MDRV_GFXDECODE(macrossp)
782554   MDRV_PALETTE_LENGTH(0x1000)
783555
784556   MDRV_VIDEO_START(macrossp)
src/mame/drivers/gladiatr.c
r1051r1052
634634   64*8
635635};
636636
637static const gfx_decode ppking_gfxdecodeinfo[] =
638{
639   { REGION_GFX1, 0, &charlayout, 0, 1 },
640   { REGION_GFX2, 0, &tilelayout, 0, 32 },
641   { REGION_GFX3, 0, &spritelayout, 0x100, 32 },
642   { -1 }
643};
637static GFXDECODE_START( ppking )
638   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 1 )
639   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0, 32 )
640   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x100, 32 )
641GFXDECODE_END
644642
645static const gfx_decode gladiatr_gfxdecodeinfo[] =
646{
647   { REGION_GFX1, 0, &charlayout,   0x200, 1 },
648   { REGION_GFX2, 0, &tilelayout,   0x000, 32 },
649   { REGION_GFX3, 0, &spritelayout, 0x100, 32 },
650   { -1 }
651};
643static GFXDECODE_START( gladiatr )
644   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x200, 1 )
645   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   0x000, 32 )
646   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x100, 32 )
647GFXDECODE_END
652648
653649
654650
r1051r1052
708704   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
709705   MDRV_SCREEN_SIZE(32*8, 32*8)
710706   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
711   MDRV_GFXDECODE(ppking_gfxdecodeinfo)
707   MDRV_GFXDECODE(ppking)
712708   MDRV_PALETTE_LENGTH(1024)
713709
714710   MDRV_VIDEO_START(ppking)
r1051r1052
757753   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
758754   MDRV_SCREEN_SIZE(32*8, 32*8)
759755   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
760   MDRV_GFXDECODE(gladiatr_gfxdecodeinfo)
756   MDRV_GFXDECODE(gladiatr)
761757   MDRV_PALETTE_LENGTH(1024)
762758
763759   MDRV_VIDEO_START(gladiatr)
src/mame/drivers/kinstb.c
r1051r1052
206206static struct CustomSound_interface snes_sound_interface =
207207{ snes_sh_start };
208208
209static const gfx_decode gfxdecodeinfo[] =
210{
211   { -1 }
212};
209static GFXDECODE_START( kinstb )
210GFXDECODE_END
213211
214212static PALETTE_INIT( snes )
215213{
r1051r1052
243241   MDRV_VIDEO_UPDATE( snes )
244242
245243   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
246   MDRV_GFXDECODE(gfxdecodeinfo)
244   MDRV_GFXDECODE(kinstb)
247245   MDRV_PALETTE_LENGTH(32768)
248246   MDRV_COLORTABLE_LENGTH(257)
249247   MDRV_PALETTE_INIT( snes )
src/mame/drivers/skychut.c
r1051r1052
277277};
278278
279279
280static const gfx_decode gfxdecodeinfo[] =
281{
282   { REGION_GFX1, 0x0000, &charlayout, 0, 8 },
283   { -1 }
284};
280static GFXDECODE_START( skychut )
281   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 8 )
282GFXDECODE_END
285283
286284
287285static MACHINE_DRIVER_START( skychut )
r1051r1052
299297   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
300298   MDRV_SCREEN_SIZE(32*8, 32*8)
301299   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
302   MDRV_GFXDECODE(gfxdecodeinfo)
300   MDRV_GFXDECODE(skychut)
303301   MDRV_PALETTE_LENGTH(8)
304302   MDRV_COLORTABLE_LENGTH(2*8)
305303
src/mame/drivers/stepstag.c
r1051r1052
9898   64*8
9999};
100100
101static const gfx_decode gfxdecodeinfo[] =
102{
103   { REGION_GFX1, 0, &tiles8x8_layout, 0, 2 },
104   { REGION_GFX2, 0, &tiles8x8_layout, 0, 2 },
105   { REGION_GFX3, 0, &tiles8x8_layout, 0, 2 },
106   { REGION_GFX4, 0, &tiles8x8_layout, 0, 2 },
107   { REGION_GFX5, 0, &tiles8x8_layout, 0, 2 },
108   { REGION_GFX6, 0, &tiles8x8_layout, 0, 2 },
109   { REGION_GFX7, 0, &tiles8x8_layout, 0, 2 },
110   { REGION_GFX8, 0, &tiles8x8_layout, 0, 2 },
101static GFXDECODE_START( stepstag )
102   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 2 )
103   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout, 0, 2 )
104   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles8x8_layout, 0, 2 )
105   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles8x8_layout, 0, 2 )
106   GFXDECODE_ENTRY( REGION_GFX5, 0, tiles8x8_layout, 0, 2 )
107   GFXDECODE_ENTRY( REGION_GFX6, 0, tiles8x8_layout, 0, 2 )
108   GFXDECODE_ENTRY( REGION_GFX7, 0, tiles8x8_layout, 0, 2 )
109   GFXDECODE_ENTRY( REGION_GFX8, 0, tiles8x8_layout, 0, 2 )
111110
112   { -1 }
113};
111GFXDECODE_END
114112
115113VIDEO_START(stepstag)
116114{
r1051r1052
140138   MDRV_SCREEN_SIZE(64*8, 32*8)
141139   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
142140   MDRV_PALETTE_LENGTH(0x200)
143   MDRV_GFXDECODE(gfxdecodeinfo)
141   MDRV_GFXDECODE(stepstag)
144142
145143   MDRV_VIDEO_START(stepstag)
146144   MDRV_VIDEO_UPDATE(stepstag)
src/mame/drivers/goindol.c
r1051r1052
260260   8*8
261261};
262262
263static const gfx_decode gfxdecodeinfo[] =
264{
265   { REGION_GFX1, 0, &charlayout, 0, 32 },
266   { REGION_GFX2, 0, &charlayout, 0, 32 },
267   { -1 }
268};
263static GFXDECODE_START( goindol )
264   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 32 )
265   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 32 )
266GFXDECODE_END
269267
270268
271269
r1051r1052
289287   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
290288   MDRV_SCREEN_SIZE(32*8, 32*8)
291289   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
292   MDRV_GFXDECODE(gfxdecodeinfo)
290   MDRV_GFXDECODE(goindol)
293291   MDRV_PALETTE_LENGTH(256)
294292
295293   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/taito_l.c
r1051r1052
22092209   8*8*4
22102210};
22112211
2212static const gfx_decode gfxdecodeinfo1[] =
2213{
2214   { REGION_GFX1, 0, &bg1_layout, 0, 16 },
2215   { REGION_GFX1, 0, &sp1_layout, 0, 16 },
2216   { 0,           0, &char_layout,  0, 16 },  // Ram-based
2217   { -1 }
2218};
2212static GFXDECODE_START( 1 )
2213   GFXDECODE_ENTRY( REGION_GFX1, 0, bg1_layout, 0, 16 )
2214   GFXDECODE_ENTRY( REGION_GFX1, 0, sp1_layout, 0, 16 )
2215   GFXDECODE_ENTRY( 0,           0, char_layout,  0, 16 )  // Ram-based
2216GFXDECODE_END
22192217
2220static const gfx_decode gfxdecodeinfo2[] =
2221{
2222   { REGION_GFX1, 0, &bg2_layout, 0, 16 },
2223   { REGION_GFX1, 0, &sp2_layout, 0, 16 },
2224   { 0,           0, &char_layout,  0, 16 },  // Ram-based
2225   { -1 }
2226};
2218static GFXDECODE_START( 2 )
2219   GFXDECODE_ENTRY( REGION_GFX1, 0, bg2_layout, 0, 16 )
2220   GFXDECODE_ENTRY( REGION_GFX1, 0, sp2_layout, 0, 16 )
2221   GFXDECODE_ENTRY( 0,           0, char_layout,  0, 16 )  // Ram-based
2222GFXDECODE_END
22272223
22282224
22292225
r1051r1052
23132309   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23142310   MDRV_SCREEN_SIZE(40*8, 32*8)
23152311   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2316   MDRV_GFXDECODE(gfxdecodeinfo2)
2312   MDRV_GFXDECODE(2)
23172313   MDRV_PALETTE_LENGTH(256)
23182314
23192315   MDRV_VIDEO_START(taitol)
r1051r1052
24082404   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24092405   MDRV_SCREEN_SIZE(40*8, 32*8)
24102406   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2411   MDRV_GFXDECODE(gfxdecodeinfo2)
2407   MDRV_GFXDECODE(2)
24122408   MDRV_PALETTE_LENGTH(256)
24132409
24142410   MDRV_VIDEO_START(taitol)
r1051r1052
24322428   MDRV_IMPORT_FROM(kurikint)
24332429
24342430   /* video hardware */
2435   MDRV_GFXDECODE(gfxdecodeinfo1)
2431   MDRV_GFXDECODE(1)
24362432MACHINE_DRIVER_END
24372433
24382434
r1051r1052
24532449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24542450   MDRV_SCREEN_SIZE(40*8, 32*8)
24552451   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2456   MDRV_GFXDECODE(gfxdecodeinfo1)
2452   MDRV_GFXDECODE(1)
24572453   MDRV_PALETTE_LENGTH(256)
24582454
24592455   MDRV_VIDEO_START(taitol)
r1051r1052
25372533   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
25382534   MDRV_SCREEN_SIZE(40*8, 32*8)
25392535   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
2540   MDRV_GFXDECODE(gfxdecodeinfo2)
2536   MDRV_GFXDECODE(2)
25412537   MDRV_PALETTE_LENGTH(256)
25422538
25432539   MDRV_VIDEO_START(taitol)
src/mame/drivers/gyruss.c
r1051r1052
330330
331331
332332
333static const gfx_decode gfxdecodeinfo[] =
334{
335   { REGION_GFX1, 0x0000, &charlayout,      0, 16 },
336   { REGION_GFX2, 0x0000, &spritelayout, 16*4, 16 },   /* upper half */
337   { REGION_GFX2, 0x0010, &spritelayout, 16*4, 16 },   /* lower half */
338   { -1 }
339};
333static GFXDECODE_START( gyruss )
334   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 )
335   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout, 16*4, 16 )   /* upper half */
336   GFXDECODE_ENTRY( REGION_GFX2, 0x0010, spritelayout, 16*4, 16 )   /* lower half */
337GFXDECODE_END
340338
341339
342340
r1051r1052
392390   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
393391   MDRV_SCREEN_SIZE(32*8, 32*8)
394392   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
395   MDRV_GFXDECODE(gfxdecodeinfo)
393   MDRV_GFXDECODE(gyruss)
396394   MDRV_PALETTE_LENGTH(32)
397395   MDRV_COLORTABLE_LENGTH(16*4+16*16)
398396
src/mame/drivers/groundfx.c
r1051r1052
380380   32*8    /* every sprite takes 32 consecutive bytes */
381381};
382382
383static const gfx_decode groundfx_gfxdecodeinfo[] =
384{
385   { REGION_GFX2, 0x0, &tile16x16_layout,  4096, 512 },
386   { REGION_GFX1, 0x0, &charlayout,        0, 512 },
387   { REGION_GFX3, 0x0, &pivlayout,         0, 512 },
388   { -1 }
389};
383static GFXDECODE_START( groundfx )
384   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x16_layout,  4096, 512 )
385   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,        0, 512 )
386   GFXDECODE_ENTRY( REGION_GFX3, 0x0, pivlayout,         0, 512 )
387GFXDECODE_END
390388
391389
392390/***********************************************************
r1051r1052
425423   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
426424   MDRV_SCREEN_SIZE(40*8, 32*8)
427425   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 3*8, 32*8-1)
428   MDRV_GFXDECODE(groundfx_gfxdecodeinfo)
426   MDRV_GFXDECODE(groundfx)
429427   MDRV_PALETTE_LENGTH(16384)
430428
431429   MDRV_VIDEO_START(groundfx)
src/mame/drivers/fastlane.c
r1051r1052
239239   32*8
240240};
241241
242static const gfx_decode gfxdecodeinfo[] =
243{
244   { REGION_GFX1, 0, &gfxlayout, 0, 64*16 },
245   { -1 }
246};
242static GFXDECODE_START( fastlane )
243   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout, 0, 64*16 )
244GFXDECODE_END
247245
248246/***************************************************************************
249247
r1051r1052
290288   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
291289   MDRV_SCREEN_SIZE(37*8, 32*8)
292290   MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
293   MDRV_GFXDECODE(gfxdecodeinfo)
291   MDRV_GFXDECODE(fastlane)
294292   MDRV_PALETTE_LENGTH(1024)
295293   MDRV_COLORTABLE_LENGTH(1024*16)
296294
src/mame/drivers/segald.c
r1051r1052
334334   laserdisc_vsync(discinfo);
335335}
336336
337static const gfx_decode gfxdecodeinfo[] =
338{
339    { REGION_GFX1, 0, &gfx_8x8x1,  0, 1 },      /* CHARACTERS */
337static GFXDECODE_START( segald )
338    GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x1,  0, 1 )      /* CHARACTERS */
340339   /* SPRITES are apparently non-uniform in width - not straightforward to decode */
341   { -1 }
342};
340GFXDECODE_END
343341
344342
345343/* DRIVER */
r1051r1052
362360   MDRV_SCREEN_SIZE(32*8, 32*8)
363361   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
364362
365   MDRV_GFXDECODE(gfxdecodeinfo)
363   MDRV_GFXDECODE(segald)
366364   MDRV_PALETTE_LENGTH(256)
367365   MDRV_VIDEO_UPDATE(astron)
368366
src/mame/drivers/cabal.c
r1051r1052
510510   64*16
511511};
512512
513static const gfx_decode cabal_gfxdecodeinfo[] =
514{
515   { REGION_GFX1, 0, &text_layout,      0, 1024/4 },
516   { REGION_GFX2, 0, &tile_layout,      32*16, 16 },
517   { REGION_GFX3, 0, &sprite_layout,   16*16, 16 },
518   { -1 }
519};
513static GFXDECODE_START( cabal )
514   GFXDECODE_ENTRY( REGION_GFX1, 0, text_layout,      0, 1024/4 )
515   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,      32*16, 16 )
516   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite_layout,   16*16, 16 )
517GFXDECODE_END
520518
521519
522520
r1051r1052
565563   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
566564   MDRV_SCREEN_SIZE(256, 256)
567565   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
568   MDRV_GFXDECODE(cabal_gfxdecodeinfo)
566   MDRV_GFXDECODE(cabal)
569567   MDRV_PALETTE_LENGTH(1024)
570568
571569   MDRV_VIDEO_START(cabal)
572570   MDRV_VIDEO_UPDATE(cabal)
573571
574572   /* sound hardware */
575   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
573   MDRV_SPEAKER_STANDARD_MONO("mono")
576574
577575   MDRV_SOUND_ADD(YM2151, 3579580)
578576   MDRV_SOUND_CONFIG(ym2151_interface)
579   MDRV_SOUND_ROUTE(0, "left", 0.80)
580   MDRV_SOUND_ROUTE(1, "right", 0.80)
577   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.80)
581578
582579   MDRV_SOUND_ADD(CUSTOM, 8000)
583580   MDRV_SOUND_CONFIG(adpcm_interface)
584   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.40)
585   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.40)
581   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.40)
586582
583
587584   MDRV_SOUND_ADD(CUSTOM, 8000)
588585   MDRV_SOUND_CONFIG(adpcm_interface)
589   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.40)
590   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.40)
586   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.40)
591587MACHINE_DRIVER_END
592588
593589static MACHINE_DRIVER_START( cabalbl )
r1051r1052
612608   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
613609   MDRV_SCREEN_SIZE(256, 256)
614610   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
615   MDRV_GFXDECODE(cabal_gfxdecodeinfo)
611   MDRV_GFXDECODE(cabal)
616612   MDRV_PALETTE_LENGTH(1024)
617613
618614   MDRV_VIDEO_START(cabal)
619615   MDRV_VIDEO_UPDATE(cabal)
620616
621617   /* sound hardware */
622   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
618   MDRV_SPEAKER_STANDARD_MONO("mono")
623619
624620   MDRV_SOUND_ADD(YM2151, 3579580)
625621   MDRV_SOUND_CONFIG(cabalbl_ym2151_interface)
626   MDRV_SOUND_ROUTE(0, "left", 0.80)
627   MDRV_SOUND_ROUTE(1, "right", 0.80)
622   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.80)
628623
629624   MDRV_SOUND_ADD(CUSTOM, 8000)
630625   MDRV_SOUND_CONFIG(cabalbl_adpcm_interface)
631   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.40)
632   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.40)
626   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
633627
634628   MDRV_SOUND_ADD(CUSTOM, 8000)
635629   MDRV_SOUND_CONFIG(cabalbl_adpcm_interface)
636   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.40)
637   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.40)
630   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
638631MACHINE_DRIVER_END
639632
633ROM_START( cabal )
634   ROM_REGION( 0x50000, REGION_CPU1, 0 )   /* 64k for cpu code */
635   ROM_LOAD16_BYTE( "13.bin",    0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
636   ROM_LOAD16_BYTE( "11.bin",    0x00001, 0x10000, CRC(96d5e8af) SHA1(1d6da95ef96d9c02aea70791e1cb87b70097d5ed) )
637   ROM_LOAD16_BYTE( "12.bin",    0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
638   ROM_LOAD16_BYTE( "10.bin",    0x20001, 0x10000, CRC(96d5e8af) SHA1(ed7d854f08e87db5ae6cf526eafa029dfd2bfb9f) )
640639
640   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound cpu code */
641   ROM_LOAD( "4-3n",         0x0000, 0x2000, CRC(4038eff2) SHA1(0bcafc1b78c3bef9a0e9b822c482ea4a942fd180) )
642   ROM_LOAD( "3-3p",         0x8000, 0x8000, CRC(d9defcbf) SHA1(f26b10b1dbe5aa6446f70fd18e5f1379455578ec) )
641643
642ROM_START( cabal )
644   ROM_REGION( 0x4000,  REGION_GFX1, ROMREGION_DISPOSE )
645   ROM_LOAD( "5-6s",           0x00000, 0x04000, CRC(6a76955a) SHA1(733cb4b862b5dac97c2641b58f2362471e62fcf2) ) /* characters */
646
647   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
648   ROM_LOAD( "tad-2.7s",       0x00000, 0x80000, CRC(13ca7ae1) SHA1(b26bb4876a6518e3809e0fa4d442616508b3e7e8) ) /* tiles */
649#if 0   /* same data, different layout */
650   ROM_LOAD16_BYTE( "cabal_17.bin",   0x00000, 0x10000, CRC(3b6d2b09) )
651   ROM_LOAD16_BYTE( "cabal_15.bin",   0x00001, 0x10000, CRC(1023319b) )
652   ROM_LOAD16_BYTE( "cabal_16.bin",   0x20000, 0x10000, CRC(77bc7a60) )
653   ROM_LOAD16_BYTE( "cabal_14.bin",   0x20001, 0x10000, CRC(420b0801) )
654   ROM_LOAD16_BYTE( "cabal_18.bin",   0x40000, 0x10000, CRC(0bc50075) )
655   ROM_LOAD16_BYTE( "cabal_12.bin",   0x40001, 0x10000, CRC(543fcb37) )
656   ROM_LOAD16_BYTE( "cabal_19.bin",   0x60000, 0x10000, CRC(67e4fe47) )
657   ROM_LOAD16_BYTE( "cabal_13.bin",   0x60001, 0x10000, CRC(d28d921e) )
658#endif
659
660   ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE )
661   ROM_LOAD( "tad-1.5e",       0x00000, 0x80000, CRC(8324a7fe) SHA1(aed4470df35ec18e65e35bddc9c217a5019fdcbf) ) /* sprites */
662#if 0   /* same data, different layout */
663   ROM_LOAD16_BYTE( "cabal_05.bin",   0x00000, 0x10000, CRC(4e49c28e) )
664   ROM_LOAD16_BYTE( "cabal_04.bin",   0x00001, 0x10000, CRC(34d3cac8) )
665   ROM_LOAD16_BYTE( "cabal_06.bin",   0x20000, 0x10000, CRC(6a0e739d) )
666   ROM_LOAD16_BYTE( "cabal_03.bin",   0x20001, 0x10000, CRC(7065e840) )
667   ROM_LOAD16_BYTE( "cabal_07.bin",   0x40000, 0x10000, CRC(581a50c1) )
668   ROM_LOAD16_BYTE( "cabal_02.bin",   0x40001, 0x10000, CRC(0e1ec30e) )
669   ROM_LOAD16_BYTE( "cabal_08.bin",   0x60000, 0x10000, CRC(702735c9) )
670   ROM_LOAD16_BYTE( "cabal_01.bin",   0x60001, 0x10000, CRC(55c44764) )
671#endif
672
673   ROM_REGION( 0x20000, REGION_SOUND1, 0 )   /* Samples? */
674   ROM_LOAD( "2-1s",           0x00000, 0x10000, CRC(850406b4) SHA1(23ac1650c6d6f35607a5264b3aa89868401a645a) )
675   ROM_LOAD( "1-1u",           0x10000, 0x10000, CRC(8b3e0789) SHA1(b1450db1b1bada237c90930623e4def321099f13) )
676
677ROM_END
678
679ROM_START( cabalus )
643680   ROM_REGION( 0x50000, REGION_CPU1, 0 )   /* 64k for cpu code */
644681   ROM_LOAD16_BYTE( "h7_512.bin",      0x00000, 0x10000, CRC(8fe16fb4) SHA1(fedb2d0c6c21516f68cfa99093772fe8fa862389) )
645682   ROM_LOAD16_BYTE( "h6_512.bin",      0x00001, 0x10000, CRC(6968101c) SHA1(d65005ac235dae5c32bbcd182cb365e8fa067fe7) )
src/mame/drivers/suprloco.c
r1051r1052
173173};
174174
175175
176static const gfx_decode gfxdecodeinfo[] =
177{
176static GFXDECODE_START( suprloco )
178177   /* sprites use colors 256-511 + 512-767 */
179   { REGION_GFX1, 0x6000, &charlayout, 0, 16 },
180   { -1 }
181};
178   GFXDECODE_ENTRY( REGION_GFX1, 0x6000, charlayout, 0, 16 )
179GFXDECODE_END
182180
183181
184182
r1051r1052
202200   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
203201   MDRV_SCREEN_SIZE(32*8, 32*8)
204202   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 28*8-1)
205   MDRV_GFXDECODE(gfxdecodeinfo)
203   MDRV_GFXDECODE(suprloco)
206204   MDRV_PALETTE_LENGTH(512+256)
207205
208206   MDRV_PALETTE_INIT(suprloco)
src/mame/drivers/m92.c
r1051r1052
913913   32*8
914914};
915915
916static const gfx_decode gfxdecodeinfo[] =
917{
918   { REGION_GFX1, 0, &charlayout,   0, 128 },
919   { REGION_GFX2, 0, &spritelayout, 0, 128 },
920   { -1 }
921};
916static GFXDECODE_START( m92 )
917   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 128 )
918   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 128 )
919GFXDECODE_END
922920
923static const gfx_decode gfxdecodeinfo2[] =
924{
925   { REGION_GFX1, 0, &charlayout,    0, 128 },
926   { REGION_GFX2, 0, &spritelayout2, 0, 128 },
927   { -1 }
928};
921static GFXDECODE_START( 2 )
922   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,    0, 128 )
923   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout2, 0, 128 )
924GFXDECODE_END
929925
930926/***************************************************************************/
931927
r1051r1052
974970   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
975971   MDRV_SCREEN_SIZE(512, 256)
976972   MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */
977   MDRV_GFXDECODE(gfxdecodeinfo)
973   MDRV_GFXDECODE(m92)
978974   MDRV_PALETTE_LENGTH(2048)
979975
980976   MDRV_VIDEO_START(m92)
r1051r1052
10071003   MDRV_IMPORT_FROM(m92)
10081004
10091005   /* video hardware */
1010   MDRV_GFXDECODE(gfxdecodeinfo2)
1006   MDRV_GFXDECODE(2)
10111007MACHINE_DRIVER_END
10121008
10131009/***************************************************************************/
src/mame/drivers/hal21.c
r1051r1052
539539   256
540540};
541541
542static const gfx_decode aso_gfxdecodeinfo[] =
543{
542static GFXDECODE_START( aso )
544543   /* colors 512-1023 are currently unused, I think they are a second bank */
545   { REGION_GFX1, 0, &char256,    128*3,  8 }, /* colors 384..511 */
546   { REGION_GFX2, 0, &char1024,   128*1, 16 }, /* colors 128..383 */
547   { REGION_GFX3, 0, &sprite1024, 128*0, 16 }, /* colors   0..127 */
548   { -1 }
549};
544   GFXDECODE_ENTRY( REGION_GFX1, 0, char256,    128*3,  8 ) /* colors 384..511 */
545   GFXDECODE_ENTRY( REGION_GFX2, 0, char1024,   128*1, 16 ) /* colors 128..383 */
546   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite1024, 128*0, 16 ) /* colors   0..127 */
547GFXDECODE_END
550548
551549/**************************************************************************/
552550
r1051r1052
721719   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
722720   MDRV_SCREEN_SIZE(36*8, 28*8)
723721   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
724   MDRV_GFXDECODE(aso_gfxdecodeinfo)
722   MDRV_GFXDECODE(aso)
725723   MDRV_PALETTE_LENGTH(1024)
726724
727725   MDRV_MACHINE_RESET(aso)
r1051r1052
764762   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
765763   MDRV_SCREEN_SIZE(36*8, 28*8)
766764   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
767   MDRV_GFXDECODE(aso_gfxdecodeinfo)
765   MDRV_GFXDECODE(aso)
768766   MDRV_PALETTE_LENGTH(1024)
769767
770768   MDRV_MACHINE_RESET(aso)
src/mame/drivers/fcombat.c
r1051r1052
280280};
281281
282282
283static const gfx_decode gfxdecodeinfo[] =
284{
285   { REGION_GFX1, 0, &charlayout,         0, 64 },
286   { REGION_GFX2, 0, &spritelayout,     256, 64 },
287   { REGION_GFX3, 0, &spritelayout,     512, 64 },
288   { -1 }
289};
283static GFXDECODE_START( fcombat )
284   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0, 64 )
285   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,     256, 64 )
286   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,     512, 64 )
287GFXDECODE_END
290288
291289/*************************************
292290 *
r1051r1052
323321   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
324322   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
325323   MDRV_SCREEN_RAW_PARAMS(FCOMBAT_PIXEL_CLOCK, FCOMBAT_HTOTAL, FCOMBAT_HBEND, FCOMBAT_HBSTART, FCOMBAT_VTOTAL, FCOMBAT_VBEND, FCOMBAT_VBSTART)
326   MDRV_GFXDECODE(gfxdecodeinfo)
324   MDRV_GFXDECODE(fcombat)
327325   MDRV_PALETTE_LENGTH(32)
328326   MDRV_COLORTABLE_LENGTH(256*3)
329327
src/mame/drivers/destroyr.c
r1051r1052
314314};
315315
316316
317static const gfx_decode destroyr_gfx_decode_info[] =
318{
319   { REGION_GFX1, 0, &destroyr_alpha_num_layout, 4, 1 },
320   { REGION_GFX2, 0, &destroyr_minor_object_layout, 4, 1 },
321   { REGION_GFX3, 0, &destroyr_major_object_layout, 0, 1 },
322   { REGION_GFX4, 0, &destroyr_waves_layout, 4, 1 },
323   { -1 }
324};
317static GFXDECODE_START( destroyr )
318   GFXDECODE_ENTRY( REGION_GFX1, 0, destroyr_alpha_num_layout, 4, 1 )
319   GFXDECODE_ENTRY( REGION_GFX2, 0, destroyr_minor_object_layout, 4, 1 )
320   GFXDECODE_ENTRY( REGION_GFX3, 0, destroyr_major_object_layout, 0, 1 )
321   GFXDECODE_ENTRY( REGION_GFX4, 0, destroyr_waves_layout, 4, 1 )
322GFXDECODE_END
325323
326324
327325static PALETTE_INIT( destroyr )
r1051r1052
353351   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
354352   MDRV_SCREEN_SIZE(256, 262)
355353   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
356   MDRV_GFXDECODE(destroyr_gfx_decode_info)
354   MDRV_GFXDECODE(destroyr)
357355   MDRV_PALETTE_LENGTH(8)
358356   MDRV_PALETTE_INIT(destroyr)
359357   MDRV_VIDEO_UPDATE(destroyr)
src/mame/drivers/segas16b.c
r1051r1052
31093109 *
31103110 *************************************/
31113111
3112static const gfx_decode gfxdecodeinfo[] =
3113{
3114   { REGION_GFX1, 0, &gfx_8x8x3_planar,   0, 1024 },
3115   { -1 }
3116};
3112static GFXDECODE_START( segas16b )
3113   GFXDECODE_ENTRY( REGION_GFX1, 0, gfx_8x8x3_planar,   0, 1024 )
3114GFXDECODE_END
31173115
31183116
31193117
r1051r1052
31413139
31423140   /* video hardware */
31433141   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
3144   MDRV_GFXDECODE(gfxdecodeinfo)
3142   MDRV_GFXDECODE(segas16b)
31453143   MDRV_PALETTE_LENGTH(2048*3)
31463144
31473145   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/thoop2.c
r1051r1052
4848};
4949
5050
51static const gfx_decode thoop2_gfxdecodeinfo[] =
52{
53   { REGION_GFX1, 0x000000, &thoop2_tilelayout, 0,      64 },
54   { REGION_GFX1, 0x000000, &thoop2_tilelayout_16, 0,   64 },
55   { -1 }
56};
51static GFXDECODE_START( thoop2 )
52   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, thoop2_tilelayout, 0,      64 )
53   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, thoop2_tilelayout_16, 0,   64 )
54GFXDECODE_END
5755
5856
5957static ADDRESS_MAP_START( thoop2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r1051r1052
210208   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
211209   MDRV_SCREEN_SIZE(32*16, 32*16)
212210   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
213   MDRV_GFXDECODE(thoop2_gfxdecodeinfo)
211   MDRV_GFXDECODE(thoop2)
214212   MDRV_PALETTE_LENGTH(1024)
215213
216214   MDRV_VIDEO_START(thoop2)
src/mame/drivers/wwfwfest.c
r1051r1052
356356   32*8   /* every tile takes 32 consecutive bytes */
357357};
358358
359static const gfx_decode gfxdecodeinfo[] =
360{
361   { REGION_GFX1, 0, &tiles8x8_layout, 0x0000, 16 },
362   { REGION_GFX2, 0, &sprite_layout,   0x0400, 16 },
363   { REGION_GFX3, 0, &tile_layout,     0x1000, 16 },
364   { REGION_GFX3, 0, &tile_layout,     0x0c00, 16 },
365   { -1 }
366};
359static GFXDECODE_START( wwfwfest )
360   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0x0000, 16 )
361   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout,   0x0400, 16 )
362   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,     0x1000, 16 )
363   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,     0x0c00, 16 )
364GFXDECODE_END
367365
368366/*******************************************************************************
369367 Interrupt Function
r1051r1052
420418   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
421419   MDRV_SCREEN_SIZE(320, 256)
422420   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1*8, 31*8-1)
423   MDRV_GFXDECODE(gfxdecodeinfo)
421   MDRV_GFXDECODE(wwfwfest)
424422   MDRV_PALETTE_LENGTH(8192)
425423
426424   MDRV_VIDEO_START(wwfwfest)
src/mame/drivers/marineb.c
r1051r1052
475475};
476476
477477
478static const gfx_decode marineb_gfxdecodeinfo[] =
479{
480   { REGION_GFX1, 0x0000, &marineb_charlayout,          0, 64 },
481   { REGION_GFX2, 0x0000, &marineb_small_spritelayout,  0, 64 },
482   { REGION_GFX2, 0x0000, &marineb_big_spritelayout,    0, 64 },
483   { -1 }
484};
478static GFXDECODE_START( marineb )
479   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, marineb_charlayout,          0, 64 )
480   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, marineb_small_spritelayout,  0, 64 )
481   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, marineb_big_spritelayout,    0, 64 )
482GFXDECODE_END
485483
486static const gfx_decode wanted_gfxdecodeinfo[] =
487{
488   { REGION_GFX1, 0x0000, &wanted_charlayout,           0, 64 },
489   { REGION_GFX2, 0x0000, &marineb_small_spritelayout,  0, 64 },
490   { REGION_GFX2, 0x0000, &marineb_big_spritelayout,    0, 64 },
491   { -1 }
492};
484static GFXDECODE_START( wanted )
485   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, wanted_charlayout,           0, 64 )
486   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, marineb_small_spritelayout,  0, 64 )
487   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, marineb_big_spritelayout,    0, 64 )
488GFXDECODE_END
493489
494static const gfx_decode changes_gfxdecodeinfo[] =
495{
496   { REGION_GFX1, 0x0000, &marineb_charlayout,          0, 64 },
497   { REGION_GFX2, 0x0000, &changes_small_spritelayout,  0, 64 },
498   { REGION_GFX2, 0x1000, &changes_big_spritelayout,    0, 64 },
499   { -1 }
500};
490static GFXDECODE_START( changes )
491   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, marineb_charlayout,          0, 64 )
492   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, changes_small_spritelayout,  0, 64 )
493   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, changes_big_spritelayout,    0, 64 )
494GFXDECODE_END
501495
502static const gfx_decode hoccer_gfxdecodeinfo[] =
503{
504   { REGION_GFX1, 0x0000, &marineb_charlayout,          0, 16 },   /* no palette banks */
505   { REGION_GFX2, 0x0000, &changes_small_spritelayout,  0, 16 },   /* no palette banks */
506   { -1 }
507};
496static GFXDECODE_START( hoccer )
497   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, marineb_charlayout,          0, 16 )   /* no palette banks */
498   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, changes_small_spritelayout,  0, 16 )   /* no palette banks */
499GFXDECODE_END
508500
509static const gfx_decode hopprobo_gfxdecodeinfo[] =
510{
511   { REGION_GFX1, 0x0000, &hopprobo_charlayout,         0, 64 },
512   { REGION_GFX2, 0x0000, &marineb_small_spritelayout,  0, 64 },
513   { REGION_GFX2, 0x0000, &marineb_big_spritelayout,    0, 64 },
514   { -1 }
515};
501static GFXDECODE_START( hopprobo )
502   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, hopprobo_charlayout,         0, 64 )
503   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, marineb_small_spritelayout,  0, 64 )
504   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, marineb_big_spritelayout,    0, 64 )
505GFXDECODE_END
516506
517507
518508static MACHINE_DRIVER_START( marineb )
r1051r1052
533523   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
534524   MDRV_SCREEN_SIZE(32*8, 32*8)
535525   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
536   MDRV_GFXDECODE(marineb_gfxdecodeinfo)
526   MDRV_GFXDECODE(marineb)
537527   MDRV_PALETTE_LENGTH(256)
538528
539529   MDRV_PALETTE_INIT(espial)
r1051r1052
553543   MDRV_IMPORT_FROM(marineb)
554544
555545   /* video hardware */
556   MDRV_GFXDECODE(changes_gfxdecodeinfo)
546   MDRV_GFXDECODE(changes)
557547   MDRV_VIDEO_UPDATE(changes)
558548MACHINE_DRIVER_END
559549
r1051r1052
575565   MDRV_IMPORT_FROM(marineb)
576566
577567   /* video hardware */
578   MDRV_GFXDECODE(hoccer_gfxdecodeinfo)
568   MDRV_GFXDECODE(hoccer)
579569   MDRV_VIDEO_UPDATE(hoccer)
580570MACHINE_DRIVER_END
581571
r1051r1052
589579   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
590580
591581   /* video hardware */
592   MDRV_GFXDECODE(wanted_gfxdecodeinfo)
582   MDRV_GFXDECODE(wanted)
593583   MDRV_VIDEO_UPDATE(springer)
594584
595585   /* sound hardware */
r1051r1052
607597   MDRV_IMPORT_FROM(marineb)
608598
609599   /* video hardware */
610   MDRV_GFXDECODE(hopprobo_gfxdecodeinfo)
600   MDRV_GFXDECODE(hopprobo)
611601   MDRV_VIDEO_UPDATE(hopprobo)
612602MACHINE_DRIVER_END
613603
src/mame/drivers/pktgaldx.c
r1051r1052
319319   32*32
320320};
321321
322static const gfx_decode gfxdecodeinfo[] =
323{
324   { REGION_GFX1, 0, &tile_8x8_layout,     0, 32 },   /* Tiles (8x8) */
325   { REGION_GFX1, 0, &tile_16x16_layout,   0, 32 },   /* Tiles (16x16) */
326   { REGION_GFX2, 0, &spritelayout,      512, 32 },   /* Sprites (16x16) */
327   { -1 }
328};
322static GFXDECODE_START( pktgaldx )
323   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_8x8_layout,     0, 32 )   /* Tiles (8x8) */
324   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_16x16_layout,   0, 32 )   /* Tiles (16x16) */
325   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,      512, 32 )   /* Sprites (16x16) */
326GFXDECODE_END
329327
330328static const gfx_layout bootleg_spritelayout =
331329{
r1051r1052
339337   16*64
340338};
341339
342static const gfx_decode bootleg_gfxdecodeinfo[] =
343{
344   { REGION_GFX1, 0, &bootleg_spritelayout,     0, 64 },
345   { -1 }
346};
340static GFXDECODE_START( bootleg )
341   GFXDECODE_ENTRY( REGION_GFX1, 0, bootleg_spritelayout,     0, 64 )
342GFXDECODE_END
347343
348344
349345static MACHINE_DRIVER_START( pktgaldx )
r1051r1052
361357   MDRV_SCREEN_SIZE(40*8, 32*8)
362358   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
363359   MDRV_PALETTE_LENGTH(4096)
364   MDRV_GFXDECODE(gfxdecodeinfo)
360   MDRV_GFXDECODE(pktgaldx)
365361
366362   MDRV_VIDEO_START(pktgaldx)
367363   MDRV_VIDEO_UPDATE(pktgaldx)
r1051r1052
396392   MDRV_SCREEN_SIZE(40*8, 32*8)
397393   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
398394   MDRV_PALETTE_LENGTH(4096)
399   MDRV_GFXDECODE(bootleg_gfxdecodeinfo)
395   MDRV_GFXDECODE(bootleg)
400396
401397   MDRV_VIDEO_START(pktgaldb)
402398   MDRV_VIDEO_UPDATE(pktgaldb)
src/mame/drivers/timeplt.c
r1051r1052
274274};
275275
276276
277static const gfx_decode gfxdecodeinfo[] =
278{
279   { REGION_GFX1, 0, &charlayout,        0, 32 },
280   { REGION_GFX2, 0, &spritelayout,   32*4, 64 },
281   { -1 }
282};
277static GFXDECODE_START( timeplt )
278   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,        0, 32 )
279   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   32*4, 64 )
280GFXDECODE_END
283281
284282
285283
r1051r1052
302300   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
303301   MDRV_SCREEN_SIZE(32*8, 32*8)
304302   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
305   MDRV_GFXDECODE(gfxdecodeinfo)
303   MDRV_GFXDECODE(timeplt)
306304   MDRV_PALETTE_LENGTH(32)
307305   MDRV_COLORTABLE_LENGTH(32*4+64*4)
308306
src/mame/drivers/multigam.c
r1051r1052
256256   multigam_mapper_w( 0x0fff, 0x01 );
257257}
258258
259static const gfx_decode multigam_gfxdecodeinfo[] =
260{
259static GFXDECODE_START( multigam )
261260   /* none, the ppu generates one */
262   { -1 }
263};
261GFXDECODE_END
264262
265263static MACHINE_DRIVER_START( multigam )
266264   /* basic machine hardware */
r1051r1052
276274   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
277275   MDRV_SCREEN_SIZE(32*8, 262)
278276   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
279   MDRV_GFXDECODE(multigam_gfxdecodeinfo)
277   MDRV_GFXDECODE(multigam)
280278   MDRV_PALETTE_LENGTH(8*4*16)
281279   MDRV_COLORTABLE_LENGTH(4*8)
282280
src/mame/drivers/atarigx2.c
r1051r1052
14131413   32*8
14141414};
14151415
1416static const gfx_decode gfxdecodeinfo[] =
1417{
1418   { REGION_GFX1, 0, &pflayout, 0x000, 64 },
1419   { REGION_GFX2, 0, &anlayout, 0x000, 16 },
1420   { REGION_GFX1, 0, &pftoplayout, 0x000, 64 },
1421   { -1 }
1422};
1416static GFXDECODE_START( atarigx2 )
1417   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout, 0x000, 64 )
1418   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout, 0x000, 16 )
1419   GFXDECODE_ENTRY( REGION_GFX1, 0, pftoplayout, 0x000, 64 )
1420GFXDECODE_END
14231421
14241422
14251423
r1051r1052
14411439
14421440   /* video hardware */
14431441   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
1444   MDRV_GFXDECODE(gfxdecodeinfo)
1442   MDRV_GFXDECODE(atarigx2)
14451443   MDRV_PALETTE_LENGTH(2048)
14461444
14471445   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/fuukifg2.c
r1051r1052
482482   16*16*4
483483};
484484
485static const gfx_decode fuuki16_gfxdecodeinfo[] =
486{
487   { REGION_GFX1, 0, &layout_16x16x4, 0x400*2, 0x40 }, // [0] Sprites
488   { REGION_GFX2, 0, &layout_16x16x4, 0x400*0, 0x40 }, // [1] Layer 0
489   { REGION_GFX3, 0, &layout_16x16x8, 0x400*1, 0x40 }, // [2] Layer 1
490   { REGION_GFX4, 0, &layout_8x8x4,   0x400*3, 0x40 }, // [3] Layer 2
491   { REGION_GFX4, 0, &layout_8x8x4,   0x400*3, 0x40 }, // [4] Layer 3 (GFX4!)
492   { -1 }
493};
485static GFXDECODE_START( fuuki16 )
486   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0x400*2, 0x40 ) // [0] Sprites
487   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0x400*0, 0x40 ) // [1] Layer 0
488   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8, 0x400*1, 0x40 ) // [2] Layer 1
489   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x400*3, 0x40 ) // [3] Layer 2
490   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x400*3, 0x40 ) // [4] Layer 3 (GFX4!)
491GFXDECODE_END
494492
495493
496494/***************************************************************************
r1051r1052
580578   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
581579   MDRV_SCREEN_SIZE(320, 256)
582580   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-16-1)
583   MDRV_GFXDECODE(fuuki16_gfxdecodeinfo)
581   MDRV_GFXDECODE(fuuki16)
584582   MDRV_PALETTE_LENGTH(0x800*4)
585583
586584   MDRV_VIDEO_START(fuuki16)
src/mame/drivers/vulgus.c
r1051r1052
231231
232232
233233
234static const gfx_decode gfxdecodeinfo[] =
235{
236   { REGION_GFX1, 0, &charlayout,           0, 64 },
237   { REGION_GFX2, 0, &tilelayout,  64*4+16*16, 32*4 },
238   { REGION_GFX3, 0, &spritelayout,      64*4, 16 },
239   { -1 }
240};
234static GFXDECODE_START( vulgus )
235   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,           0, 64 )
236   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  64*4+16*16, 32*4 )
237   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,      64*4, 16 )
238GFXDECODE_END
241239
242240
243241
r1051r1052
262260   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
263261   MDRV_SCREEN_SIZE(32*8, 32*8)
264262   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
265   MDRV_GFXDECODE(gfxdecodeinfo)
263   MDRV_GFXDECODE(vulgus)
266264   MDRV_PALETTE_LENGTH(64*4+16*16+4*32*8)
267265
268266   MDRV_PALETTE_INIT(vulgus)
src/mame/drivers/circus.c
r1051r1052
245245   8
246246};
247247
248static const gfx_decode gfxdecodeinfo[] =
249{
250   { REGION_GFX1, 0, &charlayout,  0, 1 },
251   { REGION_GFX2, 0, &clownlayout, 0, 1 },
252   { -1 }
253};
248static GFXDECODE_START( circus )
249   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 1 )
250   GFXDECODE_ENTRY( REGION_GFX2, 0, clownlayout, 0, 1 )
251GFXDECODE_END
254252
255static const gfx_decode robotbwl_gfxdecodeinfo[] =
256{
257   { REGION_GFX1, 0, &charlayout,  0, 1 },
258   { REGION_GFX2, 0, &robotlayout, 0, 1 },
259   { -1 }
260};
253static GFXDECODE_START( robotbwl )
254   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 1 )
255   GFXDECODE_ENTRY( REGION_GFX2, 0, robotlayout, 0, 1 )
256GFXDECODE_END
261257
262258
263259
r1051r1052
286282   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
287283   MDRV_SCREEN_SIZE(32*8, 32*8)
288284   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1)
289   MDRV_GFXDECODE(gfxdecodeinfo)
285   MDRV_GFXDECODE(circus)
290286   MDRV_PALETTE_LENGTH(2)
291287
292288   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
301297   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
302298
303299   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
304   MDRV_SOUND_CONFIG(circus_discrete_interface)
300   MDRV_SOUND_CONFIG_DISCRETE(circus)
305301   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
306302MACHINE_DRIVER_END
307303
r1051r1052
321317   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
322318   MDRV_SCREEN_SIZE(32*8, 32*8)
323319   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1)
324   MDRV_GFXDECODE(robotbwl_gfxdecodeinfo)
320   MDRV_GFXDECODE(robotbwl)
325321   MDRV_PALETTE_LENGTH(2)
326322
327323   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
336332   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
337333
338334   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
339   MDRV_SOUND_CONFIG(robotbwl_discrete_interface)
335   MDRV_SOUND_CONFIG_DISCRETE(robotbwl)
340336   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
341337MACHINE_DRIVER_END
342338
r1051r1052
355351   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
356352   MDRV_SCREEN_SIZE(32*8, 32*8)
357353   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1)
358   MDRV_GFXDECODE(gfxdecodeinfo)
354   MDRV_GFXDECODE(circus)
359355   MDRV_PALETTE_LENGTH(2)
360356
361357   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
370366   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
371367
372368   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
373   MDRV_SOUND_CONFIG(crash_discrete_interface)
369   MDRV_SOUND_CONFIG_DISCRETE(crash)
374370   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
375371MACHINE_DRIVER_END
376372
r1051r1052
389385   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
390386   MDRV_SCREEN_SIZE(32*8, 32*8)
391387   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1)
392   MDRV_GFXDECODE(gfxdecodeinfo)
388   MDRV_GFXDECODE(circus)
393389   MDRV_PALETTE_LENGTH(2)
394390
395391   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
404400   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
405401
406402   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
407   MDRV_SOUND_CONFIG(circus_discrete_interface)
403   MDRV_SOUND_CONFIG_DISCRETE(circus)
408404   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
409405MACHINE_DRIVER_END
410406
src/mame/drivers/sderby.c
r1051r1052
244244
245245
246246
247static const gfx_decode gfxdecodeinfo[] =
248{
249   { REGION_GFX1, 0, &tiles8x8_layout,   0x000, 256  }, /* sprites */
250   { REGION_GFX1, 0, &tiles16x16_layout,   0x000, 256  }, /* sprites */
247static GFXDECODE_START( sderby )
248   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout,   0x000, 256  ) /* sprites */
249   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16_layout,   0x000, 256  ) /* sprites */
251250
252   { -1 }
253};
251GFXDECODE_END
254252
255253static MACHINE_DRIVER_START( sderby )
256254   MDRV_CPU_ADD(M68000, 12000000)
r1051r1052
260258   MDRV_SCREEN_REFRESH_RATE(60)
261259   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
262260
263   MDRV_GFXDECODE(gfxdecodeinfo)
261   MDRV_GFXDECODE(sderby)
264262
265263   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
266264   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
r1051r1052
287285   MDRV_SCREEN_REFRESH_RATE(60)
288286   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
289287
290   MDRV_GFXDECODE(gfxdecodeinfo)
288   MDRV_GFXDECODE(sderby)
291289
292290   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
293291   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/zac2650.c
r1051r1052
313313   s2636_character16_yoffset
314314};
315315
316static const gfx_decode tinvader_gfxdecodeinfo[] =
317{
318   { REGION_GFX1, 0, &tinvader_character,  0, 2 },
319     { REGION_CPU1, 0x1F00, &s2636_character8, 0, 2 },   /* dynamic */
320     { REGION_CPU1, 0x1F00, &s2636_character16, 0, 2 },   /* dynamic */
321   { -1 }
322};
316static GFXDECODE_START( tinvader )
317   GFXDECODE_ENTRY( REGION_GFX1, 0, tinvader_character,  0, 2 )
318     GFXDECODE_ENTRY( REGION_CPU1, 0x1F00, s2636_character8, 0, 2 )   /* dynamic */
319     GFXDECODE_ENTRY( REGION_CPU1, 0x1F00, s2636_character16, 0, 2 )   /* dynamic */
320GFXDECODE_END
323321
324322static MACHINE_DRIVER_START( tinvader )
325323
r1051r1052
336334   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
337335   MDRV_SCREEN_SIZE(30*24, 32*24)
338336   MDRV_SCREEN_VISIBLE_AREA(0, 719, 0, 767)
339   MDRV_GFXDECODE(tinvader_gfxdecodeinfo)
337   MDRV_GFXDECODE(tinvader)
340338   MDRV_PALETTE_LENGTH(2)
341339   MDRV_COLORTABLE_LENGTH(4)
342340
src/mame/drivers/shangha3.c
r1051r1052
470470   128*8
471471};
472472
473static const gfx_decode gfxdecodeinfo[] =
474{
475   { REGION_GFX1, 0, &charlayout, 0, 128 },
476   { -1 }
477};
473static GFXDECODE_START( shangha3 )
474   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 128 )
475GFXDECODE_END
478476
479477
480478
r1051r1052
510508   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
511509   MDRV_SCREEN_SIZE(24*16, 16*16)
512510   MDRV_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1)
513   MDRV_GFXDECODE(gfxdecodeinfo)
511   MDRV_GFXDECODE(shangha3)
514512   MDRV_PALETTE_LENGTH(2048)
515513
516514   MDRV_VIDEO_START(shangha3)
r1051r1052
548546   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
549547   MDRV_SCREEN_SIZE(24*16, 16*16)
550548   MDRV_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1)
551   MDRV_GFXDECODE(gfxdecodeinfo)
549   MDRV_GFXDECODE(shangha3)
552550   MDRV_PALETTE_LENGTH(2048)
553551
554552   MDRV_VIDEO_START(shangha3)
r1051r1052
587585   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
588586   MDRV_SCREEN_SIZE(24*16, 16*16)
589587   MDRV_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1)
590   MDRV_GFXDECODE(gfxdecodeinfo)
588   MDRV_GFXDECODE(shangha3)
591589   MDRV_PALETTE_LENGTH(2048)
592590
593591   MDRV_VIDEO_START(shangha3)
src/mame/drivers/pkscram.c
r1051r1052
254254};
255255
256256
257static const gfx_decode gfxdecodeinfo[] =
258{
259   { REGION_GFX1, 0, &tiles8x8_layout, 0, 0x80 },
260   { -1 }
261};
257static GFXDECODE_START( pkscram )
258   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 0x80 )
259GFXDECODE_END
262260
263261static void irqhandler(int irq)
264262{
r1051r1052
302300   MDRV_SCREEN_SIZE(32*8, 32*8)
303301   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 24*8-1)
304302   MDRV_PALETTE_LENGTH(0x800)
305   MDRV_GFXDECODE(gfxdecodeinfo)
303   MDRV_GFXDECODE(pkscram)
306304
307305   MDRV_VIDEO_START(pkscramble)
308306   MDRV_VIDEO_UPDATE(pkscramble)
src/mame/drivers/vastar.c
r1051r1052
302302   128*8
303303};
304304
305static const gfx_decode gfxdecodeinfo[] =
306{
307   { REGION_GFX1, 0, &charlayout,     0, 64 },
308   { REGION_GFX2, 0, &spritelayout,   0, 64 },
309   { REGION_GFX2, 0, &spritelayoutdw, 0, 64 },
310   { REGION_GFX3, 0, &charlayout,     0, 64 },
311   { REGION_GFX4, 0, &charlayout,     0, 64 },
312   { -1 }
313};
305static GFXDECODE_START( vastar )
306   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 64 )
307   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   0, 64 )
308   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayoutdw, 0, 64 )
309   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,     0, 64 )
310   GFXDECODE_ENTRY( REGION_GFX4, 0, charlayout,     0, 64 )
311GFXDECODE_END
314312
315313
316314
r1051r1052
346344   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
347345   MDRV_SCREEN_SIZE(32*8, 32*8)
348346   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
349   MDRV_GFXDECODE(gfxdecodeinfo)
347   MDRV_GFXDECODE(vastar)
350348   MDRV_PALETTE_LENGTH(256)
351349
352350   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/taotaido.c
r1051r1052
339339   128*8
340340};
341341
342static const gfx_decode gfxdecodeinfo[] =
343{
344   { REGION_GFX1, 0, &taotaido_layout,  0x000, 256  }, /* sprites */
345   { REGION_GFX2, 0, &taotaido_layout,  0x300, 256  }, /* bg tiles */
346   { -1 }
347};
342static GFXDECODE_START( taotaido )
343   GFXDECODE_ENTRY( REGION_GFX1, 0, taotaido_layout,  0x000, 256  ) /* sprites */
344   GFXDECODE_ENTRY( REGION_GFX2, 0, taotaido_layout,  0x300, 256  ) /* bg tiles */
345GFXDECODE_END
348346
349347static void irqhandler(int irq)
350348{
r1051r1052
372370   MDRV_SCREEN_REFRESH_RATE(60)
373371   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
374372
375   MDRV_GFXDECODE(gfxdecodeinfo)
373   MDRV_GFXDECODE(taotaido)
376374
377375   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
378376   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/fortecar.c
r1051r1052
108108   16*8
109109};
110110
111static const gfx_decode gfxdecodeinfo[] =
112{
113   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
114   { -1 }
115};
111static GFXDECODE_START( fortecar )
112   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
113GFXDECODE_END
116114
117115VIDEO_START(fortecar)
118116{
r1051r1052
156154   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
157155   MDRV_SCREEN_SIZE(512, 256)
158156   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
159   MDRV_GFXDECODE(gfxdecodeinfo)
157   MDRV_GFXDECODE(fortecar)
160158   MDRV_PALETTE_LENGTH(0x100)
161159
162160   MDRV_VIDEO_START(fortecar)
src/mame/drivers/relief.c
r1051r1052
305305};
306306
307307
308static const gfx_decode gfxdecodeinfo[] =
309{
310   { REGION_GFX1, 0, &pfmolayout,   0, 64 },      /* alpha & playfield */
311   { REGION_GFX1, 1, &pfmolayout, 256, 16 },      /* sprites */
312   { REGION_GFX2, 0, &moexlayout, 256, 16 },      /* extra sprite bit */
313   { -1 }
314};
308static GFXDECODE_START( relief )
309   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,   0, 64 )      /* alpha & playfield */
310   GFXDECODE_ENTRY( REGION_GFX1, 1, pfmolayout, 256, 16 )      /* sprites */
311   GFXDECODE_ENTRY( REGION_GFX2, 0, moexlayout, 256, 16 )      /* extra sprite bit */
312GFXDECODE_END
315313
316314
317315
r1051r1052
332330
333331   /* video hardware */
334332   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
335   MDRV_GFXDECODE(gfxdecodeinfo)
333   MDRV_GFXDECODE(relief)
336334   MDRV_PALETTE_LENGTH(2048)
337335
338336   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/taito_f3.c
r1051r1052
376376   128*8   /* every sprite takes 128 consecutive bytes */
377377};
378378
379static const gfx_decode gfxdecodeinfo[] =
380{
381   { 0,           0x000000, &charlayout,          0,  64 }, /* Dynamically modified */
382   { REGION_GFX2, 0x000000, &tile_layout,           0, 512 }, /* Tiles area */
383   { REGION_GFX1, 0x000000, &spriteram_layout, 4096, 256 }, /* Sprites area */
384   { 0,           0x000000, &pivotlayout,         0,  64 }, /* Dynamically modified */
385   { -1 }
386};
379static GFXDECODE_START( taito_f3 )
380   GFXDECODE_ENTRY( 0,           0x000000, charlayout,          0,  64 ) /* Dynamically modified */
381   GFXDECODE_ENTRY( REGION_GFX2, 0x000000, tile_layout,           0, 512 ) /* Tiles area */
382   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, spriteram_layout, 4096, 256 ) /* Sprites area */
383   GFXDECODE_ENTRY( 0,           0x000000, pivotlayout,         0,  64 ) /* Dynamically modified */
384GFXDECODE_END
387385
388386/******************************************************************************/
389387
r1051r1052
459457   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
460458   MDRV_SCREEN_SIZE(40*8+48*2, 32*8)
461459   MDRV_SCREEN_VISIBLE_AREA(46, 40*8-1 + 46, 24, 24+232-1)
462   MDRV_GFXDECODE(gfxdecodeinfo)
460   MDRV_GFXDECODE(taito_f3)
463461   MDRV_PALETTE_LENGTH(8192)
464462
465463   MDRV_VIDEO_START(f3)
src/mame/drivers/gaelco2.c
r1051r1052
6363   32*8                                                         \
6464}
6565
66#define GFXDECODEINFO(NUM,ENTRIES) static const gfx_decode gfxdecodeinfo_##NUM[] =   \
67{                                                                  \
68   { REGION_GFX1, 0x0000000, &tilelayout16_##NUM,0,   ENTRIES },                  \
69   { -1 }                                                            \
70}
66#define GFXDECODEINFO(NUM,ENTRIES) \
67static GFXDECODE_START( NUM )\
68   GFXDECODE_ENTRY( REGION_GFX1, 0x0000000, tilelayout16_##NUM,0,   ENTRIES )                  \
69GFXDECODE_END
7170
71
7272TILELAYOUT16(0x0080000);
7373GFXDECODEINFO(0x0080000, 128);
7474TILELAYOUT16(0x0200000);
r1051r1052
105105ADDRESS_MAP_END
106106
107107
108INPUT_PORTS_START( maniacsq )
108static INPUT_PORTS_START( maniacsq )
109109PORT_START   /* DSW #1 + 1P INPUTS */
110110   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
111111   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r1051r1052
203203   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
204204   MDRV_SCREEN_SIZE(64*16, 32*16)
205205   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
206   MDRV_GFXDECODE(gfxdecodeinfo_0x0080000)
206   MDRV_GFXDECODE(0x0080000)
207207   MDRV_PALETTE_LENGTH(4096*16 - 16)   /* game's palette is 4096 but we allocate 15 more for shadows & highlights */
208208
209209   MDRV_VIDEO_START(gaelco2)
r1051r1052
356356   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
357357   MDRV_SCREEN_SIZE(64*16, 32*16)
358358   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
359   MDRV_GFXDECODE(gfxdecodeinfo_0x0200000)
359   MDRV_GFXDECODE(0x0200000)
360360   MDRV_PALETTE_LENGTH(4096*16 - 16)   /* game's palette is 4096 but we allocate 15 more for shadows & highlights */
361361
362362   MDRV_VIDEO_START(gaelco2)
r1051r1052
557557   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
558558   MDRV_SCREEN_SIZE(64*16, 32*16)
559559   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
560   MDRV_GFXDECODE(gfxdecodeinfo_0x0400000)
560   MDRV_GFXDECODE(0x0400000)
561561   MDRV_PALETTE_LENGTH(4096*16 - 16)   /* game's palette is 4096 but we allocate 15 more for shadows & highlights */
562562
563563   MDRV_VIDEO_START(gaelco2)
r1051r1052
812812
813813   /* video hardware */
814814   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM)
815   MDRV_GFXDECODE(gfxdecodeinfo_0x0400000)
815   MDRV_GFXDECODE(0x0400000)
816816   MDRV_PALETTE_LENGTH(4096*16 - 16)   /* game's palette is 4096 but we allocate 15 more for shadows & highlights */
817817   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
818818
r1051r1052
10231023   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10241024   MDRV_SCREEN_SIZE(64*16, 32*16)
10251025   MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 16, 256-1)
1026   MDRV_GFXDECODE(gfxdecodeinfo_0x0400000)
1026   MDRV_GFXDECODE(0x0400000)
10271027   MDRV_PALETTE_LENGTH(4096*16 - 16)   /* game's palette is 4096 but we allocate 15 more for shadows & highlights */
10281028
10291029   MDRV_VIDEO_START(gaelco2)
r1051r1052
12601260
12611261   /* video hardware */
12621262   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM)
1263   MDRV_GFXDECODE(gfxdecodeinfo_0x0200000)
1263   MDRV_GFXDECODE(0x0200000)
12641264   MDRV_PALETTE_LENGTH(4096*16 - 16)   /* game's palette is 4096 but we allocate 15 more for shadows & highlights */
12651265   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
12661266
src/mame/drivers/homerun.c
r1051r1052
7575   8*8*2*4
7676};
7777
78static const gfx_decode gfxdecodeinfo[] =
79{
80   { REGION_GFX1, 0, &gfxlayout,   0, 16 },
81   { REGION_GFX2, 0, &spritelayout,   0, 16 },
82   { -1 }
83};
78static GFXDECODE_START( homerun )
79   GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout,   0, 16 )
80   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   0, 16 )
81GFXDECODE_END
8482
8583static ADDRESS_MAP_START( homerun_memmap, ADDRESS_SPACE_PROGRAM, 8 )
8684   AM_RANGE(0x0000, 0x3fff) AM_ROM
r1051r1052
202200   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
203201   MDRV_SCREEN_SIZE(256, 256)
204202   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-25)
205   MDRV_GFXDECODE(gfxdecodeinfo)
203   MDRV_GFXDECODE(homerun)
206204   MDRV_PALETTE_LENGTH(16*4)
207205
208206   MDRV_VIDEO_START(homerun)
src/mame/drivers/champbas.c
r1051r1052
242242   64*8   /* every sprite takes 64 bytes */
243243};
244244
245static const gfx_decode gfxdecodeinfo[] =
246{
247   { REGION_GFX1, 0x0000, &charlayout,   0, 64 },
248   { REGION_GFX2, 0x0000, &charlayout,   0, 64 },
249   { REGION_GFX1, 0x1000, &spritelayout, 0, 64 },
250   { REGION_GFX2, 0x1000, &spritelayout, 0, 64 },
251   { -1 }
252};
245static GFXDECODE_START( champbas )
246   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 64 )
247   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   0, 64 )
248   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout, 0, 64 )
249   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, spritelayout, 0, 64 )
250GFXDECODE_END
253251
254252
255253
r1051r1052
281279   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
282280   MDRV_SCREEN_SIZE(32*8, 32*8)
283281   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
284   MDRV_GFXDECODE(gfxdecodeinfo)
282   MDRV_GFXDECODE(champbas)
285283   MDRV_PALETTE_LENGTH(32)
286284   MDRV_COLORTABLE_LENGTH(64*4)
287285
src/mame/drivers/baraduke.c
r1051r1052
414414   128*8
415415};
416416
417static const gfx_decode gfxdecodeinfo[] =
418{
419   { REGION_GFX1, 0,      &text_layout,  0, 512 },
420   { REGION_GFX2, 0x0000, &tile_layout,  0, 256 },
421   { REGION_GFX2, 0x4000, &tile_layout,  0, 256 },
422   { REGION_GFX3, 0,      &spritelayout, 0, 128 },
423   { -1 }
424};
417static GFXDECODE_START( baraduke )
418   GFXDECODE_ENTRY( REGION_GFX1, 0,      text_layout,  0, 512 )
419   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, tile_layout,  0, 256 )
420   GFXDECODE_ENTRY( REGION_GFX2, 0x4000, tile_layout,  0, 256 )
421   GFXDECODE_ENTRY( REGION_GFX3, 0,      spritelayout, 0, 128 )
422GFXDECODE_END
425423
426424
427425
r1051r1052
455453   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
456454   MDRV_SCREEN_SIZE(64*8, 32*8)
457455   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
458   MDRV_GFXDECODE(gfxdecodeinfo)
456   MDRV_GFXDECODE(baraduke)
459457   MDRV_PALETTE_LENGTH(2048)
460458
461459   MDRV_PALETTE_INIT(baraduke)
src/mame/drivers/ssozumo.c
r1051r1052
222222};
223223
224224
225static const gfx_decode gfxdecodeinfo[] =
226{
227   { REGION_GFX1, 0, &charlayout,     0, 4 },
228   { REGION_GFX2, 0, &tilelayout,   4*8, 4 },
229   { REGION_GFX3, 0, &spritelayout, 8*8, 2 },
230   { -1 }      /* end of array */
231};
225static GFXDECODE_START( ssozumo )
226   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 4 )
227   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   4*8, 4 )
228   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 8*8, 2 )
229GFXDECODE_END
232230
233231
234232static MACHINE_DRIVER_START( ssozumo )
r1051r1052
251249   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
252250   MDRV_SCREEN_SIZE(32*8, 32*8)
253251   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8 - 1, 1*8, 31*8 - 1)
254   MDRV_GFXDECODE(gfxdecodeinfo)
252   MDRV_GFXDECODE(ssozumo)
255253   MDRV_PALETTE_LENGTH(64 + 16)
256254
257255   MDRV_PALETTE_INIT(ssozumo)
src/mame/drivers/mcr.c
r1051r1052
14591459 *
14601460 *************************************/
14611461
1462static const gfx_decode gfxdecodeinfo[] =
1463{
1464   { REGION_GFX1, 0, &mcr_bg_layout,     0, 4, 2, 2 },   /* colors 0-15, 2x2 */
1465   { REGION_GFX2, 0, &mcr_sprite_layout, 0, 4 },      /* colors 16-31 */
1466   { -1 }
1467};
1462static GFXDECODE_START( mcr )
1463   GFXDECODE_SCALE( REGION_GFX1, 0, mcr_bg_layout,     0, 4, 2, 2 )   /* colors 0-15, 2x2 */
1464   GFXDECODE_ENTRY( REGION_GFX2, 0, mcr_sprite_layout, 0, 4 )      /* colors 16-31 */
1465GFXDECODE_END
14681466
14691467
14701468
r1051r1052
15171515   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
15181516   MDRV_SCREEN_SIZE(32*16, 30*16)
15191517   MDRV_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 0*16, 30*16-1)
1520   MDRV_GFXDECODE(gfxdecodeinfo)
1518   MDRV_GFXDECODE(mcr)
15211519   MDRV_PALETTE_LENGTH(32)
15221520
15231521   MDRV_VIDEO_START(mcr)
src/mame/drivers/m107.c
r1051r1052
442442   32*8
443443};
444444
445static const gfx_decode gfxdecodeinfo[] =
446{
447   { REGION_GFX1, 0, &charlayout,   0, 128 },
448   { REGION_GFX2, 0, &spritelayout, 0, 128 },
449   { -1 }
450};
445static GFXDECODE_START( m107 )
446   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 128 )
447   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 128 )
448GFXDECODE_END
451449
452static const gfx_decode firebarr_gfxdecodeinfo[] =
453{
454   { REGION_GFX1, 0, &charlayout,   0, 128 },
455   { REGION_GFX2, 0, &spritelayout2,0, 128 },
456   { -1 }
457};
450static GFXDECODE_START( firebarr )
451   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 128 )
452   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout2,0, 128 )
453GFXDECODE_END
458454
459455/***************************************************************************/
460456
r1051r1052
499495   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
500496   MDRV_SCREEN_SIZE(512, 256)
501497   MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */
502   MDRV_GFXDECODE(firebarr_gfxdecodeinfo)
498   MDRV_GFXDECODE(firebarr)
503499   MDRV_PALETTE_LENGTH(2048)
504500
505501   MDRV_VIDEO_START(m107)
r1051r1052
527523   MDRV_CPU_REPLACE("main", V33, 20000000/2)   /* NEC V33, Could be 28MHz clock? */
528524
529525   /* video hardware */
530   MDRV_GFXDECODE(gfxdecodeinfo)
526   MDRV_GFXDECODE(m107)
531527MACHINE_DRIVER_END
532528
533529/***************************************************************************/
src/mame/drivers/ninjaw.c
r1051r1052
578578   32*8   /* every sprite takes 32 consecutive bytes */
579579};
580580
581static const gfx_decode ninjaw_gfxdecodeinfo[] =
582{
583   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* sprites */
584   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* scr tiles (screen 1) */
585   { REGION_GFX3, 0, &charlayout,  0, 256 },   /* scr tiles (screens 2+) */
586   { -1 }
587};
581static GFXDECODE_START( ninjaw )
582   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* sprites */
583   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* scr tiles (screen 1) */
584   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,  0, 256 )   /* scr tiles (screens 2+) */
585GFXDECODE_END
588586
589587
590588/**************************************************************
r1051r1052
665663
666664   /* video hardware */
667665   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
668   MDRV_GFXDECODE(ninjaw_gfxdecodeinfo)
666   MDRV_GFXDECODE(ninjaw)
669667   MDRV_PALETTE_LENGTH(4096*3)
670668   MDRV_DEFAULT_LAYOUT(layout_darius)
671669
r1051r1052
740738
741739   /* video hardware */
742740   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
743   MDRV_GFXDECODE(ninjaw_gfxdecodeinfo)
741   MDRV_GFXDECODE(ninjaw)
744742   MDRV_PALETTE_LENGTH(4096*3)
745743   MDRV_DEFAULT_LAYOUT(layout_darius)
746744
src/mame/drivers/matmania.c
r1051r1052
320320   32*8   /* every tile takes 16 consecutive bytes */
321321};
322322
323static const gfx_decode matmania_gfxdecodeinfo[] =
324{
325   { REGION_GFX1, 0, &charlayout,              0, 4 },
326   { REGION_GFX2, 0, &tilelayout,            4*8, 4 },
327   { REGION_GFX3, 0, &matmania_spritelayout, 8*8, 2 },
328   { -1 }
329};
323static GFXDECODE_START( matmania )
324   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,              0, 4 )
325   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,            4*8, 4 )
326   GFXDECODE_ENTRY( REGION_GFX3, 0, matmania_spritelayout, 8*8, 2 )
327GFXDECODE_END
330328
331static const gfx_decode maniach_gfxdecodeinfo[] =
332{
333   { REGION_GFX1, 0, &charlayout,             0, 4 },
334   { REGION_GFX2, 0, &maniach_tilelayout,   4*8, 4 },
335   { REGION_GFX3, 0, &maniach_spritelayout, 8*8, 2 },
336   { -1 }
337};
329static GFXDECODE_START( maniach )
330   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,             0, 4 )
331   GFXDECODE_ENTRY( REGION_GFX2, 0, maniach_tilelayout,   4*8, 4 )
332   GFXDECODE_ENTRY( REGION_GFX3, 0, maniach_spritelayout, 8*8, 2 )
333GFXDECODE_END
338334
339335
340336
r1051r1052
359355   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
360356   MDRV_SCREEN_SIZE(32*8, 32*8)
361357   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
362   MDRV_GFXDECODE(matmania_gfxdecodeinfo)
358   MDRV_GFXDECODE(matmania)
363359   MDRV_PALETTE_LENGTH(64+16)
364360
365361   MDRV_PALETTE_INIT(matmania)
r1051r1052
416412   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
417413   MDRV_SCREEN_SIZE(32*8, 32*8)
418414   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
419   MDRV_GFXDECODE(maniach_gfxdecodeinfo)
415   MDRV_GFXDECODE(maniach)
420416   MDRV_PALETTE_LENGTH(64+16)
421417
422418   MDRV_PALETTE_INIT(matmania)
src/mame/drivers/arkanoid.c
r1051r1052
746746
747747/* Graphics Decode Information */
748748
749static const gfx_decode gfxdecodeinfo[] =
750{
751   { REGION_GFX1, 0, &charlayout,  0, 64 },
749static GFXDECODE_START( arkanoid )
750   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 64 )
752751   // sprites use the same characters above, but are 16x8
753   { -1 }
754};
752GFXDECODE_END
755753
756754/* Sound Interfaces */
757755
r1051r1052
784782   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
785783   MDRV_SCREEN_SIZE(32*8, 32*8)
786784   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
787   MDRV_GFXDECODE(gfxdecodeinfo)
785   MDRV_GFXDECODE(arkanoid)
788786   MDRV_PALETTE_LENGTH(512)
789787
790788   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/twin16.c
r1051r1052
921921
922922/* Graphics Decode Info */
923923
924static const gfx_decode gfxdecodeinfo[] =
925{
926   { REGION_GFX1, 0x00000, &alpha_layout, 0, 16 },
927   { -1 }
928};
924static GFXDECODE_START( twin16 )
925   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, alpha_layout, 0, 16 )
926GFXDECODE_END
929927
930928/* Sound Interfaces */
931929
r1051r1052
983981   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
984982   MDRV_SCREEN_SIZE(40*8, 32*8)
985983   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 2*8, 30*8-1)
986   MDRV_GFXDECODE(gfxdecodeinfo)
984   MDRV_GFXDECODE(twin16)
987985   MDRV_PALETTE_LENGTH(0x400)
988986
989987   MDRV_VIDEO_START(twin16)
r1051r1052
10341032   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10351033   MDRV_SCREEN_SIZE(40*8, 32*8)
10361034   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 2*8, 30*8-1)
1037   MDRV_GFXDECODE(gfxdecodeinfo)
1035   MDRV_GFXDECODE(twin16)
10381036   MDRV_PALETTE_LENGTH(0x400)
10391037
10401038   MDRV_VIDEO_START(fround)
src/mame/drivers/megasys1.c
r1051r1052
608608   16*16*4
609609};
610610
611static const gfx_decode gfxdecodeinfo_Z[] =
612{
613   { REGION_GFX1, 0, &tilelayout,   256*0, 16 },   // [0] Scroll 0
614   { REGION_GFX2, 0, &tilelayout,   256*2, 16 },   // [1] Scroll 1
615   { REGION_GFX3, 0, &spritelayout, 256*1, 16 },   // [2] Sprites
616   { -1 }
617};
611static GFXDECODE_START( Z )
612   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   256*0, 16 )   // [0] Scroll 0
613   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   256*2, 16 )   // [1] Scroll 1
614   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 256*1, 16 )   // [2] Sprites
615GFXDECODE_END
618616
619static const gfx_decode gfxdecodeinfo_ABC[] =
620{
621   { REGION_GFX1, 0, &tilelayout,   256*0, 16 },   // [0] Scroll 0
622   { REGION_GFX2, 0, &tilelayout,   256*1, 16 },   // [1] Scroll 1
623   { REGION_GFX3, 0, &tilelayout,   256*2, 16 },   // [2] Scroll 2 (unused in system D)
624   { REGION_GFX4, 0, &spritelayout, 256*3, 16 },   // [3] Sprites
625   { -1 }
626};
617static GFXDECODE_START( ABC )
618   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,   256*0, 16 )   // [0] Scroll 0
619   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   256*1, 16 )   // [1] Scroll 1
620   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,   256*2, 16 )   // [2] Scroll 2 (unused in system D)
621   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout, 256*3, 16 )   // [3] Sprites
622GFXDECODE_END
627623
628624
629625/***************************************************************************
r1051r1052
670666   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
671667   MDRV_SCREEN_SIZE(32*8, 32*8)
672668   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
673   MDRV_GFXDECODE(gfxdecodeinfo_ABC)
669   MDRV_GFXDECODE(ABC)
674670   MDRV_PALETTE_LENGTH(1024)
675671
676672   MDRV_PALETTE_INIT(megasys1)
r1051r1052
763759   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
764760   MDRV_SCREEN_SIZE(32*8, 32*8)
765761   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
766   MDRV_GFXDECODE(gfxdecodeinfo_ABC)
762   MDRV_GFXDECODE(ABC)
767763   MDRV_PALETTE_LENGTH(1024)
768764
769765   MDRV_PALETTE_INIT(megasys1)
r1051r1052
827823   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
828824   MDRV_SCREEN_SIZE(32*8, 32*8)
829825   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
830   MDRV_GFXDECODE(gfxdecodeinfo_Z)
826   MDRV_GFXDECODE(Z)
831827   MDRV_PALETTE_LENGTH(768)
832828
833829   MDRV_VIDEO_START(megasys1)
src/mame/drivers/crshrace.c
r1051r1052
597597   128*8
598598};
599599
600static const gfx_decode gfxdecodeinfo[] =
601{
602   { REGION_GFX1, 0, &charlayout,     0,  1 },
603   { REGION_GFX2, 0, &tilelayout,   256, 16 },
604   { REGION_GFX3, 0, &spritelayout, 512, 32 },
605   { -1 }
606};
600static GFXDECODE_START( crshrace )
601   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0,  1 )
602   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   256, 16 )
603   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 512, 32 )
604GFXDECODE_END
607605
608606
609607
r1051r1052
640638   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
641639   MDRV_SCREEN_SIZE(64*8, 32*8)
642640   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
643   MDRV_GFXDECODE(gfxdecodeinfo)
641   MDRV_GFXDECODE(crshrace)
644642   MDRV_PALETTE_LENGTH(2048)
645643
646644   MDRV_VIDEO_START(crshrace)
src/mame/drivers/airbustr.c
r1051r1052
550550
551551/* Graphics Decode Information */
552552
553static const gfx_decode gfxdecodeinfo[] =
554{
555   { REGION_GFX1, 0, &tile_gfxlayout,   0, 32 }, // tiles
556   { REGION_GFX2, 0, &sprite_gfxlayout, 512, 16 }, // sprites
557   { -1 }
558};
553static GFXDECODE_START( airbustr )
554   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_gfxlayout,   0, 32 ) // tiles
555   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_gfxlayout, 512, 16 ) // sprites
556GFXDECODE_END
559557
560558/* Sound Interfaces */
561559
r1051r1052
624622   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
625623   MDRV_SCREEN_SIZE(32*8, 32*8)
626624   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
627   MDRV_GFXDECODE(gfxdecodeinfo)
625   MDRV_GFXDECODE(airbustr)
628626   MDRV_PALETTE_LENGTH(768)
629627
630628   MDRV_VIDEO_START(airbustr)
src/mame/drivers/clshroad.c
r1051r1052
280280   16*16*2
281281};
282282
283static const gfx_decode firebatl_gfxdecodeinfo[] =
284{
285   { REGION_GFX1, 0, &layout_16x16x4,   0, 16 }, // [0] Sprites
286   { REGION_GFX2, 0, &layout_16x16x4,    16,  1 }, // [1] Layer 0
287   { REGION_GFX3, 0, &layout_8x8x2,   512, 64 }, // [2] Layer 1
288   { -1 }
289};
283static GFXDECODE_START( firebatl )
284   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4,   0, 16 ) // [0] Sprites
285   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4,    16,  1 ) // [1] Layer 0
286   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x2,   512, 64 ) // [2] Layer 1
287GFXDECODE_END
290288
291static const gfx_decode clshroad_gfxdecodeinfo[] =
292{
293   { REGION_GFX1, 0, &layout_16x16x4, 0, 16 }, // [0] Sprites
294   { REGION_GFX2, 0, &layout_16x16x4, 0x90,  1 }, // [1] Layer 0
295   { REGION_GFX3, 0, &layout_8x8x4,   0, 16 }, // [2] Layer 1
296   { -1 }
297};
289static GFXDECODE_START( clshroad )
290   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0, 16 ) // [0] Sprites
291   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x4, 0x90,  1 ) // [1] Layer 0
292   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0, 16 ) // [2] Layer 1
293GFXDECODE_END
298294
299295
300296
r1051r1052
327323   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
328324   MDRV_SCREEN_SIZE(0x120, 0x100)
329325   MDRV_SCREEN_VISIBLE_AREA(0, 0x120-1, 0x0+16, 0x100-16-1)
330   MDRV_GFXDECODE(firebatl_gfxdecodeinfo)
326   MDRV_GFXDECODE(firebatl)
331327   MDRV_PALETTE_LENGTH(512)
332328   MDRV_COLORTABLE_LENGTH(512+64*4)
333329
r1051r1052
365361   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
366362   MDRV_SCREEN_SIZE(0x120, 0x100)
367363   MDRV_SCREEN_VISIBLE_AREA(0, 0x120-1, 0x0+16, 0x100-16-1)
368   MDRV_GFXDECODE(clshroad_gfxdecodeinfo)
364   MDRV_GFXDECODE(clshroad)
369365   MDRV_PALETTE_LENGTH(256)
370366
371367   MDRV_PALETTE_INIT(clshroad)
src/mame/drivers/pacman.c
r1051r1052
29662966};
29672967
29682968
2969static const gfx_decode gfxdecodeinfo[] =
2970{
2971   { REGION_GFX1, 0x0000, &tilelayout,   0, 128 },
2972   { REGION_GFX1, 0x1000, &spritelayout, 0, 128 },
2973   { -1 }
2974};
2969static GFXDECODE_START( pacman )
2970   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tilelayout,   0, 128 )
2971   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout, 0, 128 )
2972GFXDECODE_END
29752973
29762974
2977static const gfx_decode s2650games_gfxdecodeinfo[] =
2978{
2979   { REGION_GFX1, 0x0000, &tilelayout,   0, 128 },
2980   { REGION_GFX1, 0x4000, &spritelayout, 0, 128 },
2981   { -1 }
2982};
2975static GFXDECODE_START( s2650games )
2976   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, tilelayout,   0, 128 )
2977   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, spritelayout, 0, 128 )
2978GFXDECODE_END
29832979
29842980
2985static const gfx_decode crush4_gfxdecodeinfo[] =
2986{
2987   { REGION_GFX1, 0x0000, &crush4_tilelayout,   0, 128 },
2988   { REGION_GFX1, 0x1000, &crush4_spritelayout, 0, 128 },
2989   { -1 }
2990};
2981static GFXDECODE_START( crush4 )
2982   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, crush4_tilelayout,   0, 128 )
2983   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, crush4_spritelayout, 0, 128 )
2984GFXDECODE_END
29912985
29922986
29932987
r1051r1052
30223016
30233017   /* video hardware */
30243018   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
3025   MDRV_GFXDECODE(gfxdecodeinfo)
3019   MDRV_GFXDECODE(pacman)
30263020   MDRV_PALETTE_LENGTH(128*4)
30273021
30283022   MDRV_SCREEN_ADD("main", 0)
r1051r1052
31853179
31863180   MDRV_SCREEN_SIZE(32*8, 32*8)
31873181   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3188   MDRV_GFXDECODE(s2650games_gfxdecodeinfo)
3182   MDRV_GFXDECODE(s2650games)
31893183
31903184   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
31913185
r1051r1052
32603254   /* basic machine hardware */
32613255   MDRV_IMPORT_FROM(mschamp)
32623256
3263   MDRV_GFXDECODE(crush4_gfxdecodeinfo)
3257   MDRV_GFXDECODE(crush4)
32643258MACHINE_DRIVER_END
32653259
32663260static struct AY8910interface crushs_ay8910_interface =
src/mame/drivers/bwing.c
r1051r1052
368368};
369369
370370
371static const gfx_decode gfxdecodeinfo[] =
372{
373   { REGION_GFX1,  0, &charlayout,       0x00, 1 }, // chars
374   { REGION_GFX2,  0, &spritelayout,     0x20, 2 }, // sprites
375   { REGION_USER1, 0, &bwing_tilelayout, 0x10, 2 }, // foreground tiles place holder
376   { REGION_USER1, 0, &bwing_tilelayout, 0x30, 2 }, // background tiles place holder
377   { -1 }
378};
371static GFXDECODE_START( bwing )
372   GFXDECODE_ENTRY( REGION_GFX1,  0, charlayout,       0x00, 1 ) // chars
373   GFXDECODE_ENTRY( REGION_GFX2,  0, spritelayout,     0x20, 2 ) // sprites
374   GFXDECODE_ENTRY( REGION_USER1, 0, bwing_tilelayout, 0x10, 2 ) // foreground tiles place holder
375   GFXDECODE_ENTRY( REGION_USER1, 0, bwing_tilelayout, 0x30, 2 ) // background tiles place holder
376GFXDECODE_END
379377
380378//****************************************************************************
381379// Hardware Definitions
r1051r1052
414412   // video hardware
415413   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
416414   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
417   MDRV_GFXDECODE(gfxdecodeinfo)
415   MDRV_GFXDECODE(bwing)
418416   MDRV_SCREEN_SIZE(32*8, 32*8)
419417   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
420418   MDRV_PALETTE_LENGTH(64)
src/mame/drivers/srmp6.c
r1051r1052
22    Super Real Mahjong P6 (JPN Ver.)
33    (c)1996 Seta
44
5WIP driver by Sebastien Volpe
5WIP driver by Sebastien Volpe, Tomasz Slanina and David Haywood
66
7Emulation Notes:
8The graphics are compressed, using the same 8bpp RLE scheme as CPS3 uses
9for the background on Sean's stage of Street Fighter III.
10
11DMA Operations are not fully understood
12
13
714according prg ROM (offset $0fff80):
815
916    S12 SYSTEM
r1051r1052
1320    V1.00
1421
1522TODO:
16 - gfx decoding / emulation
1723 - sound emulation (appears to be really close to st0016)
24 - fix DMA operations
25 - fix video emulation
1826
1927Are there other games on this 'System S12' hardware ???
2028
r1051r1052
5462
5563
5664Dumped 06/15/2000
65
5766*/
5867
68
5969#include "driver.h"
60#include "srmp6.h"
6170
71static UINT16* tileram;
72static UINT8* dirty_tileram;
73static UINT16* dmaram;
6274
75static UINT16 *sprram, *sprram_old;
76
77static int brightness;
78
79#define SRMP6_VERBOSE 0
80
81static const gfx_layout tiles8x8_layout =
82{
83   8,8,
84   (0x100000*16)/0x40,
85   8,
86   { 0,1,2,3,4,5,6,7 },
87   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
88   { 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64 },
89   8*64
90};
91
92void update_palette(void)
93{
94   char r, g ,b;
95   int brg = brightness - 0x60;
96   int i;
97
98   for(i = 0; i < 0x800; i++)
99   {
100      r = paletteram16[i] >>  0 & 0x1F;
101      g = paletteram16[i] >>  5 & 0x1F;
102      b = paletteram16[i] >> 10 & 0x1F;
103
104      if(brg < 0) {
105         r += (r * brg) >> 5;
106         if(r < 0) r = 0;
107         g += (g * brg) >> 5;
108         if(g < 0) g = 0;
109         b += (b * brg) >> 5;
110         if(b < 0) b = 0;
111      }
112      else if(brg > 0) {
113         r += ((0x1F - r) * brg) >> 5;
114         if(r > 0x1F) r = 0x1F;
115         g += ((0x1F - g) * brg) >> 5;
116         if(g > 0x1F) g = 0x1F;
117         b += ((0x1F - b) * brg) >> 5;
118         if(b > 0x1F) b = 0x1F;
119      }
120      palette_set_color(Machine, i, MAKE_RGB(r << 3, g << 3, b << 3));
121   }
122}
123
124static VIDEO_START(srmp6)
125{
126   /* create the char set (gfx will then be updated dynamically from RAM) */
127   machine->gfx[0] = allocgfx(&tiles8x8_layout);
128   machine->gfx[0]->total_colors = machine->drv->total_colors / 256;
129   machine->gfx[0]->color_granularity=256;
130
131   tileram = auto_malloc(0x100000*16);
132   dirty_tileram = auto_malloc((0x100000*16)/0x40); // every 8x8x8 tile is 0x40 bytes
133
134   memset(tileram,(0x100000*16),0x00);
135   memset(dirty_tileram,(0x100000*16)/0x40,1);
136
137   dmaram = auto_malloc(0x100);
138
139   sprram_old = auto_malloc(0x80000);
140   memset(sprram_old, 0, 0x80000);
141
142   brightness = 0x60;
143}
144
145/* Debug code */
146#ifdef UNUSED_FUNCTION
147static void srmp6_decode_charram(void)
148{
149   if(input_code_pressed_once(KEYCODE_Z))
150   {
151      int i;
152      for (i=0;i<(0x100000*16)/0x40;i++)
153      {
154         decodechar(Machine->gfx[0], i, (UINT8*)tileram, &tiles8x8_layout);
155         dirty_tileram[i] = 0;
156      }
157   }
158}
159#endif
160
161#if 0
162static int xixi=0;
163#endif
164
165static VIDEO_UPDATE(srmp6)
166{
167   int trans = TRANSPARENCY_PEN;
168   int x,y,tileno,height,width,xw,yw,sprite,xb,yb;
169   UINT16 *sprite_list=sprram_old;
170   UINT16 mainlist_offset = 0;
171
172   union
173   {
174      INT16  a;
175      UINT16 b;
176   } temp;
177
178   fillbitmap(bitmap,0,&machine->screen[0].visarea);
179
180#if 0
181   /* debug */
182   srmp6_decode_charram();
183
184
185
186   /* debug */
187   if(input_code_pressed_once(KEYCODE_Q))
188   {
189      ++xixi;
190      printf("%x\n",xixi);
191   }
192
193   if(input_code_pressed_once(KEYCODE_W))
194   {
195      --xixi;
196      printf("%x\n",xixi);
197   }
198#endif
199
200   /* Main spritelist is 0x0000 - 0x1fff in spriteram, sublists follow */
201   while (mainlist_offset<0x2000/2)
202   {
203
204      UINT16 *sprite_sublist=&sprram_old[sprite_list[mainlist_offset+1]<<3];
205      UINT16 sublist_length=sprite_list[mainlist_offset+0]&0x7fff; //+1 ?
206      INT16 global_x,global_y, flip_x, flip_y;
207      UINT16 global_pal;
208
209      /* end of list marker */
210      if (sprite_list[mainlist_offset+0] == 0x8000)
211         break;
212
213
214      if(sprite_list[mainlist_offset+0]!=0)
215      {
216         temp.b=sprite_list[mainlist_offset+2];
217         global_x=temp.a;
218         temp.b=sprite_list[mainlist_offset+3];
219         global_y=temp.a;
220
221         global_pal = sprite_list[mainlist_offset+4] & 0x7;
222
223         if((sprite_list[mainlist_offset+5] & 0x700) == 0x700)
224         {
225            trans = TRANSPARENCY_ALPHA;
226            alpha_set_level((sprite_list[mainlist_offset+5] & 0x1F) << 3);
227         }
228         else
229         {
230            trans = TRANSPARENCY_PEN;
231            alpha_set_level(255);
232         }
233   //  printf("%x %x \n",sprite_list[mainlist_offset+1],sublist_length);
234
235         while(sublist_length)
236         {
237            sprite=sprite_sublist[0]&0x7fff;
238            flip_x=sprite_sublist[1]>>8&1;
239            flip_y=sprite_sublist[1]>>9&1;
240            temp.b=sprite_sublist[2];
241            x=temp.a;
242            temp.b=sprite_sublist[3];
243            y=temp.a;
244            //x+=global_x;
245            //y+=global_y;
246
247            width=((sprite_sublist[1])&0x3);
248            height=((sprite_sublist[1]>>2)&0x3);
249
250            height = 1 << height;
251            width = 1 << width;
252
253            y-=height*8;
254            tileno = sprite;
255            //tileno += (sprite_list[4]&0xf)*0x4000; // this makes things worse in places (title screen for example)
256
257            for(xw=0;xw<width;xw++)
258            {
259               for(yw=0;yw<height;yw++)
260               {
261
262                  if(!flip_x)
263                     xb=x+xw*8+global_x;
264                  else
265                     xb=x+(width-xw-1)*8+global_x;
266
267                  if(!flip_y)
268                     yb=y+yw*8+global_y;
269                  else
270                     yb=y+(height-yw-1)*8+global_y;
271
272                  if (dirty_tileram[tileno])
273                  {
274                     decodechar(Machine->gfx[0], tileno, (UINT8*)tileram, &tiles8x8_layout);
275                     dirty_tileram[tileno] = 0;
276                  }
277
278                  drawgfx(bitmap,machine->gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,cliprect,trans,0);
279                  tileno++;
280                }
281            }
282
283            sprite_sublist+=8;
284            --sublist_length;
285         }
286      }
287      mainlist_offset+=8;
288   }
289
290   memcpy(sprram_old, sprram, 0x80000);
291   return 0;
292}
293
63294/***************************************************************************
64    sndhrdw - VERY preliminary
295    audio - VERY preliminary
65296
66297    TODO: watch similarities with st0016
67298***************************************************************************/
r1051r1052
101332
102333*/
103334
104UINT16 *sound_regs;
335/***************************************************************************
336    Main CPU memory handlers
337***************************************************************************/
105338
106READ16_HANDLER( sound_regs_r )
339static UINT16 srmp6_input_select = 0;
340
341static WRITE16_HANDLER( srmp6_input_select_w )
107342{
343   srmp6_input_select = data & 0x0f;
344}
345
346static READ16_HANDLER( srmp6_inputs_r )
347{
348   if (offset == 0)         // DSW
349      return readinputport(4);
350
351   switch(srmp6_input_select)   // inputs
352   {
353      case 1<<0: return readinputport(0);
354      case 1<<1: return readinputport(1);
355      case 1<<2: return readinputport(2);
356      case 1<<3: return readinputport(3);
357   }
358
108359   return 0;
109360}
110361
111WRITE16_HANDLER( sound_regs_w )
362
363static UINT16 *video_regs;
364
365static WRITE16_HANDLER( video_regs_w )
112366{
113   COMBINE_DATA(&sound_regs[offset]);
367   switch(offset)
368   {
114369
115   switch(offset & 0x0f)
116   {
117      case 0x02: // Start Address LSW
370      case 0x5e/2: // bank switch, used by ROM check
371#if SRMP6_VERBOSE
372         printf("%x\n",data);
373#endif
374
375         memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000));
118376         break;
119      case 0x03: // Start Address MSW
120//          fprintf(stdout, "Ch %d Start Address %08X\n", offset>>4, (sound_regs[offset]<<16)|sound_regs[offset-1]);
377
378      // set by IT4
379      case 0x5c/2: // either 0x40 explicitely in many places, or according $2083b0 (IT4)
380         //Fade in/out (0x40(dark)-0x60(normal)-0x7e?(bright) reset by 0x00?
381         data = (!data)?0x60:(data == 0x5e)?0x60:data;
382         if(brightness != data) {
383            brightness = data;
384            update_palette();
385         }
121386         break;
122      case 0x0c: // End Address LSW
123         break;
124      case 0x0d: // End Address MSW
125//          fprintf(stdout, "Ch %d End Address   %08X\n", offset>>4, (sound_regs[offset]<<16)|sound_regs[offset-1]);
126         break;
127      case 0x05: // Status Register
128         break;
129      case 0x06: // frequency Register?
130         break;
131      case 0x0e: // Left Volume
132//          fprintf(stdout, "Ch.%d Left Volume  %04X\n", offset>>4, data);
133         break;
134      case 0x0f: // Right Volume
135//          fprintf(stdout, "Ch.%d Right Volume %04X\n", offset>>4, data);
136         break;
387
388      /* unknown registers - there are others */
389
390      // set by IT4 (jsr $b3c), according flip screen dsw
391      case 0x48/2: //     0 /  0xb0 if flipscreen
392      case 0x52/2: //     0 / 0x2ef if flipscreen
393      case 0x54/2: // 0x152 / 0x15e if flipscreen
394
395      // set by IT4 ($82e-$846)
396      case 0x56/2: // written 8,9,8,9 successively
397
137398      default:
138//          fprintf(stdout, "Sound Regs %02X: %04X\n", offset, data);
399         logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", activecpu_get_previouspc(), offset*2, data, mem_mask);
139400         break;
140401   }
402   COMBINE_DATA(&video_regs[offset]);
141403}
142404
143READ16_HANDLER( sndctrl_reg_r )
405static READ16_HANDLER( video_regs_r )
144406{
145   return 0;
407   logerror("video_regs_r (PC=%06X): %04x\n", activecpu_get_previouspc(), offset*2);
408   return video_regs[offset];
146409}
147410
148WRITE16_HANDLER( sndctrl_reg_w )
411
412/* DMA RLE stuff - the same as CPS3 */
413static unsigned short lastb;
414static unsigned short lastb2;
415static int destl;
416
417static UINT32 process(UINT8 b,UINT32 dst_offset)
149418{
150/*
151    int i;
152    for(i=0;i<8;i++)
153        if(data & (1 << i))
154            fprintf(stdout, "Ch.%d Sound Start\n", i);
155*/
156}
157419
158/***************************************************************************
159    Main CPU memory handlers
160***************************************************************************/
420    int l=0;
161421
162static UINT16 srmp6_input_select = 0;
422    UINT8 *tram=(UINT8*)tileram;
163423
164WRITE16_HANDLER( srmp6_input_select_w )
424    if(lastb==lastb2)   //rle
425    {
426      int i;
427       int rle=(b+1)&0xff;
428
429       for(i=0;i<rle;++i)
430       {
431         tram[dst_offset+destl] = lastb;
432         dirty_tileram[(dst_offset+destl)/0x40] = 1;
433
434         dst_offset++;
435          ++l;
436       }
437       lastb2=0xffff;
438
439       return l;
440    }
441    else
442    {
443       lastb2=lastb;
444       lastb=b;
445      tram[dst_offset+destl] = b;
446      dirty_tileram[(dst_offset+destl)/0x40] = 1;
447
448       return 1;
449    }
450 }
451
452
453static WRITE16_HANDLER(srmp6_dma_w)
165454{
166   srmp6_input_select = data & 0x0f;
455   COMBINE_DATA(&dmaram[offset]);
456   if(offset==13 && dmaram[offset]==0x40)
457   {
458      UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]);
459      UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]);
460      UINT32 len=4*(((((UINT32)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG!
461      int tempidx=0;
462
463      /* show params */
464#if SRMP6_VERBOSE
465      printf("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n",
466            dmaram[0x00/2],
467            dmaram[0x02/2],
468            dmaram[0x04/2],
469            dmaram[0x06/2],
470            dmaram[0x08/2],
471            dmaram[0x0a/2],
472            dmaram[0x0c/2],
473            dmaram[0x0e/2],
474            dmaram[0x10/2],
475            dmaram[0x12/2],
476            dmaram[0x14/2],
477            dmaram[0x16/2],
478            dmaram[0x18/2],
479            dmaram[0x1a/2]);
480#endif
481
482      destl=dmaram[9]*0x40000;
483
484      lastb=0xfffe;
485      lastb2=0xffff;
486
487      while(1)
488      {
489         int i;
490         UINT8 ctrl=memory_region(REGION_USER2)[srcdata];
491          ++srcdata;
492
493         for(i=0;i<8;++i)
494         {
495            UINT8 p=memory_region(REGION_USER2)[srcdata];
496
497            if(ctrl&0x80)
498            {
499               UINT8 real_byte;
500               real_byte = memory_region(REGION_USER2)[srctab+p*2];
501               tempidx+=process(real_byte,tempidx);
502               real_byte = memory_region(REGION_USER2)[srctab+p*2+1];//px[DMA_XOR((current_table_address+p*2+1))];
503               tempidx+=process(real_byte,tempidx);
504             }
505             else
506             {
507                tempidx+=process(p,tempidx);
508             }
509
510             ctrl<<=1;
511             ++srcdata;
512
513
514            if(tempidx>=len)
515            {
516#if SRMP6_VERBOSE
517               printf("%x\n",srcdata);
518#endif
519               return;
520            }
521          }
522      }
523   }
167524}
168525
169READ16_HANDLER( srmp6_inputs_r )
526/* if tileram is actually bigger than the mapped area, how do we access the rest? */
527static READ16_HANDLER(tileram_r)
170528{
171   if (offset == 0)         // DSW
172      return readinputport(4);
529//  return tileram[offset];
530   return 0x0000;
531}
173532
174   switch(srmp6_input_select)   // inputs
533static WRITE16_HANDLER(tileram_w)
534{
535   //UINT16 tmp;
536//  COMBINE_DATA(&tileram[offset]);
537
538   /* are the DMA registers enabled some other way, or always mapped here, over RAM? */
539   if (offset >= 0xfff00/2 && offset <= 0xfff1a/2 )
175540   {
176      case 1<<0: return readinputport(0);
177      case 1<<1: return readinputport(1);
178      case 1<<2: return readinputport(2);
179      case 1<<3: return readinputport(3);
541      offset &=0x1f;
542      srmp6_dma_w(offset,data,mem_mask);
180543   }
544}
181545
182   return 0;
546WRITE16_HANDLER(paletteram_w)
547{
548   char r, g, b;
549   int brg = brightness - 0x60;
550
551   paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, data, mem_mask);
552
553   if(brg)
554   {
555      r = data >>  0 & 0x1F;
556      g = data >>  5 & 0x1F;
557      b = data >> 10 & 0x1F;
558
559      if(brg < 0) {
560         r += (r * brg) >> 5;
561         if(r < 0) r = 0;
562         g += (g * brg) >> 5;
563         if(g < 0) g = 0;
564         b += (b * brg) >> 5;
565         if(b < 0) b = 0;
566      }
567      else if(brg > 0) {
568         r += ((0x1F - r) * brg) >> 5;
569         if(r > 0x1F) r = 0x1F;
570         g += ((0x1F - g) * brg) >> 5;
571         if(g > 0x1F) g = 0x1F;
572         b += ((0x1F - b) * brg) >> 5;
573         if(b > 0x1F) b = 0x1F;
574      }
575
576      palette_set_color(Machine, offset, MAKE_RGB(r << 3, g << 3, b << 3));
577   }
183578}
184579
185580static ADDRESS_MAP_START( srmp6, ADDRESS_SPACE_PROGRAM, 16 )
r1051r1052
189584   AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION(REGION_USER1, 0)
190585
191586   AM_RANGE(0x300000, 0x300005) AM_READWRITE(srmp6_inputs_r, srmp6_input_select_w)      // inputs
192   AM_RANGE(0x480000, 0x480fff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
587   AM_RANGE(0x480000, 0x480fff) AM_READWRITE(MRA16_RAM, paletteram_w) AM_BASE(&paletteram16)
193588   AM_RANGE(0x4d0000, 0x4d0001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w)   // watchdog
194589
195590   // OBJ RAM: checked [$400000-$47dfff]
196   AM_RANGE(0x400000, 0x47dfff) AM_RAM AM_BASE(&sprite_ram)   // 512 sprites & character list
197//  AM_RANGE(0x402000, 0x40200f) AM_RAM // set by routine $11c48
198//  AM_RANGE(0x402010, 0x40806f) AM_RAM // set by routine $11bf6 - 2nd sprite RAM maybe ?
199//  AM_RANGE(0x412000, 0x416ebf) AM_RAM // probably larger
591   AM_RANGE(0x400000, 0x47ffff) AM_RAM AM_BASE(&sprram)
200592
201593   // CHR RAM: checked [$500000-$5fffff]
594   AM_RANGE(0x500000, 0x5fffff) AM_READWRITE(tileram_r,tileram_w)//AM_RAM AM_BASE(&tileram)
595//  AM_RANGE(0x5fff00, 0x5fffff) AM_WRITE(dma_w) AM_BASE(&dmaram)
202596
203   AM_RANGE(0x5fff00, 0x5fff1f) AM_WRITE(gfx_decode_w) AM_BASE(&dec_regs)// ? see routine $5ca8, video_regs related ???
204   AM_RANGE(0x500000, 0x5fffff) AM_RAM
205//  AM_RANGE(0x500000, 0x505cff) AM_RAM
206//  AM_RANGE(0x505d00, 0x5fffff) AM_RAM
207
208597   AM_RANGE(0x4c0000, 0x4c006f) AM_READWRITE(video_regs_r, video_regs_w) AM_BASE(&video_regs)   // ? gfx regs ST-0026 NiLe
209   AM_RANGE(0x4e0000, 0x4e00ff) AM_READWRITE(sound_regs_r, sound_regs_w) AM_BASE(&sound_regs)  // ? sound regs (data) ST-0026 NiLe
210   AM_RANGE(0x4e0100, 0x4e0101) AM_READWRITE(sndctrl_reg_r, sndctrl_reg_w)                     // ? sound reg  (ctrl) ST-0026 NiLe
598//  AM_RANGE(0x4e0000, 0x4e00ff) AM_READWRITE(sound_regs_r, sound_regs_w) AM_BASE(&sound_regs)  // ? sound regs (data) ST-0026 NiLe
599//  AM_RANGE(0x4e0100, 0x4e0101) AM_READWRITE(sndctrl_reg_r, sndctrl_reg_w)                     // ? sound reg  (ctrl) ST-0026 NiLe
211600//  AM_RANGE(0x4e0110, 0x4e0111) AM_NOP // ? accessed once ($268dc, written $b.w)
601//  AM_RANGE(0x5fff00, 0x5fff1f) AM_RAM // ? see routine $5ca8, video_regs related ???
212602
213
214603//  AM_RANGE(0xf00004, 0xf00005) AM_RAM // ?
215604//  AM_RANGE(0xf00006, 0xf00007) AM_RAM // ?
216   AM_RANGE(0xfffffe, 0xffffff) AM_NOP
605
217606ADDRESS_MAP_END
218607
219608
r1051r1052
307696   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
308697   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
309698   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
310
311699INPUT_PORTS_END
312700
313701/***************************************************************************
314702    Machine driver
315703***************************************************************************/
316704
705INTERRUPT_GEN(srmp6_interrupt)
706{
707   if(!cpu_getiloops())
708   {
709      cpunum_set_input_line(0,3,HOLD_LINE);
710   }
711   else
712   {
713      cpunum_set_input_line(0,4,HOLD_LINE);
714   }
715}
716
317717static MACHINE_DRIVER_START( srmp6 )
318718   MDRV_CPU_ADD(M68000, 16000000)
319719   MDRV_CPU_PROGRAM_MAP(srmp6,0)
320   MDRV_CPU_VBLANK_INT(irq4_line_hold,1) // don't trigger IT 3 for now...
720   MDRV_CPU_VBLANK_INT(srmp6_interrupt,2)
321721
322722   MDRV_SCREEN_REFRESH_RATE(60)
323723   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
324724
325725   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
326726   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
327   MDRV_SCREEN_SIZE(0x150,0xf0)
727   MDRV_SCREEN_SIZE(64*8, 64*8)
328728   MDRV_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 0*8, 30*8-1)
329729   MDRV_PALETTE_LENGTH(0x800)
330730
r1051r1052
360760   ROM_REGION( 0x200000, REGION_USER1, 0 ) /* 68000 Data */
361761   ROM_LOAD( "sx011-09.10", 0x000000, 0x200000, CRC(58f74438) SHA1(a256e39ca0406e513ab4dbd812fb0b559b4f61f2) )
362762
363   ROM_REGION( 0xc00000, REGION_SOUND1, 0) /* Samples */
364   ROM_LOAD( "sx011-08.15", 0x0000000, 0x400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00
365   ROM_LOAD( "sx011-07.16", 0x0400000, 0x400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01
366   ROM_LOAD( "sx011-06.17", 0x0800000, 0x400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02
367
368    /* CHRxx loaded here undecoded for ROM Check */
763    /* these are accessed directly by the 68k, DMA device etc.  NOT decoded */
369764   ROM_REGION( 0x2000000, REGION_USER2, 0)   /* Banked ROM */
370   ROM_LOAD( "sx011-08.15", 0x0000000, 0x400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00
371   ROM_LOAD( "sx011-07.16", 0x0400000, 0x400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01
372   ROM_LOAD( "sx011-06.17", 0x0800000, 0x400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02
373   ROM_LOAD( "sx011-05.18", 0x0c00000, 0x400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03
374   ROM_LOAD( "sx011-04.19", 0x1000000, 0x400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04
375   ROM_LOAD( "sx011-03.20", 0x1400000, 0x400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05
376   ROM_LOAD( "sx011-02.21", 0x1800000, 0x400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06
377   ROM_LOAD( "sx011-01.22", 0x1c00000, 0x400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07
378
379
380   ROM_REGION( 0x1400000, REGION_USER3, 0)
381   ROM_LOAD16_WORD_SWAP( "sx011-05.18", 0x0000000, 0x400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03
382   ROM_LOAD16_WORD_SWAP( "sx011-04.19", 0x0400000, 0x400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04
383   ROM_LOAD16_WORD_SWAP( "sx011-03.20", 0x0800000, 0x400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05
384   ROM_LOAD16_WORD_SWAP( "sx011-02.21", 0x0c00000, 0x400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06
385   ROM_LOAD16_WORD_SWAP( "sx011-01.22", 0x1000000, 0x400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07
386
765   ROM_LOAD16_WORD_SWAP( "sx011-08.15", 0x0000000, 0x0400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00
766   ROM_LOAD16_WORD_SWAP( "sx011-07.16", 0x0400000, 0x0400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01
767   ROM_LOAD16_WORD_SWAP( "sx011-06.17", 0x0800000, 0x0400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02
768   ROM_LOAD16_WORD_SWAP( "sx011-05.18", 0x0c00000, 0x0400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03
769   ROM_LOAD16_WORD_SWAP( "sx011-04.19", 0x1000000, 0x0400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04
770   ROM_LOAD16_WORD_SWAP( "sx011-03.20", 0x1400000, 0x0400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05
771   ROM_LOAD16_WORD_SWAP( "sx011-02.21", 0x1800000, 0x0400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06
772   ROM_LOAD16_WORD_SWAP( "sx011-01.22", 0x1c00000, 0x0400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07
387773ROM_END
388774
389775
r1051r1052
401787***************************************************************************/
402788
403789/*GAME( YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS)*/
404GAME( 1995, srmp6, 0, srmp6, srmp6, srmp6, ROT0, "Seta", "Super Real Mahjong P6 (Japan)",GAME_NO_SOUND)
790GAME( 1995, srmp6, 0, srmp6, srmp6, srmp6, ROT0, "Seta", "Super Real Mahjong P6 (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND)
405791
src/mame/drivers/sf.c
r1051r1052
789789};
790790
791791
792static const gfx_decode gfxdecodeinfo[] =
793{
794   { REGION_GFX1, 0, &sprite_layout,   0, 16 },
795   { REGION_GFX2, 0, &sprite_layout, 256, 16 },
796   { REGION_GFX3, 0, &sprite_layout, 512, 16 },
797   { REGION_GFX4, 0, &char_layout,   768, 16 },
798   { -1 }
799};
792static GFXDECODE_START( sf )
793   GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout,   0, 16 )
794   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 256, 16 )
795   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite_layout, 512, 16 )
796   GFXDECODE_ENTRY( REGION_GFX4, 0, char_layout,   768, 16 )
797GFXDECODE_END
800798
801799
802800
r1051r1052
841839   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
842840   MDRV_SCREEN_SIZE(64*8, 32*8)
843841   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
844   MDRV_GFXDECODE(gfxdecodeinfo)
842   MDRV_GFXDECODE(sf)
845843   MDRV_PALETTE_LENGTH(1024)
846844
847845   MDRV_VIDEO_START(sf)
src/mame/drivers/lsasquad.c
r1051r1052
557557   64*8
558558};
559559
560static const gfx_decode gfxdecodeinfo[] =
561{
562   { REGION_GFX1, 0, &charlayout,     0, 16 },
563   { REGION_GFX2, 0, &spritelayout, 256, 16 },
564   { -1 }   /* end of array */
565};
560static GFXDECODE_START( lsasquad )
561   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
562   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 256, 16 )
563GFXDECODE_END
566564
567565
568566
r1051r1052
612610   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
613611   MDRV_SCREEN_SIZE(32*8, 32*8)
614612   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
615   MDRV_GFXDECODE(gfxdecodeinfo)
613   MDRV_GFXDECODE(lsasquad)
616614   MDRV_PALETTE_LENGTH(512)
617615
618616   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
r1051r1052
657655   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
658656   MDRV_SCREEN_SIZE(32*8, 32*8)
659657   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
660   MDRV_GFXDECODE(gfxdecodeinfo)
658   MDRV_GFXDECODE(lsasquad)
661659   MDRV_PALETTE_LENGTH(512)
662660
663661   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
src/mame/drivers/cball.c
r1051r1052
193193};
194194
195195
196static const gfx_decode gfxdecodeinfo[] =
197{
198   { REGION_GFX1, 0, &tile_layout, 0, 2 },
199   { REGION_GFX2, 0, &sprite_layout, 4, 1 },
200   { -1 }
201};
196static GFXDECODE_START( cball )
197   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0, 2 )
198   GFXDECODE_ENTRY( REGION_GFX2, 0, sprite_layout, 4, 1 )
199GFXDECODE_END
202200
203201
204202static MACHINE_DRIVER_START( cball )
r1051r1052
215213   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
216214   MDRV_SCREEN_SIZE(256, 262)
217215   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 223)
218   MDRV_GFXDECODE(gfxdecodeinfo)
216   MDRV_GFXDECODE(cball)
219217   MDRV_PALETTE_LENGTH(6)
220218
221219   MDRV_PALETTE_INIT(cball)
src/mame/drivers/sengokmj.c
r1051r1052
272272   128*8   /* every sprite takes 128 consecutive bytes */
273273};
274274
275static const gfx_decode gfxdecodeinfo[] =
276{
277   { REGION_GFX1, 0, &tilelayout, 0x000, 0x40 }, /* Sprites */
278   { REGION_GFX2, 0, &tilelayout, 0x400, 0x30 }, /* Tiles */
279   { REGION_GFX2, 0, &charlayout, 0x700, 0x10 }, /* Text */
280   { -1 }
281};
275static GFXDECODE_START( sengokmj )
276   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0x000, 0x40 ) /* Sprites */
277   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x400, 0x30 ) /* Tiles */
278   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0x700, 0x10 ) /* Text */
279GFXDECODE_END
282280
283281SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
284282
r1051r1052
307305   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
308306   MDRV_SCREEN_SIZE(64*8, 32*8)
309307   MDRV_SCREEN_VISIBLE_AREA(16*8, 56*8-1, 2*8, 32*8-1)
310   MDRV_GFXDECODE(gfxdecodeinfo)
308   MDRV_GFXDECODE(sengokmj)
311309   MDRV_PALETTE_LENGTH(0x800)
312310
313311   MDRV_VIDEO_START(sengokmj)
src/mame/drivers/cham24.c
r1051r1052
245245{
246246}
247247
248static const gfx_decode cham24_gfxdecodeinfo[] =
249{
248static GFXDECODE_START( cham24 )
250249   /* none, the ppu generates one */
251   { -1 }
252};
250GFXDECODE_END
253251
254252static MACHINE_DRIVER_START( cham24 )
255253   /* basic machine hardware */
r1051r1052
265263   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
266264   MDRV_SCREEN_SIZE(32*8, 262)
267265   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
268   MDRV_GFXDECODE(cham24_gfxdecodeinfo)
266   MDRV_GFXDECODE(cham24)
269267   MDRV_PALETTE_LENGTH(8*4*16)
270268   MDRV_COLORTABLE_LENGTH(4*8)
271269
src/mame/drivers/cave.c
r1051r1052
19451945                                Dangun Feveron
19461946***************************************************************************/
19471947
1948static const gfx_decode dfeveron_gfxdecodeinfo[] =
1949{
1948static GFXDECODE_START( dfeveron )
19501949   /* There are only $800 colors here, the first half for sprites
19511950       the second half for tiles. We use $8000 virtual colors instead
19521951       for consistency with games having $8000 real colors.
19531952       A PALETTE_INIT function is thus needed for sprites */
19541953
19551954//    REGION_GFX1                                       // Sprites
1956   { REGION_GFX2, 0, &layout_8x8x4,   0x4400, 0x40 }, // [0] Layer 0
1957   { REGION_GFX3, 0, &layout_8x8x4,   0x4400, 0x40 }, // [1] Layer 1
1958   { -1 }
1959};
1955   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x4400, 0x40 ) // [0] Layer 0
1956   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0x4400, 0x40 ) // [1] Layer 1
1957GFXDECODE_END
19601958
19611959/***************************************************************************
19621960                                Dodonpachi
19631961***************************************************************************/
19641962
1965static const gfx_decode ddonpach_gfxdecodeinfo[] =
1966{
1967   /* Layers 0&1 are 4 bit deep and use the first 16 of every 256
1963static GFXDECODE_START( ddonpach )
1964   /* Layers 01 are 4 bit deep and use the first 16 of every 256
19681965       colors for any given color code (a PALETTE_INIT function
19691966       is provided for these layers, filling the 8000-83ff entries
19701967       in the color table). Layer 2 uses the whole 256 for any given
19711968       color code and the 4000-7fff range in the color table.   */
19721969
19731970//    REGION_GFX1                                       // Sprites
1974   { REGION_GFX2, 0, &layout_8x8x4,   0x8000, 0x40 }, // [0] Layer 0
1975   { REGION_GFX3, 0, &layout_8x8x4,   0x8000, 0x40 }, // [1] Layer 1
1976   { REGION_GFX4, 0, &layout_8x8x8,   0x4000, 0x40 }, // [2] Layer 2
1977   { -1 }
1978};
1971   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x8000, 0x40 ) // [0] Layer 0
1972   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0x8000, 0x40 ) // [1] Layer 1
1973   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,   0x4000, 0x40 ) // [2] Layer 2
1974GFXDECODE_END
19791975
19801976/***************************************************************************
19811977                                Donpachi
19821978***************************************************************************/
19831979
1984static const gfx_decode donpachi_gfxdecodeinfo[] =
1985{
1980static GFXDECODE_START( donpachi )
19861981   /* There are only $800 colors here, the first half for sprites
19871982       the second half for tiles. We use $8000 virtual colors instead
19881983       for consistency with games having $8000 real colors.
19891984       A PALETTE_INIT function is thus needed for sprites */
19901985
19911986//    REGION_GFX1                                       // Sprites
1992   { REGION_GFX2, 0, &layout_8x8x4,   0x4400, 0x40 }, // [0] Layer 0
1993   { REGION_GFX3, 0, &layout_8x8x4,   0x4400, 0x40 }, // [1] Layer 1
1994   { REGION_GFX4, 0, &layout_8x8x4,   0x4400, 0x40 }, // [2] Layer 2
1995   { -1 }
1996};
1987   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x4400, 0x40 ) // [0] Layer 0
1988   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0x4400, 0x40 ) // [1] Layer 1
1989   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x4400, 0x40 ) // [2] Layer 2
1990GFXDECODE_END
19971991
19981992/***************************************************************************
19991993                                Esprade
20001994***************************************************************************/
20011995
2002static const gfx_decode esprade_gfxdecodeinfo[] =
2003{
1996static GFXDECODE_START( esprade )
20041997//    REGION_GFX1                                       // Sprites
2005   { REGION_GFX2, 0, &layout_8x8x8,   0x4000, 0x40 }, // [0] Layer 0
2006   { REGION_GFX3, 0, &layout_8x8x8,   0x4000, 0x40 }, // [1] Layer 1
2007   { REGION_GFX4, 0, &layout_8x8x8,   0x4000, 0x40 }, // [2] Layer 2
2008   { -1 }
2009};
1998   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x8,   0x4000, 0x40 ) // [0] Layer 0
1999   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x8,   0x4000, 0x40 ) // [1] Layer 1
2000   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x8,   0x4000, 0x40 ) // [2] Layer 2
2001GFXDECODE_END
20102002
20112003/***************************************************************************
20122004                                Hotdog Storm
20132005***************************************************************************/
20142006
2015static const gfx_decode hotdogst_gfxdecodeinfo[] =
2016{
2007static GFXDECODE_START( hotdogst )
20172008   /* There are only $800 colors here, the first half for sprites
20182009       the second half for tiles. We use $8000 virtual colors instead
20192010       for consistency with games having $8000 real colors.
20202011       A PALETTE_INIT function is needed for sprites */
20212012
20222013//    REGION_GFX1                                       // Sprites
2023   { REGION_GFX2, 0, &layout_8x8x4,   0x4000, 0x40 }, // [0] Layer 0
2024   { REGION_GFX3, 0, &layout_8x8x4,   0x4000, 0x40 }, // [1] Layer 1
2025   { REGION_GFX4, 0, &layout_8x8x4,   0x4000, 0x40 }, // [2] Layer 2
2026   { -1 }
2027};
2014   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x4000, 0x40 ) // [0] Layer 0
2015   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0x4000, 0x40 ) // [1] Layer 1
2016   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x4000, 0x40 ) // [2] Layer 2
2017GFXDECODE_END
20282018
20292019/***************************************************************************
20302020                                Koro Koro Quest
20312021***************************************************************************/
20322022
2033static const gfx_decode korokoro_gfxdecodeinfo[] =
2034{
2023static GFXDECODE_START( korokoro )
20352024//    REGION_GFX1                                       // Sprites
2036   { REGION_GFX2, 0, &layout_8x8x4,   0x4400, 0x40 }, // [0] Layer 0
2037   { -1 }
2038};
2025   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x4400, 0x40 ) // [0] Layer 0
2026GFXDECODE_END
20392027
20402028/***************************************************************************
20412029                                Mazinger Z
20422030***************************************************************************/
20432031
2044static const gfx_decode mazinger_gfxdecodeinfo[] =
2045{
2032static GFXDECODE_START( mazinger )
20462033   /*  Sprites are 4 bit deep.
20472034        Layer 0 is 4 bit deep.
20482035        Layer 1 uses 64 color palettes, but the game only fills the
r1051r1052
20522039        A PALETTE_INIT function is thus needed for sprites and layer 0.   */
20532040
20542041//    REGION_GFX1                                       // Sprites
2055   { REGION_GFX2, 0, &layout_8x8x4,   0x4000, 0x40 }, // [0] Layer 0
2056   { REGION_GFX3, 0, &layout_8x8x6,   0x4400, 0x40 }, // [1] Layer 1
2057   { -1 }
2058};
2042   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x4000, 0x40 ) // [0] Layer 0
2043   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x6,   0x4400, 0x40 ) // [1] Layer 1
2044GFXDECODE_END
20592045
20602046
20612047/***************************************************************************
20622048                                Power Instinct 2
20632049***************************************************************************/
20642050
2065static const gfx_decode pwrinst2_gfxdecodeinfo[] =
2066{
2051static GFXDECODE_START( pwrinst2 )
20672052//    REGION_GFX1                                       // Sprites
2068   { REGION_GFX2, 0, &layout_8x8x4,   0x0800+0x8000, 0x40 }, // [0] Layer 0
2069   { REGION_GFX3, 0, &layout_8x8x4,   0x1000+0x8000, 0x40 }, // [1] Layer 1
2070   { REGION_GFX4, 0, &layout_8x8x4,   0x1800+0x8000, 0x40 }, // [2] Layer 2
2071   { REGION_GFX5, 0, &layout_8x8x4,   0x2000+0x8000, 0x40 }, // [3] Layer 3
2072   { -1 }
2073};
2053   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x0800+0x8000, 0x40 ) // [0] Layer 0
2054   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0x1000+0x8000, 0x40 ) // [1] Layer 1
2055   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x1800+0x8000, 0x40 ) // [2] Layer 2
2056   GFXDECODE_ENTRY( REGION_GFX5, 0, layout_8x8x4,   0x2000+0x8000, 0x40 ) // [3] Layer 3
2057GFXDECODE_END
20742058
20752059
20762060/***************************************************************************
20772061                                Sailor Moon
20782062***************************************************************************/
20792063
2080static const gfx_decode sailormn_gfxdecodeinfo[] =
2081{
2064static GFXDECODE_START( sailormn )
20822065   /* 4 bit sprites ? */
20832066//    REGION_GFX1                                       // Sprites
2084   { REGION_GFX2, 0, &layout_8x8x4,   0x4400, 0x40 }, // [0] Layer 0
2085   { REGION_GFX3, 0, &layout_8x8x4,   0x4800, 0x40 }, // [1] Layer 1
2086   { REGION_GFX4, 0, &layout_8x8x6_2,   0x4c00, 0x40 }, // [2] Layer 2
2087   { -1 }
2088};
2067   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4,   0x4400, 0x40 ) // [0] Layer 0
2068   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_8x8x4,   0x4800, 0x40 ) // [1] Layer 1
2069   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x6_2,   0x4c00, 0x40 ) // [2] Layer 2
2070GFXDECODE_END
20892071
20902072
20912073/***************************************************************************
20922074                                Uo Poko
20932075***************************************************************************/
20942076
2095static const gfx_decode uopoko_gfxdecodeinfo[] =
2096{
2077static GFXDECODE_START( uopoko )
20972078//    REGION_GFX1                                       // Sprites
2098   { REGION_GFX2, 0, &layout_8x8x8,   0x4000, 0x40 }, // [0] Layer 0
2099   { -1 }
2100};
2079   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x8,   0x4000, 0x40 ) // [0] Layer 0
2080GFXDECODE_END
21012081
21022082
21032083/***************************************************************************
r1051r1052
21622142   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21632143   MDRV_SCREEN_SIZE(320, 240)
21642144   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2165   MDRV_GFXDECODE(dfeveron_gfxdecodeinfo)
2145   MDRV_GFXDECODE(dfeveron)
21662146   MDRV_PALETTE_LENGTH(0x800)
21672147   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
21682148
r1051r1052
22022182   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22032183   MDRV_SCREEN_SIZE(320, 240)
22042184   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2205   MDRV_GFXDECODE(ddonpach_gfxdecodeinfo)
2185   MDRV_GFXDECODE(ddonpach)
22062186   MDRV_PALETTE_LENGTH(0x8000)
22072187   MDRV_COLORTABLE_LENGTH(0x8000 + 0x40*16)   // $400 extra entries for layers 1&2
22082188
r1051r1052
22422222   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22432223   MDRV_SCREEN_SIZE(320, 240)
22442224   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2245   MDRV_GFXDECODE(donpachi_gfxdecodeinfo)
2225   MDRV_GFXDECODE(donpachi)
22462226   MDRV_PALETTE_LENGTH(0x800)
22472227   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
22482228
r1051r1052
22872267   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22882268   MDRV_SCREEN_SIZE(320, 240)
22892269   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2290   MDRV_GFXDECODE(esprade_gfxdecodeinfo)
2270   MDRV_GFXDECODE(esprade)
22912271   MDRV_PALETTE_LENGTH(0x8000)
22922272
22932273   MDRV_VIDEO_START(cave_3_layers)
r1051r1052
23242304   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23252305   MDRV_SCREEN_SIZE(320, 240)
23262306   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
2327   MDRV_GFXDECODE(esprade_gfxdecodeinfo)
2307   MDRV_GFXDECODE(esprade)
23282308   MDRV_PALETTE_LENGTH(0x8000)
23292309
23302310   MDRV_VIDEO_START(cave_3_layers)
r1051r1052
23622342   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23632343   MDRV_SCREEN_SIZE(320, 240)
23642344   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2365   MDRV_GFXDECODE(esprade_gfxdecodeinfo)
2345   MDRV_GFXDECODE(esprade)
23662346   MDRV_PALETTE_LENGTH(0x8000)
23672347
23682348   MDRV_VIDEO_START(cave_3_layers)
r1051r1052
24042384   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24052385   MDRV_SCREEN_SIZE(384, 240)
24062386   MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1)
2407   MDRV_GFXDECODE(hotdogst_gfxdecodeinfo)
2387   MDRV_GFXDECODE(hotdogst)
24082388   MDRV_PALETTE_LENGTH(0x800)
24092389   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
24102390
r1051r1052
24552435   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24562436   MDRV_SCREEN_SIZE(320, 240)
24572437   MDRV_SCREEN_VISIBLE_AREA(0, 320-1-2, 0, 240-1-1)
2458   MDRV_GFXDECODE(korokoro_gfxdecodeinfo)
2438   MDRV_GFXDECODE(korokoro)
24592439   MDRV_PALETTE_LENGTH(0x4000)
24602440   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
24612441
r1051r1052
25012481   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
25022482   MDRV_SCREEN_SIZE(384, 240)
25032483   MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1)
2504   MDRV_GFXDECODE(mazinger_gfxdecodeinfo)
2484   MDRV_GFXDECODE(mazinger)
25052485   MDRV_PALETTE_LENGTH(0x4000)
25062486   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
25072487
r1051r1052
25582538   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
25592539   MDRV_SCREEN_SIZE(0x200, 240)
25602540   MDRV_SCREEN_VISIBLE_AREA(0x7d, 0x7d + 0x180-1, 0, 240-1)
2561   MDRV_GFXDECODE(donpachi_gfxdecodeinfo)
2541   MDRV_GFXDECODE(donpachi)
25622542   MDRV_PALETTE_LENGTH(0x800)
25632543   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
25642544
r1051r1052
26152595   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
26162596   MDRV_SCREEN_SIZE(0x200, 240)
26172597   MDRV_SCREEN_VISIBLE_AREA(0x70, 0x70 + 0x140-1, 0, 240-1)
2618   MDRV_GFXDECODE(pwrinst2_gfxdecodeinfo)
2598   MDRV_GFXDECODE(pwrinst2)
26192599   MDRV_PALETTE_LENGTH(0x5000/2)
26202600   MDRV_COLORTABLE_LENGTH(0x8000+0x2800)
26212601
r1051r1052
26772657   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
26782658   MDRV_SCREEN_SIZE(320+1, 240)
26792659   MDRV_SCREEN_VISIBLE_AREA(0+1, 320+1-1, 0, 240-1)
2680   MDRV_GFXDECODE(sailormn_gfxdecodeinfo)
2660   MDRV_GFXDECODE(sailormn)
26812661   MDRV_PALETTE_LENGTH(0x2000)
26822662   MDRV_COLORTABLE_LENGTH(0x8000)   /* $8000 palette entries for consistency with the other games */
26832663
r1051r1052
27252705   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
27262706   MDRV_SCREEN_SIZE(320, 240)
27272707   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2728   MDRV_GFXDECODE(uopoko_gfxdecodeinfo)
2708   MDRV_GFXDECODE(uopoko)
27292709   MDRV_PALETTE_LENGTH(0x8000)
27302710
27312711   MDRV_VIDEO_START(cave_1_layer)
src/mame/drivers/dooyong.c
r1051r1052
853853   512*8
854854};
855855
856static const gfx_decode lastday_gfxdecodeinfo[] =
857{
858   { REGION_GFX1, 0, &lastday_charlayout,   0, 16 },
859   { REGION_GFX2, 0, &spritelayout,       256, 16 },
860   { REGION_GFX3, 0, &tilelayout,         768, 16 },
861   { REGION_GFX4, 0, &tilelayout,         512, 16 },
862   { -1 }
863};
856static GFXDECODE_START( lastday )
857   GFXDECODE_ENTRY( REGION_GFX1, 0, lastday_charlayout,   0, 16 )
858   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 16 )
859   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,         768, 16 )
860   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,         512, 16 )
861GFXDECODE_END
864862
865static const gfx_decode flytiger_gfxdecodeinfo[] =
866{
867   { REGION_GFX1, 0, &lastday_charlayout,   0, 16 },
868   { REGION_GFX2, 0, &spritelayout,       256, 16 },
869   { REGION_GFX3, 0, &tilelayout,         768, 16 },
870   { REGION_GFX4, 0, &tilelayout,         512, 32 },
871   { -1 }
872};
863static GFXDECODE_START( flytiger )
864   GFXDECODE_ENTRY( REGION_GFX1, 0, lastday_charlayout,   0, 16 )
865   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 16 )
866   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,         768, 16 )
867   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,         512, 32 )
868GFXDECODE_END
873869
874static const gfx_decode bluehawk_gfxdecodeinfo[] =
875{
876   { REGION_GFX1, 0, &bluehawk_charlayout,  0, 16 },
877   { REGION_GFX2, 0, &spritelayout,       256, 16 },
878   { REGION_GFX3, 0, &tilelayout,         768, 16 },
879   { REGION_GFX4, 0, &tilelayout,         512, 16 },
880   { REGION_GFX5, 0, &tilelayout,           0, 16 },
881   { -1 }
882};
870static GFXDECODE_START( bluehawk )
871   GFXDECODE_ENTRY( REGION_GFX1, 0, bluehawk_charlayout,  0, 16 )
872   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 16 )
873   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,         768, 16 )
874   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout,         512, 16 )
875   GFXDECODE_ENTRY( REGION_GFX5, 0, tilelayout,           0, 16 )
876GFXDECODE_END
883877
884static const gfx_decode primella_gfxdecodeinfo[] =
885{
886   { REGION_GFX1, 0, &bluehawk_charlayout,  0, 16 },
878static GFXDECODE_START( primella )
879   GFXDECODE_ENTRY( REGION_GFX1, 0, bluehawk_charlayout,  0, 16 )
887880   /* no sprites */
888   { REGION_GFX2, 0, &tilelayout,         768, 16 },
889   { REGION_GFX3, 0, &tilelayout,         512, 16 },
890   { -1 }
891};
881   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,         768, 16 )
882   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,         512, 16 )
883GFXDECODE_END
892884
893static const gfx_decode rshark_gfxdecodeinfo[] =
894{
885static GFXDECODE_START( rshark )
895886   /* no chars */
896   { REGION_GFX1, 0, &rshark_spritelayout,  0, 16 },
897   { REGION_GFX2, 0, &spritelayout,       256, 16 },
898   { REGION_GFX3, 0, &spritelayout,       512, 16 },
899   { REGION_GFX4, 0, &spritelayout,       768, 16 },
900   { REGION_GFX5, 0, &spritelayout,      1024, 16 },
901   { -1 }
902};
887   GFXDECODE_ENTRY( REGION_GFX1, 0, rshark_spritelayout,  0, 16 )
888   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256, 16 )
889   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,       512, 16 )
890   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,       768, 16 )
891   GFXDECODE_ENTRY( REGION_GFX5, 0, spritelayout,      1024, 16 )
892GFXDECODE_END
903893
904static const gfx_decode popbingo_gfxdecodeinfo[] =
905{
894static GFXDECODE_START( popbingo )
906895   /* no chars */
907   { REGION_GFX1, 0, &rshark_spritelayout,   0, 16 },
908   { REGION_GFX2, 0, &popbingo_tilelayout, 256,  1 },
909   { -1 }
910};
896   GFXDECODE_ENTRY( REGION_GFX1, 0, rshark_spritelayout,   0, 16 )
897   GFXDECODE_ENTRY( REGION_GFX2, 0, popbingo_tilelayout, 256,  1 )
898GFXDECODE_END
911899
912900static void irqhandler(int irq)
913901{
r1051r1052
1004992   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1005993   MDRV_SCREEN_SIZE(64*8, 32*8)
1006994   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1007   MDRV_GFXDECODE(lastday_gfxdecodeinfo)
995   MDRV_GFXDECODE(lastday)
1008996   MDRV_PALETTE_LENGTH(1024)
1009997
1010998   MDRV_VIDEO_START(lastday)
r1051r1052
10361024   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10371025   MDRV_SCREEN_SIZE(64*8, 32*8)
10381026   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1039   MDRV_GFXDECODE(lastday_gfxdecodeinfo)
1027   MDRV_GFXDECODE(lastday)
10401028   MDRV_PALETTE_LENGTH(1024)
10411029
10421030   MDRV_VIDEO_START(gulfstrm)
r1051r1052
10681056   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10691057   MDRV_SCREEN_SIZE(64*8, 32*8)
10701058   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1071   MDRV_GFXDECODE(lastday_gfxdecodeinfo)
1059   MDRV_GFXDECODE(lastday)
10721060   MDRV_PALETTE_LENGTH(1024)
10731061
10741062   MDRV_VIDEO_START(pollux)
r1051r1052
11001088   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11011089   MDRV_SCREEN_SIZE(64*8, 32*8)
11021090   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1103   MDRV_GFXDECODE(bluehawk_gfxdecodeinfo)
1091   MDRV_GFXDECODE(bluehawk)
11041092   MDRV_PALETTE_LENGTH(1024)
11051093
11061094   MDRV_VIDEO_START(bluehawk)
r1051r1052
11321120   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11331121   MDRV_SCREEN_SIZE(64*8, 32*8)
11341122   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1135   MDRV_GFXDECODE(flytiger_gfxdecodeinfo)
1123   MDRV_GFXDECODE(flytiger)
11361124   MDRV_PALETTE_LENGTH(1024)
11371125
11381126   MDRV_VIDEO_START(flytiger)
r1051r1052
11621150   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
11631151   MDRV_SCREEN_SIZE(64*8, 32*8)
11641152   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 0*8, 32*8-1 )
1165   MDRV_GFXDECODE(primella_gfxdecodeinfo)
1153   MDRV_GFXDECODE(primella)
11661154   MDRV_PALETTE_LENGTH(1024)
11671155
11681156   MDRV_VIDEO_START(primella)
r1051r1052
12001188   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12011189   MDRV_SCREEN_SIZE(64*8, 32*8)
12021190   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1203   MDRV_GFXDECODE(rshark_gfxdecodeinfo)
1191   MDRV_GFXDECODE(rshark)
12041192   MDRV_PALETTE_LENGTH(2048)
12051193
12061194   MDRV_VIDEO_START(rshark)
r1051r1052
12301218   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12311219   MDRV_SCREEN_SIZE(64*8, 32*8)
12321220   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1233   MDRV_GFXDECODE(rshark_gfxdecodeinfo)
1221   MDRV_GFXDECODE(rshark)
12341222   MDRV_PALETTE_LENGTH(2048)
12351223
12361224   MDRV_VIDEO_START(rshark)
r1051r1052
12601248   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12611249   MDRV_SCREEN_SIZE(64*8, 32*8)
12621250   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1263   MDRV_GFXDECODE(popbingo_gfxdecodeinfo)
1251   MDRV_GFXDECODE(popbingo)
12641252   MDRV_PALETTE_LENGTH(2048)
12651253
12661254   MDRV_VIDEO_START(popbingo)
src/mame/drivers/brkthru.c
r1051r1052
386386   32*8   /* every sprite takes 32 consecutive bytes */
387387};
388388
389static const gfx_decode gfxdecodeinfo[] =
390{
391   { REGION_GFX1, 0x00000, &charlayout,   0x00,  1 },   /* use colors 0x00-0x07 */
392   { REGION_GFX2, 0x00000, &tilelayout1,  0x80, 16 },   /* use colors 0x80-0xff */
393   { REGION_GFX2, 0x01000, &tilelayout2,  0x80, 16 },
394   { REGION_GFX2, 0x08000, &tilelayout1,  0x80, 16 },
395   { REGION_GFX2, 0x09000, &tilelayout2,  0x80, 16 },
396   { REGION_GFX2, 0x10000, &tilelayout1,  0x80, 16 },
397   { REGION_GFX2, 0x11000, &tilelayout2,  0x80, 16 },
398   { REGION_GFX2, 0x18000, &tilelayout1,  0x80, 16 },
399   { REGION_GFX2, 0x19000, &tilelayout2,  0x80, 16 },
400   { REGION_GFX3, 0x00000, &spritelayout, 0x40,  8 },   /* use colors 0x40-0x7f */
401   { -1 }
402};
389static GFXDECODE_START( brkthru )
390   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,   0x00,  1 )   /* use colors 0x00-0x07 */
391   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, tilelayout1,  0x80, 16 )   /* use colors 0x80-0xff */
392   GFXDECODE_ENTRY( REGION_GFX2, 0x01000, tilelayout2,  0x80, 16 )
393   GFXDECODE_ENTRY( REGION_GFX2, 0x08000, tilelayout1,  0x80, 16 )
394   GFXDECODE_ENTRY( REGION_GFX2, 0x09000, tilelayout2,  0x80, 16 )
395   GFXDECODE_ENTRY( REGION_GFX2, 0x10000, tilelayout1,  0x80, 16 )
396   GFXDECODE_ENTRY( REGION_GFX2, 0x11000, tilelayout2,  0x80, 16 )
397   GFXDECODE_ENTRY( REGION_GFX2, 0x18000, tilelayout1,  0x80, 16 )
398   GFXDECODE_ENTRY( REGION_GFX2, 0x19000, tilelayout2,  0x80, 16 )
399   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, spritelayout, 0x40,  8 )   /* use colors 0x40-0x7f */
400GFXDECODE_END
403401
404402/* handler called by the 3812 emulator when the internal timers cause an IRQ */
405403static void irqhandler(int linestate)
r1051r1052
433431   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
434432   MDRV_SCREEN_SIZE(32*8, 32*8)
435433   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)   /* not sure */
436   MDRV_GFXDECODE(gfxdecodeinfo)
434   MDRV_GFXDECODE(brkthru)
437435   MDRV_PALETTE_LENGTH(256)
438436
439437   MDRV_PALETTE_INIT(brkthru)
r1051r1052
485483   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
486484   MDRV_SCREEN_SIZE(32*8, 32*8)
487485   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
488   MDRV_GFXDECODE(gfxdecodeinfo)
486   MDRV_GFXDECODE(brkthru)
489487   MDRV_PALETTE_LENGTH(256)
490488
491489   MDRV_PALETTE_INIT(brkthru)
src/mame/drivers/williams.c
r1051r1052
13521352};
13531353
13541354
1355static const gfx_decode williams2_gfxdecodeinfo[] =
1356{
1357   { REGION_GFX1, 0, &williams2_layout, 0, 8 },
1358   { -1 }
1359};
1355static GFXDECODE_START( williams2 )
1356   GFXDECODE_ENTRY( REGION_GFX1, 0, williams2_layout, 0, 8 )
1357GFXDECODE_END
13601358
13611359
13621360
r1051r1052
14861484
14871485   /* video hardware */
14881486   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1489   MDRV_GFXDECODE(williams2_gfxdecodeinfo)
1487   MDRV_GFXDECODE(williams2)
14901488   MDRV_PALETTE_LENGTH(1024)
14911489
14921490   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/fuukifg3.c
r1051r1052
519519   16*16*4
520520};
521521
522static const gfx_decode fuuki32_gfxdecodeinfo[] =
523{
524   { REGION_GFX1, 0, &layout_16x16x4, 0x400*2, 0x40 }, // [0] Sprites
525   { REGION_GFX2, 0, &layout_16x16x8, 0x400*0, 0x40 }, // [1] Layer 1
526   { REGION_GFX3, 0, &layout_16x16x8, 0x400*1, 0x40 }, // [2] Layer 2
527   { REGION_GFX4, 0, &layout_8x8x4,   0x400*3, 0x40 }, // [3] BG Layer
528   { REGION_GFX4, 0, &layout_8x8x4,   0x400*3, 0x40 }, // [4] BG Layer 2 (GFX4!)
529   { -1 }
530};
522static GFXDECODE_START( fuuki32 )
523   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0x400*2, 0x40 ) // [0] Sprites
524   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_16x16x8, 0x400*0, 0x40 ) // [1] Layer 1
525   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_16x16x8, 0x400*1, 0x40 ) // [2] Layer 2
526   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x400*3, 0x40 ) // [3] BG Layer
527   GFXDECODE_ENTRY( REGION_GFX4, 0, layout_8x8x4,   0x400*3, 0x40 ) // [4] BG Layer 2 (GFX4!)
528GFXDECODE_END
531529
532530
533531/***************************************************************************
r1051r1052
609607   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
610608   MDRV_SCREEN_SIZE(64*8, 32*8)
611609   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 30*8-1)
612   MDRV_GFXDECODE(fuuki32_gfxdecodeinfo)
610   MDRV_GFXDECODE(fuuki32)
613611   MDRV_PALETTE_LENGTH(0x4000/2)
614612
615613   MDRV_VIDEO_START(fuuki32)
src/mame/drivers/dec8.c
r1051r1052
20222022   16*16
20232023};
20242024
2025static const gfx_decode cobracom_gfxdecodeinfo[] =
2026{
2027   { REGION_GFX1, 0, &charlayout_32k, 0, 8 },
2028   { REGION_GFX2, 0, &tiles,         64, 4 },
2029   { REGION_GFX4, 0, &tiles,        128, 4 },
2030   { REGION_GFX3, 0, &tiles,        192, 4 },
2031   { -1 }
2032};
2025static GFXDECODE_START( cobracom )
2026   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_32k, 0, 8 )
2027   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles,         64, 4 )
2028   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles,        128, 4 )
2029   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles,        192, 4 )
2030GFXDECODE_END
20332031
2034static const gfx_decode ghostb_gfxdecodeinfo[] =
2035{
2036   { REGION_GFX1, 0, &chars_3bpp,   0,  4 },
2037   { REGION_GFX2, 0, &tiles,     256, 16 },
2038   { REGION_GFX3, 0, &tiles_r,   512, 16 },
2039   { -1 }
2040};
2032static GFXDECODE_START( ghostb )
2033   GFXDECODE_ENTRY( REGION_GFX1, 0, chars_3bpp,   0,  4 )
2034   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles,     256, 16 )
2035   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles_r,   512, 16 )
2036GFXDECODE_END
20412037
2042static const gfx_decode srdarwin_gfxdecodeinfo[] =
2043{
2044   { REGION_GFX1, 0x00000, &charlayout_16k,128, 4 }, /* Only 1 used so far :/ */
2045   { REGION_GFX2, 0x00000, &sr_sprites,     64, 8 },
2046   { REGION_GFX3, 0x00000, &srdarwin_tiles,  0, 8 },
2047     { REGION_GFX3, 0x10000, &srdarwin_tiles,  0, 8 },
2048    { REGION_GFX3, 0x20000, &srdarwin_tiles,  0, 8 },
2049    { REGION_GFX3, 0x30000, &srdarwin_tiles,  0, 8 },
2050   { -1 }
2051};
2038static GFXDECODE_START( srdarwin )
2039   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout_16k,128, 4 ) /* Only 1 used so far :/ */
2040   GFXDECODE_ENTRY( REGION_GFX2, 0x00000, sr_sprites,     64, 8 )
2041   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, srdarwin_tiles,  0, 8 )
2042     GFXDECODE_ENTRY( REGION_GFX3, 0x10000, srdarwin_tiles,  0, 8 )
2043    GFXDECODE_ENTRY( REGION_GFX3, 0x20000, srdarwin_tiles,  0, 8 )
2044    GFXDECODE_ENTRY( REGION_GFX3, 0x30000, srdarwin_tiles,  0, 8 )
2045GFXDECODE_END
20522046
2053static const gfx_decode gondo_gfxdecodeinfo[] =
2054{
2055   { REGION_GFX1, 0, &chars_3bpp,  0, 16 }, /* Chars */
2056   { REGION_GFX2, 0, &tiles,     256, 32 }, /* Sprites */
2057   { REGION_GFX3, 0, &tiles,     768, 16 }, /* Tiles */
2058    { -1 }
2059};
2047static GFXDECODE_START( gondo )
2048   GFXDECODE_ENTRY( REGION_GFX1, 0, chars_3bpp,  0, 16 ) /* Chars */
2049   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles,     256, 32 ) /* Sprites */
2050   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles,     768, 16 ) /* Tiles */
2051GFXDECODE_END
20602052
2061static const gfx_decode oscar_gfxdecodeinfo[] =
2062{
2063   { REGION_GFX1, 0, &oscar_charlayout, 256,  8 }, /* Chars */
2064   { REGION_GFX2, 0, &tiles,              0, 16 }, /* Sprites */
2065   { REGION_GFX3, 0, &tiles,            384,  8 }, /* Tiles */
2066    { -1 }
2067};
2053static GFXDECODE_START( oscar )
2054   GFXDECODE_ENTRY( REGION_GFX1, 0, oscar_charlayout, 256,  8 ) /* Chars */
2055   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles,              0, 16 ) /* Sprites */
2056   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles,            384,  8 ) /* Tiles */
2057GFXDECODE_END
20682058
2069static const gfx_decode shackled_gfxdecodeinfo[] =
2070{
2071   { REGION_GFX1, 0, &chars_3bpp,   0,  4 },
2072   { REGION_GFX2, 0, &tiles,      256, 16 },
2073   { REGION_GFX3, 0, &tiles,      768, 16 },
2074    { -1 }
2075};
2059static GFXDECODE_START( shackled )
2060   GFXDECODE_ENTRY( REGION_GFX1, 0, chars_3bpp,   0,  4 )
2061   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles,      256, 16 )
2062   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles,      768, 16 )
2063GFXDECODE_END
20762064
20772065/******************************************************************************/
20782066
r1051r1052
21682156   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21692157   MDRV_SCREEN_SIZE(32*8, 32*8)
21702158   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2171   MDRV_GFXDECODE(cobracom_gfxdecodeinfo)
2159   MDRV_GFXDECODE(cobracom)
21722160   MDRV_PALETTE_LENGTH(256)
21732161
21742162   MDRV_VIDEO_START(cobracom)
r1051r1052
22072195   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22082196   MDRV_SCREEN_SIZE(32*8, 32*8)
22092197   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2210   MDRV_GFXDECODE(ghostb_gfxdecodeinfo)
2198   MDRV_GFXDECODE(ghostb)
22112199   MDRV_PALETTE_LENGTH(1024)
22122200
22132201   MDRV_PALETTE_INIT(ghostb)
r1051r1052
22482236   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22492237   MDRV_SCREEN_SIZE(32*8, 32*8)
22502238   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2251   MDRV_GFXDECODE(srdarwin_gfxdecodeinfo)
2239   MDRV_GFXDECODE(srdarwin)
22522240   MDRV_PALETTE_LENGTH(144)
22532241
22542242   MDRV_VIDEO_START(srdarwin)
r1051r1052
22872275   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22882276   MDRV_SCREEN_SIZE(32*8, 32*8)
22892277   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2290   MDRV_GFXDECODE(gondo_gfxdecodeinfo)
2278   MDRV_GFXDECODE(gondo)
22912279   MDRV_PALETTE_LENGTH(1024)
22922280
22932281   MDRV_VIDEO_START(gondo)
r1051r1052
23312319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23322320   MDRV_SCREEN_SIZE(32*8, 32*8)
23332321   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2334   MDRV_GFXDECODE(oscar_gfxdecodeinfo)
2322   MDRV_GFXDECODE(oscar)
23352323   MDRV_PALETTE_LENGTH(512)
23362324
23372325   MDRV_VIDEO_START(oscar)
r1051r1052
23732361   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23742362   MDRV_SCREEN_SIZE(32*8, 32*8)
23752363   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2376   MDRV_GFXDECODE(shackled_gfxdecodeinfo)
2364   MDRV_GFXDECODE(shackled)
23772365   MDRV_PALETTE_LENGTH(1024)
23782366
23792367   MDRV_VIDEO_START(lastmiss)
r1051r1052
24152403   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24162404   MDRV_SCREEN_SIZE(32*8, 32*8)
24172405   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2418   MDRV_GFXDECODE(shackled_gfxdecodeinfo)
2406   MDRV_GFXDECODE(shackled)
24192407   MDRV_PALETTE_LENGTH(1024)
24202408
24212409   MDRV_VIDEO_START(shackled)
r1051r1052
24582446   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
24592447   MDRV_SCREEN_SIZE(32*8, 32*8)
24602448   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2461   MDRV_GFXDECODE(shackled_gfxdecodeinfo)
2449   MDRV_GFXDECODE(shackled)
24622450   MDRV_PALETTE_LENGTH(1024)
24632451
24642452   MDRV_VIDEO_START(lastmiss)
r1051r1052
25012489   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
25022490   MDRV_SCREEN_SIZE(32*8, 32*8)
25032491   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2504   MDRV_GFXDECODE(gondo_gfxdecodeinfo)
2492   MDRV_GFXDECODE(gondo)
25052493   MDRV_PALETTE_LENGTH(1024)
25062494
25072495   MDRV_VIDEO_START(garyoret)
src/mame/drivers/rcorsair.c
r1051r1052
100100   8*8
101101};
102102
103static const gfx_decode gfxdecodeinfo[] =
104{
105   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
106   { -1 }
107};
103static GFXDECODE_START( rcorsair )
104   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
105GFXDECODE_END
108106
109107VIDEO_START( rcorsair )
110108{
r1051r1052
132130   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
133131   MDRV_SCREEN_SIZE(256, 256)
134132   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
135   MDRV_GFXDECODE(gfxdecodeinfo)
133   MDRV_GFXDECODE(rcorsair)
136134   MDRV_PALETTE_LENGTH(0x100)
137135
138136   MDRV_VIDEO_START(rcorsair)
src/mame/drivers/mnight.c
r1051r1052
329329};
330330
331331
332static const gfx_decode gfxdecodeinfo[] =
333{
334   { REGION_GFX1, 0, &spritelayout,     0*16, 16},
335   { REGION_GFX2, 0, &spritelayout,    16*16, 16},
336   { REGION_GFX2, 0, &bigspritelayout, 16*16, 16},
337   { REGION_GFX3, 0, &charlayout,      32*16, 16},
338   { -1}
339};
332static GFXDECODE_START( mnight )
333   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0*16, 16)
334   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,    16*16, 16)
335   GFXDECODE_ENTRY( REGION_GFX2, 0, bigspritelayout, 16*16, 16)
336   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,      32*16, 16)
337GFXDECODE_END
340338
341339
342340static MACHINE_DRIVER_START( mnight )
r1051r1052
363361   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
364362   MDRV_SCREEN_SIZE(32*8, 32*8)
365363   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
366   MDRV_GFXDECODE(gfxdecodeinfo)
364   MDRV_GFXDECODE(mnight)
367365   MDRV_PALETTE_LENGTH(768)
368366
369367   MDRV_VIDEO_START(mnight)
src/mame/drivers/pkunwar.c
r1051r1052
144144   64*8
145145};
146146
147static const gfx_decode gfxdecodeinfo[] =
148{
149   { REGION_GFX1, 0x0000, &charlayout,   16*16, 16 },
150   { REGION_GFX1, 0x0000, &spritelayout,     0, 16 },
151   { -1 }
152};
147static GFXDECODE_START( pkunwar )
148   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   16*16, 16 )
149   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,     0, 16 )
150GFXDECODE_END
153151
154152
155153
r1051r1052
181179   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
182180   MDRV_SCREEN_SIZE(32*8, 32*8)
183181   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
184   MDRV_GFXDECODE(gfxdecodeinfo)
182   MDRV_GFXDECODE(pkunwar)
185183   MDRV_PALETTE_LENGTH(32)
186184   MDRV_COLORTABLE_LENGTH(32*16)
187185
src/mame/drivers/tbowl.c
r1051r1052
543543   8*32   /* offset to next tile */
544544};
545545
546static const gfx_decode gfxdecodeinfo[] =
547{
548   { REGION_GFX1, 0, &charlayout,   256, 16 },
549   { REGION_GFX2, 0, &bgtilelayout, 768, 16 },
550   { REGION_GFX2, 0, &bgtilelayout, 512, 16 },
551   { REGION_GFX3, 0, &sprite8layout, 0,   16 },
546static GFXDECODE_START( tbowl )
547   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   256, 16 )
548   GFXDECODE_ENTRY( REGION_GFX2, 0, bgtilelayout, 768, 16 )
549   GFXDECODE_ENTRY( REGION_GFX2, 0, bgtilelayout, 512, 16 )
550   GFXDECODE_ENTRY( REGION_GFX3, 0, sprite8layout, 0,   16 )
552551
553   { -1 }
554};
552GFXDECODE_END
555553
556554/*** Sound Bits
557555
r1051r1052
606604
607605   /* video hardware */
608606   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
609   MDRV_GFXDECODE(gfxdecodeinfo)
607   MDRV_GFXDECODE(tbowl)
610608   MDRV_PALETTE_LENGTH(1024*2)
611609   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
612610
src/mame/drivers/battlane.c
r1051r1052
234234};
235235
236236
237static const gfx_decode gfxdecodeinfo[] =
238{
239   { REGION_GFX1, 0, &spritelayout,  0, 2 },   /* colors 0x00-0x0f */
240   { REGION_GFX2, 0, &tilelayout,   32, 4 },   /* colors 0x20-0x3f */
241   { REGION_GFX2, 0, &tilelayout2,  32, 4 },   /* colors 0x20-0x3f */
242   { -1 }
243};
237static GFXDECODE_START( battlane )
238   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,  0, 2 )   /* colors 0x00-0x0f */
239   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,   32, 4 )   /* colors 0x20-0x3f */
240   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout2,  32, 4 )   /* colors 0x20-0x3f */
241GFXDECODE_END
244242
245243
246244static void irqhandler(int irq)
r1051r1052
273271   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
274272   MDRV_SCREEN_SIZE(32 * 8, 32 * 8)
275273   MDRV_SCREEN_VISIBLE_AREA(1 * 8, 31 * 8 - 1, 0 * 8, 32 * 8 - 1)
276   MDRV_GFXDECODE(gfxdecodeinfo)
274   MDRV_GFXDECODE(battlane)
277275   MDRV_PALETTE_LENGTH(64)
278276
279277   MDRV_VIDEO_START(battlane)
src/mame/drivers/atarigt.c
r1051r1052
787787};
788788
789789
790static const gfx_decode gfxdecodeinfo[] =
791{
792   { REGION_GFX1, 0, &pflayout, 0x000, 64 },
793   { REGION_GFX2, 0, &anlayout, 0x000, 16 },
794   { REGION_GFX1, 0, &pftoplayout, 0x000, 64 },
795   { -1 }
796};
790static GFXDECODE_START( atarigt )
791   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout, 0x000, 64 )
792   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout, 0x000, 16 )
793   GFXDECODE_ENTRY( REGION_GFX1, 0, pftoplayout, 0x000, 64 )
794GFXDECODE_END
797795
798796
799797
r1051r1052
816814
817815   /* video hardware */
818816   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
819   MDRV_GFXDECODE(gfxdecodeinfo)
817   MDRV_GFXDECODE(atarigt)
820818   MDRV_PALETTE_LENGTH(32768)
821819
822820   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/cherrym2.c
r1051r1052
329329   spritelayout2_yoffset
330330};
331331
332static const gfx_decode gfxdecodeinfo[] =
333{
334   { REGION_GFX1, 0x0000, &charlayout,      0, 16 },
335   { -1 }
336};
332static GFXDECODE_START( cherrym2 )
333   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 )
334GFXDECODE_END
337335
338static const gfx_decode gfxdecodeinfoalt[] =
339{
340   { REGION_GFX1, 0x0000, &charlayout,      0, 16 },
341   { REGION_GFX2, 0x0040, &spritelayout,  0, 16 },
342   { REGION_GFX3, 0x0100, &spritelayout2, 0, 16 },
343   { -1 }
344};
336static GFXDECODE_START( alt )
337   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 )
338   GFXDECODE_ENTRY( REGION_GFX2, 0x0040, spritelayout,  0, 16 )
339   GFXDECODE_ENTRY( REGION_GFX3, 0x0100, spritelayout2, 0, 16 )
340GFXDECODE_END
345341
346342
347343static struct AY8910interface ay8910_interface =
r1051r1052
370366   MDRV_SCREEN_SIZE(32*8, 32*8)
371367   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
372368
373   MDRV_GFXDECODE(gfxdecodeinfo)
369   MDRV_GFXDECODE(cherrym2)
374370   MDRV_PALETTE_LENGTH(256)
375371   MDRV_COLORTABLE_LENGTH(256)
376372
r1051r1052
387383static MACHINE_DRIVER_START( cm2841a )
388384
389385   MDRV_IMPORT_FROM(cm2v841)
390   MDRV_GFXDECODE(gfxdecodeinfoalt)
386   MDRV_GFXDECODE(alt)
391387   MACHINE_DRIVER_END
392388
393389
src/mame/drivers/rbmk.c
r1051r1052
442442};
443443
444444
445static const gfx_decode gfxdecodeinfo[] =
446{
447   { REGION_GFX1, 0, &rbmk32_layout,   0x0, 16  },
448   { REGION_GFX2, 0, &rbmk8_layout,   0x100, 16  },
449   { -1 }
450};
445static GFXDECODE_START( rbmk )
446   GFXDECODE_ENTRY( REGION_GFX1, 0, rbmk32_layout,   0x0, 16  )
447   GFXDECODE_ENTRY( REGION_GFX2, 0, rbmk8_layout,   0x100, 16  )
448GFXDECODE_END
451449
452450VIDEO_START(rbmk)
453451{
r1051r1052
509507   MDRV_SCREEN_REFRESH_RATE(58)
510508   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
511509
512   MDRV_GFXDECODE(gfxdecodeinfo)
510   MDRV_GFXDECODE(rbmk)
513511
514512   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
515513   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/bigfghtr.c
r1051r1052
407407   64*8
408408};
409409
410static const gfx_decode gfxdecodeinfo[] =
411{
412   { REGION_GFX1, 0, &char_layout,       0*16,   32 },
413   { REGION_GFX2, 0, &tile_layout,      64*16,   32 },
414   { REGION_GFX3, 0, &tile_layout,      96*16,   32 },
415   { REGION_GFX4, 0, &sprite_layout,   32*16,   32 },
416   { -1 }
417};
410static GFXDECODE_START( bigfghtr )
411   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,       0*16,   32 )
412   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout,      64*16,   32 )
413   GFXDECODE_ENTRY( REGION_GFX3, 0, tile_layout,      96*16,   32 )
414   GFXDECODE_ENTRY( REGION_GFX4, 0, sprite_layout,   32*16,   32 )
415GFXDECODE_END
418416
419417
420418
r1051r1052
438436   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
439437   MDRV_SCREEN_SIZE(64*8, 32*8)
440438   MDRV_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 1*8, 31*8-1 )
441   MDRV_GFXDECODE(gfxdecodeinfo)
439   MDRV_GFXDECODE(bigfghtr)
442440   MDRV_PALETTE_LENGTH(2048)
443441
444442   MDRV_VIDEO_EOF(bigfghtr)
src/mame/drivers/amidar.c
r1051r1052
3535};
3636
3737
38static gfx_decode amidar_gfxdecodeinfo[] =
39{
40   { REGION_GFX1, 0x0000, &amidar_charlayout,   0, 8 },
41   { REGION_GFX1, 0x0000, &amidar_spritelayout, 0, 8 },
42   { -1 }
43};
38static GFXDECODE_START( amidar )
39   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, amidar_charlayout,   0, 8 )
40   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, amidar_spritelayout, 0, 8 )
41GFXDECODE_END
4442
4543
4644static UINT8 *amidar_soundram;
r1051r1052
416414   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
417415   MDRV_SCREEN_SIZE(32*8, 32*8)
418416   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
419   MDRV_GFXDECODE(amidar_gfxdecodeinfo)
417   MDRV_GFXDECODE(amidar)
420418   MDRV_PALETTE_LENGTH(32+64+2+8)
421419
422420   MDRV_PALETTE_INIT(turtles)
src/mame/drivers/thepit.c
r1051r1052
615615};
616616
617617
618static const gfx_decode thepit_gfxdecodeinfo[] =
619{
620   { REGION_GFX1, 0, &thepit_charlayout,   0, 8 },
621   { REGION_GFX1, 0, &thepit_spritelayout, 0, 8 },
622   { -1 }
623};
618static GFXDECODE_START( thepit )
619   GFXDECODE_ENTRY( REGION_GFX1, 0, thepit_charlayout,   0, 8 )
620   GFXDECODE_ENTRY( REGION_GFX1, 0, thepit_spritelayout, 0, 8 )
621GFXDECODE_END
624622
625static const gfx_decode intrepid_gfxdecodeinfo[] =
626{
627   { REGION_GFX1, 0x0000, &thepit_charlayout,   0, 8 },
628   { REGION_GFX1, 0x0000, &thepit_spritelayout, 0, 8 },
629   { REGION_GFX1, 0x0800, &thepit_charlayout,   0, 8 },
630   { REGION_GFX1, 0x0800, &thepit_spritelayout, 0, 8 },
631   { -1 }
632};
623static GFXDECODE_START( intrepid )
624   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, thepit_charlayout,   0, 8 )
625   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, thepit_spritelayout, 0, 8 )
626   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, thepit_charlayout,   0, 8 )
627   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, thepit_spritelayout, 0, 8 )
628GFXDECODE_END
633629
634static const gfx_decode suprmous_gfxdecodeinfo[] =
635{
636   { REGION_GFX1, 0x0000, &suprmous_charlayout,   0, 4 },
637   { REGION_GFX1, 0x0800, &suprmous_spritelayout, 0, 4 },
638   { -1 }
639};
630static GFXDECODE_START( suprmous )
631   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, suprmous_charlayout,   0, 4 )
632   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, suprmous_spritelayout, 0, 4 )
633GFXDECODE_END
640634
641635
642636static struct AY8910interface ay8910_interface =
r1051r1052
659653
660654   /* video hardware */
661655   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
662   MDRV_GFXDECODE(thepit_gfxdecodeinfo)
656   MDRV_GFXDECODE(thepit)
663657   MDRV_PALETTE_LENGTH(32+8)
664658
665659   MDRV_SCREEN_ADD("main", 0)
r1051r1052
690684   MDRV_CPU_PROGRAM_MAP(intrepid_main_map,0)
691685
692686   /* video hardware */
693   MDRV_GFXDECODE(intrepid_gfxdecodeinfo)
687   MDRV_GFXDECODE(intrepid)
694688MACHINE_DRIVER_END
695689
696690
r1051r1052
701695
702696   /* video hardware */
703697   MDRV_PALETTE_INIT(suprmous)
704   MDRV_GFXDECODE(suprmous_gfxdecodeinfo)
698   MDRV_GFXDECODE(suprmous)
705699MACHINE_DRIVER_END
706700
707701
src/mame/drivers/trvmadns.c
r1051r1052
239239   8*16
240240};
241241
242static const gfx_decode gfxdecodeinfo[] =
243{
244   { REGION_CPU1, 0x6000, &charlayout, 0, 4 }, // doesn't matter where we point this, all the tiles are decoded while the game runs
245   { -1 }
246};
242static GFXDECODE_START( trvmadns )
243   GFXDECODE_ENTRY( REGION_CPU1, 0x6000, charlayout, 0, 4 ) // doesn't matter where we point this, all the tiles are decoded while the game runs
244GFXDECODE_END
247245
248246static TILE_GET_INFO( get_bg_tile_info )
249247{
r1051r1052
293291   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
294292   MDRV_SCREEN_SIZE(256, 256)
295293   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 30*8-1)
296   MDRV_GFXDECODE(gfxdecodeinfo)
294   MDRV_GFXDECODE(trvmadns)
297295   MDRV_PALETTE_LENGTH(16)
298296
299297   MDRV_VIDEO_START(trvmadns)
src/mame/drivers/cloud9.c
r1051r1052
428428 *
429429 *************************************/
430430
431static const gfx_decode gfxdecodeinfo[] =
432{
433   { REGION_GFX1, 0x0000, &gfx_16x16x4_planar, 0, 4 },
434   { -1 }
435};
431static GFXDECODE_START( cloud9 )
432   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, gfx_16x16x4_planar, 0, 4 )
433GFXDECODE_END
436434
437435
438436
r1051r1052
469467
470468   /* video hardware */
471469   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
472   MDRV_GFXDECODE(gfxdecodeinfo)
470   MDRV_GFXDECODE(cloud9)
473471   MDRV_PALETTE_LENGTH(64)
474472
475473   MDRV_SCREEN_ADD("main", 0)
src/mame/drivers/rpunch.c
r1051r1052
580580};
581581
582582
583static const gfx_decode gfxdecodeinfo[] =
584{
585   { REGION_GFX1, 0, &bglayout,   0, 16 },
586   { REGION_GFX2, 0, &bglayout, 256, 16 },
587   { REGION_GFX3, 0, &splayout,   0, 16*4 },
588   { -1 }
589};
583static GFXDECODE_START( rpunch )
584   GFXDECODE_ENTRY( REGION_GFX1, 0, bglayout,   0, 16 )
585   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout, 256, 16 )
586   GFXDECODE_ENTRY( REGION_GFX3, 0, splayout,   0, 16*4 )
587GFXDECODE_END
590588
591589
592590
r1051r1052
633631   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
634632   MDRV_SCREEN_SIZE(304, 224)
635633   MDRV_SCREEN_VISIBLE_AREA(8, 303-8, 0, 223-8)
636   MDRV_GFXDECODE(gfxdecodeinfo)
634   MDRV_GFXDECODE(rpunch)
637635   MDRV_PALETTE_LENGTH(1024)
638636
639637   MDRV_VIDEO_START(rpunch)
src/mame/drivers/yard.c
r1051r1052
185185
186186/* Graphics Decode Information */
187187
188static const gfx_decode gfxdecodeinfo[] =
189{
190   { REGION_GFX1, 0, &charlayout,      0, 32 },   // use colors 0-255
191   { REGION_GFX2, 0, &spritelayout, 32*8, 32 },   // use colors 256-271 with lookup table
192   { -1 }                                 // bitmapped radar uses colors 272-527
193};
188static GFXDECODE_START( yard )
189   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 32 )   // use colors 0-255
190   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 32*8, 32 )   // use colors 256-271 with lookup table
191GFXDECODE_END// bitmapped radar uses colors 272-527
194192
193
195194/* Machine Driver */
196195
197196static MACHINE_DRIVER_START( yard )
r1051r1052
211210   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
212211   MDRV_SCREEN_SIZE(32*8, 32*8)
213212   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
214   MDRV_GFXDECODE(gfxdecodeinfo)
213   MDRV_GFXDECODE(yard)
215214   MDRV_PALETTE_LENGTH(256+16+256)
216215   MDRV_COLORTABLE_LENGTH(32*8+32*8)
217216
src/mame/drivers/rabbit.c
r1051r1052
10241024};
10251025
10261026
1027static const gfx_decode gfxdecodeinfo[] =
1028{
1027static GFXDECODE_START( rabbit )
10291028   /* this seems to be sprites */
1030   { REGION_USER1, 0, &rabbit_sprite_8x8x4_layout,   0x0, 0x1000  },
1031   { REGION_USER1, 0, &rabbit_sprite_16x16x4_layout, 0x0, 0x1000  },
1032   { REGION_USER1, 0, &rabbit_sprite_8x8x8_layout,   0x0, 0x1000  }, // wrong
1033   { REGION_USER1, 0, &rabbit_sprite_16x16x8_layout, 0x0, 0x1000  }, // wrong
1029   GFXDECODE_ENTRY( REGION_USER1, 0, rabbit_sprite_8x8x4_layout,   0x0, 0x1000  )
1030   GFXDECODE_ENTRY( REGION_USER1, 0, rabbit_sprite_16x16x4_layout, 0x0, 0x1000  )
1031   GFXDECODE_ENTRY( REGION_USER1, 0, rabbit_sprite_8x8x8_layout,   0x0, 0x1000  ) // wrong
1032   GFXDECODE_ENTRY( REGION_USER1, 0, rabbit_sprite_16x16x8_layout, 0x0, 0x1000  ) // wrong
10341033
10351034   /* this seems to be backgrounds and tilemap gfx */
1036   { REGION_USER2, 0, &rabbit_8x8x4_layout,   0x0, 0x1000  },
1037   { REGION_USER2, 0, &rabbit_16x16x4_layout, 0x0, 0x1000  },
1038   { REGION_USER2, 0, &rabbit_8x8x8_layout,   0x0, 0x1000  },
1039   { REGION_USER2, 0, &rabbit_16x16x8_layout, 0x0, 0x1000  },
1035   GFXDECODE_ENTRY( REGION_USER2, 0, rabbit_8x8x4_layout,   0x0, 0x1000  )
1036   GFXDECODE_ENTRY( REGION_USER2, 0, rabbit_16x16x4_layout, 0x0, 0x1000  )
1037   GFXDECODE_ENTRY( REGION_USER2, 0, rabbit_8x8x8_layout,   0x0, 0x1000  )
1038   GFXDECODE_ENTRY( REGION_USER2, 0, rabbit_16x16x8_layout, 0x0, 0x1000  )
10401039
1041   { -1 }
1042};
1040GFXDECODE_END
10431041
10441042/* irq 6 = vblank
10451043   irq 4 = blitter done?
r1051r1052
10841082   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
10851083   MDRV_NVRAM_HANDLER(93C46)
10861084
1087   MDRV_GFXDECODE(gfxdecodeinfo)
1085   MDRV_GFXDECODE(rabbit)
10881086
10891087
10901088   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/asuka.c
r1051r1052
799799   128*8
800800};
801801
802static const gfx_decode gfxdecodeinfo[] =
803{
804   { REGION_GFX2, 0, &tilelayout,  0, 256 },   /* OBJ */
805   { REGION_GFX1, 0, &charlayout,  0, 256 },   /* SCR */
806   { -1 }
807};
802static GFXDECODE_START( asuka )
803   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 256 )   /* OBJ */
804   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 256 )   /* SCR */
805GFXDECODE_END
808806
809807
810808
r1051r1052
867865   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
868866   MDRV_SCREEN_SIZE(40*8, 32*8)
869867   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 3*8, 31*8-1)
870   MDRV_GFXDECODE(gfxdecodeinfo)
868   MDRV_GFXDECODE(asuka)
871869   MDRV_PALETTE_LENGTH(4096)
872870
873871   MDRV_VIDEO_START(asuka)
r1051r1052
903901   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
904902   MDRV_SCREEN_SIZE(40*8, 32*8)
905903   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
906   MDRV_GFXDECODE(gfxdecodeinfo)
904   MDRV_GFXDECODE(asuka)
907905   MDRV_PALETTE_LENGTH(4096)
908906
909907   MDRV_VIDEO_START(asuka)
r1051r1052
942940   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
943941   MDRV_SCREEN_SIZE(40*8, 32*8)
944942   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
945   MDRV_GFXDECODE(gfxdecodeinfo)
943   MDRV_GFXDECODE(asuka)
946944   MDRV_PALETTE_LENGTH(4096)
947945
948946   MDRV_VIDEO_START(cadash)
r1051r1052
977975   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
978976   MDRV_SCREEN_SIZE(40*8, 32*8)
979977   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
980   MDRV_GFXDECODE(gfxdecodeinfo)
978   MDRV_GFXDECODE(asuka)
981979   MDRV_PALETTE_LENGTH(4096)   /* only Mofflott uses full palette space */
982980
983981   MDRV_VIDEO_START(galmedes)
r1051r1052
10161014   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10171015   MDRV_SCREEN_SIZE(40*8, 32*8)
10181016   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1019   MDRV_GFXDECODE(gfxdecodeinfo)
1017   MDRV_GFXDECODE(asuka)
10201018   MDRV_PALETTE_LENGTH(4096)   /* only Mofflott uses full palette space */
10211019
10221020   MDRV_VIDEO_START(galmedes)
r1051r1052
10511049   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10521050   MDRV_SCREEN_SIZE(40*8, 32*8)
10531051   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1054   MDRV_GFXDECODE(gfxdecodeinfo)
1052   MDRV_GFXDECODE(asuka)
10551053   MDRV_PALETTE_LENGTH(4096)
10561054
10571055   MDRV_VIDEO_START(galmedes)
src/mame/drivers/triplhnt.c
r1051r1052
295295};
296296
297297
298static const gfx_decode triplhnt_gfx_decode_info[] =
299{
300   { REGION_GFX1, 0, &triplhnt_small_sprite_layout, 0, 1 },
301   { REGION_GFX1, 0, &triplhnt_large_sprite_layout, 0, 1 },
302   { REGION_GFX2, 0, &triplhnt_tile_layout, 4, 2 },
303   { -1 }
304};
298static GFXDECODE_START( triplhnt )
299   GFXDECODE_ENTRY( REGION_GFX1, 0, triplhnt_small_sprite_layout, 0, 1 )
300   GFXDECODE_ENTRY( REGION_GFX1, 0, triplhnt_large_sprite_layout, 0, 1 )
301   GFXDECODE_ENTRY( REGION_GFX2, 0, triplhnt_tile_layout, 4, 2 )
302GFXDECODE_END
305303
306304
307305static PALETTE_INIT( triplhnt )
r1051r1052
333331   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
334332   MDRV_SCREEN_SIZE(256, 262)
335333   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
336   MDRV_GFXDECODE(triplhnt_gfx_decode_info)
334   MDRV_GFXDECODE(triplhnt)
337335   MDRV_PALETTE_LENGTH(8)
338336   MDRV_PALETTE_INIT(triplhnt)
339337   MDRV_VIDEO_START(triplhnt)
r1051r1052
347345   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
348346
349347   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
350   MDRV_SOUND_CONFIG(triplhnt_discrete_interface)
348   MDRV_SOUND_CONFIG_DISCRETE(triplhnt)
351349   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
352350MACHINE_DRIVER_END
353351
src/mame/drivers/pooyan.c
r1051r1052
207207
208208
209209
210static const gfx_decode gfxdecodeinfo[] =
211{
212   { REGION_GFX1, 0, &charlayout,       0, 16 },
213   { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
214   { -1 }
215};
210static GFXDECODE_START( pooyan )
211   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
212   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
213GFXDECODE_END
216214
217215
218216
r1051r1052
235233   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
236234   MDRV_SCREEN_SIZE(32*8, 32*8)
237235   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
238   MDRV_GFXDECODE(gfxdecodeinfo)
236   MDRV_GFXDECODE(pooyan)
239237   MDRV_PALETTE_LENGTH(32)
240238   MDRV_COLORTABLE_LENGTH(16*16+16*16)
241239
src/mame/drivers/backfire.c
r1051r1052
454454};
455455
456456
457static const gfx_decode gfxdecodeinfo_backfire[] =
458{
459   { REGION_GFX1, 0, &charlayout,      0, 128 },   /* Characters 8x8 */
460   { REGION_GFX1, 0, &tilelayout,      0, 128 },   /* Tiles 16x16 */
461   { REGION_GFX2, 0, &tilelayout,      0, 128 },   /* Tiles 16x16 */
462   { REGION_GFX3, 0, &spritelayout,    0x200, 32 },   /* Sprites 16x16 (screen 1) */
463   { REGION_GFX4, 0, &spritelayout,    0x600, 32 },   /* Sprites 16x16 (screen 2) */
464   { -1 }
465};
457static GFXDECODE_START( backfire )
458   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,      0, 128 )   /* Characters 8x8 */
459   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,      0, 128 )   /* Tiles 16x16 */
460   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,      0, 128 )   /* Tiles 16x16 */
461   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,    0x200, 32 )   /* Sprites 16x16 (screen 1) */
462   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,    0x600, 32 )   /* Sprites 16x16 (screen 2) */
463GFXDECODE_END
466464
467465
468466static void sound_irq_gen(int state)
r1051r1052
497495   /* video hardware */
498496   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
499497   MDRV_PALETTE_LENGTH(2048)
500   MDRV_GFXDECODE(gfxdecodeinfo_backfire)
498   MDRV_GFXDECODE(backfire)
501499   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
502500
503501   MDRV_SCREEN_ADD("left", 0x000)
src/mame/drivers/sidepckt.c
r1051r1052
269269    32*8    /* every char takes 8 consecutive bytes */
270270};
271271
272static const gfx_decode gfxdecodeinfo[] =
273{
274   { REGION_GFX1, 0, &charlayout,   128,  4 },   /* colors 128-159 */
275   { REGION_GFX2, 0, &spritelayout,   0, 16 },   /* colors   0-127 */
276   { -1 }
277};
272static GFXDECODE_START( sidepckt )
273   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   128,  4 )   /* colors 128-159 */
274   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,   0, 16 )   /* colors   0-127 */
275GFXDECODE_END
278276
279277
280278
r1051r1052
310308   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
311309   MDRV_SCREEN_SIZE(32*8, 32*8)
312310   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
313   MDRV_GFXDECODE(gfxdecodeinfo)
311   MDRV_GFXDECODE(sidepckt)
314312   MDRV_PALETTE_LENGTH(256)
315313
316314   MDRV_PALETTE_INIT(sidepckt)
r1051r1052
348346   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
349347   MDRV_SCREEN_SIZE(32*8, 32*8)
350348   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
351   MDRV_GFXDECODE(gfxdecodeinfo)
349   MDRV_GFXDECODE(sidepckt)
352350   MDRV_PALETTE_LENGTH(256)
353351
354352   MDRV_PALETTE_INIT(sidepckt)
src/mame/drivers/wolfpack.c
r1051r1052
353353};
354354
355355
356static const gfx_decode gfxdecodeinfo[] =
357{
358   { REGION_GFX1, 0, &tile_layout, 0, 2 },
359   { REGION_GFX2, 0, &ship_layout, 6, 1 },
360   { REGION_GFX3, 0, &pt_layout, 0, 1 },
361   { REGION_GFX4, 0, &torpedo_layout, 4, 1 },
362   { -1 }
363};
356static GFXDECODE_START( wolfpack )
357   GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0, 2 )
358   GFXDECODE_ENTRY( REGION_GFX2, 0, ship_layout, 6, 1 )
359   GFXDECODE_ENTRY( REGION_GFX3, 0, pt_layout, 0, 1 )
360   GFXDECODE_ENTRY( REGION_GFX4, 0, torpedo_layout, 4, 1 )
361GFXDECODE_END
364362
365363
366364static MACHINE_DRIVER_START(wolfpack)
r1051r1052
379377   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
380378   MDRV_SCREEN_SIZE(512, 262)
381379   MDRV_SCREEN_VISIBLE_AREA(0, 511, 16, 239)
382   MDRV_GFXDECODE(gfxdecodeinfo)
380   MDRV_GFXDECODE(wolfpack)
383381   MDRV_PALETTE_LENGTH(8)
384382   MDRV_COLORTABLE_LENGTH(8)
385383   MDRV_PALETTE_INIT(wolfpack)
src/mame/drivers/pirates.c
r1051r1052
274274   16*16
275275};
276276
277static const gfx_decode gfxdecodeinfo[] =
278{
277static GFXDECODE_START( pirates )
279278
280   { REGION_GFX1, 0, &charlayout,   0x0000, 3*128 },
281   { REGION_GFX2, 0, &spritelayout, 0x1800,   128 },
282   { -1 }
283};
279   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x0000, 3*128 )
280   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x1800,   128 )
281GFXDECODE_END
284282
285283
286284
r1051r1052
296294
297295   MDRV_NVRAM_HANDLER(pirates)
298296
299   MDRV_GFXDECODE(gfxdecodeinfo)
297   MDRV_GFXDECODE(pirates)
300298
301299   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
302300   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
src/mame/drivers/tankbatt.c
r1051r1052
250250};
251251
252252
253static const gfx_decode gfxdecodeinfo[] =
254{
255   { REGION_GFX1, 0, &charlayout,   0, 64 },
256   { REGION_GFX1, 0, &bulletlayout, 0, 64 },
257   { -1 }
258};
253static GFXDECODE_START( tankbatt )
254   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 64 )
255   GFXDECODE_ENTRY( REGION_GFX1, 0, bulletlayout, 0, 64 )
256GFXDECODE_END
259257
260258
261259
r1051r1052
292290   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
293291   MDRV_SCREEN_SIZE(32*8, 32*8)
294292   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
295   MDRV_GFXDECODE(gfxdecodeinfo)
293   MDRV_GFXDECODE(tankbatt)
296294   MDRV_PALETTE_LENGTH(65)
297295   MDRV_COLORTABLE_LENGTH(128)
298296
src/mame/drivers/cherrym.c
r1051r1052
359359   NULL
360360};
361361
362static const gfx_decode gfxdecodeinfo[] =
363{
364   { REGION_GFX1, 0x0000, &charlayout,     0, 16 },
365   { REGION_GFX2, 0x0020, &spritelayout, 0, 16 },
366   { -1 }
367};
362static GFXDECODE_START( cherrym )
363   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,     0, 16 )
364   GFXDECODE_ENTRY( REGION_GFX2, 0x0020, spritelayout, 0, 16 )
365GFXDECODE_END
368366
369367static struct AY8910interface ay8910_interface =
370368{
r1051r1052
392390   MDRV_SCREEN_SIZE(64*8, 32*8)
393391   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
394392
395   MDRV_GFXDECODE(gfxdecodeinfo)
393   MDRV_GFXDECODE(cherrym)
396394   MDRV_PALETTE_LENGTH(256)
397395   MDRV_COLORTABLE_LENGTH(256)
398396
src/mame/drivers/exerion.c
r1051r1052
247247};
248248
249249
250static const gfx_decode gfxdecodeinfo[] =
251{
252   { REGION_GFX1, 0, &charlayout,         0, 64 },
253   { REGION_GFX2, 0, &spritelayout,     256, 64 },
254   { REGION_GFX2, 0, &bigspritelayout,  256, 64 },
255   { -1 }
256};
250static GFXDECODE_START( exerion )
251   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0, 64 )
252   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,     256, 64 )
253   GFXDECODE_ENTRY( REGION_GFX2, 0, bigspritelayout,  256, 64 )
254GFXDECODE_END
257255
258256
259257
r1051r1052
292290   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
293291   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
294292   MDRV_SCREEN_RAW_PARAMS(EXERION_PIXEL_CLOCK, EXERION_HTOTAL, EXERION_HBEND, EXERION_HBSTART, EXERION_VTOTAL, EXERION_VBEND, EXERION_VBSTART)
295   MDRV_GFXDECODE(gfxdecodeinfo)
293   MDRV_GFXDECODE(exerion)
296294   MDRV_PALETTE_LENGTH(32)
297295   MDRV_COLORTABLE_LENGTH(256*3)
298296
src/mame/drivers/wrally.c
r1051r1052
221221   64*8
222222};
223223
224static const gfx_decode wrally_gfxdecodeinfo[] =
225{
226   { REGION_GFX1, 0x000000, &wrally_tilelayout16, 0, 64*8 },
227   { -1 }
228};
224static GFXDECODE_START( wrally )
225   GFXDECODE_ENTRY( REGION_GFX1, 0x000000, wrally_tilelayout16, 0, 64*8 )
226GFXDECODE_END
229227
230228
231229
r1051r1052
244242   MDRV_SCREEN_SIZE(64*16, 32*16)
245243   MDRV_SCREEN_VISIBLE_AREA(0, 64*16-1, 0, 32*16-1)
246244//  MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1)
247   MDRV_GFXDECODE(wrally_gfxdecodeinfo)
245   MDRV_GFXDECODE(wrally)
248246   MDRV_PALETTE_LENGTH(1024*8)
249247
250248   MDRV_VIDEO_START(wrally)
src/mame/drivers/mosaic.c
r1051r1052
267267   16*8
268268};
269269
270static const gfx_decode gfxdecodeinfo[] =
271{
272   { REGION_GFX1, 0, &charlayout, 0, 1 },
273   { REGION_GFX2, 0, &charlayout, 0, 1 },
274   { -1 }
275};
270static GFXDECODE_START( mosaic )
271   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 1 )
272   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 1 )
273GFXDECODE_END
276274
277275
278276
r1051r1052
297295   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298296   MDRV_SCREEN_SIZE(64*8, 32*8)
299297   MDRV_SCREEN_VISIBLE_AREA(8*8, 48*8-1, 2*8, 30*8-1)
300   MDRV_GFXDECODE(gfxdecodeinfo)
298   MDRV_GFXDECODE(mosaic)
301299   MDRV_PALETTE_LENGTH(256)
302300
303301   MDRV_VIDEO_START(mosaic)
src/mame/drivers/segas18.c
r1051r1052
12401240};
12411241
12421242
1243static const gfx_decode gfxdecodeinfo[] =
1244{
1245   { REGION_GFX1, 0, &charlayout,   0, 1024 },
1246   { -1 }
1247};
1243static GFXDECODE_START( segas18 )
1244   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 1024 )
1245GFXDECODE_END
12481246
12491247
12501248
r1051r1052
12761274   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
12771275   MDRV_SCREEN_SIZE(342,262)
12781276   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1279   MDRV_GFXDECODE(gfxdecodeinfo)
1277   MDRV_GFXDECODE(segas18)
12801278   MDRV_PALETTE_LENGTH(2048*3+2048)
12811279
12821280   MDRV_VIDEO_START(system18)
src/mame/drivers/ltcasino.c
r1051r1052
633633};
634634
635635
636static const gfx_decode gfxdecodeinfo[] =
637{
638   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
639   { -1 }
640};
636static GFXDECODE_START( ltcasino )
637   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
638GFXDECODE_END
641639
642640
643641VIDEO_UPDATE(ltcasino)
r1051r1052
661659   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
662660   MDRV_SCREEN_SIZE(64*8, 32*8)
663661   MDRV_SCREEN_VISIBLE_AREA(6*8, 58*8-1, 0, 32*8-1)
664   MDRV_GFXDECODE(gfxdecodeinfo)
662   MDRV_GFXDECODE(ltcasino)
665663   MDRV_PALETTE_LENGTH(0x100)
666664
667665   MDRV_VIDEO_START(ltcasino)
src/mame/drivers/crospang.c
r1051r1052
382382};
383383
384384
385static const gfx_decode gfxdecodeinfo[] =
386{
387   //{ REGION_GFX1, 0, &tcharlayout, 256, 16 },    /* Characters 8x8 */
388   //{ REGION_GFX1, 0, &tlayout,     512, 16 },    /* Tiles 16x16 */
389   { REGION_GFX2, 0, &tlayout,       0, 64 },   /* Tiles 16x16 */
390   { REGION_GFX1, 0, &tlayout,       0, 64 },   /* Sprites 16x16 */
391   { -1 }
392};
385static GFXDECODE_START( crospang )
386   //GFXDECODE_ENTRY( REGION_GFX1, 0, tcharlayout, 256, 16 )    /* Characters 8x8 */
387   //GFXDECODE_ENTRY( REGION_GFX1, 0, tlayout,     512, 16 )    /* Tiles 16x16 */
388   GFXDECODE_ENTRY( REGION_GFX2, 0, tlayout,       0, 64 )   /* Tiles 16x16 */
389   GFXDECODE_ENTRY( REGION_GFX1, 0, tlayout,       0, 64 )   /* Sprites 16x16 */
390GFXDECODE_END
393391
394392
395393static void irqhandler(int linestate)
r1051r1052
424422   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 30*8-1)
425423
426424   MDRV_PALETTE_LENGTH(0x300)
427   MDRV_GFXDECODE(gfxdecodeinfo)
425   MDRV_GFXDECODE(crospang)
428426
429427   MDRV_VIDEO_START(crospang)
430428   MDRV_VIDEO_UPDATE(crospang)
r1051r1052
463461   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 30*8-1)
464462
465463   MDRV_PALETTE_LENGTH(0x300)
466   MDRV_GFXDECODE(gfxdecodeinfo)
464   MDRV_GFXDECODE(crospang)
467465
468466   MDRV_VIDEO_START(crospang)
469467   MDRV_VIDEO_UPDATE(crospang)
src/mame/drivers/royalmah.c
r1051r1052
33Royal Mahjong (c) 1981 Nichibutsu
44and many other Dyna/Dynax games running in similar bare-bones hardware
55
6driver by Zsolt Vasvari and Nicola Salmoria
6driver by Zsolt Vasvari, Nicola Salmoria, Luca Elia
77
8
9Hardware specs are the same for all Dyna/Dynax games:
10
11CPU:    Z80
8CPU:    Z80 / TLCS-90
9Video:  Framebuffer
1210Sound:  AY-3-8910
1311OSC:    18.432MHz and 8MHz
1412
15----------------------------------------------------------------------------------------------------------
16Year + Game                  Board           CPU        Company             Notes
17----------------------------------------------------------------------------------------------------------
1881  Royal Mahjong                            Z80        Nichibutsu
1981? Open Mahjong                             Z80        Sapporo Mechanic
2082  Royal Mahjong            FRM-03          Z80        Falcon              bootleg
2186  Ippatsu Gyakuten                         Z80        Public/Paradais
2286  Don Den Mahjong          D039198L-0      Z80        Dyna Electronics
2386  Watashiha Suzumechan                     Z80        Dyna Electronics
2487  Mahjong Diplomat         D0706088L1-0    Z80        Dynax
2587  Mahjong Studio 101       D1708228L1      Z80        Dynax
2687  Tonton                   D0908288L1-0    Z80        Dynax
2788  Mahjong Almond Pinky     D1401128L-0     Z80        Dynax
2889  Mahjong Derringer        D2203018L       Z80        Dynax               Larger palette
2990  Mahjong If..?            D29?            TLCS-90    Dynax               Larger palette
3092  Mahjong Cafe Time        D6310128L1-1    TLCS-90    Dynax               Larger palette, Real Time Clock
3193  Mahjong Cafe Doll                        TLCS-90    Dynax               Undumped internal rom
3295  Mahjong Tensinhai        D10010318L1     TLCS-90    Dynax               Larger palette, Real Time Clock
3396  Janputer '96                             Z80        Dynax               Larger palette, Real Time Clock
34----------------------------------------------------------------------------------------------------------
13---------------------------------------------------------------------------------------------------------------------
14Year + Game               Board(s)             CPU      Company            Notes
15---------------------------------------------------------------------------------------------------------------------
1681  Royal Mahjong                              Z80      Nichibutsu
1781? Open Mahjong                               Z80      Sapporo Mechanic
1882  Royal Mahjong         ? + FRM-03           Z80      Falcon             bootleg
1983  Janyou Part II                             Z80        Cosmo Denshi
2084? Jan Oh                FRM-00?              Z80      Toaplan            Incomplete program roms
2186  Ippatsu Gyakuten                           Z80      Public/Paradais
2286  Don Den Mahjong       D039198L-0           Z80      Dyna Electronics
2386  Watashiha Suzumechan                       Z80      Dyna Electronics
2487  Mahjong Diplomat      D0706088L1-0         Z80      Dynax
2587  Mahjong Studio 101    D1708228L1           Z80      Dynax
2687  Tonton                D0908288L1-0         Z80      Dynax
2788  Almond Pinky          D1401128L-0 + RM-1D  Z80      Dynax
2889  Mahjong Shinkirou     D210301BL2 + FRM-00? TLCS-90  Dynax
2989  Mahjong Derringer     D2203018L            Z80      Dynax              Larger palette
3090  Mahjong If..?         D29?                 TLCS-90  Dynax              Larger palette
3191  Mahjong Vegas         D5011308L1 + FRM-00  TLCS-90
3292  Mahjong Cafe Time     D6310128L1-1         TLCS-90  Dynax              Larger palette, RTC
3393  Mahjong Cafe Doll     D76052208L-2         TLCS-90  Dynax              Larger palette, RTC, Undumped internal rom
3495  Mahjong Tensinhai     D10010318L1          TLCS-90  Dynax              Larger palette, RTC
3596  Janputer '96                               Z80      Dynax              Larger palette, RTC
36---------------------------------------------------------------------------------------------------------------------
3537
3638TODO:
3739
r1051r1052
664666
665667
666668/****************************************************************************
669                           Mahjong Shinkirou Deja Vu
670****************************************************************************/
671
672static READ8_HANDLER( mjdejavu_rom_io_r )
673{
674   if (mjifb_rom_enable)
675      return ((UINT8*)(memory_region(REGION_CPU1) + 0x10000 + rombank * 0x4000))[offset];
676
677   offset += 0x8000;
678
679   switch(offset)
680   {
681      case 0x8000:   return readinputport(14);      // dsw 2
682      case 0x8001:   return readinputport(13);      // dsw 1
683      case 0x9001:   return AY8910_read_port_0_r(0);   // inputs
684      case 0x9011:   return readinputport(10);
685   }
686
687   logerror("%04X: unmapped input read at %04X\n", activecpu_get_pc(), offset);
688   return 0xff;
689}
690
691static WRITE8_HANDLER( mjdejavu_rom_io_w )
692{
693   if (mjifb_rom_enable)
694   {
695      videoram[offset] = data;
696      return;
697   }
698
699   offset += 0x8000;
700   switch(offset)
701   {
702      case 0x8802:   palette_base = data & 0x1f;         return;
703      case 0x9002:   AY8910_write_port_0_w(0,data);      return;
704      case 0x9003:   AY8910_control_port_0_w(0,data);   return;
705      case 0x9010:   mjifb_coin_counter_w(0,data);      return;
706      case 0x9011:   input_port_select_w(0,data);      return;
707      case 0x9013:
708//          if (data)   popmessage("%02x",data);
709         return;
710   }
711
712   logerror("%04X: unmapped input write at %04X = %02X\n", activecpu_get_pc(), offset,data);
713}
714
715static ADDRESS_MAP_START( mjdejavu_map, ADDRESS_SPACE_PROGRAM, 8 )
716   AM_RANGE( 0x0000, 0x6fff ) AM_ROM
717   AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
718   AM_RANGE( 0x8000, 0xbfff ) AM_READWRITE(mjdejavu_rom_io_r, mjdejavu_rom_io_w) AM_BASE(&videoram)
719   AM_RANGE( 0xc000, 0xffff ) AM_READWRITE(MRA8_ROM, mjifb_videoram_w)
720ADDRESS_MAP_END
721
722
723/****************************************************************************
667724                                Mahjong Tensinhai
668725****************************************************************************/
669726
r1051r1052
907964   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
908965INPUT_PORTS_END
909966
967static INPUT_PORTS_START( janyoup2 )
968   PORT_START   /* P1 IN0 */
969   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
970   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
971   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
972   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
973   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
974   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
975   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Credit Clear") PORT_CODE(KEYCODE_7)
976   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Credit Clear") PORT_CODE(KEYCODE_8)
977
978   PORT_START   /* P1 IN1 */
979   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
980   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
981   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
982   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
983   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
984   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
985   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
986
987   PORT_START   /* P1 IN2 */
988   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
989   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
990   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
991   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
992   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
993   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
994
995   PORT_START   /* P1 IN3 */
996   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
997   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
998   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
999   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
1000   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1001
1002   PORT_START   /* P1 IN4 */
1003   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
1004   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
1005   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
1006   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
1007   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
1008   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
1009   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
1010
1011   PORT_START   /* P2 IN0 */
1012   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )PORT_PLAYER(2)
1013   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )PORT_PLAYER(2)
1014   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )PORT_PLAYER(2)
1015   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )PORT_PLAYER(2)
1016   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )PORT_PLAYER(2)
1017   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1018   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )   // "COIN2"
1019   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )   // "COIN1", but not working
1020
1021   PORT_START   /* P2 IN1 */
1022   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )PORT_PLAYER(2)
1023   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )PORT_PLAYER(2)
1024   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )PORT_PLAYER(2)
1025   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )PORT_PLAYER(2)
1026   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )PORT_PLAYER(2)
1027   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )PORT_PLAYER(2)
1028   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
1029
1030   PORT_START   /* P2 IN2 */
1031   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )PORT_PLAYER(2)
1032   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )PORT_PLAYER(2)
1033   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )PORT_PLAYER(2)
1034   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )PORT_PLAYER(2)
1035   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )PORT_PLAYER(2)
1036   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1037
1038   PORT_START   /* P2 IN3 */
1039   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )PORT_PLAYER(2)
1040   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )PORT_PLAYER(2)
1041   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )PORT_PLAYER(2)
1042   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )PORT_PLAYER(2)
1043   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1044
1045   PORT_START   /* P2 IN4 */
1046   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )PORT_PLAYER(2)
1047   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )PORT_PLAYER(2)
1048   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )PORT_PLAYER(2)
1049   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )PORT_PLAYER(2)
1050   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )PORT_PLAYER(2)
1051   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )PORT_PLAYER(2)
1052   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
1053
1054   PORT_START   /* IN10 */
1055   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )   /* "Note" ("Paper Money") = 10 Credits */
1056   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE3 )   /* Memory Reset */
1057   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 )   /* Analizer (Statistics) */
1058   PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
1059   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1060
1061   PORT_START   /* DSW  (inport $10) */
1062   PORT_DIPNAME( 0x0f, 0x0f, "Pay Out Rate" )
1063   PORT_DIPSETTING(    0x0f, "96%" )
1064   PORT_DIPSETTING(    0x0e, "93%" )
1065   PORT_DIPSETTING(    0x0d, "90%" )
1066   PORT_DIPSETTING(    0x0c, "87%" )
1067   PORT_DIPSETTING(    0x0b, "84%" )
1068   PORT_DIPSETTING(    0x0a, "81%" )
1069   PORT_DIPSETTING(    0x09, "78%" )
1070   PORT_DIPSETTING(    0x08, "75%" )
1071   PORT_DIPSETTING(    0x07, "71%" )
1072   PORT_DIPSETTING(    0x06, "68%" )
1073   PORT_DIPSETTING(    0x05, "65%" )
1074   PORT_DIPSETTING(    0x04, "62%" )
1075   PORT_DIPSETTING(    0x03, "59%" )
1076   PORT_DIPSETTING(    0x02, "56%" )
1077   PORT_DIPSETTING(    0x01, "53%" )
1078   PORT_DIPSETTING(    0x00, "50%" )
1079   PORT_DIPNAME( 0x30, 0x30, "Maximum Bet" )
1080   PORT_DIPSETTING(    0x00, "1" )
1081   PORT_DIPSETTING(    0x10, "5" )
1082   PORT_DIPSETTING(    0x20, "10" )
1083   PORT_DIPSETTING(    0x30, "20" )
1084   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
1085   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1086   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1087   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
1088   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1089   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1090
1091   PORT_START   /* DSW  (inport $12) */
1092   PORT_DIPNAME( 0x01, 0x01, "Unknown 1-0" )
1093   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1094   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1095   PORT_DIPNAME( 0x02, 0x02, "Unknown 1-1" )
1096   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1097   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1098   PORT_DIPNAME( 0x04, 0x04, "Unknown 1-2" )
1099   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1100   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1101   PORT_DIPNAME( 0x08, 0x08, "Unknown 1-3" )
1102   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1103   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1104   PORT_DIPNAME( 0x10, 0x10, "Unknown 1-4" )
1105   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1107   PORT_DIPNAME( 0x20, 0x20, "Unknown 1-5" )
1108   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1109   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1110   PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6" )
1111   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1112   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1113   PORT_DIPNAME( 0x80, 0x80, "Unknown 1-7" )
1114   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1115   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1116
1117   PORT_START   /* DSW  (inport $13) */
1118   PORT_DIPNAME( 0x01, 0x01, "Unknown 2-0" )
1119   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1120   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1121   PORT_DIPNAME( 0x02, 0x02, "Unknown 2-1" )
1122   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1123   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1124   PORT_DIPNAME( 0x04, 0x04, "Unknown 2-2" )
1125   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1126   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1127   PORT_DIPNAME( 0x08, 0x08, "Unknown 2-3" )
1128   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1129   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1130   PORT_DIPNAME( 0x10, 0x10, "Unknown 2-4" )
1131   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1133   PORT_DIPNAME( 0x20, 0x20, "Unknown 2-5" )
1134   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1136   PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
1137   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1138   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1139   PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
1140   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1141   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1142INPUT_PORTS_END
1143
9101144static INPUT_PORTS_START( suzume )
9111145   PORT_START   /* P1 IN0 */
9121146   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
r1051r1052
28713105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
28723106INPUT_PORTS_END
28733107
3108static INPUT_PORTS_START( mjdejavu )
3109   PORT_START   /* P1 IN0 */
3110   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
3111   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
3112   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
3113   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
3114   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
3115   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
3116   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Payout") PORT_CODE(KEYCODE_7)
3117   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
28743118
3119   PORT_START   /* P1 IN1 */
3120   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
3121   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
3122   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
3123   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
3124   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
3125   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
3126   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
3127
3128   PORT_START   /* P1 IN2 */
3129   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
3130   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
3131   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
3132   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
3133   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
3134   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
3135
3136   PORT_START   /* P1 IN3 */
3137   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
3138   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
3139   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
3140   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
3141   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
3142
3143   PORT_START   /* P1 IN4 */
3144   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
3145   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
3146   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
3147   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
3148   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
3149   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
3150   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
3151
3152   PORT_START   /* P2 IN0 */
3153   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )PORT_PLAYER(2)
3154   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )PORT_PLAYER(2)
3155   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )PORT_PLAYER(2)
3156   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )PORT_PLAYER(2)
3157   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )PORT_PLAYER(2)
3158   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
3159   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
3160   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
3161
3162   PORT_START   /* P2 IN1 */
3163   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )PORT_PLAYER(2)
3164   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )PORT_PLAYER(2)
3165   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )PORT_PLAYER(2)
3166   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )PORT_PLAYER(2)
3167   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )PORT_PLAYER(2)
3168   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )PORT_PLAYER(2) PORT_CODE(KEYCODE_4)
3169   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
3170
3171   PORT_START   /* P2 IN2 */
3172   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )PORT_PLAYER(2)
3173   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )PORT_PLAYER(2)
3174   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )PORT_PLAYER(2)
3175   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )PORT_PLAYER(2)
3176   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )PORT_PLAYER(2)
3177   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
3178
3179   PORT_START   /* P2 IN3 */
3180   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )PORT_PLAYER(2)
3181   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )PORT_PLAYER(2)
3182   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )PORT_PLAYER(2)
3183   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )PORT_PLAYER(2)
3184   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
3185
3186   PORT_START   /* P2 IN4 */
3187   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )PORT_PLAYER(2)
3188   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )PORT_PLAYER(2)
3189   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )PORT_PLAYER(2)
3190   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )PORT_PLAYER(2)
3191   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )PORT_PLAYER(2)
3192   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )PORT_PLAYER(2)
3193   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
3194
3195   PORT_START   /* IN10 */
3196   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )   /* "Note" ("Paper Money") = 10 Credits */
3197   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE3 )   /* Memory Reset */
3198   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 )   /* Analizer (Statistics) */
3199   PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
3200   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
3201
3202   PORT_START   // IN11 - DSW3 (P3 & P5)
3203   PORT_DIPNAME( 0x03, 0x03, "Unknown 3-0&1*" )
3204   PORT_DIPSETTING(    0x00, "1 1" )
3205   PORT_DIPSETTING(    0x02, "3 4" )
3206   PORT_DIPSETTING(    0x01, "1 2" )
3207   PORT_DIPSETTING(    0x03, "1 4" )
3208   PORT_DIPNAME( 0x04, 0x04, "Unknown 3-2" )
3209   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3210   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3211   PORT_DIPNAME( 0x08, 0x08, "Unknown 3-3" )
3212   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3213   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3214   PORT_DIPNAME( 0x10, 0x10, "Unknown 3-4" )
3215   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
3216   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3217   PORT_DIPNAME( 0x20, 0x20, "Unknown 3-5" )
3218   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3219   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3220   PORT_DIPNAME( 0x40, 0x40, "Unknown 3-6" )
3221   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3223   PORT_DIPNAME( 0x80, 0x80, "Unknown 3-7" )
3224   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3225   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3226
3227   PORT_START   // IN12 - DSW4 (P6 & P7)
3228   PORT_DIPNAME( 0x01, 0x01, "Unknown 4-0" )
3229   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3230   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3231   PORT_DIPNAME( 0x02, 0x02, "Unknown 4-1" )
3232   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3233   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3234   PORT_DIPNAME( 0x04, 0x04, "Unknown 4-2" )
3235   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3236   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3237   PORT_DIPNAME( 0x08, 0x08, "Unknown 4-3" )
3238   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3239   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3240   PORT_DIPNAME( 0x10, 0x10, "Unknown 4-4" )
3241   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
3242   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3243   PORT_DIPNAME( 0x20, 0x20, "Unknown 4-5" )
3244   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3245   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3246   PORT_DIPNAME( 0x40, 0x40, "Unknown 4-6" )
3247   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3248   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3249   PORT_DIPNAME( 0x80, 0x80, "Full Tests" )
3250   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3251   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3252
3253   PORT_START   // IN13 - DSW1 ($8001)
3254   PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate" )
3255   PORT_DIPSETTING(    0x0f, "96%" )
3256   PORT_DIPSETTING(    0x0e, "93%" )
3257   PORT_DIPSETTING(    0x0d, "90%" )
3258   PORT_DIPSETTING(    0x0c, "87%" )
3259   PORT_DIPSETTING(    0x0b, "84%" )
3260   PORT_DIPSETTING(    0x0a, "81%" )
3261   PORT_DIPSETTING(    0x09, "78%" )
3262   PORT_DIPSETTING(    0x08, "75%" )
3263   PORT_DIPSETTING(    0x07, "71%" )
3264   PORT_DIPSETTING(    0x06, "68%" )
3265   PORT_DIPSETTING(    0x05, "65%" )
3266   PORT_DIPSETTING(    0x04, "62%" )
3267   PORT_DIPSETTING(    0x03, "59%" )
3268   PORT_DIPSETTING(    0x02, "56%" )
3269   PORT_DIPSETTING(    0x01, "53%" )
3270   PORT_DIPSETTING(    0x00, "50%" )
3271   PORT_DIPNAME( 0x30, 0x30, "Maximum Bet" )
3272   PORT_DIPSETTING(    0x00, "1" )
3273   PORT_DIPSETTING(    0x10, "5" )
3274   PORT_DIPSETTING(    0x20, "10" )
3275   PORT_DIPSETTING(    0x30, "20" )
3276   PORT_DIPNAME( 0x40, 0x40, "Credits Per Note" )
3277   PORT_DIPSETTING(    0x00, "5" )
3278   PORT_DIPSETTING(    0x40, "10" )
3279   PORT_DIPNAME( 0x80, 0x80, "Background" )
3280   PORT_DIPSETTING(    0x80, "Gray" )
3281   PORT_DIPSETTING(    0x00, "Black" )
3282
3283   PORT_START   // IN14 - DSW2 ($8000)
3284   PORT_DIPNAME( 0x03, 0x03, "Winnings" )
3285   PORT_DIPSETTING(    0x00, "32 24 16 12 8 4 2 1" )
3286   PORT_DIPSETTING(    0x03, "50 30 15 8 5 3 2 1" )
3287   PORT_DIPSETTING(    0x02, "100 50 25 10 5 3 2 1" )
3288   PORT_DIPSETTING(    0x01, "200 100 50 10 5 3 2 1" )
3289   PORT_DIPNAME( 0x3c, 0x3c, "YAKUMAN Bonus" )
3290   PORT_DIPSETTING(    0x3c, "Cut" )
3291   PORT_DIPSETTING(    0x20, "300" )
3292   PORT_DIPSETTING(    0x10, "500" )
3293   PORT_DIPSETTING(    0x08, "700" )
3294   PORT_DIPSETTING(    0x00, "1000" )
3295//  PORT_DIPSETTING(    0x04, "1000?" )
3296   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
3297   PORT_DIPSETTING(    0x00, "1" )
3298   PORT_DIPSETTING(    0x40, "2" )
3299   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3300   PORT_DIPSETTING(    0x00, "1/4" )
3301   PORT_DIPSETTING(    0x80, "2/4" )
3302INPUT_PORTS_END
3303
3304
28753305static struct AY8910interface ay8910_interface =
28763306{
28773307   royalmah_player_1_port_r,
r1051r1052
29093339   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
29103340MACHINE_DRIVER_END
29113341
2912
29133342static MACHINE_DRIVER_START( dondenmj )
29143343   MDRV_IMPORT_FROM(royalmah)
29153344   MDRV_CPU_REPLACE("main", Z80, 8000000/2)   /* 4 MHz ? */
r1051r1052
30023431   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
30033432MACHINE_DRIVER_END
30043433
3434
3435static MACHINE_DRIVER_START( mjdejavu )
3436   MDRV_IMPORT_FROM(mjderngr)
3437   MDRV_CPU_REPLACE("main",TMP90841, 8000000)   /* ? */
3438   MDRV_CPU_PROGRAM_MAP(mjdejavu_map,0)
3439   MDRV_CPU_IO_MAP(mjifb_iomap,0)
3440   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
3441
3442   MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)
3443MACHINE_DRIVER_END
3444
3445
30053446static INTERRUPT_GEN( mjtensin_interrupt )
30063447{
30073448   switch(cpu_getiloops())
r1051r1052
30843525   ROM_LOAD( "82s123.prm", 0x00, 0x20, CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) )
30853526ROM_END
30863527
3528/***************************************************************************
3529Janyou Part II
3530(c)1984 Cosmo Denshi
3531
3532CPU: Z80
3533Sound: AY-3-8910
3534Video: HD46505SP(HD6845SP)
3535OSC: 18.432MHz
3536
3537ROMs:
35381.C110       [36ebb3d0]
35392.C109       [324426d4]
35403.C108       [e98b6d34]
35414.C107       [377b8ce9]
3542
3543N82S123N.C98 [d3007282]
3544
3545
3546Others:
3547Battery
3548empty socket for MC68705
3549***************************************************************************/
3550
3551ROM_START( janyoup2 )
3552   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3553   ROM_LOAD( "1.c110",       0x0000, 0x2000, CRC(36ebb3d0) SHA1(39c0cdd1dc5878539768074dad3c39aac4ace8bf) )
3554   ROM_LOAD( "2.c109",       0x2000, 0x2000, CRC(324426d4) SHA1(409244c8458d9bafa325746c37de9e7b955b3787) )
3555   ROM_LOAD( "3.c108",       0x4000, 0x2000, CRC(e98b6d34) SHA1(e27ab9a03aff750df78c5db52a112247bdd31328) )
3556   ROM_LOAD( "4.c107",       0x6000, 0x1000, CRC(377b8ce9) SHA1(a5efc517ae975e54af5325b8b3f4867e9f449d4c) )
3557
3558   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3559   ROM_LOAD( "n82s123n.c98", 0x0000, 0x0020, CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) )
3560ROM_END
3561
30873562/****************************************************************************
30883563
30893564Ippatsu Gyakuten
r1051r1052
31133588   ROM_LOAD( "82s123an", 0x00, 0x20, CRC(3bde1bbd) SHA1(729498483943f960e38c4ada992b099b698b497a) )
31143589ROM_END
31153590
3116
31173591ROM_START( suzume )
31183592   ROM_REGION( 0x100000, REGION_CPU1, 0 )
31193593   ROM_LOAD( "p1.bin",     0x00000, 0x1000, CRC(e9706967) SHA1(2e3d78178623de6552c9036da90e02f240d94055) )
r1051r1052
33613835
33623836/***************************************************************************
33633837
3364Mahjong Almond Pinky
3365(c)1988 Dynax
3366Modified Royal Mahjong PCB
3367D1401128L-0 (Sub PCB)
3838Almond Pinky
3839Dynax, 1988
33683840
3369CPU: Z80
3370Sound: AY-3-8910
3841This game runs on Royal Mahjong hardware.
3842It appears Royal Mahjong was originally manufactured by Nichibutsu
3843This PCB says "(C) 1983 Nichibutsu" on it.
33713844
3372ROMs:
3373141.4D       [0c4fb83a]
3374142.4E       [129806f0]
3375143.4F       [3d0bc452]
3376144.4H       [24509a18]
3377145.4J       [fea3375a]
3378146.4K       [be27a9b9]
3845Top PCB
3846-------
3847D1401128L-0
3848|------------------------------------------|
3849|         |---------|                      |
3850|DIP40    |         |                      |
3851| Z80A    |   &     |                      |
3852|         |---------|                      |
3853|     8MHz                           DSW1  |
3854|                                          |
3855|                                          |
3856|                                          |
3857|                                          |
3858|                                    DSW2  |
3859|                                          |
3860|                                          |
3861|                                          |
3862|DYNAX DYNAX DYNAX DYNAX DYNAX DYNAX       |
3863| 146   145   144   143   142   141  6116 *|
3864|------------------------------------------|
3865Notes:
3866      Every chip has it's surface scratched
3867      *     - 4 pin power connector joined to main PCB
3868      DSWx  - have 8 switches each
3869      DIP40 - Socket joins to main PCB
3870      &     - Large Dynax ceramic SIP module (DAC or similar)
3871      Z80   - clock 4MHz [8/2]
3872      All ROMs type 27512
33793873
338018S030N.CLR  [5736d0aa]
3874Note! On Royal Mahjong-based PCBs where there is a 3 pin RGB connector (3 wires) tied to the main
3875board and joining to the top board, the color PROM is located on the top daughterboard. Usually that
3876chip is an 82S123 (32 bytes), 82S129 (256 bytes) or 82S147 (512 bytes). In any case, you can be sure
3877there is a PROM(s) on the PCB somewhere if the RGB connector cable is present.
33813878
3879
3880Main PCB
3881--------
3882RM-1D (C) Nichibutsu 1983
3883|------------------------------------------------|
3884|  6116 DIP24  P6    P5    P4    P3     P2    P1 |
3885|MB3712                                          |
3886|     BATTERY                                    |
3887|              DSW(8)                    DIP40   |
3888|                                                |
3889|1                                      18.432MHz|
3890|8    TBP18S030.6K                               |
3891|W                                               |
3892|A                                               |
3893|Y                                               |
3894|   AY3-8910                                     |
3895|            4116    4116                        |
3896|1           4116    4116                        |
3897|0           4116    4116                        |
3898|W           4116    4116                        |
3899|A           4116    4116                        |
3900|Y           4116    4116                        |
3901|            4116    4116                        |
3902|            4116    4116                        |
3903|------------------------------------------------|
3904Notes:
3905      DIP40 - Socket joins to top PCB
3906      DIP24 - Unpopulated DIP24 position (no socket)
3907      TBP18S030.6K - Color PROM (32 bytes)
3908      P1-P6 - Program ROM sockets (DIP24)
3909
33823910***************************************************************************/
33833911
33843912ROM_START( mjapinky )
r1051r1052
34333961   ROM_LOAD( "d63-1.7f", 0x200, 0x200, CRC(e7410136) SHA1(54d3aec0d11485d4f419e76f9c4071ab9b817937) )
34343962ROM_END
34353963
3964/***************************************************************************
3965
3966Mahjong Cafe Doll
3967Dynax, 1993
3968
3969This game runs on Royal Mahjong hardware.
3970
3971Top PCB
3972-------
3973D76052208L-2
3974|-----------------------------------|
3975|   7601  6264        RTC   BATTERY |
3976|DIP40                              |
3977|   7602                  8MHz      |
3978|                PAL           PAL  |
3979|   7603           |-----------|    |
3980|                  |    CPU    |    |
3981|   DIP32          |-----------|    |
3982|                                   |
3983|                                   |
3984|                                   |
3985|                                   |
3986|                                   |
3987| 82s147.7F                        &|
3988|*                      DSW3   DSW1 |
3989| 82S147.9F  %          DSW4   DSW2 |
3990|-----------------------------------|
3991Notes:
3992      Every chip has it's surface scratched, except the PROMs
3993      *     - Connector joined to main PCB
3994      &     - Power input connector
3995      %     - RGB Video output
3996      DIP32 - Empty DIP32 socket
3997      DSWx  - have 10 switches each
3998      DIP40 - Socket joins to main PCB
3999      CPU   - unknown SDIP64 chip. Possibly TMP90P640 or similar TLCS-90 type CPU
4000
4001
4002Main PCB
4003--------
4004no pcb number
4005|------------------------------------------------|
4006|   6116 DIP24 DIP24 DIP24 DIP28 DIP28 DIP28     |
4007|        DIP24                                   |
4008|HA1368                                          |
4009|                                        DIP40   |
4010|                                                |
4011|             DSW(8)                    18.432MHz|
4012|M                                               |
4013|A                                               |
4014|H                                               |
4015|J                                               |
4016|O  AY3-8910                                     |
4017|N           4116    4116                        |
4018|G           4116    4116                        |
4019|2           4116    4116                        |
4020|8           4116    4116                        |
4021|            4116    4116                        |
4022|            4116    4116                        |
4023|            4116    4116                        |
4024|            4116    4116                        |
4025|------------------------------------------------|
4026Notes:
4027      DIP40 - Sockets joins to top PCB
4028      DIP24/28 - Unpopulated sockets
4029
4030***************************************************************************/
4031
34364032ROM_START( cafedoll )
34374033   ROM_REGION( 0x190000, REGION_CPU1, 0 )
34384034   ROM_LOAD( "76xx.tmp90841", 0x00000, 0x02000, NO_DUMP )
r1051r1052
34434039   ROM_LOAD( "7603", 0x110000, 0x80000, CRC(c4293019) SHA1(afd717844e9e681ada14e80cd10dce0ed60d4259) )
34444040
34454041   ROM_REGION( 0x400, REGION_PROMS, 0 )
3446   ROM_LOAD( "cafedoll.prom1", 0x000, 0x200, NO_DUMP )
3447   ROM_LOAD( "cafedoll.prom2", 0x200, 0x200, NO_DUMP )
4042   ROM_LOAD( "d76-2_82s147.9f", 0x000, 0x200, CRC(9c1d0512) SHA1(3ca82d4271badc890701ecc76b97e80b16509b50) )
4043   ROM_LOAD( "d76-1_82s147.7f", 0x200, 0x200, CRC(9a75349c) SHA1(2071132267aafd8facf1d7841093d9a45c30a8d3) )
34484044ROM_END
34494045
4046/***************************************************************************
4047
4048Mahjong Vegas
4049Dynax, 199?
4050
4051This game runs on Royal Mahjong hardware.
4052
4053Top PCB
4054-------
4055D5011308L1
4056|-----------------------------------|
4057| DIP32 DIP32 5003  5002 DIP32 5001A|
4058|DIP40                          62XX|
4059|                         32.768kHz |
4060|                             RTC   |
4061|                   |-----------|   |
4062|                   |    CPU    |   |
4063|                   |-----------|   |
4064|DSW4   DSW2                        |
4065|    DSW3   DSW1           PAL      |
4066|                                   |
4067|                                   |
4068|                                   |
4069|    D50-2                          |
4070|*      D50-1            8MHz       |
4071|  %         &             BATTERY  |
4072|-----------------------------------|
4073Notes:
4074      Every chip has it's surface scratched
4075      *     - Cable connector joined to main PCB (to original PROM socket on main board)
4076      %     - RGB Video output
4077      &     - +12V input to top PCB
4078      DIP32 - Empty DIP32 socket
4079      DSWx  - have 10 switches each
4080      DIP40 - Socket joins to main PCB
4081      CPU   - unknown SDIP64 chip. Possibly TMP90P640 or similar TLCS-90 type CPU
4082              Pins 9-14 have been broken off and removed!
4083      62XX  - 6264 or 62256 SRAM
4084      D50-* - 82S147 color PROMs
4085
4086
4087Main PCB
4088--------
4089FRM-00 (with Falcon Logo.... PCB is made by Falcon)
4090|------------------------------------------------|
4091|  6116 DIP24 ROM6  ROM5  ROM4  ROM3  ROM2  ROM1 |
4092|HA1368                                          |
4093|                                                |
4094|     VOL                                DIP40   |
4095|                                                |
4096|             DSW(8)                    18.432MHz|
4097|M                                               |
4098|A                                               |
4099|H                                               |
4100|J                                               |
4101|O  AY3-8910                                     |
4102|N           4116    4116                        |
4103|G           4116    4116                        |
4104|2           4116    4116                        |
4105|8           4116    4116                        |
4106|            4116    4116                        |
4107|            4116    4116                        |
4108|            4116    4116                        |
4109|            4116    4116                        |
4110|------------------------------------------------|
4111Notes:
4112      DIP40 - Socket joins to top PCB
4113      DIP24 - Unpopulated socket
4114      AY-3-8910 - clock 1.536MHz (18.432/12]
4115      ROM* - Unpopulated DIP24 sockets
4116
4117***************************************************************************/
4118
4119ROM_START( mjvegas )
4120   ROM_REGION( 0xd0000, REGION_CPU1, 0 )
4121   ROM_LOAD( "50xx.tmp90841", 0x00000, 0x02000, NO_DUMP )
4122   ROM_LOAD( "5001a.1b", 0x00000, 0x20000, CRC(91859a47) SHA1(3c452405bf28f5e7302eaccdf472e91b64629a67) )
4123   /* bank switched ROMs follow */
4124   ROM_RELOAD(           0x10000, 0x20000 )
4125   ROM_LOAD( "5002.1d",  0x30000, 0x80000, CRC(016c0a32) SHA1(5c5fdd631eacb36a0ee7dba9e070c2d3d3d8fd5b) )
4126   ROM_LOAD( "5003.1e",  0xb0000, 0x20000, CRC(5323cc85) SHA1(58b75ba560f05a0568024f52ee89f54713219452) )
4127
4128   ROM_REGION( 0x400, REGION_PROMS, 0 )
4129   ROM_LOAD( "d50-2_82s147.4h", 0x000, 0x200, CRC(3c960ea2) SHA1(65e05e3f129e9e6fcb14b7d44a75a76919c54d52) )
4130   ROM_LOAD( "d50-1_82s147.4g", 0x200, 0x200, CRC(50c0d0ec) SHA1(222899456cd2e15391d8d0f771bbd5e5333d6ba3) )
4131ROM_END
4132
4133/***************************************************************************
4134
4135Mahjong Shinkirou Deja Vu (+ some roms from Jan Oh (Toapan) !?)
4136
4137This game runs on Royal Mahjong hardware.
4138
4139Top PCB
4140-------
4141D210301BL2
4142|-----------------------------------|
4143| DIP32 DIP32 2104  2103  2102 2101 |
4144|DIP40                          6116|
4145|                                   |
4146|DSW3                               |
4147|  |-----------|                    |
4148|  |    CPU    |                    |
4149|  |-----------|                    |
4150|DSW4                               |
4151|             8MHz                  |
4152|                         DSW2  DSW1|
4153|                                   |
4154|                                   |
4155|                                   |
4156|*                                  |
4157|  %                                |
4158|-----------------------------------|
4159Notes:
4160      Every chip has it's surface scratched
4161      *     - Connector joined to main PCB
4162      %     - RGB Video output
4163      DIP32 - Empty DIP32 socket
4164      DSWx  - have 8 switches each
4165      DIP40 - Socket joins to main PCB
4166      CPU   - unknown SDIP64 chip. Possibly TMP90P640 or similar TLCS-90 type CPU
4167
4168
4169Main PCB
4170--------
4171FRM-00
4172|------------------------------------------------|
4173|  6116 DIP24 ROM6  ROM5  ROM4  ROM3  ROM2  ROM1 |
4174|HA1368                                          |
4175|                                                |
4176|                                        DIP40   |
4177|                                                |
4178|             DSW(8)                    18.432MHz|
4179|M                                               |
4180|A                                               |
4181|H                                               |
4182|J                                               |
4183|O  AY3-8910                                     |
4184|N           4116    4116                        |
4185|G           4116    4116                        |
4186|2           4116    4116                        |
4187|8           4116    4116                        |
4188|            4116    4116                        |
4189|            4116    4116                        |
4190|            4116    4116                        |
4191|            4116    4116                        |
4192|------------------------------------------------|
4193Notes:
4194      DIP40 - Sockets joins to top PCB
4195      DIP24 - Unpopulated socket
4196
4197***************************************************************************/
4198
4199ROM_START( mjdejavu )
4200   ROM_REGION( 0xd0000, REGION_CPU1, 0 )
4201   ROM_LOAD( "2101.1b", 0x00000, 0x10000, CRC(b0426ea7) SHA1(ac39cbf5d78acdaa4b01d948917965c3aa2761b8) )
4202   /* bank switched ROMs follow */
4203   ROM_RELOAD(          0x10000, 0x08000 )
4204   ROM_CONTINUE(        0x10000, 0x08000 )   // 0
4205   // unused
4206   ROM_LOAD( "2103.1d", 0x30000, 0x20000, CRC(ed5fde4b) SHA1(d55487ae1007d43b71f06ae5c407c75db7054515) )   // 8
4207   // unused
4208   ROM_LOAD( "2104.1e", 0x70000, 0x20000, CRC(cfb8075d) SHA1(31f613a1a9b5f4295b552aeeddb760605ce2ac70) )   // 18
4209   // unused
4210   ROM_LOAD( "2102.1c", 0xb0000, 0x20000, CRC(f461e422) SHA1(c3505feb32650fdd5c0d7f30faed69b65d94937a) )   // 28
4211
4212   ROM_REGION( 0x400, REGION_PROMS, 0 )
4213   ROM_LOAD( "82s147.4d", 0x000, 0x200, CRC(d43f4c7c) SHA1(117d2e4e8d5bea3e5dc903a4b87bd71786ae009c) )
4214   ROM_LOAD( "82s147.4c", 0x200, 0x200, CRC(30cf7831) SHA1(b4593d51c6ceb301279a01a98665e4be8a3c403d) )
4215ROM_END
4216
4217// Incomplete romset (missing rom7 at $6000): "Jan Oh" by Toaplan, on royalmah hardware (try pc=64f).
4218ROM_START( janoh )
4219   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4220   ROM_LOAD( "rom1.p1",  0x0000, 0x1000, CRC(8fc19963) SHA1(309e941c059a97b117090fd9dd69a00031aa6109) )   // "1984 JAN OH"
4221   ROM_LOAD( "rom2.p12", 0x1000, 0x1000, CRC(e1141ae1) SHA1(38f7a71b367a607bb20a5cbe62e7c87c96c6997c) )
4222   ROM_LOAD( "rom3.p2",  0x2000, 0x1000, CRC(66e6d2f4) SHA1(d7e00e5bfee60daf844c46d36b1f4860fba70759) )   // "JANOH TOAPLAN 84"
4223   ROM_LOAD( "rom4.p3",  0x3000, 0x1000, CRC(9186f02c) SHA1(b7dc2d6c19e67dd3f841cbb56df9589e3e6941f7) )
4224   ROM_LOAD( "rom5.p4",  0x4000, 0x1000, CRC(f3c478a8) SHA1(02a8504457cbcdd3e67e7f5ba60fb789f198a51d) )
4225   ROM_LOAD( "rom6.p5",  0x5000, 0x1000, CRC(92687327) SHA1(4fafba5881dca2a147616d94dd055eba6aa3c653) )
4226   ROM_LOAD( "rom7.p6",  0x6000, 0x1000, NO_DUMP )
4227
4228   ROM_REGION( 0x20, REGION_PROMS, 0 )
4229   ROM_LOAD( "janho.color", 0x00, 0x20, NO_DUMP )
4230ROM_END
4231
4232
34504233static DRIVER_INIT( ippatsu )   {   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x8000 );   }
34514234
34524235static DRIVER_INIT( janptr96 )
r1051r1052
34574240   memory_set_bankptr(3,generic_nvram);
34584241}
34594242
4243
34604244GAME( 1981,  royalmj,  0,        royalmah, royalmah, 0,        ROT0, "Nichibutsu",                 "Royal Mahjong (Japan, v1.13)",          0 )
34614245GAME( 1981?, openmj,   royalmj,  royalmah, royalmah, 0,        ROT0, "Sapporo Mechanic",           "Open Mahjong [BET] (Japan)",            0 )
34624246GAME( 1982,  royalmah, royalmj,  royalmah, royalmah, 0,        ROT0, "bootleg",                    "Royal Mahjong (Falcon bootleg, v1.01)", 0 )
4247GAME( 1983,  janyoup2, royalmj,  ippatsu,  janyoup2, 0,        ROT0, "Cosmo Denshi",               "Janyou Part II (ver 7.03, July 1 1983)",0 )
4248GAME( 1984,  janoh,    0,        royalmah, royalmah, 0,        ROT0, "Toaplan",                    "Jan Oh",                                GAME_NOT_WORKING )
34634249GAME( 1986,  dondenmj, 0,        dondenmj, majs101b, 0,        ROT0, "Dyna Electronics",           "Don Den Mahjong [BET] (Japan)",         0 )
34644250GAME( 1986,  ippatsu,  0,        ippatsu,  ippatsu,  ippatsu,  ROT0, "Public Software / Paradais", "Ippatsu Gyakuten [BET] (Japan)",        0 )
34654251GAME( 1986,  suzume,   0,        suzume,   suzume,   0,        ROT0, "Dyna Electronics",           "Watashiha Suzumechan (Japan)",          0 )
r1051r1052
34674253GAME( 1987,  tontonb,  0,        tontonb,  tontonb,  0,        ROT0, "Dynax",                      "Tonton [BET] (Japan)",                  0 )
34684254GAME( 1988,  majs101b, 0,        majs101b, majs101b, 0,        ROT0, "Dynax",                      "Mahjong Studio 101 [BET] (Japan)",      0 )
34694255GAME( 1988,  mjapinky, 0,        mjapinky, mjapinky, 0,        ROT0, "Dynax",                      "Almond Pinky [BET] (Japan)",            0 )
4256GAME( 1989,  mjdejavu, 0,        mjdejavu, mjdejavu, 0,        ROT0, "Dynax",                      "Mahjong Shinkirou Deja Vu (Japan)",     0 )
34704257GAME( 1989,  mjderngr, 0,        mjderngr, majs101b, 0,        ROT0, "Dynax",                      "Mahjong Derringer (Japan)",             0 )
34714258GAME( 1990,  mjifb,    0,        mjifb,    mjifb,    0,        ROT0, "Dynax",                      "Mahjong If...? [BET]",                  0 )
4259GAME( 1991,  mjvegas,  0,        mjifb,    mjifb,    0,        ROT0, "Dynax",                      "Mahjong Vegas (Japan)",                 GAME_NOT_WORKING )
34724260GAME( 1992,  cafetime, 0,        cafetime, cafetime, 0,        ROT0, "Dynax",                      "Mahjong Cafe Time",                     0 )
34734261GAME( 1993,  cafedoll, 0,        mjifb,    mjifb,    0,        ROT0, "Dynax",                      "Mahjong Cafe Doll (Japan)",             GAME_NOT_WORKING )
34744262GAME( 1995,  mjtensin, 0,        mjtensin, mjtensin, 0,        ROT0, "Dynax",                      "Mahjong Tensinhai (Japan)",             GAME_NOT_WORKING )
src/mame/drivers/subs.c
r1051r1052
168168};
169169
170170
171static const gfx_decode gfxdecodeinfo[] =
172{
173   { REGION_GFX1, 0, &playfield_layout, 0, 2 },    /* playfield graphics */
174   { REGION_GFX2, 0, &motion_layout,    0, 2 },    /* motion graphics */
175   { -1 }
176};
171static GFXDECODE_START( subs )
172   GFXDECODE_ENTRY( REGION_GFX1, 0, playfield_layout, 0, 2 )    /* playfield graphics */
173   GFXDECODE_ENTRY( REGION_GFX2, 0, motion_layout,    0, 2 )    /* motion graphics */
174GFXDECODE_END
177175
178176
179177/*************************************
r1051r1052
196194
197195   /* video hardware */
198196   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
199   MDRV_GFXDECODE(gfxdecodeinfo)
197   MDRV_GFXDECODE(subs)
200198   MDRV_PALETTE_LENGTH(4)
201199   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
202200
r1051r1052
226224   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
227225
228226   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
229   MDRV_SOUND_CONFIG(subs_discrete_interface)
227   MDRV_SOUND_CONFIG_DISCRETE(subs)
230228   MDRV_SOUND_ROUTE(0, "left", 1.0)
231229   MDRV_SOUND_ROUTE(1, "right", 1.0)
232230MACHINE_DRIVER_END
src/mame/drivers/coolridr.c
r1051r1052
2626
2727SEGA CUSTOM IC :
2828
29315-5687 (x2)
29315-5687 (x2) (SCSP)
3030
3131315-5757
3232
r1051r1052
6868
6969*/
7070
71#include <stdio.h>
7172#include "driver.h"
73#include "sound/scsp.h"
7274
7375/* video */
7476
r1051r1052
7880
7981VIDEO_UPDATE(coolridr)
8082{
81
8283   return 0;
8384}
8485
r1051r1052
8788UINT32* sysh1_workram_h;
8889UINT16* sysh1_soundram;
8990
91// what's wrong:
92//
93// SH-1 waits for "SEGA" at 0530008c after writing it to 6000020 and 600010c
94// SH-2 writes 0x01 to 060d88a5, expects something (SH-1?) to change that
95
9096static ADDRESS_MAP_START( system_h1_map, ADDRESS_SPACE_PROGRAM, 32 )
9197   AM_RANGE(0x00000000, 0x000fffff) AM_ROM
92   AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM //AM_SHARE(1) /*not work ram,something else *AND* not all of it...*/
93   AM_RANGE(0x03f10000, 0x03ffffff) AM_RAM
94   /*code jumps here after is it uploaded,likely to be Work Ram-H as in st-v,
95      I think nobody cares if I give it the same name...*/
98   AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM // either RAM or registers, not sure
9699   AM_RANGE(0x06000000, 0x060fffff) AM_RAM AM_BASE(&sysh1_workram_h)
97100ADDRESS_MAP_END
98101
99102static ADDRESS_MAP_START( coolridr_submap, ADDRESS_SPACE_PROGRAM, 32 )
100103   AM_RANGE(0x00000000, 0x0001ffff) AM_ROM
101104   AM_RANGE(0x01000000, 0x0100ffff) AM_RAM
102
103   AM_RANGE(0x05000000, 0x0500ffff) AM_RAM
104
105105   AM_RANGE(0x05200000, 0x052001ff) AM_RAM
106
107   AM_RANGE(0x05300000, 0x0530ffff) AM_RAM //AM_SHARE(1)
108
109   AM_RANGE(0x05f00000, 0x05ffffff) AM_RAM
110
111   AM_RANGE(0x06000000, 0x060fffff) AM_RAM// AM_SHARE(1)
112
113   AM_RANGE(0x07000000, 0x07ffffff) AM_RAM
114
115
106   AM_RANGE(0x05300000, 0x0530ffff) AM_RAM
107   AM_RANGE(0x06000000, 0x06000fff) AM_RAM
108   AM_RANGE(0x07fff000, 0x07ffffff) AM_RAM
116109ADDRESS_MAP_END
117110
111// SH-1 or SH-2 almost certainly copies the program down to here: the ROM containing the program is 32-bit wide and the 68000 is 16-bit
112// the SCSP is believed to be hardcoded to decode the first 4 MB like this for a master/slave config
113// (see also Model 3):
118114static ADDRESS_MAP_START( system_h1_sound_map, ADDRESS_SPACE_PROGRAM, 16 )
119   AM_RANGE(0x000000, 0x0fffff) AM_ROM
120   AM_RANGE(0x100700, 0x100bff) AM_RAM
121   AM_RANGE(0x800000, 0x807fff) AM_RAM AM_BASE(&sysh1_soundram)
122   AM_RANGE(0x808000, 0x80ffff) AM_RAM
115   AM_RANGE(0x000000, 0x07ffff) AM_RAM
116   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(SCSP_0_r, SCSP_0_w)
117   AM_RANGE(0x200000, 0x27ffff) AM_RAM
118   AM_RANGE(0x300000, 0x300fff) AM_READWRITE(SCSP_1_r, SCSP_1_w)
123119ADDRESS_MAP_END
124120
125121INPUT_PORTS_START( coolridr )
r1051r1052
139135   16*128
140136};
141137
142static const gfx_decode gfxdecodeinfo[] =
143{
144   { REGION_GFX1, 0, &tiles8x8_layout, 0, 16 },
145   { REGION_GFX2, 0, &tiles8x8_layout, 0, 16 },
146   { REGION_GFX3, 0, &tiles8x8_layout, 0, 16 },
147   { REGION_GFX4, 0, &tiles8x8_layout, 0, 16 },
148   { REGION_GFX5, 0, &tiles8x8_layout, 0, 16 },
138static GFXDECODE_START( coolridr )
139   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8_layout, 0, 16 )
140   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8_layout, 0, 16 )
141   GFXDECODE_ENTRY( REGION_GFX3, 0, tiles8x8_layout, 0, 16 )
142   GFXDECODE_ENTRY( REGION_GFX4, 0, tiles8x8_layout, 0, 16 )
143   GFXDECODE_ENTRY( REGION_GFX5, 0, tiles8x8_layout, 0, 16 )
149144
150   { -1 }
151};
145GFXDECODE_END
152146
153147
154
148// IRQs 2 & 3 are valid on SH-2
155149static INTERRUPT_GEN( system_h1 )
156150{
157   switch(cpu_getiloops())
151   if (cpu_getiloops())
158152   {
159   //  case 2: cpunum_set_input_line(0, 6, HOLD_LINE); break;
160      case 1: cpunum_set_input_line(0, 4, HOLD_LINE); break;
161   //  case 0: cpunum_set_input_line(0, 2, HOLD_LINE); break;
153      cpunum_set_input_line(0, 4, HOLD_LINE);
162154   }
155   else
156   {
157      cpunum_set_input_line(0, 3, HOLD_LINE);
158   }
163159}
164160
161// not sure on SH-1
162static INTERRUPT_GEN( system_h1_sub )
163{
164   if (cpu_getiloops())
165   {
166//      cpunum_set_input_line(2, 4, HOLD_LINE);
167   }
168   else
169   {
170//      cpunum_set_input_line(2, 3, HOLD_LINE);
171   }
172}
173
165174MACHINE_RESET ( coolridr )
166175{
167176
r1051r1052
173182static MACHINE_DRIVER_START( coolridr )
174183   MDRV_CPU_ADD_TAG("main", SH2, 28000000)   // ?? mhz
175184   MDRV_CPU_PROGRAM_MAP(system_h1_map,0)
176   MDRV_CPU_VBLANK_INT(system_h1,3)
185   MDRV_CPU_VBLANK_INT(system_h1, 2)
177186
178187   MDRV_CPU_ADD_TAG("sound", M68000, 12000000)   // ?? mhz
179188   MDRV_CPU_PROGRAM_MAP(system_h1_sound_map,0)
180189
181190   MDRV_CPU_ADD_TAG("sub", SH2, 8000000)   // SH7032 HD6417032F20!! ?? mhz
182191   MDRV_CPU_PROGRAM_MAP(coolridr_submap,0)
183   MDRV_CPU_VBLANK_INT(system_h1,3)
192   MDRV_CPU_VBLANK_INT(system_h1_sub, 2)
184193
185   MDRV_GFXDECODE(gfxdecodeinfo)
194   MDRV_GFXDECODE(coolridr)
186195
187196
188197   MDRV_SCREEN_REFRESH_RATE(60)
r1051r1052
200209MACHINE_DRIVER_END
201210
202211ROM_START( coolridr )
203   ROM_REGION( 0x1000000, REGION_CPU1, 0 ) /* SH2 code */
212   ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* SH2 code */
204213   ROM_LOAD32_WORD_SWAP( "ep17659.30", 0x0000000, 0x080000, CRC(473027b0) SHA1(acaa212869dd79550235171b9f054e82750f74c3) )
205214   ROM_LOAD32_WORD_SWAP( "ep17658.29", 0x0000002, 0x080000, CRC(7ecfdfcc) SHA1(97cb3e6cf9764c8db06de12e4e958148818ef737) )
206215
207
208   ROM_REGION( 0x1000000, REGION_CPU2, 0) /* M68000 code*/
216   ROM_REGION( 0x100000, REGION_CPU2, 0 )   /* 68000 */
209217   ROM_LOAD32_WORD_SWAP( "ep17661.32", 0x0000000, 0x080000, CRC(81a7d90b) SHA1(99f8c3e75b94dd1b60455c26dc38ce08db82fe32) )
210218   ROM_LOAD32_WORD_SWAP( "ep17660.31", 0x0000002, 0x080000, CRC(27b7a507) SHA1(4c28b1d18d75630a73194b5d4fd166f3b647c595) )
211219
212220   ROM_REGION( 0x100000, REGION_CPU3, 0 ) /* SH1 */
213221   ROM_LOAD16_WORD_SWAP( "ep17662.12", 0x000000, 0x020000,  CRC(50d66b1f) SHA1(f7b7f2f5b403a13b162f941c338a3e1207762a0b) )
214222
215
216
217223   ROM_REGION( 0x0400000, REGION_GFX1, 0 ) /* Tiles. . at least 1 format */
218224   ROM_LOAD32_WORD_SWAP( "mp17650.11",0x000000, 0x0200000, CRC(0ccc84a1) SHA1(65951685b0c8073f6bd1cf9959e1b4d0fc6031d8) )
219225   ROM_LOAD32_WORD_SWAP( "mp17651.12",0x000002, 0x0200000, CRC(25fd7dde) SHA1(a1c3f3d947ce20fbf61ea7ab235259be9b7d35a8) )
src/mame/drivers/darkmist.c
r1051r1052
230230};
231231
232232
233static const gfx_decode gfxdecodeinfo[] =
234{
235   { REGION_GFX1, 0, &charlayout,  0, 16*4 },
236   { REGION_GFX2, 0, &tilelayout,  0, 16*4 },
237   { REGION_GFX3, 0, &tilelayout,  0, 16*4 },
238   { -1 }
239};
233static GFXDECODE_START( darkmist )
234   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 16*4 )
235   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout,  0, 16*4 )
236   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout,  0, 16*4 )
237GFXDECODE_END
240238
241239INTERRUPT_GEN( darkmist_interrupt )
242240{
r1051r1052
270268   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
271269   MDRV_SCREEN_SIZE(256, 256)
272270   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
273   MDRV_GFXDECODE(gfxdecodeinfo)
271   MDRV_GFXDECODE(darkmist)
274272   MDRV_PALETTE_LENGTH(0x100+1)
275273   MDRV_PALETTE_INIT(darkmist)
276274   MDRV_COLORTABLE_LENGTH(0x100*4)
src/mame/drivers/exctsccr.c
r1051r1052
361361   64*8   /* every sprite takes 64 bytes */
362362};
363363
364static const gfx_decode gfxdecodeinfo[] =
365{
366   { REGION_GFX1, 0x0000, &charlayout1,      0, 32 }, /* chars */
367   { REGION_GFX1, 0x2000, &charlayout2,      0, 32 }, /* chars */
368   { REGION_GFX1, 0x1000, &spritelayout1, 16*8, 32 }, /* sprites */
369   { REGION_GFX1, 0x3000, &spritelayout2, 16*8, 32 }, /* sprites */
370   { REGION_GFX2, 0x0000, &spritelayout,  16*8, 32 }, /* sprites */
371   { -1 }
372};
364static GFXDECODE_START( exctsccr )
365   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout1,      0, 32 ) /* chars */
366   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout2,      0, 32 ) /* chars */
367   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout1, 16*8, 32 ) /* sprites */
368   GFXDECODE_ENTRY( REGION_GFX1, 0x3000, spritelayout2, 16*8, 32 ) /* sprites */
369   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,  16*8, 32 ) /* sprites */
370GFXDECODE_END
373371
374372
375373/***************************************************************************
r1051r1052
405403   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
406404   MDRV_SCREEN_SIZE(32*8, 32*8)
407405   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
408   MDRV_GFXDECODE(gfxdecodeinfo)
406   MDRV_GFXDECODE(exctsccr)
409407   MDRV_PALETTE_LENGTH(32)
410408   MDRV_COLORTABLE_LENGTH(64*8)
411409
r1051r1052
454452   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
455453   MDRV_SCREEN_SIZE(32*8, 32*8)
456454   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
457   MDRV_GFXDECODE(gfxdecodeinfo)
455   MDRV_GFXDECODE(exctsccr)
458456   MDRV_PALETTE_LENGTH(32)
459457   MDRV_COLORTABLE_LENGTH(64*8)
460458
src/mame/drivers/funybubl.c
r1051r1052
226226};
227227
228228
229static const gfx_decode gfxdecodeinfo[] =
230{
231   { REGION_GFX1, 0, &tiles16x16x8_1_layout, 0, 16 },
232   { REGION_GFX2, 0, &tiles16x16x8_2_layout, 0, 16 },
233   { -1 }
234};
229static GFXDECODE_START( funybubl )
230   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16x8_1_layout, 0, 16 )
231   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16x8_2_layout, 0, 16 )
232GFXDECODE_END
235233
236234
237235
r1051r1052
264262   MDRV_SCREEN_VISIBLE_AREA(12*8, 512-12*8-1, 16, 256-16-1)
265263//  MDRV_SCREEN_VISIBLE_AREA(0*8, 512-1, 0, 256-1)
266264
267   MDRV_GFXDECODE(gfxdecodeinfo)
265   MDRV_GFXDECODE(funybubl)
268266   MDRV_PALETTE_LENGTH(0x400)
269267
270268   MDRV_VIDEO_START(funybubl)
src/mame/drivers/shisen.c
r1051r1052
218218};
219219
220220
221static const gfx_decode gfxdecodeinfo[] =
222{
223   { REGION_GFX1, 0x00000, &charlayout,  0, 16 },
224   { -1 }
225};
221static GFXDECODE_START( shisen )
222   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout,  0, 16 )
223GFXDECODE_END
226224
227225
228226
r1051r1052
257255   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
258256   MDRV_SCREEN_SIZE(64*8, 32*8)
259257   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
260   MDRV_GFXDECODE(gfxdecodeinfo)
258   MDRV_GFXDECODE(shisen)
261259   MDRV_PALETTE_LENGTH(256)
262260
263261   MDRV_VIDEO_START(sichuan2)
src/mame/drivers/nmk16.c
r1051r1052
28382838   32*32
28392839};
28402840
2841static const gfx_decode tharrier_gfxdecodeinfo[] =
2842{
2843   { REGION_GFX1, 0, &charlayout, 0x000, 16 },   /* color 0x200-0x2ff */
2844   { REGION_GFX2, 0, &tilelayout, 0x000, 16 },   /* color 0x000-0x0ff */
2845   { REGION_GFX3, 0, &tilelayout, 0x100, 16 },   /* color 0x100-0x1ff */
2846   { -1 }
2847};
2841static GFXDECODE_START( tharrier )
2842   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x000, 16 )   /* color 0x200-0x2ff */
2843   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x000, 16 )   /* color 0x000-0x0ff */
2844   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x100, 16 )   /* color 0x100-0x1ff */
2845GFXDECODE_END
28482846
2849static const gfx_decode macross_gfxdecodeinfo[] =
2850{
2851   { REGION_GFX1, 0, &charlayout, 0x200, 16 },   /* color 0x200-0x2ff */
2852   { REGION_GFX2, 0, &tilelayout, 0x000, 16 },   /* color 0x000-0x0ff */
2853   { REGION_GFX3, 0, &tilelayout, 0x100, 16 },   /* color 0x100-0x1ff */
2854   { -1 }
2855};
2847static GFXDECODE_START( macross )
2848   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x200, 16 )   /* color 0x200-0x2ff */
2849   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x000, 16 )   /* color 0x000-0x0ff */
2850   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x100, 16 )   /* color 0x100-0x1ff */
2851GFXDECODE_END
28562852
2857static const gfx_decode macross2_gfxdecodeinfo[] =
2858{
2859   { REGION_GFX1, 0, &charlayout, 0x300, 16 },   /* color 0x300-0x3ff */
2860   { REGION_GFX2, 0, &tilelayout, 0x000, 16 },   /* color 0x000-0x0ff */
2861   { REGION_GFX3, 0, &tilelayout, 0x100, 32 },   /* color 0x100-0x2ff */
2862   { -1 }
2863};
2853static GFXDECODE_START( macross2 )
2854   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x300, 16 )   /* color 0x300-0x3ff */
2855   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x000, 16 )   /* color 0x000-0x0ff */
2856   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x100, 32 )   /* color 0x100-0x2ff */
2857GFXDECODE_END
28642858
2865static const gfx_decode bjtwin_gfxdecodeinfo[] =
2866{
2867   { REGION_GFX1, 0, &charlayout, 0x000, 16 },   /* color 0x000-0x0ff */
2868   { REGION_GFX2, 0, &charlayout, 0x000, 16 },   /* color 0x000-0x0ff */
2869   { REGION_GFX3, 0, &tilelayout, 0x100, 16 },   /* color 0x100-0x1ff */
2870   { -1 }
2871};
2859static GFXDECODE_START( bjtwin )
2860   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x000, 16 )   /* color 0x000-0x0ff */
2861   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0x000, 16 )   /* color 0x000-0x0ff */
2862   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x100, 16 )   /* color 0x100-0x1ff */
2863GFXDECODE_END
28722864
2873static const gfx_decode bioship_gfxdecodeinfo[] =
2874{
2875   { REGION_GFX1, 0, &charlayout, 0x300, 16 },   /* color 0x300-0x3ff */
2876   { REGION_GFX2, 0, &tilelayout, 0x100, 16 },   /* color 0x100-0x1ff */
2877   { REGION_GFX3, 0, &tilelayout, 0x200, 16 },   /* color 0x200-0x2ff */
2878   { REGION_GFX4, 0, &tilelayout, 0x000, 16 },   /* color 0x000-0x0ff */
2879   { -1 }
2880};
2865static GFXDECODE_START( bioship )
2866   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x300, 16 )   /* color 0x300-0x3ff */
2867   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x100, 16 )   /* color 0x100-0x1ff */
2868   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x200, 16 )   /* color 0x200-0x2ff */
2869   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 0x000, 16 )   /* color 0x000-0x0ff */
2870GFXDECODE_END
28812871
2882static const gfx_decode strahl_gfxdecodeinfo[] =
2883{
2884   { REGION_GFX1, 0, &charlayout, 0x000, 16 },   /* color 0x000-0x0ff */
2885   { REGION_GFX2, 0, &tilelayout, 0x300, 16 },   /* color 0x300-0x3ff */
2886   { REGION_GFX3, 0, &tilelayout, 0x100, 16 },   /* color 0x100-0x1ff */
2887   { REGION_GFX4, 0, &tilelayout, 0x200, 16 },   /* color 0x200-0x2ff */
2888   { -1 }
2889};
2872static GFXDECODE_START( strahl )
2873   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x000, 16 )   /* color 0x000-0x0ff */
2874   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0x300, 16 )   /* color 0x300-0x3ff */
2875   GFXDECODE_ENTRY( REGION_GFX3, 0, tilelayout, 0x100, 16 )   /* color 0x100-0x1ff */
2876   GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 0x200, 16 )   /* color 0x200-0x2ff */
2877GFXDECODE_END
28902878
28912879
28922880
r1051r1052
29382926   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29392927   MDRV_SCREEN_SIZE(256, 256)
29402928   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2941   MDRV_GFXDECODE(tharrier_gfxdecodeinfo)
2929   MDRV_GFXDECODE(tharrier)
29422930   MDRV_PALETTE_LENGTH(512)
29432931
29442932   MDRV_VIDEO_START(macross)
r1051r1052
29852973   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29862974   MDRV_SCREEN_SIZE(256, 256)
29872975   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
2988   MDRV_GFXDECODE(tharrier_gfxdecodeinfo)
2976   MDRV_GFXDECODE(tharrier)
29892977   MDRV_PALETTE_LENGTH(512)
29902978
29912979   MDRV_VIDEO_START(macross)
r1051r1052
30283016   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30293017   MDRV_SCREEN_SIZE(256, 256)
30303018   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3031   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3019   MDRV_GFXDECODE(macross)
30323020   MDRV_PALETTE_LENGTH(1024)
30333021
30343022   MDRV_VIDEO_START(macross)
r1051r1052
30743062   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
30753063   MDRV_SCREEN_SIZE(256, 256)
30763064   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3077   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3065   MDRV_GFXDECODE(macross)
30783066   MDRV_PALETTE_LENGTH(1024)
30793067
30803068   MDRV_VIDEO_START(macross)
r1051r1052
31533141   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
31543142   MDRV_SCREEN_SIZE(256, 256)
31553143   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3156   MDRV_GFXDECODE(bioship_gfxdecodeinfo)
3144   MDRV_GFXDECODE(bioship)
31573145   MDRV_PALETTE_LENGTH(1024)
31583146
31593147   MDRV_VIDEO_START(bioship)
r1051r1052
31963184   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
31973185   MDRV_SCREEN_SIZE(256, 256)
31983186   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3199   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3187   MDRV_GFXDECODE(macross)
32003188   MDRV_PALETTE_LENGTH(1024)
32013189
32023190   MDRV_VIDEO_START(macross)
r1051r1052
32423230   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32433231   MDRV_SCREEN_SIZE(256, 256)
32443232   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3245   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3233   MDRV_GFXDECODE(macross)
32463234   MDRV_PALETTE_LENGTH(1024)
32473235
32483236   MDRV_VIDEO_START(macross)
r1051r1052
32743262   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
32753263   MDRV_SCREEN_SIZE(256, 256)
32763264   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3277   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3265   MDRV_GFXDECODE(macross)
32783266   MDRV_PALETTE_LENGTH(1024)
32793267
32803268   MDRV_VIDEO_START(macross)
r1051r1052
33213309   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33223310   MDRV_SCREEN_SIZE(256, 256)
33233311   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3324   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3312   MDRV_GFXDECODE(macross)
33253313   MDRV_PALETTE_LENGTH(1024)
33263314
33273315   MDRV_VIDEO_START(macross)
r1051r1052
33493337   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33503338   MDRV_SCREEN_SIZE(256, 256)
33513339   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3352   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3340   MDRV_GFXDECODE(macross)
33533341   MDRV_PALETTE_LENGTH(1024)
33543342
33553343   MDRV_VIDEO_START(macross)
r1051r1052
33953383   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
33963384   MDRV_SCREEN_SIZE(256, 256)
33973385   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3398   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3386   MDRV_GFXDECODE(macross)
33993387   MDRV_PALETTE_LENGTH(1024)
34003388
34013389   MDRV_VIDEO_START(macross)
r1051r1052
34283416   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
34293417   MDRV_SCREEN_SIZE(256, 256)
34303418   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3431   MDRV_GFXDECODE(strahl_gfxdecodeinfo)
3419   MDRV_GFXDECODE(strahl)
34323420   MDRV_PALETTE_LENGTH(1024)
34333421
34343422   MDRV_VIDEO_START(strahl)
r1051r1052
34723460   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
34733461   MDRV_SCREEN_SIZE(256, 256)
34743462   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3475   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3463   MDRV_GFXDECODE(macross)
34763464   MDRV_PALETTE_LENGTH(1024)
34773465
34783466   MDRV_VIDEO_START(macross)
r1051r1052
35163504   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
35173505   MDRV_SCREEN_SIZE(256, 256)
35183506   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
3519   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3507   MDRV_GFXDECODE(macross)
35203508   MDRV_PALETTE_LENGTH(1024)
35213509
35223510   MDRV_VIDEO_START(macross)
r1051r1052
35603548   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
35613549   MDRV_SCREEN_SIZE(512, 256)
35623550   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
3563   MDRV_GFXDECODE(macross_gfxdecodeinfo)
3551   MDRV_GFXDECODE(macross)
35643552   MDRV_PALETTE_LENGTH(1024)
35653553
35663554   MDRV_VIDEO_START(gunnail)
r1051r1052
36093597   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
36103598   MDRV_SCREEN_SIZE(512, 256)
36113599   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
3612   MDRV_GFXDECODE(macross2_gfxdecodeinfo)
3600   MDRV_GFXDECODE(macross2)
36133601   MDRV_PALETTE_LENGTH(1024)
36143602
36153603   MDRV_VIDEO_START(macross2)
r1051r1052
36543642   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
36553643   MDRV_SCREEN_SIZE(512, 256)
36563644   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
3657   MDRV_GFXDECODE(macross2_gfxdecodeinfo)
3645   MDRV_GFXDECODE(macross2)
36583646   MDRV_PALETTE_LENGTH(1024)
36593647
36603648   MDRV_VIDEO_START(tdragon2)
r1051r1052
36973685   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
36983686   MDRV_SCREEN_SIZE(512, 256)
36993687   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
3700   MDRV_GFXDECODE(macross2_gfxdecodeinfo)
3688   MDRV_GFXDECODE(macross2)
37013689   MDRV_PALETTE_LENGTH(1024)
37023690
37033691   MDRV_VIDEO_START(macross2)
r1051r1052
37373725   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
37383726   MDRV_SCREEN_SIZE(512, 256)
37393727   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
3740   MDRV_GFXDECODE(bjtwin_gfxdecodeinfo)
3728   MDRV_GFXDECODE(bjtwin)
37413729   MDRV_PALETTE_LENGTH(1024)
37423730
37433731   MDRV_VIDEO_START(bjtwin)
src/mame/drivers/miniboy7.c
r1051r1052
236236* Graphics Decode Information *
237237******************************/
238238
239static const gfx_decode gfxdecodeinfo[] =
240{
241   { REGION_GFX1, 0x0800,   &charlayout, 0, 16 },   /* text layer 1 */
242   { REGION_GFX1, 0x0000,   &charlayout, 0, 16 },   /* text layer 2 */
239static GFXDECODE_START( miniboy7 )
240   GFXDECODE_ENTRY( REGION_GFX1, 0x0800,   charlayout, 0, 16 )   /* text layer 1 */
241   GFXDECODE_ENTRY( REGION_GFX1, 0x0000,   charlayout, 0, 16 )   /* text layer 2 */
243242
244243    /* 0x000 cards
245244       0x100 joker
246245       0x200 dices
247246       0x300 bigtxt */
248   { REGION_GFX2, 0,   &tilelayout, 0, 16 },
247   GFXDECODE_ENTRY( REGION_GFX2, 0,   tilelayout, 0, 16 )
249248
250   { -1 }
251};
249GFXDECODE_END
252250
253251
254252/*************************
r1051r1052
271269   MDRV_SCREEN_SIZE((47+1)*8, (39+1)*8)                  /* Taken from MC6845, registers 00 & 04. Normally programmed with (value-1) */
272270   MDRV_SCREEN_VISIBLE_AREA(0*8, 37*8-1, 0*8, 37*8-1)    /* Taken from MC6845, registers 01 & 06 */
273271
274   MDRV_GFXDECODE(gfxdecodeinfo)
272   MDRV_GFXDECODE(miniboy7)
275273
276274   MDRV_PALETTE_LENGTH(256)
277275   MDRV_COLORTABLE_LENGTH(1024)
src/mame/drivers/nitedrvr.c
r1051r1052
141141
142142/* Graphics Decode Information */
143143
144static const gfx_decode gfxdecodeinfo[] =
145{
146   { REGION_GFX1, 0, &charlayout, 0, 1 },
147   { -1 }
148};
144static GFXDECODE_START( nitedrvr )
145   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 1 )
146GFXDECODE_END
149147
150148/* Machine Initialization */
151149
r1051r1052
179177   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
180178   MDRV_SCREEN_SIZE(32*8, 32*8)
181179   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
182   MDRV_GFXDECODE(gfxdecodeinfo)
180   MDRV_GFXDECODE(nitedrvr)
183181   MDRV_PALETTE_LENGTH(2)
184182
185183   MDRV_PALETTE_INIT(black_and_white)
r1051r1052
190188   MDRV_SPEAKER_STANDARD_MONO("mono")
191189
192190   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
193   MDRV_SOUND_CONFIG(nitedrvr_discrete_interface)
191   MDRV_SOUND_CONFIG_DISCRETE(nitedrvr)
194192   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
195193MACHINE_DRIVER_END
196194
src/osd/windows/wintime.c
r1051r1052
2222//============================================================
2323
2424static osd_ticks_t ticks_per_second = 0;
25static osd_ticks_t suspend_adjustment = 0;
2625static osd_ticks_t suspend_ticks = 0;
2726static BOOL using_qpc = TRUE;
2827
r1051r1052
158157      SetThreadPriority(current_thread, old_priority);
159158   }
160159}
161
162
163//============================================================
164//  win_timer_enable
165//============================================================
166
167void win_timer_enable(int enabled)
168{
169   // get the current count
170   osd_ticks_t current_ticks = osd_ticks();
171
172   // if we're disabling, remember the time
173   if (!enabled && suspend_ticks == 0)
174      suspend_ticks = current_ticks;
175
176   // if we're enabling, compute the adjustment
177   else if (suspend_ticks > 0)
178   {
179      suspend_adjustment += current_ticks - suspend_ticks;
180      suspend_ticks = 0;
181   }
182}
src/osd/windows/winfile.c
r1051r1052
1818
1919// MAMEOS headers
2020#include "strconv.h"
21#include "winutil.h"
2122
2223
2324//============================================================
r1051r1052
3738//============================================================
3839
3940static DWORD create_path_recursive(const TCHAR *path);
40static file_error win_error_to_file_error(DWORD error);
4141
4242
4343
r1051r1052
329329      return GetLastError();
330330   return NO_ERROR;
331331}
332
333
334//============================================================
335//  win_error_to_file_error
336//============================================================
337
338static file_error win_error_to_file_error(DWORD error)
339{
340   file_error filerr;
341
342   // convert a Windows error to a file_error
343   switch (error)
344   {
345      case ERROR_SUCCESS:
346         filerr = FILERR_NONE;
347         break;
348
349      case ERROR_OUTOFMEMORY:
350         filerr = FILERR_OUT_OF_MEMORY;
351         break;
352
353      case ERROR_FILE_NOT_FOUND:
354      case ERROR_PATH_NOT_FOUND:
355         filerr = FILERR_NOT_FOUND;
356         break;
357
358      case ERROR_ACCESS_DENIED:
359         filerr = FILERR_ACCESS_DENIED;
360         break;
361
362      case ERROR_SHARING_VIOLATION:
363         filerr = FILERR_ALREADY_OPEN;
364         break;
365
366      default:
367         filerr = FILERR_FAILURE;
368         break;
369   }
370   return filerr;
371}
src/osd/windows/input.c
r1051r1052
5353
5454
5555//============================================================
56//  IMPORTS
57//============================================================
58
59extern int win_physical_width;
60extern int win_physical_height;
61
62
63
64//============================================================
6556//  PARAMETERS
6657//============================================================
6758
src/osd/windows/window.c
r1051r1052
4242#include "menu.h"
4343#endif /* MESS */
4444
45extern void win_timer_enable(int enabled);
46
4745extern int drawnone_init(win_draw_callbacks *callbacks);
4846extern int drawgdi_init(win_draw_callbacks *callbacks);
4947extern int drawdd_init(win_draw_callbacks *callbacks);
r1051r1052
9088static DWORD main_threadid;
9189
9290// actual physical resolution
93int win_physical_width;
94int win_physical_height;
91static int win_physical_width;
92static int win_physical_height;
9593
9694
9795
src/emu/romload.h
r1051r1052
288288
289289/* ROM processing */
290290void rom_init(running_machine *machine, const rom_entry *romp);
291void rom_exit(running_machine *machine);
292291int rom_load_warnings(void);
293292const rom_entry *rom_first_region(const game_driver *drv);
294293const rom_entry *rom_next_region(const rom_entry *romp);
src/emu/cpu/m68000/m68kfpu.c
r1051r1052
382382   }
383383}
384384
385fp_reg READ_EA_FPE(int ea)
385static fp_reg READ_EA_FPE(int ea)
386386{
387387   fp_reg r;
388388   int mode = (ea >> 3) & 0x7;
r1051r1052
409409   return r;
410410}
411411
412void WRITE_EA_FPE(int ea, fp_reg fpr)
412static void WRITE_EA_FPE(int ea, fp_reg fpr)
413413{
414414   int mode = (ea >> 3) & 0x7;
415415   int reg = (ea & 0x7);
src/emu/cpu/cpu.mak
r1051r1052
2020
2121ifdef PTR64
2222
23DRCOBJ = $(CPUOBJ)/x64drc.o
23DRCOBJ = $(CPUOBJ)/x64drc.o $(CPUOBJ)/x86log.o $(CPUOBJ)/drcfe.o
2424
2525DRCDEPS =    $(CPUSRC)/x86emit.h \
2626         $(CPUSRC)/x64drc.c \
r1051r1052
3030
3131else
3232
33DRCOBJ = $(CPUOBJ)/x86drc.o
33DRCOBJ = $(CPUOBJ)/x86drc.o $(CPUOBJ)/x86log.o $(CPUOBJ)/drcfe.o
3434
3535DRCDEPS =    $(CPUSRC)/x86emit.h \
3636         $(CPUSRC)/x86drc.c \
src/emu/cpu/drcfe.c
r0r1052
1/***************************************************************************
2
3    drcfe.c
4
5    Generic dynamic recompiler frontend structures and utilities.
6
7    Copyright (c) 2007, Aaron Giles
8    Released for general use under the MAME license
9    Visit http://mamedev.org for licensing and usage restrictions.
10
11***************************************************************************/
12
13#include <stddef.h>
14#include "cpuintrf.h"
15#include "drcfe.h"
16
17
18/***************************************************************************
19    CONSTANTS
20***************************************************************************/
21
22#define MAX_STACK_DEPTH      100
23
24
25
26/***************************************************************************
27    TYPE DEFINITIONS
28***************************************************************************/
29
30/* an entry that maps branches for our code walking */
31typedef struct _pc_stack_entry pc_stack_entry;
32struct _pc_stack_entry
33{
34   offs_t            targetpc;
35   offs_t            srcpc;
36};
37
38
39/* internal state */
40struct _drcfe_state
41{
42   /* configuration parameters */
43   UINT32            window_start;            /* code window start offset = startpc - window_start */
44   UINT32            window_end;               /* code window end offset = startpc + window_end */
45   UINT32            max_sequence;            /* maximum instructions to include in a sequence */
46
47   drcfe_describe      describe;               /* callback to describe a single instruction */
48   void *            param;                  /* parameter for the callback */
49
50   /* CPU parameters */
51   offs_t            pageshift;               /* shift to convert address to a page index */
52   cpufunc_translate   translate;               /* pointer to translation function */
53
54   /* opcode descriptor arrays */
55   opcode_desc *      desc_live_list;            /* head of list of live descriptions */
56   opcode_desc *      desc_free_list;            /* head of list of free descriptions */
57   opcode_desc **      desc_array;               /* array of descriptions in PC order */
58   UINT32             desc_array_size;         /* size of the array */
59};
60
61
62
63/***************************************************************************
64    FUNCTION PROTOTYPES
65***************************************************************************/
66
67static opcode_desc *describe_one(drcfe_state *drcfe, offs_t curpc);
68static opcode_desc **build_sequence(drcfe_state *drcfe, opcode_desc **tailptr, int start, int end, UINT32 endflag);
69static void accumulate_live_info_forwards(opcode_desc *desc, UINT64 *gprread, UINT64 *gprwrite, UINT64 *fprread, UINT64 *fprwrite);
70static void accumulate_live_info_backwards(opcode_desc *desc, UINT64 *gprread, UINT64 *gprwrite, UINT64 *fprread, UINT64 *fprwrite);
71static void release_descriptions(drcfe_state *drcfe, opcode_desc *desc);
72
73
74
75/***************************************************************************
76    INLINE FUNCTIONS
77***************************************************************************/
78
79/*-------------------------------------------------
80    desc_alloc - allocate a new opcode description
81-------------------------------------------------*/
82
83INLINE opcode_desc *desc_alloc(drcfe_state *drcfe)
84{
85   opcode_desc *desc = drcfe->desc_free_list;
86
87   /* pull a description off of the free list or allocate a new one */
88   if (desc != NULL)
89      drcfe->desc_free_list = desc->next;
90   else
91      desc = malloc_or_die(sizeof(*desc));
92   return desc;
93}
94
95
96/*-------------------------------------------------
97    desc_free - free an opcode description
98-------------------------------------------------*/
99
100INLINE void desc_free(drcfe_state *drcfe, opcode_desc *desc)
101{
102   /* just put ourselves on the free list */
103   desc->next = drcfe->desc_free_list;
104   drcfe->desc_free_list = desc;
105}
106
107
108
109/***************************************************************************
110    CORE IMPLEMENTATION
111***************************************************************************/
112
113/*-------------------------------------------------
114    drcfe_init - initializate the drcfe state
115-------------------------------------------------*/
116
117drcfe_state *drcfe_init(const drcfe_config *config, void *param)
118{
119   drcfe_state *drcfe;
120
121   /* allocate some memory to hold the state */
122   drcfe = malloc_or_die(sizeof(*drcfe));
123   memset(drcfe, 0, sizeof(*drcfe));
124
125   /* allocate the description array */
126   drcfe->desc_array = malloc_or_die((config->window_end + config->window_start + 2) * sizeof(*drcfe->desc_array));
127   memset(drcfe->desc_array, 0, (config->window_end + config->window_start + 2) * sizeof(*drcfe->desc_array));
128
129   /* copy in configuration information */
130   drcfe->window_start = config->window_start;
131   drcfe->window_end = config->window_end;
132   drcfe->max_sequence = config->max_sequence;
133   drcfe->describe = config->describe;
134   drcfe->param = param;
135
136   /* initialize the state */
137   drcfe->pageshift = activecpu_page_shift(ADDRESS_SPACE_PROGRAM);
138   drcfe->translate = (cpufunc_translate)activecpu_get_info_fct(CPUINFO_PTR_TRANSLATE);
139
140   return drcfe;
141}
142
143
144/*-------------------------------------------------
145    drcfe_exit - clean up after ourselves
146-------------------------------------------------*/
147
148void drcfe_exit(drcfe_state *drcfe)
149{
150   /* release any descriptions we've accumulated */
151   release_descriptions(drcfe, drcfe->desc_live_list);
152
153   /* free our free list of descriptions */
154   while (drcfe->desc_free_list != NULL)
155   {
156      opcode_desc *freeme = drcfe->desc_free_list;
157      drcfe->desc_free_list = drcfe->desc_free_list->next;
158      free(freeme);
159   }
160
161   /* free the description array */
162   if (drcfe->desc_array != NULL)
163      free(drcfe->desc_array);
164
165   /* free the object itself */
166   free(drcfe);
167}
168
169
170/*-------------------------------------------------
171    drcfe_describe_code - describe a sequence of
172    code that falls within the configured window
173    relative to the specified startpc
174-------------------------------------------------*/
175
176const opcode_desc *drcfe_describe_code(drcfe_state *drcfe, offs_t startpc)
177{
178   offs_t minpc = startpc - drcfe->window_start;
179   offs_t maxpc = startpc + drcfe->window_end;
180   pc_stack_entry pcstack[MAX_STACK_DEPTH];
181   pc_stack_entry *pcstackptr = &pcstack[0];
182   opcode_desc **tailptr;
183
184   /* release any descriptions we've accumulated */
185   release_descriptions(drcfe, drcfe->desc_live_list);
186   drcfe->desc_live_list = NULL;
187
188   /* add the initial PC to the stack */
189   pcstackptr->srcpc = 0;
190   pcstackptr->targetpc = startpc;
191   pcstackptr++;
192
193   /* loop while we still have a stack */
194   while (pcstackptr != &pcstack[0])
195   {
196      pc_stack_entry *curstack = --pcstackptr;
197      opcode_desc *curdesc;
198      offs_t curpc;
199
200      /* if we've already hit this PC, just mark it a branch target and continue */
201      curdesc = drcfe->desc_array[curstack->targetpc - minpc];
202      if (curdesc != NULL)
203      {
204         curdesc->flags |= OPFLAG_IS_BRANCH_TARGET;
205
206         /* if the branch crosses a page boundary, mark the target as needing to revalidate */
207         if (drcfe->pageshift != 0 && ((curstack->srcpc ^ curdesc->pc) >> drcfe->pageshift) != 0)
208            curdesc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION;
209
210         /* continue processing */
211         continue;
212      }
213
214      /* loop until we exit the block */
215      for (curpc = curstack->targetpc; curpc < maxpc && drcfe->desc_array[curpc - minpc] == NULL; curpc += drcfe->desc_array[curpc - minpc]->length)
216      {
217         /* allocate a new description and describe this instruction */
218         drcfe->desc_array[curpc - minpc] = curdesc = describe_one(drcfe, curpc);
219
220         /* stop if we hit a page fault */
221         if (curdesc->flags & OPFLAG_COMPILER_PAGE_FAULT)
222            break;
223
224         /* if we are the first instruction in the whole window, we must validate the TLB */
225         if (curpc == startpc && drcfe->pageshift != 0)
226            curdesc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION;
227
228         /* first instruction in a sequence is always a branch target */
229         if (curpc == curstack->targetpc)
230            curdesc->flags |= OPFLAG_IS_BRANCH_TARGET;
231
232         /* if we are a branch within the block range, add the branch target to our stack */
233         if ((curdesc->flags & OPFLAG_IS_BRANCH) && curdesc->targetpc >= minpc && curdesc->targetpc < maxpc && pcstackptr < &pcstack[MAX_STACK_DEPTH])
234         {
235            curdesc->flags |= OPFLAG_INTRABLOCK_BRANCH;
236            pcstackptr->srcpc = curdesc->pc;
237            pcstackptr->targetpc = curdesc->targetpc;
238            pcstackptr++;
239         }
240
241         /* if we're done, we're done */
242         if (curdesc->flags & OPFLAG_END_SEQUENCE)
243            break;
244      }
245   }
246
247   /* now build the list of descriptions in order */
248   /* first from startpc -> maxpc, then from minpc -> startpc */
249   tailptr = build_sequence(drcfe, &drcfe->desc_live_list, startpc - minpc, maxpc - minpc, OPFLAG_REDISPATCH);
250   tailptr = build_sequence(drcfe, tailptr, minpc - minpc, startpc - minpc, OPFLAG_RETURN_TO_START);
251   return drcfe->desc_live_list;
252}
253
254
255
256/***************************************************************************
257    INTERNAL HELPERS
258***************************************************************************/
259
260/*-------------------------------------------------
261    describe_one - describe a single instruction,
262    recursively describing opcodes in delay
263    slots of branches as well
264-------------------------------------------------*/
265
266static opcode_desc *describe_one(drcfe_state *drcfe, offs_t curpc)
267{
268   opcode_desc *desc = desc_alloc(drcfe);
269
270   /* initialize the description */
271   memset(desc, 0, sizeof(*desc));
272   desc->pc = curpc;
273   desc->physpc = curpc;
274   desc->targetpc = BRANCH_TARGET_DYNAMIC;
275
276   /* compute the physical PC */
277   if (drcfe->translate != NULL && !(*drcfe->translate)(ADDRESS_SPACE_PROGRAM, &desc->physpc))
278   {
279      /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */
280      /* mark as needing to validate; otherwise, just end the sequence here */
281      desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP;
282      return desc;
283   }
284
285   /* call the callback to describe an instruction */
286   if (!(*drcfe->describe)(drcfe->param, desc))
287   {
288      desc->flags |= OPFLAG_WILL_CAUSE_EXCEPTION | OPFLAG_INVALID_OPCODE;
289      return desc;
290   }
291
292   /* validate the TLB if we are exactly at the start of a page, or if we cross a page boundary */
293   if (drcfe->pageshift != 0 && (((curpc - 1) ^ (curpc + desc->length - 1)) >> drcfe->pageshift) != 0)
294      desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION;
295
296   /* validate stuff */
297   assert(desc->length > 0);
298
299   /* if we are a branch with delay slots, recursively walk those */
300   if (desc->flags & OPFLAG_IS_BRANCH)
301   {
302      opcode_desc **tailptr = &desc->delay;
303      offs_t delaypc = curpc + desc->length;
304      UINT8 slotnum;
305
306      /* iterate over slots and describe them */
307      for (slotnum = 0; slotnum < desc->delayslots; slotnum++)
308      {
309         /* recursively describe the next instruction */
310         *tailptr = describe_one(drcfe, delaypc);
311         if (*tailptr == NULL)
312            break;
313
314         /* set the delay slot flag and a pointer back to the original branch */
315         (*tailptr)->flags |= OPFLAG_IN_DELAY_SLOT;
316         (*tailptr)->branch = desc;
317
318         /* stop if we hit a page fault */
319         if ((*tailptr)->flags & OPFLAG_COMPILER_PAGE_FAULT)
320            break;
321
322         /* otherwise, advance */
323         delaypc += (*tailptr)->length;
324         tailptr = &(*tailptr)->next;
325      }
326   }
327
328   return desc;
329}
330
331
332/*-------------------------------------------------
333    build_sequence - build an ordered sequence
334    of instructions
335-------------------------------------------------*/
336
337static opcode_desc **build_sequence(drcfe_state *drcfe, opcode_desc **tailptr, int start, int end, UINT32 endflag)
338{
339   UINT64 gprread = 0, gprwrite = 0;
340   UINT64 fprread = 0, fprwrite = 0;
341   int consecutive = 0;
342   int seqstart = -1;
343   int descnum;
344
345   /* iterate in order from start to end, picking up all non-NULL instructions */
346   for (descnum = start; descnum < end; descnum++)
347      if (drcfe->desc_array[descnum] != NULL)
348      {
349         opcode_desc *curdesc = drcfe->desc_array[descnum];
350         opcode_desc *nextdesc = NULL;
351         int scandescnum;
352
353         /* determine the next instruction */
354         if (descnum + curdesc->length < end)
355            nextdesc = drcfe->desc_array[descnum + curdesc->length];
356
357         /* start a new sequence if we aren't already in the middle of one */
358         if (seqstart == -1)
359            seqstart = descnum;
360
361         /* if we are the last instruction, indicate end-of-sequence and redispatch */
362         if (nextdesc == NULL)
363            curdesc->flags |= OPFLAG_END_SEQUENCE | endflag;
364
365         /* otherwise, do some analysis based on the next instruction */
366         else
367         {
368            /* if there are instructions between us and the next instruction, we must end our sequence here */
369            for (scandescnum = 1; scandescnum < curdesc->length; scandescnum++)
370               if (drcfe->desc_array[descnum + scandescnum] != NULL)
371                  break;
372            if (scandescnum != curdesc->length)
373               curdesc->flags |= OPFLAG_END_SEQUENCE;
374
375            /* if the next instruction is a branch target, mark this instruction as end of sequence */
376            if (nextdesc->flags & OPFLAG_IS_BRANCH_TARGET)
377               curdesc->flags |= OPFLAG_END_SEQUENCE;
378         }
379
380         /* if we exceed the maximum consecutive count, cut off the sequence */
381         if (++consecutive >= drcfe->max_sequence)
382            curdesc->flags |= OPFLAG_END_SEQUENCE;
383         if (curdesc->flags & OPFLAG_END_SEQUENCE)
384            consecutive = 0;
385
386         /* update register accumulators */
387         accumulate_live_info_forwards(curdesc, &gprread, &gprwrite, &fprread, &fprwrite);
388
389         /* if this is the end of a sequence, work backwards */
390         if (curdesc->flags & OPFLAG_END_SEQUENCE)
391         {
392            int backdesc;
393
394            /* loop until all the registers have been accounted for */
395            gprread = gprwrite = 0;
396            fprread = fprwrite = 0;
397            for (backdesc = descnum; backdesc != seqstart - 1; backdesc--)
398               if (drcfe->desc_array[backdesc] != NULL)
399                  accumulate_live_info_backwards(drcfe->desc_array[backdesc], &gprread, &gprwrite, &fprread, &fprwrite);
400
401            /* reset the register states */
402            seqstart = -1;
403            gprread = gprwrite = 0;
404            fprread = fprwrite = 0;
405         }
406
407         /* add us to the end of the list and clear our array slot */
408         *tailptr = curdesc;
409         tailptr = &curdesc->next;
410      }
411
412   /* zap the array */
413   memset(&drcfe->desc_array[start], 0, (end - start) * sizeof(drcfe->desc_array[0]));
414
415   /* return the final tailptr */
416   return tailptr;
417}
418
419
420/*-------------------------------------------------
421    accumulate_live_info_forwards - recursively
422    accumulate live register liveness information
423    walking in a forward direction
424-------------------------------------------------*/
425
426static void accumulate_live_info_forwards(opcode_desc *desc, UINT64 *gprread, UINT64 *gprwrite, UINT64 *fprread, UINT64 *fprwrite)
427{
428   /* set the initial information */
429   desc->gpr.liveread = (*gprread |= desc->gpr.used);
430   desc->gpr.livewrite = (*gprwrite |= desc->gpr.modified);
431   desc->fpr.liveread = (*fprread |= desc->fpr.used);
432   desc->fpr.livewrite = (*fprwrite |= desc->fpr.modified);
433
434   /* recursively handle delay slots */
435   if (desc->delay != NULL)
436      accumulate_live_info_forwards(desc->delay, gprread, gprwrite, fprread, fprwrite);
437}
438
439
440/*-------------------------------------------------
441    accumulate_live_info_backwards - recursively
442    accumulate live register liveness information
443    walking in a backwards direction
444-------------------------------------------------*/
445
446static void accumulate_live_info_backwards(opcode_desc *desc, UINT64 *gprread, UINT64 *gprwrite, UINT64 *fprread, UINT64 *fprwrite)
447{
448   /* recursively handle delay slots */
449   if (desc->delay != NULL)
450      accumulate_live_info_backwards(desc->delay, gprread, gprwrite, fprread, fprwrite);
451
452   /* accumulate the info from this instruction */
453   desc->gpr.liveread &= (*gprread |= desc->gpr.used);
454   desc->gpr.livewrite &= (*gprwrite |= desc->gpr.modified);
455   desc->fpr.liveread &= (*fprread |= desc->fpr.used);
456   desc->fpr.livewrite &= (*fprwrite |= desc->fpr.modified);
457}
458
459
460/*-------------------------------------------------
461    release_descriptions - release any
462    descriptions we've allocated back to the
463    free list
464------------------------------------------------*/
465
466static void release_descriptions(drcfe_state *drcfe, opcode_desc *desc)
467{
468   /* loop while we still have valid entries */
469   while (desc != NULL)
470   {
471      opcode_desc *freeme = desc;
472
473      /* recursively release delay slots */
474      if (desc->delay != NULL)
475         release_descriptions(drcfe, desc->delay);
476      desc = desc->next;
477      desc_free(drcfe, freeme);
478   }
479}
src/emu/cpu/x86log.c
r0r1052
1/***************************************************************************
2
3    x86log.c
4
5    x86/x64 code logging helpers.
6
7    Copyright (c) 2007, Aaron Giles
8    Released for general use under the MAME license
9    Visit http://mamedev.org for licensing and usage restrictions.
10
11***************************************************************************/
12
13#include "x86log.h"
14
15#include <stddef.h>
16
17
18
19/***************************************************************************
20    CONSTANTS
21***************************************************************************/
22
23/* comment parameters */
24#define MAX_COMMENTS      1000
25#define MAX_DATA_RANGES      1000
26#define COMMENT_POOL_SIZE   (MAX_COMMENTS * 40)
27
28
29
30/***************************************************************************
31    TYPE DEFINITIONS
32***************************************************************************/
33
34/* code logging info */
35typedef struct _log_comment log_comment;
36struct _log_comment
37{
38   x86code *      base;
39   const char *   string;
40};
41
42
43/* data ranges */
44typedef struct _data_range data_range;
45struct _data_range
46{
47   x86code *      base;
48   x86code *      end;
49   int            size;
50};
51
52
53/* the code logging context */
54struct _x86log_context
55{
56   astring *      filename;                  /* name of the file */
57   FILE *         file;                     /* file we are logging to */
58
59   data_range       data_range[MAX_DATA_RANGES];   /* list of data ranges */
60   int            data_range_count;            /* number of data ranges */
61
62   log_comment    comment_list[MAX_COMMENTS];      /* list of comments */
63   int            comment_count;               /* number of live comments */
64
65   char          comment_pool[COMMENT_POOL_SIZE];/* string pool to hold comments */
66   char *         comment_pool_next;            /* pointer to next string pool location */
67};
68
69
70
71/***************************************************************************
72    FUNCTION PROTOTYPES
73***************************************************************************/
74
75static void reset_log(x86log_context *log);
76static int x86log_i386_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, int mode);
77
78
79
80/***************************************************************************
81    EXTERNAL INTERFACES
82***************************************************************************/
83
84/*-------------------------------------------------
85    x86log_create_context - create a new context
86-------------------------------------------------*/
87
88x86log_context *x86log_create_context(const char *filename)
89{
90   x86log_context *log;
91
92   /* allocate the log */
93   log = malloc_or_die(sizeof(*log));
94   memset(log, 0, sizeof(*log));
95
96   /* allocate the filename */
97   log->filename = astring_dupc(filename);
98
99   /* reset things */
100   reset_log(log);
101   return log;
102}
103
104
105/*-------------------------------------------------
106    x86log_free_context - release a context
107-------------------------------------------------*/
108
109void x86log_free_context(x86log_context *log)
110{
111   /* close any open files */
112   if (log->file != NULL)
113      fclose(log->file);
114
115   /* free the structure */
116   astring_free(log->filename);
117   free(log);
118}
119
120
121/*-------------------------------------------------
122    x86log_add_comment - add a comment associated
123    with a given code pointer
124-------------------------------------------------*/
125
126void x86log_add_comment(x86log_context *log, x86code *base, const char *format, ...)
127{
128   char *string = log->comment_pool_next;
129   log_comment *comment;
130   va_list va;
131
132   assert(log->comment_count < MAX_COMMENTS);
133   assert(log->comment_pool_next + strlen(format) + 256 < log->comment_pool + COMMENT_POOL_SIZE);
134
135   /* we assume comments are registered in order; enforce this */
136   assert(log->comment_count == 0 || base >= log->comment_list[log->comment_count - 1].base);
137
138   /* if we exceed the maxima, skip it */
139   if (log->comment_count >= MAX_COMMENTS)
140      return;
141   if (log->comment_pool_next + strlen(format) + 256 >= log->comment_pool + COMMENT_POOL_SIZE)
142      return;
143
144   /* do the printf to the string pool */
145   va_start(va, format);
146   log->comment_pool_next += vsprintf(log->comment_pool_next, format, va) + 1;
147   va_end(va);
148
149   /* fill in the new comment */
150   comment = &log->comment_list[log->comment_count++];
151   comment->base = base;
152   comment->string = string;
153}
154
155
156/*-------------------------------------------------
157    x86log_mark_as_data - mark a given range as
158    data for logging purposes
159-------------------------------------------------*/
160
161void x86log_mark_as_data(x86log_context *log, x86code *base, x86code *end, int size)
162{
163   data_range *data;
164
165   assert(log->data_range_count < MAX_DATA_RANGES);
166   assert(end >= base);
167   assert(size == 1 || size == 2 || size == 4 || size == 8);
168
169   /* we assume data ranges are registered in order; enforce this */
170   assert(log->data_range_count == 0 || base > log->data_range[log->data_range_count - 1].end);
171
172   /* if we exceed the maxima, skip it */
173   if (log->data_range_count >= MAX_DATA_RANGES)
174      return;
175
176   /* fill in the new range */
177   data = &log->data_range[log->data_range_count++];
178   data->base = base;
179   data->end = end;
180   data->size = size;
181}
182
183
184/*-------------------------------------------------
185    x86log_disasm_code_range - disassemble a range
186    of code and reset accumulated information
187-------------------------------------------------*/
188
189void x86log_disasm_code_range(x86log_context *log, const char *label, x86code *start, x86code *stop)
190{
191   const log_comment *lastcomment = &log->comment_list[log->comment_count];
192   const log_comment *curcomment = &log->comment_list[0];
193   const data_range *lastdata = &log->data_range[log->data_range_count];
194   const data_range *curdata = &log->data_range[0];
195   x86code *cur = start;
196
197   /* print the optional label */
198   if (label != NULL)
199      x86log_printf(log, "\n%s\n", label);
200
201   /* loop from the start until the cache top */
202   while (cur < stop)
203   {
204      char buffer[100];
205      int bytes;
206
207      /* skip past any past data ranges */
208      while (curdata < lastdata && cur > curdata->end)
209         curdata++;
210
211      /* skip past any past comments */
212      while (curcomment < lastcomment && cur > curcomment->base)
213         curcomment++;
214
215      /* if we're in a data range, output the next chunk and continue */
216      if (cur >= curdata->base && cur <= curdata->end)
217      {
218         bytes = curdata->size;
219         switch (curdata->size)
220         {
221            default:
222            case 1:      sprintf(buffer, "db      %02X", *cur);             break;
223            case 2:      sprintf(buffer, "dw      %04X", *(UINT16 *)cur);    break;
224            case 4:      sprintf(buffer, "dd      %08X", *(UINT32 *)cur);    break;
225            case 8:      sprintf(buffer, "dq      %08X%08X", ((UINT32 *)cur)[1], ((UINT32 *)cur)[0]);    break;
226         }
227      }
228
229      /* if we're not in the data range, skip filler opcodes */
230      else if (*cur == 0xcc)
231      {
232         cur++;
233         continue;
234      }
235
236      /* otherwise, do a disassembly of the current instruction */
237      else
238      {
239#ifdef PTR64
240         bytes = x86log_i386_dasm_one(buffer, (UINT32)(FPTR)cur, cur, 64) & DASMFLAG_LENGTHMASK;
241#else
242         bytes = x86log_i386_dasm_one(buffer, (UINT32)(FPTR)cur, cur, 32) & DASMFLAG_LENGTHMASK;
243#endif
244      }
245
246      /* if we have a matching comment, output it */
247      if (curcomment < lastcomment && cur == curcomment->base)
248      {
249         /* if we have additional matching comments at the same address, output them first */
250         for ( ; curcomment + 1 < lastcomment && cur == curcomment[1].base; curcomment++)
251            x86log_printf(log, "%p: %-50s; %s\n", cur, "", curcomment->string);
252         x86log_printf(log, "%p: %-50s; %s\n", cur, buffer, curcomment->string);
253      }
254
255      /* if we don't, just print the disassembly and move on */
256      else
257         x86log_printf(log, "%p: %s\n", cur, buffer);
258
259      /* advance past this instruction */
260      cur += bytes;
261   }
262
263   /* reset our state */
264   reset_log(log);
265}
266
267
268/*-------------------------------------------------
269    x86log_printf - manually printf information to
270    the log file
271-------------------------------------------------*/
272
273void x86log_printf(x86log_context *log, const char *format, ...)
274{
275   va_list va;
276
277   /* open the file, creating it if necessary */
278   if (log->file == NULL)
279      log->file = fopen(astring_c(log->filename), "w");
280   if (log->file == NULL)
281      return;
282
283   /* do the printf */
284   va_start(va, format);
285   vfprintf(log->file, format, va);
286   va_end(va);
287
288   /* flush the file */
289   fflush(log->file);
290}
291
292
293
294/***************************************************************************
295    LOCAL FUNCTIONS
296***************************************************************************/
297
298/*-------------------------------------------------
299    reset_log - reset the state of the log
300-------------------------------------------------*/
301
302static void reset_log(x86log_context *log)
303{
304   log->data_range_count = 0;
305   log->comment_count = 0;
306   log->comment_pool_next = log->comment_pool;
307}
308
309
310
311/***************************************************************************
312    DISASSEMBLERS
313***************************************************************************/
314
315#define i386_dasm_one x86log_i386_dasm_one
316#include "cpu/i386/i386dasm.c"
src/emu/cpu/drcfe.h
r0r1052
1/***************************************************************************
2
3    drcfe.h
4
5    Generic dynamic recompiler frontend structures and utilities.
6
7    Copyright (c) 2007, Aaron Giles
8    Released for general use under the MAME license
9    Visit http://mamedev.org for licensing and usage restrictions.
10
11****************************************************************************
12
13    Concepts:
14
15    Dynamic recompiling cores are generally broken into a platform-neutral
16    "frontend", which performs some level of analysis on the code, and a
17    platform-specific "backend", which generates the recompiled machine
18    code.
19
20    The frontend's job is generally to walk through the instruction stream,
21    identifying basic blocks, or "sequences" of code that can be compiled
22    and optimized as a unit. This scanning involves recursively walking
23    the instruction stream, following branches, etc., within a specific
24    "code window", relative to the current PC.
25
26    As the frontend walks through the code, it generates a list of opcode
27    "descriptions", one per visited opcode, providing information about
28    code flow, exception handling, and other characteristics. Once the
29    walkthrough is finished, these descriptions are assembled together into
30    a linked list and returned for further processing by the backend.
31
32***************************************************************************/
33
34#ifndef __DRCFE_H__
35#define __DRCFE_H__
36
37#ifdef PTR64
38#include "x64drc.h"
39#else
40#include "x86drc.h"
41#endif
42
43
44
45/***************************************************************************
46    CONSTANTS
47***************************************************************************/
48
49/* this defines a branch targetpc that is dynamic at runtime */
50#define BRANCH_TARGET_DYNAMIC         (~0)
51
52
53/* opcode branch flags */
54#define OPFLAG_IS_UNCONDITIONAL_BRANCH   0x00000001      /* instruction is unconditional branch */
55#define OPFLAG_IS_CONDITIONAL_BRANCH   0x00000002      /* instruction is conditional branch */
56#define OPFLAG_IS_BRANCH            (OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_IS_CONDITIONAL_BRANCH)
57#define OPFLAG_IS_BRANCH_TARGET         0x00000004      /* instruction is the target of a branch */
58#define OPFLAG_IN_DELAY_SLOT         0x00000008      /* instruction is in the delay slot of a branch */
59#define OPFLAG_INTRABLOCK_BRANCH      0x00000010      /* instruction branches within the block */
60
61/* opcode exception flags */
62#define OPFLAG_CAN_TRIGGER_SW_INT      0x00000020      /* instruction can trigger a software interrupt */
63#define OPFLAG_CAN_EXPOSE_EXTERNAL_INT   0x00000040      /* instruction can expose an external interrupt */
64#define OPFLAG_CAN_CAUSE_EXCEPTION      0x00000080      /* instruction may generate exception */
65#define OPFLAG_WILL_CAUSE_EXCEPTION      0x00000100      /* instruction will generate exception */
66
67/* opcode virtual->physical translation flags */
68#define OPFLAG_VALIDATE_TLB            0x00000200      /* instruction must validate TLB before execution */
69#define OPFLAG_MODIFIES_TRANSLATION      0x00000400      /* instruction modifies the TLB */
70#define OPFLAG_COMPILER_PAGE_FAULT      0x00000800      /* compiler hit a page fault when parsing */
71
72/* opcode flags */
73#define OPFLAG_INVALID_OPCODE         0x00001000      /* instruction is invalid */
74#define OPFLAG_VIRTUAL_NOOP            0x00002000      /* instruction is a virtual no-op */
75
76/* opcode sequence flow flags */
77#define OPFLAG_REDISPATCH            0x00004000      /* instruction must redispatch after completion */
78#define OPFLAG_RETURN_TO_START         0x00008000      /* instruction must jump back to the beginning after completion */
79#define OPFLAG_END_SEQUENCE            0x00010000      /* this is the last instruction in a sequence */
80#define OPFLAG_CAN_CHANGE_MODES         0x00020000      /* instruction can change modes */
81
82/* execution semantics */
83#define OPFLAG_READS_MEMORY            0x00040000      /* instruction reads memory */
84#define OPFLAG_WRITES_MEMORY         0x00080000      /* instruction writes memory */
85#define OPFLAG_VARIABLE_SHIFT         0x00100000      /* instruction performs a variable count shift */
86#define OPFLAG_MULTIPLY_DIVIDE         0x00200000      /* instruction performs a multiply/divide */
87
88
89
90/***************************************************************************
91    TYPE DEFINITIONS
92***************************************************************************/
93
94/* opaque internal state */
95typedef struct _drcfe_state drcfe_state;
96
97
98/* register information as bitmasks */
99typedef struct _drc_reginfo drc_reginfo;
100struct _drc_reginfo
101{
102   UINT64         used;               /* bitmask of used registers */
103   UINT64         modified;            /* bitmask of modified registers */
104   UINT64         constant;            /* bitmask of constant registers */
105   UINT64         liveread;            /* bitmask of registers that are live for reading */
106   UINT64         livewrite;            /* bitmask of registers that are live for writing */
107};
108
109
110/* description of a given opcode */
111typedef struct _opcode_desc opcode_desc;
112struct _opcode_desc
113{
114   /* links to other descriptions */
115   opcode_desc *   next;               /* pointer to next description */
116   opcode_desc *   branch;               /* pointer back to branch description for delay slots */
117   opcode_desc *   delay;               /* pointer to delay slot description */
118
119   /* information about the current PC */
120   offs_t         pc;                  /* PC of this opcode */
121   offs_t         physpc;               /* physical PC of this opcode */
122   offs_t         targetpc;            /* target PC if we are a branch, or BRANCH_TARGET_DYNAMIC */
123
124   /* pointer to the current opcode */
125   union
126   {
127      UINT8 *      b;
128      UINT16 *   w;
129      UINT32 *   l;
130      UINT64 *   q;
131   } opptr;                        /* pointer to opcode memory */
132
133   /* information about this instruction's execution */
134   UINT8         length;               /* length in bytes of this opcode */
135   UINT8         delayslots;            /* number of delay slots (for branches) */
136   UINT32         flags;               /* OPFLAG_* opcode flags */
137   UINT32         cycles;               /* number of cycles needed to execute */
138
139   /* register usage information */
140   drc_reginfo      gpr;               /* register info for GPRs */
141   drc_reginfo      fpr;               /* register info for FPRs */
142};
143
144
145/* callback function that is used to describe a single opcode */
146typedef int (*drcfe_describe)(void *param, opcode_desc *desc);
147
148
149/* description of a given opcode */
150typedef struct _drcfe_config drcfe_config;
151struct _drcfe_config
152{
153   UINT32         window_start;         /* code window start offset = startpc - window_start */
154   UINT32         window_end;            /* code window end offset = startpc + window_end */
155   UINT32         max_sequence;         /* maximum instructions to include in a sequence */
156
157   drcfe_describe   describe;            /* callback to describe a single instruction */
158};
159
160
161
162/***************************************************************************
163    FUNCTION PROTOTYPES
164***************************************************************************/
165
166/* initializate the drcfe state */
167drcfe_state *drcfe_init(const drcfe_config *config, void *param);
168
169/* clean up after ourselves */
170void drcfe_exit(drcfe_state *drcfe);
171
172/* describe a sequence of code that falls within the configured window relative to the specified startpc */
173const opcode_desc *drcfe_describe_code(drcfe_state *drcfe, offs_t startpc);
174
175
176#endif
src/emu/cpu/x86log.h
r0r1052
1/***************************************************************************
2
3    x86log.h
4
5    x86/x64 code logging helpers.
6
7    Copyright (c) 2007, Aaron Giles
8    Released for general use under the MAME license
9    Visit http://mamedev.org for licensing and usage restrictions.
10
11***************************************************************************/
12
13#pragma once
14
15#ifndef __X86LOG_H__
16#define __X86LOG_H__
17
18#include "cpuintrf.h"
19#include "x86emit.h"
20
21
22/***************************************************************************
23    TYPE DEFINITIONS
24***************************************************************************/
25
26typedef struct _x86log_context x86log_context;
27
28
29
30/***************************************************************************
31    FUNCTION PROTOTYPES
32***************************************************************************/
33
34/* create a new context */
35x86log_context *x86log_create_context(const char *filename);
36
37/* release a context */
38void x86log_free_context(x86log_context *log);
39
40/* add a comment associated with a given code pointer */
41void x86log_add_comment(x86log_context *log, x86code *base, const char *format, ...);
42
43/* mark a given range as data for logging purposes */
44void x86log_mark_as_data(x86log_context *log, x86code *base, x86code *end, int size);
45
46/* disassemble a range of code and reset accumulated information */
47void x86log_disasm_code_range(x86log_context *log, const char *label, x86code *start, x86code *stop);
48
49/* manually printf information to the log file */
50void x86log_printf(x86log_context *log, const char *format, ...);
51
52
53#endif   /* __X86LOG_H__ */
src/emu/cpu/i386/i386dasm.c
r1051r1052
20002000         break;
20012001
20022002      case OP_SIZE:
2003         rex = regex = sibex = rmex = 0;
20032004         if (operand_size < 2)
20042005            operand_size ^= 1;
20052006         op2 = FETCH();
r1051r1052
20072008         return;
20082009
20092010      case ADDR_SIZE:
2011         rex = regex = sibex = rmex = 0;
20102012         if (curmode != 64)
20112013            address_size ^= 1;
20122014         else
r1051r1052
20282030      case SEG_FS:
20292031      case SEG_GS:
20302032      case SEG_SS:
2033         rex = regex = sibex = rmex = 0;
20312034         segment = op->flags;
20322035         op2 = FETCH();
20332036         decode_opcode( s, &i386_opcode_table1[op2], op2 );
src/emu/cpu/x86drc.c
r1051r1052
1919
2020
2121
22const UINT8 scale_lookup[] = { 0,0,1,0,2,0,0,0,3 };
23
2422static UINT16 fp_control[4] = { 0x023f, 0x063f, 0x0a3f, 0x0e3f };
2523static UINT32 sse_control[4] = { 0x9fc0, 0xbfc0, 0xdfc0, 0xffc0 };
2624
src/emu/cpu/tms32051/tms32051.c
r1051r1052
563563   return 1;
564564}
565565
566void tms_get_info(UINT32 state, cpuinfo *info)
566static void tms_get_info(UINT32 state, cpuinfo *info)
567567{
568568   switch(state)
569569   {
src/emu/cpu/mips/mips3dsm.c
r1051r1052
435435         }
436436         break;
437437
438      case 0x02:   sprintf(buffer, "j      $%08x", (pc & 0xf0000000) | ((op & 0x0fffffff) << 2));   break;
439      case 0x03:   sprintf(buffer, "jal    $%08x", (pc & 0xf0000000) | ((op & 0x0fffffff) << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break;
438      case 0x02:   sprintf(buffer, "j      $%08x", (pc & 0xf0000000) | ((op & 0x03ffffff) << 2));   break;
439      case 0x03:   sprintf(buffer, "jal    $%08x", (pc & 0xf0000000) | ((op & 0x03ffffff) << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break;
440440      case 0x04:   if (rs == 0 && rt == 0)
441441               sprintf(buffer, "b      $%08x", pc + 4 + ((INT16)op << 2));
442442               else
src/emu/cpu/mips/mips3com.h
r1051r1052
116116    HELPER MACROS
117117***************************************************************************/
118118
119#define REG_LO         32
120#define REG_HI         33
121
119122#define RSREG         ((op >> 21) & 31)
120123#define RTREG         ((op >> 16) & 31)
121124#define RDREG         ((op >> 11) & 31)
r1051r1052
146149struct _memory_handlers
147150{
148151   UINT8         (*readbyte)(offs_t);
149   UINT16         (*readword)(offs_t);
150   UINT32         (*readlong)(offs_t);
151   UINT32         (*readlong_masked)(offs_t, UINT32);
152   UINT16         (*readhalf)(offs_t);
153   UINT32         (*readword)(offs_t);
154   UINT32         (*readword_masked)(offs_t, UINT32);
152155   UINT64         (*readdouble)(offs_t);
153156   UINT64         (*readdouble_masked)(offs_t, UINT64);
154157   void         (*writebyte)(offs_t, UINT8);
155   void         (*writeword)(offs_t, UINT16);
156   void         (*writelong)(offs_t, UINT32);
157   void         (*writelong_masked)(offs_t, UINT32, UINT32);
158   void         (*writehalf)(offs_t, UINT16);
159   void         (*writeword)(offs_t, UINT32);
160   void         (*writeword_masked)(offs_t, UINT32, UINT32);
158161   void         (*writedouble)(offs_t, UINT64);
159162   void         (*writedouble_masked)(offs_t, UINT64, UINT64);
160163};
r1051r1052
176179{
177180   /* core registers */
178181   UINT32         pc;
179   UINT64         hi;
180   UINT64         lo;
181   UINT64         r[32];
182182   int            icount;
183   UINT64         r[35];
183184
184185   /* COP registers */
185186   UINT64         cpr[3][32];
src/emu/cpu/mips/mdrc64.c
r1051r1052
4141****************************************************************************
4242
4343    Future improvements:
44        * problem:
45            lui  r3,$b000
46            lw   r3,$100(r3)
47          if exception happens, then r3 is trashed
48
49        * register allocator can use non-volatile registers if the
50            lifetime is only for this one instruction (only for
51            registers where (gpr.used & ~gpr.modified)
52
4453        * spec says if registers aren't sign-extended, then 32-bit ops have
4554            undefined results; this can simplify our code
46        * switch to a model where the compiler ensures all MIPS registers
47            are live in x64 registers at the start of the instruction
48            and flushed at the end
4955
56        * track which results are 32-bit sign extended versus 64-bit and
57            only promote when necessary
58
59        * register aliasing - move from one to another either doesn't do
60            anything and tracks both, or else shifts ownership to new
61            target
62
63        * generic frontend:
64            * flags to indicate variable shifts and multiply/divides
65                to help register allocator avoid ECX/EDX/EAX as
66                appropriate
67
68        * generic drc:
69            * common code to load registers prior to instruction
70                - each register has a callback that generates the load
71            * generate code
72            * common code to write registers afterwards
73            * common register allocation routines (64 integer, 64 FPU)
74            * common OOB mechanism
75            * common self-mod code detection (via write bitmask)
76            * common code validation routines
77
5078****************************************************************************
5179
5280    Temporary stack usage:
5381        [esp+32].b  = storage for CL in LWL/LWR/SWL/SWR
5482        [esp+36].l  = storage for new target PC in JR/JALR
55        [esp+40].l  = storage for parameter 1 when invalidating code
56        [esp+48].l  = storage for parameter 2 when invalidating code
57        [esp+56].l  = storage for parameter 3 when invalidating code
5883
5984***************************************************************************/
6085
r1051r1052
6287
6388
6489/***************************************************************************
90    DEBUGGING
91***************************************************************************/
92
93#define SINGLE_INSTRUCTION_MODE         (0)
94#define DISABLE_FIXED_RAM_LOAD         (0)
95#define DISABLE_FIXED_RAM_STORE         (0)
96#define FLUSH_AFTER_EACH_INSTRUCTION   (0)
97#define PRINTF_EXCEPTIONS            (1)
98#define PROBE_ADDRESS               (0)
99
100
101
102/***************************************************************************
65103    CONSTANTS
66104***************************************************************************/
67105
106/* compilation boundaries -- how far back/forward does the analysis extend? */
68107#define COMPILE_BACKWARDS_BYTES         128
69108#define COMPILE_FORWARDS_BYTES         512
70109#define COMPILE_MAX_INSTRUCTIONS      ((COMPILE_BACKWARDS_BYTES/4) + (COMPILE_FORWARDS_BYTES/4))
110#define MAX_INSTRUCTION_SEQUENCE      64
71111
112/* extra "conditions" used to augment the basic conditions for OOB handlers */
72113#define COND_NONE                  16
73114#define COND_NO_JUMP               17
74115
116/* 64-bit cookie that is scanned for during exception processing */
75117#define EXCEPTION_ADDRESS_COOKIE      U64(0xcc90cc90cc90cc90)
76118
77119/* append_readwrite flags */
r1051r1052
83125#define ARW_CACHED                  0x0008
84126#define ARW_UNCACHED               0x0010
85127
86#if COMPARE_AGAINST_C
87#undef  MIPS3_COUNT_READ_CYCLES
88#undef  MIPS3_CAUSE_READ_CYCLES
89#define MIPS3_COUNT_READ_CYCLES         0
90#define MIPS3_CAUSE_READ_CYCLES         0
91#endif
128/* compiler_register_allocate flags */
129#define ALLOC_SRC                  0x0001
130#define ALLOC_DST                  0x0002
131#define ALLOC_DIRTY                  0x0004
92132
133/* x86 register tracking flags */
134#define X86REG_LIVE                  0x80      /* register is live and contains something */
135#define X86REG_MIPSMASK               0x3f      /* low 6 bits indicate which MIPS register we hold */
93136
137/* MIPS register tracking flags */
138#define MIPSREG_CONSTANT            0x8000      /* register is constant; low 10 bits select which one */
139#define MIPSREG_DIRTY               0x4000      /* register has been modified and needs to be flushed */
140#define MIPSREG_LIVE               0x2000      /* register is live in an x86 register */
141#define MIPSREG_X86MASK               0x000f      /* low 4 bits indicate which x86 register holds us */
94142
143
144
95145/***************************************************************************
96146    MACROS
97147***************************************************************************/
98148
99149#define SPOFFS_SAVECL         32
100150#define SPOFFS_NEXTPC         36
101#define SPOFFS_SAVEP1         40
102#define SPOFFS_SAVEP2         48
103#define SPOFFS_SAVEP3         56
104151
105152#define REGADDR(reg)         MDRC(&mips3.core->r[reg])
106#define HIADDR               MDRC(&mips3.core->hi)
107#define LOADDR               MDRC(&mips3.core->lo)
153#define HIADDR               MDRC(&mips3.core->r[REG_HI])
154#define LOADDR               MDRC(&mips3.core->r[REG_LO])
108155#define CPR0ADDR(reg)         MDRC(&mips3.core->cpr[0][reg])
109156#define CCR0ADDR(reg)         MDRC(&mips3.core->ccr[0][reg])
110157#define CPR1ADDR(reg)         MDRC(&mips3.core->cpr[1][reg])
r1051r1052
120167#define ICOUNTADDR            MDRC(&mips3.core->icount)
121168#define COREADDR            MDRC(mips3.core)
122169
170/* macros for querying/accessing the tracking flags */
171#define ISCONST(x)            (((x) & MIPSREG_CONSTANT) != 0)
172#define ISDIRTY(x)            (((x) & MIPSREG_DIRTY) != 0)
173#define ISLIVE(x)            (((x) & MIPSREG_LIVE) != 0)
174#define CONSTVAL(x)            ((INT32)((x) >> 32))
175#define X86REG(x)            ((x) & MIPSREG_X86MASK)
123176
177/* macro for defining a small positivec constant inline */
178#define MAKE_CONST(x)         (MIPSREG_CONSTANT | ((INT64)(x) << 32))
179#define MAKE_DESTREG(x)         (MIPSREG_DIRTY | ((x) & MIPSREG_X86MASK))
124180
181
182
125183/***************************************************************************
126184    TYPEDEFS
127185***************************************************************************/
r1051r1052
131189{
132190   x86code *      read_byte_signed;
133191   x86code *      read_byte_unsigned;
192   x86code *      read_half_signed;
193   x86code *      read_half_unsigned;
134194   x86code *      read_word_signed;
135195   x86code *      read_word_unsigned;
136   x86code *      read_long_signed;
137   x86code *      read_long_unsigned;
138   x86code *      read_long_masked;
196   x86code *      read_word_masked;
139197   x86code *      read_double;
140198   x86code *      read_double_masked;
141199   x86code *      write_byte;
200   x86code *      write_half;
142201   x86code *      write_word;
143   x86code *      write_long;
144   x86code *      write_long_masked;
202   x86code *      write_word_masked;
145203   x86code *      write_double;
146204   x86code *      write_double_masked;
147205};
148206
149207
208typedef INT64       mipsreg_state;
209typedef UINT8      x86reg_state;
210
211
150212typedef struct _compiler_state compiler_state;
151213struct _compiler_state
152214{
153215   UINT32         cycles;               /* accumulated cycles */
216   x86reg_state   x86regs[REG_MAX];      /* tracking what is in the x86 registers */
217   mipsreg_state   mipsregs[35];         /* tracking what is in the MIPS registers */
154218};
155219
156220
r1051r1052
227291static void oob_exception_cleanup(drc_core *drc, oob_handler *oob, void *param);
228292static void oob_interrupt_cleanup(drc_core *drc, oob_handler *oob, void *param);
229293
294static void compiler_register_set_constant(compiler_state *compiler, UINT8 mipsreg, UINT64 constval);
295static mipsreg_state compiler_register_allocate(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 mipsreg, UINT8 flags);
296static void compiler_register_flush(drc_core *drc, compiler_state *compiler, UINT8 mipsreg, int free);
297static void compiler_register_flush_all(drc_core *drc, compiler_state *compiler);
298
299static void probe_printf(void);
300
230301static void generate_read_write_handlers(drc_core *drc, readwrite_handlers *handlers, const char *type, UINT8 flags);
231302static void append_generate_exception(drc_core *drc, UINT8 exception);
232303static void append_readwrite_and_translate(drc_core *drc, int size, UINT8 flags, UINT32 ptroffs);
r1051r1052
237308static void append_check_interrupts(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc);
238309static void append_check_sw_interrupts(drc_core *drc, int inline_generate);
239310
240static int recompile_instruction(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
241static int recompile_special(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
242static int recompile_regimm(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
243static int recompile_cop0(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
244static int recompile_cop1(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
245static int recompile_cop1x(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
311static int compile_instruction(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
312static int compile_special(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
313static int compile_regimm(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
314static int compile_idt(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
315static int compile_cop0(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
316static int compile_cop1(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
317static int compile_cop1x(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc);
246318
319static int compile_shift(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int shift_type, int shift_variable);
320static int compile_dshift(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int shift_type, int shift_variable, int shift_const_plus32);
321static int compile_movzn(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_movn);
322static int compile_trapcc(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int condition, int immediate);
323static int compile_branchcc(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int condition);
324static int compile_branchcz(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int condition, int link);
325static int compile_add(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions, int immediate);
326static int compile_dadd(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions, int immediate);
327static int compile_sub(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions);
328static int compile_dsub(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions);
329static int compile_mult(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned);
330static int compile_dmult(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned);
331static int compile_div(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned);
332static int compile_ddiv(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned);
333static int compile_logical(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int operation, int immediate);
334static int compile_slt(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned, int immediate);
335static int compile_load(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, int is_unsigned);
336static int compile_load_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *dest);
337static int compile_loadx_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *dest);
338static int compile_load_word_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right);
339static int compile_load_double_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right);
340static int compile_store(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size);
341static int compile_store_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *src);
342static int compile_storex_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *src);
343static int compile_store_word_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right);
344static int compile_store_double_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right);
247345
248346
347
249348/***************************************************************************
250349    PRIVATE GLOBAL VARIABLES
251350***************************************************************************/
r1051r1052
256355
257356static compiler_state compiler_save;
258357
358static const UINT8 nvreg[] = { REG_NV0, REG_NV1, REG_NV2, REG_NV3, REG_NV4, REG_NV5, REG_NV6 };
259359
360static const char *x86regname[] = {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15"};
260361
362
363
261364/***************************************************************************
262365    INLINE FUNCTIONS
263366***************************************************************************/
r1051r1052
290393}
291394
292395
396/*-------------------------------------------------
397    compiler_state_reset - reset the compiler
398    state
399-------------------------------------------------*/
293400
401INLINE void compiler_state_reset(compiler_state *compiler)
402{
403   memset(compiler, 0, sizeof(*compiler));
404   compiler_register_set_constant(compiler, 0, 0);
405}
406
407
408
294409/***************************************************************************
295410    CORE RECOMPILER SYSTEMS
296411***************************************************************************/
r1051r1052
351466
352467static void mips3drc_exit(void)
353468{
469   printf("Final code size = %d\n", (int)(mips3.drc->cache_top - mips3.drc->cache_base));
354470   mips3fe_exit();
355471}
356472
r1051r1052
366482
367483static void drc_reset_callback(drc_core *drc)
368484{
369   code_log_reset();
485   if (LOG_CODE)
486   {
487      x86log_disasm_code_range(mips3.log, "entry_point:", (x86code *)drc->entry_point, drc->exit_point);
488      x86log_disasm_code_range(mips3.log, "exit_point:", drc->exit_point, drc->recompile);
489      x86log_disasm_code_range(mips3.log, "recompile:", drc->recompile, drc->dispatch);
490      x86log_disasm_code_range(mips3.log, "dispatch:", drc->dispatch, drc->flush);
491      x86log_disasm_code_range(mips3.log, "flush:", drc->flush, drc->cache_top);
492   }
370493
371   code_log("entry_point:", (x86code *)drc->entry_point, drc->exit_point);
372   code_log("exit_point:", drc->exit_point, drc->recompile);
373   code_log("recompile:", drc->recompile, drc->dispatch);
374   code_log("dispatch:", drc->dispatch, drc->flush);
375   code_log("flush:", drc->flush, drc->cache_top);
376
377494   mips3.drcdata->generate_interrupt_exception = drc->cache_top;
378495   append_generate_exception(drc, EXCEPTION_INTERRUPT);
379   code_log("generate_interrupt_exception:", mips3.drcdata->generate_interrupt_exception, drc->cache_top);
496   if (LOG_CODE)
497      x86log_disasm_code_range(mips3.log, "generate_interrupt_exception:", mips3.drcdata->generate_interrupt_exception, drc->cache_top);
380498
381499   mips3.drcdata->generate_cop_exception = drc->cache_top;
382500   append_generate_exception(drc, EXCEPTION_BADCOP);
383   code_log("generate_cop_exception:", mips3.drcdata->generate_cop_exception, drc->cache_top);
501   if (LOG_CODE)
502      x86log_disasm_code_range(mips3.log, "generate_cop_exception:", mips3.drcdata->generate_cop_exception, drc->cache_top);
384503
385504   mips3.drcdata->generate_overflow_exception = drc->cache_top;
386505   append_generate_exception(drc, EXCEPTION_OVERFLOW);
387   code_log("generate_overflow_exception:", mips3.drcdata->generate_overflow_exception, drc->cache_top);
506   if (LOG_CODE)
507      x86log_disasm_code_range(mips3.log, "generate_overflow_exception:", mips3.drcdata->generate_overflow_exception, drc->cache_top);
388508
389509   mips3.drcdata->generate_invalidop_exception = drc->cache_top;
390510   append_generate_exception(drc, EXCEPTION_INVALIDOP);
391   code_log("generate_invalidop_exception:", mips3.drcdata->generate_invalidop_exception, drc->cache_top);
511   if (LOG_CODE)
512      x86log_disasm_code_range(mips3.log, "generate_invalidop_exception:", mips3.drcdata->generate_invalidop_exception, drc->cache_top);
392513
393514   mips3.drcdata->generate_syscall_exception = drc->cache_top;
394515   append_generate_exception(drc, EXCEPTION_SYSCALL);
395   code_log("generate_syscall_exception:", mips3.drcdata->generate_syscall_exception, drc->cache_top);
516   if (LOG_CODE)
517      x86log_disasm_code_range(mips3.log, "generate_syscall_exception:", mips3.drcdata->generate_syscall_exception, drc->cache_top);
396518
397519   mips3.drcdata->generate_break_exception = drc->cache_top;
398520   append_generate_exception(drc, EXCEPTION_BREAK);
399   code_log("generate_break_exception:", mips3.drcdata->generate_break_exception, drc->cache_top);
521   if (LOG_CODE)
522      x86log_disasm_code_range(mips3.log, "generate_break_exception:", mips3.drcdata->generate_break_exception, drc->cache_top);
400523
401524   mips3.drcdata->generate_trap_exception = drc->cache_top;
402525   append_generate_exception(drc, EXCEPTION_TRAP);
403   code_log("generate_trap_exception:", mips3.drcdata->generate_trap_exception, drc->cache_top);
526   if (LOG_CODE)
527      x86log_disasm_code_range(mips3.log, "generate_trap_exception:", mips3.drcdata->generate_trap_exception, drc->cache_top);
404528
405529   mips3.drcdata->generate_tlbload_exception = drc->cache_top;
406530   append_generate_exception(drc, EXCEPTION_TLBLOAD);
407   code_log("generate_tlbload_exception:", mips3.drcdata->generate_tlbload_exception, drc->cache_top);
531   if (LOG_CODE)
532      x86log_disasm_code_range(mips3.log, "generate_tlbload_exception:", mips3.drcdata->generate_tlbload_exception, drc->cache_top);
408533
409534   mips3.drcdata->generate_tlbstore_exception = drc->cache_top;
410535   append_generate_exception(drc, EXCEPTION_TLBSTORE);
411   code_log("generate_tlbstore_exception:", mips3.drcdata->generate_tlbstore_exception, drc->cache_top);
536   if (LOG_CODE)
537      x86log_disasm_code_range(mips3.log, "generate_tlbstore_exception:", mips3.drcdata->generate_tlbstore_exception, drc->cache_top);
412538
413539   mips3.drcdata->handle_pc_tlb_mismatch = drc->cache_top;
414540   append_handle_pc_tlb_mismatch(drc);
415   code_log("handle_pc_tlb_mismatch:", mips3.drcdata->handle_pc_tlb_mismatch, drc->cache_top);
541   if (LOG_CODE)
542      x86log_disasm_code_range(mips3.log, "handle_pc_tlb_mismatch:", mips3.drcdata->handle_pc_tlb_mismatch, drc->cache_top);
416543
417544   mips3.drcdata->find_exception_handler = drc->cache_top;
418545   append_find_exception_handler(drc);
419   code_log("find_exception_handler:", mips3.drcdata->find_exception_handler, drc->cache_top);
546   if (LOG_CODE)
547      x86log_disasm_code_range(mips3.log, "find_exception_handler:", mips3.drcdata->find_exception_handler, drc->cache_top);
420548
421549   mips3.drcdata->explode_ccr31 = drc->cache_top;
422550   append_explode_ccr31(drc);
423   code_log("explode_ccr31:", mips3.drcdata->explode_ccr31, drc->cache_top);
551   if (LOG_CODE)
552      x86log_disasm_code_range(mips3.log, "explode_ccr31:", mips3.drcdata->explode_ccr31, drc->cache_top);
424553
425554   mips3.drcdata->recover_ccr31 = drc->cache_top;
426555   append_recover_ccr31(drc);
427   code_log("recover_ccr31:", mips3.drcdata->recover_ccr31, drc->cache_top);
556   if (LOG_CODE)
557      x86log_disasm_code_range(mips3.log, "recover_ccr31:", mips3.drcdata->recover_ccr31, drc->cache_top);
428558
429559   generate_read_write_handlers(drc, &mips3.drcdata->general, "general", 0);
430560   generate_read_write_handlers(drc, &mips3.drcdata->cached, "cached", ARW_CACHED);
r1051r1052
438568
439569static void drc_recompile_callback(drc_core *drc)
440570{
571   int maxseq = (Machine->debug_mode || SINGLE_INSTRUCTION_MODE) ? 1 : MAX_INSTRUCTION_SEQUENCE;
572   int compiled_last_sequence = FALSE;
441573   mips3_opcode_desc *seqhead, *seqlast;
442574   mips3_opcode_desc *desclist;
443575   void *start = drc->cache_top;
r1051r1052
448580
449581   /* begin the sequence */
450582   drc_begin_sequence(drc, mips3.core->pc);
451   code_log_reset();
452583   mips3.drcdata->oobcount = 0;
453584
454585   /* get a description of this sequence */
455   desclist = mips3fe_describe_sequence(mips3.core, mips3.core->pc, mips3.core->pc - 128, mips3.core->pc + 512);
456   desc_log(desclist, 0);
586   desclist = mips3fe_describe_sequence(mips3.core, mips3.core->pc, mips3.core->pc - 128, mips3.core->pc + 512, maxseq);
587   if (LOG_CODE)
588      log_opcode_desc(mips3.log, desclist, 0);
457589
458590   /* loop until we get through all instruction sequences */
459591   for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next)
460592   {
461      int instructions_remaining;
462593      mips3_opcode_desc *curdesc;
463594      compiler_state compiler;
464595
465596      /* determine the last instruction in this sequence */
466      instructions_remaining = Machine->debug_mode ? 1 : 32;
467597      for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next)
468      {
469         mips3_opcode_desc *next = seqlast->next;
470
471         /* if this instruction ends a block, stop */
472598         if (seqlast->flags & IDESC_END_SEQUENCE)
473599            break;
474
475         /* if we're out of instructions, stop */
476         if (--instructions_remaining == 0)
477            break;
478      }
479600      assert(seqlast != NULL);
480601
481602      /* add this as an entry point */
r1051r1052
491612         /* otherwise, just emit a jump to existing code */
492613         else
493614         {
494            drc_append_fixed_dispatcher(drc, seqhead->pc, TRUE);
615            if (compiled_last_sequence)
616               drc_append_fixed_dispatcher(drc, seqhead->pc, TRUE);
617            compiled_last_sequence = FALSE;
495618            continue;
496619         }
497620      }
621      compiled_last_sequence = TRUE;
498622
499623      /* add a code log entry */
500      code_log_add_entry_string(drc->cache_top, "[Validation for %08X]", seqhead->pc);
624      if (LOG_CODE)
625         x86log_add_comment(mips3.log, drc->cache_top, "-------------------------");
501626
502      /* validate this code block */
503      emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)seqhead->opptr);                     // mov  rax,seqhead->opptr
504      emit_mov_r32_imm(DRCTOP, REG_P1, seqhead->pc);                              // mov  p1,pc
505      for (curdesc = seqhead; curdesc != seqlast; curdesc = curdesc->next)
627      /* validate this code block if we're not pointing into ROM */
628      /* note that we assume P1 still contains the PC */
629      if (memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL)
506630      {
507         emit_cmp_m32_imm(DRCTOP, MBD(REG_RAX, (UINT8 *)curdesc->opptr - (UINT8 *)seqhead->opptr), *curdesc->opptr);
508                                                                     // cmp  [code],val
509         emit_jcc(DRCTOP, COND_NE, mips3.drc->recompile);                        // jne  recompile
631         if (LOG_CODE)
632            x86log_add_comment(mips3.log, drc->cache_top, "[Validation for %08X]", seqhead->pc);
633         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)seqhead->opptr);                     // mov  rax,seqhead->opptr
634         for (curdesc = seqhead; curdesc != seqlast->next; curdesc = curdesc->next)
635         {
636            emit_cmp_m32_imm(DRCTOP, MBD(REG_RAX, (UINT8 *)curdesc->opptr - (UINT8 *)seqhead->opptr), *curdesc->opptr);
637                                                                        // cmp  [code],val
638            emit_jcc(DRCTOP, COND_NE, mips3.drc->recompile);                        // jne  recompile
639         }
510640      }
511      emit_cmp_m32_imm(DRCTOP, MBD(REG_RAX, (UINT8 *)curdesc->opptr - (UINT8 *)seqhead->opptr), *curdesc->opptr);
512                                                                     // cmp  [code],val
513      emit_jcc(DRCTOP, COND_NE, mips3.drc->recompile);                           // jne  recompile
514641
515642      /* initialize the compiler state */
516      compiler.cycles = 0;
643      compiler_state_reset(&compiler);
517644
518645      /* iterate over instructions in the sequence and compile them */
519      for (curdesc = seqhead; curdesc != seqlast; curdesc = curdesc->next)
646      for (curdesc = seqhead; curdesc != seqlast->next; curdesc = curdesc->next)
520647         compile_one(drc, &compiler, curdesc);
521      compile_one(drc, &compiler, curdesc);
522648
523649      /* at the end of the sequence; update the PC in memory and check cycle counts */
524      if (!(curdesc->flags & (IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_WILL_CAUSE_EXCEPTION)))
650      if (!(seqlast->flags & (IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_WILL_CAUSE_EXCEPTION)))
525651      {
526         UINT32 nextpc = curdesc->pc + ((curdesc->flags & IDESC_IS_LIKELY_BRANCH) ? 8 : 4);
652         UINT32 nextpc = seqlast->pc + ((seqlast->flags & IDESC_IS_LIKELY_BRANCH) ? 8 : 4);
527653         if (compiler.cycles != 0)
528654            emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler.cycles);                  // sub  [icount],cycles
529655         emit_mov_r32_imm(DRCTOP, REG_P1, nextpc);                              // mov  p1,nextpc
656         compiler_register_flush_all(drc, &compiler);                           // <flush registers>
530657         if (compiler.cycles != 0)
531658            emit_jcc(DRCTOP, COND_S, mips3.drc->exit_point);                     // js   exit_point
532659      }
533660
534661      /* if this is a likely branch, the fall through case needs to skip the next instruction */
535      if ((curdesc->flags & (IDESC_IS_CONDITIONAL_BRANCH | IDESC_IS_LIKELY_BRANCH)) == (IDESC_IS_CONDITIONAL_BRANCH | IDESC_IS_LIKELY_BRANCH))
536         if (curdesc->next != NULL && curdesc->next->pc != curdesc->pc + 8)
537            drc_append_tentative_fixed_dispatcher(drc, curdesc->pc + 8, TRUE);         // jmp  <pc+8>
662      if ((seqlast->flags & (IDESC_IS_CONDITIONAL_BRANCH | IDESC_IS_LIKELY_BRANCH)) == (IDESC_IS_CONDITIONAL_BRANCH | IDESC_IS_LIKELY_BRANCH))
663         if (seqlast->next != NULL && seqlast->next->pc != seqlast->pc + 8)
664         {
665            compiler_register_flush_all(drc, &compiler);
666            drc_append_tentative_fixed_dispatcher(drc, seqlast->pc + 8, TRUE);         // jmp  <pc+8>
667         }
538668
539669      /* if we need a redispatch, do it now */
540      if (curdesc->flags & IDESC_REDISPATCH)
670      if (seqlast->flags & IDESC_REDISPATCH)
541671      {
542         UINT32 nextpc = curdesc->pc + ((curdesc->flags & IDESC_IS_LIKELY_BRANCH) ? 8 : 4);
543         drc_append_tentative_fixed_dispatcher(drc, nextpc, TRUE);                  // jmp  <nextpc>
672         UINT32 nextpc = seqlast->pc + ((seqlast->flags & IDESC_IS_LIKELY_BRANCH) ? 8 : 4);
673         compiler_register_flush_all(drc, &compiler);
674          drc_append_tentative_fixed_dispatcher(drc, nextpc, TRUE);                  // jmp  <nextpc>
675       }
676
677       /* if we need to return to the start, do it */
678      if (seqlast->flags & IDESC_RETURN_TO_START)
679      {
680         compiler_register_flush_all(drc, &compiler);
681          drc_append_tentative_fixed_dispatcher(drc, mips3.core->pc, FALSE);            // jmp  <startpc>
544682      }
545
546      /* if we need to return to the start, do it */
547      if (curdesc->flags & IDESC_RETURN_TO_START)
548         drc_append_tentative_fixed_dispatcher(drc, mips3.core->pc, FALSE);            // jmp  <startpc>
549683   }
550684
551685   /* free the list */
r1051r1052
561695      (*oob->callback)(drc, oob, oob->param);
562696   }
563697
564#if LOG_CODE
565{
566   char label[40];
567   sprintf(label, "Code @ %08X (%08X physical)", desclist->pc, desclist->physpc);
568   code_log(label, start, drc->cache_top);
698   /* log the generated code */
699   if (LOG_CODE)
700   {
701      char label[60];
702      sprintf(label, "Code @ %08X (%08X physical)", desclist->pc, desclist->physpc);
703      x86log_disasm_code_range(mips3.log, label, start, drc->cache_top);
704   }
569705}
570#endif
571}
572706
573707
574708/*------------------------------------------------------------------
r1051r1052
599733      drc_register_code_at_cache_top(drc, desc->pc);
600734
601735   /* add an entry for the log */
602   code_log_add_entry(drc->cache_top, desc->pc, *desc->opptr);
736   if (LOG_CODE)
737      log_add_disasm_comment(mips3.log, drc->cache_top, desc->pc, *desc->opptr);
603738
739   /* if we want a probe, add it here */
740   if (desc->pc == PROBE_ADDRESS)
741   {
742      emit_mov_m32_imm(DRCTOP, PCADDR, desc->pc);                                 // mov  [pc],desc->pc
743      compiler_register_flush_all(drc, compiler);
744      emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)probe_printf);
745      emit_call_r64(DRCTOP, REG_RAX);
746   }
747
604748   /* if we are debugging, call the debugger */
605749   if (Machine->debug_mode)
606750   {
r1051r1052
642786      UINT32 nextpc = desc->pc + ((desc->flags & IDESC_IS_LIKELY_BRANCH) ? 8 : 4);
643787
644788      /* compile the instruction */
645      if (!recompile_instruction(drc, compiler, desc))
789      if (!compile_instruction(drc, compiler, desc))
646790         fatalerror("Unimplemented op %08X (%02X,%02X)", *desc->opptr, *desc->opptr >> 26, *desc->opptr & 0x3f);
647791
648      /* if there was a read or a write, we need to update cycle counts and flush */
649      if (!(desc->flags & IDESC_IN_DELAY_SLOT) && (desc->flags & (IDESC_READS_MEMORY | IDESC_WRITES_MEMORY)))
650      {
651         emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
652         compiler->cycles = 0;
653         oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
654      }
792      /* flush */
793      if (FLUSH_AFTER_EACH_INSTRUCTION)
794         compiler_register_flush_all(drc, compiler);
655795   }
656796}
657797
r1051r1052
670810
671811static void oob_exception_cleanup(drc_core *drc, oob_handler *oob, void *param)
672812{
673   x86code *start = drc->cache_top;
674
675813   /* if this is non-jumping error, emit a unique signature */
676814   if (oob->link.size == 0)
677815   {
816      /* align to an 8-byte boundary */
678817      while (((UINT64)drc->cache_top & 7) != 0)
679818         emit_int_3(DRCTOP);
680      code_log_add_entry_string(drc->cache_top, "[Exception path for %08X]", oob->desc->pc);
819
820      /* logging */
821      if (LOG_CODE)
822      {
823         x86log_add_comment(mips3.log, drc->cache_top, "[Exception path for %08X]", oob->desc->pc);
824         x86log_mark_as_data(mips3.log, drc->cache_top, drc->cache_top + 15, 8);
825      }
826
827      /* output a pair of qwords */
681828      emit_qword(DRCTOP, EXCEPTION_ADDRESS_COOKIE);
682829      emit_qword(DRCTOP, (UINT64)oob->link.target);
683830   }
r1051r1052
686833   else
687834   {
688835      resolve_link(DRCTOP, &oob->link);
689      code_log_add_entry_string(drc->cache_top, "[Exception path for %08X]", oob->desc->pc);
836      if (LOG_CODE)
837         x86log_add_comment(mips3.log, drc->cache_top, "[Exception path for %08X]", oob->desc->pc);
690838   }
691839
692840   /* adjust for cycles */
r1051r1052
699847   else
700848      emit_mov_r32_imm(DRCTOP, REG_P1, oob->desc->pc | 1);                        // mov  p1,pc | 1
701849
702   /* eventually: flush any dirty registers */
850   /* flush any dirty registers */
851   compiler_register_flush_all(drc, &oob->compiler);                              // <flush registers>
703852
704853   /* jump to the exception generator */
705854   emit_jmp(DRCTOP, param);                                                // jmp  <generate exception>
r1051r1052
715864
716865static void oob_interrupt_cleanup(drc_core *drc, oob_handler *oob, void *param)
717866{
718   x86code *start = drc->cache_top;
719
720867   /* resolve the link */
721868   resolve_link(DRCTOP, &oob->link);
722869
723870   /* add a code log entry */
724   code_log_add_entry_string(drc->cache_top, "[Interrupt path for %08X]", oob->desc->pc);
871   if (LOG_CODE)
872      x86log_add_comment(mips3.log, drc->cache_top, "[Interrupt path for %08X]", oob->desc->pc);
725873
726874   /* adjust for cycles */
727875   if (oob->compiler.cycles != 0)
r1051r1052
742890         emit_mov_r32_m32(DRCTOP, REG_P1, MBD(REG_RSP, SPOFFS_NEXTPC));               // mov  p1,[rsp + nextpc]
743891   }
744892
745   /* eventually: flush any dirty registers */
893   /* flush any dirty registers */
894   compiler_register_flush_all(drc, &oob->compiler);                              // <flush registers>
746895
747896   /* jump to the exception generator */
748897   emit_jmp(DRCTOP, param);                                                // jmp  <generate exception>
r1051r1052
751900
752901
753902/***************************************************************************
903    REGISTER ALLOCATION ROUTINES
904***************************************************************************/
905
906/*-------------------------------------------------
907    compiler_register_set_constant - set a MIPS
908    register to a constant value
909-------------------------------------------------*/
910
911static void compiler_register_set_constant(compiler_state *compiler, UINT8 mipsreg, UINT64 constval)
912{
913   mipsreg_state reg = compiler->mipsregs[mipsreg];
914
915   assert((INT32)constval == (INT64)constval);
916
917   /* if the register was previously live, free it */
918   if (ISLIVE(reg))
919   {
920      assert(compiler->x86regs[X86REG(reg)] & X86REG_LIVE);
921      compiler->x86regs[X86REG(reg)] = 0;
922   }
923
924   /* set up the constant */
925   compiler->mipsregs[mipsreg] = MAKE_CONST(constval) | ((mipsreg == 0) ? 0 : MIPSREG_DIRTY);
926}
927
928
929/*-------------------------------------------------
930    compiler_register_allocate - allocate an x86
931    register to hold a MIPS register
932-------------------------------------------------*/
933
934static mipsreg_state compiler_register_allocate(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 mipsreg, UINT8 flags)
935{
936   UINT8 regindex, regnum = 0;
937   UINT64 livemask = 0;
938
939   /* register 0 is always constant */
940   if (mipsreg == 0)
941      return MAKE_CONST(0);
942
943   /* first see if we are already allocated */
944   if (ISLIVE(compiler->mipsregs[mipsreg]))
945   {
946      /* if we're not a source, make sure we are marked dirty */
947      if (flags & ALLOC_DIRTY)
948         compiler->mipsregs[mipsreg] |= MIPSREG_DIRTY;
949      return compiler->mipsregs[mipsreg];
950   }
951
952   /* if we just want a source register, return a constant directly */
953   if (flags == ALLOC_SRC && ISCONST(compiler->mipsregs[mipsreg]))
954      return compiler->mipsregs[mipsreg];
955
956   /* first look for a free entry */
957   for (regindex = 0; regindex < NUM_NVREG; regindex++)
958   {
959      regnum = nvreg[regindex];
960      if (!(compiler->x86regs[regnum] & X86REG_LIVE))
961         goto allocateit;
962      else
963         livemask |= (UINT64)1 << (compiler->x86regs[regnum] & X86REG_MIPSMASK);
964   }
965
966   /* can't have anything we need for this instruction, however */
967   livemask &= ~desc->gpr.used & ~desc->gpr.modified;
968   desc = desc->next;
969
970   /* next loop over the registers, figuring out who has the longest until being used */
971   while (desc != NULL && livemask != 0)
972   {
973      /* if this instruction uses the last remaining register, we have to pick from among those */
974      if ((livemask & ~desc->gpr.used) == 0)
975         break;
976      livemask &= ~desc->gpr.used;
977
978      /* if this instruction modifies any of the registers, we want those */
979      if ((livemask & desc->gpr.modified) != 0)
980      {
981         livemask &= desc->gpr.modified;
982         break;
983      }
984
985      /* advance to the next instruction; stop if we hit end-of-sequence */
986      if (desc->flags & IDESC_END_SEQUENCE)
987         break;
988      desc = desc->next;
989   }
990
991   /* pick the first one */
992   for (regindex = 0; regindex < NUM_NVREG; regindex++)
993   {
994      regnum = nvreg[regindex];
995      if (livemask & ((UINT64)1 << (compiler->x86regs[regnum] & X86REG_MIPSMASK)))
996         break;
997   }
998   assert(regindex != NUM_NVREG);
999
1000   /* flush it */
1001   compiler_register_flush(drc, compiler, compiler->x86regs[regnum] & X86REG_MIPSMASK, TRUE);
1002
1003allocateit:
1004   /* load the contents if we are a source */
1005   if (LOG_CODE)
1006      x86log_add_comment(mips3.log, drc->cache_top, "allocate r%d (%s)", mipsreg, x86regname[regnum]);
1007   if (flags & ALLOC_SRC)
1008   {
1009      mipsreg_state state = compiler->mipsregs[mipsreg];
1010      if (ISCONST(state))
1011         emit_mov_r64_imm(DRCTOP, regnum, CONSTVAL(state));                        // mov  <x86reg>,constant
1012      else
1013         emit_mov_r64_m64(DRCTOP, regnum, REGADDR(mipsreg));                        // mov  <x86reg>,[reg]
1014   }
1015
1016   /* mark it allocated */
1017   assert(!(compiler->x86regs[regnum] & X86REG_LIVE));
1018   compiler->x86regs[regnum] = X86REG_LIVE | mipsreg;
1019   compiler->mipsregs[mipsreg] = MIPSREG_LIVE | regnum | ((flags & ALLOC_DIRTY) ? MIPSREG_DIRTY : 0);
1020   return compiler->mipsregs[mipsreg];
1021}
1022
1023
1024/*-------------------------------------------------
1025    compiler_register_flush - flush and optionally
1026    free a single MIPS register
1027-------------------------------------------------*/
1028
1029static void compiler_register_flush(drc_core *drc, compiler_state *compiler, UINT8 mipsreg, int free)
1030{
1031   mipsreg_state reg = compiler->mipsregs[mipsreg];
1032
1033   assert(ISCONST(reg) || ISLIVE(reg));
1034
1035   /* flush the value if dirty */
1036   if (ISDIRTY(reg))
1037   {
1038      if (LOG_CODE)
1039         x86log_add_comment(mips3.log, drc->cache_top, "flush r%d (%s)", mipsreg, ISCONST(reg) ? "constant" : x86regname[X86REG(reg)]);
1040
1041      /* flush a constant value */
1042      if (ISCONST(reg))
1043         emit_mov_m64_imm(DRCTOP, REGADDR(mipsreg), CONSTVAL(reg));                     // mov  [reg],constant
1044
1045      /* flush a live value */
1046      else if (ISLIVE(reg))
1047         emit_mov_m64_r64(DRCTOP, REGADDR(mipsreg), X86REG(reg));                     // mov  [reg],<x86reg>
1048   }
1049
1050   /* clear the dirty flag */
1051   if (!free)
1052      compiler->mipsregs[mipsreg] &= ~MIPSREG_DIRTY;
1053   else
1054   {
1055      if (ISLIVE(reg))
1056         compiler->x86regs[X86REG(reg)] = 0;
1057      compiler->mipsregs[mipsreg] = 0;
1058   }
1059}
1060
1061
1062/*-------------------------------------------------
1063    compiler_register_flush_all - flush all dirty
1064    registers
1065-------------------------------------------------*/
1066
1067static void compiler_register_flush_all(drc_core *drc, compiler_state *compiler)
1068{
1069   int mipsreg;
1070
1071   /* flush all dirty registers */
1072   for (mipsreg = 1; mipsreg < 35; mipsreg++)
1073      if (ISDIRTY(compiler->mipsregs[mipsreg]))
1074         compiler_register_flush(drc, compiler, mipsreg, FALSE);
1075}
1076
1077
1078
1079/***************************************************************************
1080    COMPILER CALLBACKS
1081***************************************************************************/
1082
1083/*-------------------------------------------------
1084    probe_printf - print the current CPU state
1085    and return
1086-------------------------------------------------*/
1087
1088static void probe_printf(void)
1089{
1090   printf(" PC=%08X          r1=%08X%08X  r2=%08X%08X  r3=%08X%08X\n",
1091      mips3.core->pc,
1092      (UINT32)(mips3.core->r[1] >> 32), (UINT32)mips3.core->r[1],
1093      (UINT32)(mips3.core->r[2] >> 32), (UINT32)mips3.core->r[2],
1094      (UINT32)(mips3.core->r[3] >> 32), (UINT32)mips3.core->r[3]);
1095   printf(" r4=%08X%08X  r5=%08X%08X  r6=%08X%08X  r7=%08X%08X\n",
1096      (UINT32)(mips3.core->r[4] >> 32), (UINT32)mips3.core->r[4],
1097      (UINT32)(mips3.core->r[5] >> 32), (UINT32)mips3.core->r[5],
1098      (UINT32)(mips3.core->r[6] >> 32), (UINT32)mips3.core->r[6],
1099      (UINT32)(mips3.core->r[7] >> 32), (UINT32)mips3.core->r[7]);
1100   printf(" r8=%08X%08X  r9=%08X%08X r10=%08X%08X r11=%08X%08X\n",
1101      (UINT32)(mips3.core->r[8] >> 32), (UINT32)mips3.core->r[8],
1102      (UINT32)(mips3.core->r[9] >> 32), (UINT32)mips3.core->r[9],
1103      (UINT32)(mips3.core->r[10] >> 32), (UINT32)mips3.core->r[10],
1104      (UINT32)(mips3.core->r[11] >> 32), (UINT32)mips3.core->r[11]);
1105   printf("r12=%08X%08X r13=%08X%08X r14=%08X%08X r15=%08X%08X\n",
1106      (UINT32)(mips3.core->r[12] >> 32), (UINT32)mips3.core->r[12],
1107      (UINT32)(mips3.core->r[13] >> 32), (UINT32)mips3.core->r[13],
1108      (UINT32)(mips3.core->r[14] >> 32), (UINT32)mips3.core->r[14],
1109      (UINT32)(mips3.core->r[15] >> 32), (UINT32)mips3.core->r[15]);
1110   printf("r16=%08X%08X r17=%08X%08X r18=%08X%08X r19=%08X%08X\n",
1111      (UINT32)(mips3.core->r[16] >> 32), (UINT32)mips3.core->r[16],
1112      (UINT32)(mips3.core->r[17] >> 32), (UINT32)mips3.core->r[17],
1113      (UINT32)(mips3.core->r[18] >> 32), (UINT32)mips3.core->r[18],
1114      (UINT32)(mips3.core->r[19] >> 32), (UINT32)mips3.core->r[19]);
1115   printf("r20=%08X%08X r21=%08X%08X r22=%08X%08X r23=%08X%08X\n",
1116      (UINT32)(mips3.core->r[20] >> 32), (UINT32)mips3.core->r[20],
1117      (UINT32)(mips3.core->r[21] >> 32), (UINT32)mips3.core->r[21],
1118      (UINT32)(mips3.core->r[22] >> 32), (UINT32)mips3.core->r[22],
1119      (UINT32)(mips3.core->r[23] >> 32), (UINT32)mips3.core->r[23]);
1120   printf("r24=%08X%08X r25=%08X%08X r26=%08X%08X r27=%08X%08X\n",
1121      (UINT32)(mips3.core->r[24] >> 32), (UINT32)mips3.core->r[24],
1122      (UINT32)(mips3.core->r[25] >> 32), (UINT32)mips3.core->r[25],
1123      (UINT32)(mips3.core->r[26] >> 32), (UINT32)mips3.core->r[26],
1124      (UINT32)(mips3.core->r[27] >> 32), (UINT32)mips3.core->r[27]);
1125   printf("r28=%08X%08X r29=%08X%08X r30=%08X%08X r31=%08X%08X\n",
1126      (UINT32)(mips3.core->r[28] >> 32), (UINT32)mips3.core->r[28],
1127      (UINT32)(mips3.core->r[29] >> 32), (UINT32)mips3.core->r[29],
1128      (UINT32)(mips3.core->r[30] >> 32), (UINT32)mips3.core->r[30],
1129      (UINT32)(mips3.core->r[31] >> 32), (UINT32)mips3.core->r[31]);
1130   printf(" hi=%08X%08X  lo=%08X%08X\n",
1131      (UINT32)(mips3.core->r[REG_HI] >> 32), (UINT32)mips3.core->r[REG_HI],
1132      (UINT32)(mips3.core->r[REG_LO] >> 32), (UINT32)mips3.core->r[REG_LO]);
1133}
1134
1135
1136/*-------------------------------------------------
1137    exception_trap - log any exceptions that
1138    aren't interrupts
1139-------------------------------------------------*/
1140
1141static void exception_trap(void)
1142{
1143   if ((mips3.core->cpr[0][COP0_Cause] & 0xff) != 0)
1144      printf("Exception: EPC=%08X Cause=%08X BadVAddr=%08X Jmp=%08X\n", mips3.core->cpr[0][COP0_EPC], mips3.core->cpr[0][COP0_Cause], mips3.core->cpr[0][COP0_BadVAddr], mips3.core->pc);
1145}
1146
1147
1148
1149/***************************************************************************
7541150    COMMON ROUTINES
7551151***************************************************************************/
7561152
r1051r1052
7651161   handlers->read_byte_signed = drc->cache_top;
7661162   append_readwrite_and_translate(drc, 1, ARW_READ | ARW_SIGNED | flags, offsetof(readwrite_handlers, read_byte_signed));
7671163   sprintf(buffer, "%s.read_byte_signed:", type);
768   code_log(buffer, handlers->read_byte_signed, drc->cache_top);
1164   if (LOG_CODE)
1165      x86log_disasm_code_range(mips3.log, buffer, handlers->read_byte_signed, drc->cache_top);
7691166
7701167   handlers->read_byte_unsigned = drc->cache_top;
7711168   append_readwrite_and_translate(drc, 1, ARW_READ | ARW_UNSIGNED | flags, offsetof(readwrite_handlers, read_byte_unsigned));
7721169   sprintf(buffer, "%s.read_byte_unsigned:", type);
773   code_log(buffer, handlers->read_byte_unsigned, drc->cache_top);
1170   if (LOG_CODE)
1171      x86log_disasm_code_range(mips3.log, buffer, handlers->read_byte_unsigned, drc->cache_top);
7741172
1173   handlers->read_half_signed = drc->cache_top;
1174   append_readwrite_and_translate(drc, 2, ARW_READ | ARW_SIGNED | flags, offsetof(readwrite_handlers, read_half_signed));
1175   sprintf(buffer, "%s.read_half_signed:", type);
1176   if (LOG_CODE)
1177      x86log_disasm_code_range(mips3.log, buffer, handlers->read_half_signed, drc->cache_top);
1178
1179   handlers->read_half_unsigned = drc->cache_top;
1180   append_readwrite_and_translate(drc, 2, ARW_READ | ARW_UNSIGNED | flags, offsetof(readwrite_handlers, read_half_unsigned));
1181   sprintf(buffer, "%s.read_half_unsigned:", type);
1182   if (LOG_CODE)
1183      x86log_disasm_code_range(mips3.log, buffer, handlers->read_half_unsigned, drc->cache_top);
1184
7751185   handlers->read_word_signed = drc->cache_top;
776   append_readwrite_and_translate(drc, 2, ARW_READ | ARW_SIGNED | flags, offsetof(readwrite_handlers, read_word_signed));
1186   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_SIGNED | flags, offsetof(readwrite_handlers, read_word_signed));
7771187   sprintf(buffer, "%s.read_word_signed:", type);
778   code_log(buffer, handlers->read_word_signed, drc->cache_top);
1188   if (LOG_CODE)
1189      x86log_disasm_code_range(mips3.log, buffer, handlers->read_word_signed, drc->cache_top);
7791190
7801191   handlers->read_word_unsigned = drc->cache_top;
781   append_readwrite_and_translate(drc, 2, ARW_READ | ARW_UNSIGNED | flags, offsetof(readwrite_handlers, read_word_unsigned));
1192   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_UNSIGNED | flags, offsetof(readwrite_handlers, read_word_unsigned));
7821193   sprintf(buffer, "%s.read_word_unsigned:", type);
783   code_log(buffer, handlers->read_word_unsigned, drc->cache_top);
1194   if (LOG_CODE)
1195      x86log_disasm_code_range(mips3.log, buffer, handlers->read_word_unsigned, drc->cache_top);
7841196
785   handlers->read_long_signed = drc->cache_top;
786   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_SIGNED | flags, offsetof(readwrite_handlers, read_long_signed));
787   sprintf(buffer, "%s.read_long_signed:", type);
788   code_log(buffer, handlers->read_long_signed, drc->cache_top);
1197   handlers->read_word_masked = drc->cache_top;
1198   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_UNSIGNED | ARW_MASKED | flags, offsetof(readwrite_handlers, read_word_masked));
1199   sprintf(buffer, "%s.read_word_masked:", type);
1200   if (LOG_CODE)
1201      x86log_disasm_code_range(mips3.log, buffer, handlers->read_word_masked, drc->cache_top);
7891202
790   handlers->read_long_unsigned = drc->cache_top;
791   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_UNSIGNED | flags, offsetof(readwrite_handlers, read_long_unsigned));
792   sprintf(buffer, "%s.read_long_unsigned:", type);
793   code_log(buffer, handlers->read_long_unsigned, drc->cache_top);
794
795   handlers->read_long_masked = drc->cache_top;
796   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_UNSIGNED | ARW_MASKED | flags, offsetof(readwrite_handlers, read_long_masked));
797   sprintf(buffer, "%s.read_long_masked:", type);
798   code_log(buffer, handlers->read_long_masked, drc->cache_top);
799
8001203   handlers->read_double = drc->cache_top;
8011204   append_readwrite_and_translate(drc, 8, ARW_READ | flags, offsetof(readwrite_handlers, read_double));
8021205   sprintf(buffer, "%s.read_double:", type);
803   code_log(buffer, handlers->read_double, drc->cache_top);
1206   if (LOG_CODE)
1207      x86log_disasm_code_range(mips3.log, buffer, handlers->read_double, drc->cache_top);
8041208
8051209   handlers->read_double_masked = drc->cache_top;
8061210   append_readwrite_and_translate(drc, 8, ARW_READ | ARW_MASKED | flags, offsetof(readwrite_handlers, read_double_masked));
8071211   sprintf(buffer, "%s.read_double_masked:", type);
808   code_log(buffer, handlers->read_double_masked, drc->cache_top);
1212   if (LOG_CODE)
1213      x86log_disasm_code_range(mips3.log, buffer, handlers->read_double_masked, drc->cache_top);
8091214
8101215   handlers->write_byte = drc->cache_top;
8111216   append_readwrite_and_translate(drc, 1, ARW_WRITE | flags, offsetof(readwrite_handlers, write_byte));
8121217   sprintf(buffer, "%s.write_byte:", type);
813   code_log(buffer, handlers->write_byte, drc->cache_top);
1218   if (LOG_CODE)
1219      x86log_disasm_code_range(mips3.log, buffer, handlers->write_byte, drc->cache_top);
8141220
1221   handlers->write_half = drc->cache_top;
1222   append_readwrite_and_translate(drc, 2, ARW_WRITE | flags, offsetof(readwrite_handlers, write_half));
1223   sprintf(buffer, "%s.write_half:", type);
1224   if (LOG_CODE)
1225      x86log_disasm_code_range(mips3.log, buffer, handlers->write_half, drc->cache_top);
1226
8151227   handlers->write_word = drc->cache_top;
816   append_readwrite_and_translate(drc, 2, ARW_WRITE | flags, offsetof(readwrite_handlers, write_word));
1228   append_readwrite_and_translate(drc, 4, ARW_WRITE | flags, offsetof(readwrite_handlers, write_word));
8171229   sprintf(buffer, "%s.write_word:", type);
818   code_log(buffer, handlers->write_word, drc->cache_top);
1230   if (LOG_CODE)
1231      x86log_disasm_code_range(mips3.log, buffer, handlers->write_word, drc->cache_top);
8191232
820   handlers->write_long = drc->cache_top;
821   append_readwrite_and_translate(drc, 4, ARW_WRITE | flags, offsetof(readwrite_handlers, write_long));
822   sprintf(buffer, "%s.write_long:", type);
823   code_log(buffer, handlers->write_long, drc->cache_top);
1233   handlers->write_word_masked = drc->cache_top;
1234   append_readwrite_and_translate(drc, 4, ARW_WRITE | ARW_MASKED | flags, offsetof(readwrite_handlers, write_word_masked));
1235   sprintf(buffer, "%s.write_word_masked:", type);
1236   if (LOG_CODE)
1237      x86log_disasm_code_range(mips3.log, buffer, handlers->write_word_masked, drc->cache_top);
8241238
825   handlers->write_long_masked = drc->cache_top;
826   append_readwrite_and_translate(drc, 4, ARW_WRITE | ARW_MASKED | flags, offsetof(readwrite_handlers, write_long_masked));
827   sprintf(buffer, "%s.write_long_masked:", type);
828   code_log(buffer, handlers->write_long_masked, drc->cache_top);
829
8301239   handlers->write_double = drc->cache_top;
8311240   append_readwrite_and_translate(drc, 8, ARW_WRITE | flags, offsetof(readwrite_handlers, write_double));
8321241   sprintf(buffer, "%s.write_double:", type);
833   code_log(buffer, handlers->write_double, drc->cache_top);
1242   if (LOG_CODE)
1243      x86log_disasm_code_range(mips3.log, buffer, handlers->write_double, drc->cache_top);
8341244
8351245   handlers->write_double_masked = drc->cache_top;
8361246   append_readwrite_and_translate(drc, 8, ARW_WRITE | ARW_MASKED | flags, offsetof(readwrite_handlers, write_double_masked));
8371247   sprintf(buffer, "%s.write_double_masked:", type);
838   code_log(buffer, handlers->write_double_masked, drc->cache_top);
1248   if (LOG_CODE)
1249      x86log_disasm_code_range(mips3.log, buffer, handlers->write_double_masked, drc->cache_top);
8391250}
8401251
8411252
8421253/*------------------------------------------------------------------
843    append_delay_slot_and_branch
844------------------------------------------------------------------*/
845
846static void append_delay_slot_and_branch(drc_core *drc, const compiler_state *compiler, const mips3_opcode_desc *desc)
847{
848   compiler_state compiler_temp = *compiler;
849
850   /* compile the delay slot using temporary compiler state */
851   assert(desc->delay != NULL);
852   compile_one(drc, &compiler_temp, desc->delay);                                 // <next instruction>
853
854   /* if we have cycles, subtract them now */
855   if (compiler_temp.cycles != 0)
856      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler_temp.cycles);                     // sub  [icount],cycles
857
858   /* load the target PC into P1 */
859   if (desc->targetpc != ~0)
860      emit_mov_r32_imm(DRCTOP, REG_P1, desc->targetpc);                           // mov  p1,desc->targetpc
861   else
862      emit_mov_r32_m32(DRCTOP, REG_P1, MBD(REG_RSP, SPOFFS_NEXTPC));                  // mov  p1,[esp+nextpc]
863
864   /* if we subtracted cycles and went negative, time to exit */
865   if (compiler_temp.cycles != 0)
866      emit_jcc(DRCTOP, COND_S, mips3.drc->exit_point);                           // js   exit_point
867
868   /* otherwise, append a dispatcher */
869   if (desc->targetpc != ~0)
870      drc_append_tentative_fixed_dispatcher(drc, desc->targetpc, FALSE);               // <redispatch>
871   else
872      drc_append_dispatcher(drc);                                             // <redispatch>
873}
874
875
876/*------------------------------------------------------------------
8771254    append_generate_exception
8781255------------------------------------------------------------------*/
8791256
r1051r1052
9161293   emit_mov_r32_imm(DRCTOP, REG_P1, 0x80000000 + offset);                           // mov  p1,0x80000000+offset
9171294
9181295   resolve_link(DRCTOP, &link2);                                          // skip2:
1296   if (PRINTF_EXCEPTIONS)
1297   {
1298      emit_mov_m32_r32(DRCTOP, PCADDR, REG_P1);                                 // mov  [PC],p1
1299      emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)exception_trap);                     // mov  rax,exception_trap
1300      emit_call_r64(DRCTOP, REG_RAX);                                          // call rax
1301      emit_mov_r32_m32(DRCTOP, REG_P1, PCADDR);                                 // mov  p1,[PC]
1302   }
9191303   drc_append_dispatcher(drc);                                                // dispatch
9201304}
9211305
r1051r1052
10041388      }
10051389   }
10061390
1007   /* fast RAM word read */
1391   /* fast RAM halfword read */
10081392   else if (size == 2)
10091393   {
10101394      /* adjust for endianness */
r1051r1052
10981482         emit_mov_m8_r8(DRCTOP, MDRCISD(adjbase, REG_P1, 1, 0), REG_P2);               // mov   [p1 + adjbase],p2
10991483   }
11001484
1101   /* fast RAM word write */
1485   /* fast RAM halfword write */
11021486   else if (size == 2)
11031487   {
11041488      /* adjust for endianness */
r1051r1052
12731657      if (size == 1)
12741658         emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writebyte));                  // jmp  writebyte
12751659      else if (size == 2)
1276         emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writeword));                  // jmp  writeword
1660         emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writehalf));                  // jmp  writehalf
12771661      else if (size == 4)
12781662      {
12791663         if (!(flags & ARW_MASKED))
1280            emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writelong));               // jmp  writelong
1664            emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writeword));               // jmp  writeword
12811665         else
1282            emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writelong_masked));         // jmp  writelong_masked
1666            emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.writeword_masked));         // jmp  writeword_masked
12831667      }
12841668      else
12851669      {
r1051r1052
13071691      else if (size == 2)
13081692      {
13091693         emit_sub_r64_imm(DRCTOP, REG_RSP, 0x28);                              // sub   rsp,0x28
1310         emit_call_m64(DRCTOP, MDRC(&mips3.core->memory.readword));                  // call  readword
1694         emit_call_m64(DRCTOP, MDRC(&mips3.core->memory.readhalf));                  // call  readhalf
13111695         if (flags & ARW_SIGNED)
13121696            emit_movsx_r64_r16(DRCTOP, REG_RAX, REG_AX);                        // movsx rax,ax
13131697         else
r1051r1052
13201704         if (!(flags & ARW_MASKED))
13211705         {
13221706            if (!(flags & ARW_SIGNED))
1323               emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.readlong));            // jmp  readlong
1707               emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.readword));            // jmp  readword
13241708            else
13251709            {
13261710               emit_sub_r64_imm(DRCTOP, REG_RSP, 0x28);                        // sub  rsp,0x28
1327               emit_call_m64(DRCTOP, MDRC(&mips3.core->memory.readlong));            // call readlong
1711               emit_call_m64(DRCTOP, MDRC(&mips3.core->memory.readword));            // call readword
13281712               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
13291713               emit_add_r64_imm(DRCTOP, REG_RSP, 0x28);                        // add  rsp,0x28
13301714               emit_ret(DRCTOP);                                          // ret
13311715            }
13321716         }
13331717         else
1334            emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.readlong_masked));         // jmp  readlong_masked
1718            emit_jmp_m64(DRCTOP, MDRC(&mips3.core->memory.readword_masked));         // jmp  readword_masked
13351719      }
13361720      else
13371721      {
r1051r1052
14191803{
14201804   int i;
14211805
1422   emit_movsxd_r64_m32(DRCTOP, REG_RAX, CCR1ADDR(31));                              // movsxd rax,ccr1[rdreg]
1806   emit_movsxd_r64_m32(DRCTOP, REG_RAX, CCR1ADDR(31));                              // movsxd rax,ccr1[rd]
14231807   emit_and_r64_imm(DRCTOP, REG_RAX, ~0xfe800000);                                 // and  rax,~0xfe800000
14241808   emit_xor_r32_r32(DRCTOP, REG_EDX, REG_EDX);                                    // xor  edx,edx
14251809   emit_cmp_m8_imm(DRCTOP, CF1ADDR(0), 0);                                       // cmp  fcc[0],0
r1051r1052
14671851
14681852
14691853/***************************************************************************
1470    CORE RECOMPILATION
1854    RECOMPILATION HELPERS
14711855***************************************************************************/
14721856
1473/*------------------------------------------------------------------
1474    recompile_instruction
1475------------------------------------------------------------------*/
1857/*-------------------------------------------------
1858    emit_load_register_value - load a register
1859    either as a constant or as a register
1860-------------------------------------------------*/
14761861
1477static int recompile_instruction(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
1862static void emit_load_register_value(drc_core *drc, compiler_state *compiler, UINT8 dstreg, mipsreg_state regstate)
14781863{
1479   UINT32 op = *desc->opptr;
1480   emit_link link1;
1864   /* must be live or constant */
1865   assert(ISCONST(regstate) || ISLIVE(regstate));
14811866
1482   switch (op >> 26)
1867   /* if the register is constant, do an immediate load */
1868   if (ISCONST(regstate))
14831869   {
1484      case 0x00:   /* SPECIAL */
1485         return recompile_special(drc, compiler, desc);
1870      INT32 mipsval = CONSTVAL(regstate);
1871      if (mipsval != 0)
1872         emit_mov_r64_imm(DRCTOP, dstreg, mipsval);
1873      else
1874         emit_xor_r32_r32(DRCTOP, dstreg, dstreg);
1875   }
14861876
1487      case 0x01:   /* REGIMM */
1488         return recompile_regimm(drc, compiler, desc);
1877   /* otherwise, load from the allocated register, but only if different */
1878   else
1879   {
1880      UINT8 srcreg = X86REG(regstate);
1881      if (dstreg != srcreg)
1882         emit_mov_r64_r64(DRCTOP, dstreg, srcreg);
1883   }
1884}
14891885
1490      case 0x02:   /* J */
1491         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
1492         return TRUE;
14931886
1494      case 0x03:   /* JAL */
1495         assert(desc->delay != NULL);
1496         emit_mov_m64_imm(DRCTOP, REGADDR(31), (INT32)(desc->pc + 8));               // mov  [r31],pc + 8
1497         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
1498         return TRUE;
1887/*-------------------------------------------------
1888    emit_set_constant_value - set a constant
1889    value; if it is too large, allocate a
1890    register and populate it
1891-------------------------------------------------*/
14991892
1500      case 0x04:   /* BEQ */
1501      case 0x14:   /* BEQL */
1502         assert(desc->delay != NULL);
1503         if (RSREG != RTREG)
1504         {
1505            if (RSREG == 0)
1506            {
1507               emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // cmp  [rtreg],0
1508               emit_jcc_near_link(DRCTOP, COND_NE, &link1);                     // jne  skip
1509            }
1510            else if (RTREG == 0)
1511            {
1512               emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                     // cmp  [rsreg],0
1513               emit_jcc_near_link(DRCTOP, COND_NE, &link1);                     // jne  skip
1514            }
1515            else
1516            {
1517               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
1518               emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // cmp  rax,[rtreg]
1519               emit_jcc_near_link(DRCTOP, COND_NE, &link1);                     // jne  skip
1520            }
1521         }
1522         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
1523         if (RSREG != RTREG)
1524            resolve_link(DRCTOP, &link1);                                 // skip:
1525         return TRUE;
1893static void emit_set_constant_value(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 mipsreg, UINT64 constval)
1894{
1895   /* ignore reigster 0 destination */
1896   if (mipsreg == 0)
1897      return;
15261898
1527      case 0x05:   /* BNE */
1528      case 0x15:   /* BNEL */
1529         assert(desc->delay != NULL);
1530         if (RSREG == RTREG)
1531            return TRUE;
1532         else if (RSREG == 0)
1533         {
1534            emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                        // cmp  [rtreg],0
1535            emit_jcc_near_link(DRCTOP, COND_E, &link1);                           // je  skip
1536         }
1537         else if (RTREG == 0)
1538         {
1539            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
1540            emit_jcc_near_link(DRCTOP, COND_E, &link1);                           // je  skip
1541         }
1542         else
1543         {
1544            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
1545            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
1546            emit_jcc_near_link(DRCTOP, COND_E, &link1);                           // je  skip
1547         }
1548         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
1549         resolve_link(DRCTOP, &link1);                                    // skip:
1550         return TRUE;
1899   /* if we fit in 32-bits, just continue the constant charade */
1900   if ((INT32)constval == (INT64)constval)
1901      compiler_register_set_constant(compiler, mipsreg, constval);
15511902
1552      case 0x06:   /* BLEZ */
1553      case 0x16:   /* BLEZL */
1554         assert(desc->delay != NULL);
1555         if (RSREG != 0)
1556         {
1557            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
1558            emit_jcc_near_link(DRCTOP, COND_G, &link1);                           // jg  skip
1559         }
1560         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
1561         if (RSREG != 0)
1562            resolve_link(DRCTOP, &link1);                                 // skip:
1563         return TRUE;
1903   /* otherwise, allocate a new register and move the result into it */
1904   else
1905   {
1906      mipsreg_state resultreg = compiler_register_allocate(drc, compiler, desc, mipsreg, ALLOC_DST | ALLOC_DIRTY);
1907      emit_mov_r64_imm(DRCTOP, X86REG(resultreg), constval);                        // mov  <rt>,result
1908   }
1909}
15641910
1565      case 0x07:   /* BGTZ */
1566      case 0x17:   /* BGTZL */
1567         if (RSREG == 0)
1568            return TRUE;
1569         else
1570         {
1571            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
1572            emit_jcc_near_link(DRCTOP, COND_LE, &link1);                        // jle  skip
1573         }
1574         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
1575         resolve_link(DRCTOP, &link1);                                    // skip:
1576         return TRUE;
15771911
1578      case 0x08:   /* ADDI */
1579         if (RSREG != 0)
1580         {
1581            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1582            emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // add  eax,SIMMVAL
1583            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
1584                                                                     // jo   generate_overflow_exception
1585            if (RTREG != 0)
1586            {
1587               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
1588               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1589            }
1590         }
1591         else if (RTREG != 0)
1592            emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), SIMMVAL);                     // mov  [rtreg],const
1593         return TRUE;
1912/*------------------------------------------------------------------
1913    emit_delay_slot_and_branch
1914------------------------------------------------------------------*/
15941915
1595      case 0x09:   /* ADDIU */
1596         if (RTREG != 0)
1597         {
1598            if (RSREG != 0)
1599            {
1600               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                  // mov  eax,[rsreg]
1601               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
1602               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
1603               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1604            }
1605            else
1606               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), SIMMVAL);                  // mov  [rtreg],const
1607         }
1608         return TRUE;
1916static void emit_delay_slot_and_branch(drc_core *drc, const compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 linkreg)
1917{
1918   compiler_state compiler_temp = *compiler;
16091919
1610      case 0x0a:   /* SLTI */
1611         if (RTREG != 0)
1612         {
1613            if (RSREG != 0)
1614            {
1615               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
1616               emit_sub_r64_imm(DRCTOP, REG_RAX, SIMMVAL);                        // sub  rax,SIMMVAL
1617               emit_shr_r64_imm(DRCTOP, REG_RAX, 63);                           // shr  rax,63
1618               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1619            }
1620            else
1621               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), (0 < SIMMVAL));            // mov  [rtreg],(0 < SIMMVAL)
1622         }
1623         return TRUE;
1920   /* set the link if needed */
1921   if (linkreg != 0)
1922      compiler_register_set_constant(&compiler_temp, linkreg, (INT32)(desc->pc + 8));      // <link> = pc + 8
16241923
1625      case 0x0b:   /* SLTIU */
1626         if (RTREG != 0)
1627         {
1628            if (RSREG != 0)
1629            {
1630               emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                  // cmp   [rsreg],SIMMVAL
1631               emit_setcc_r8(DRCTOP, COND_B, REG_AL);                           // setb  al
1632               emit_movsx_r64_r8(DRCTOP, REG_RAX, REG_AL);                        // movsx rax,al
1633               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1634            }
1635            else
1636               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), (0 < (UINT64)SIMMVAL));
1637                                                                     // mov  [rtreg],(0 < SIMMVAL)
1638         }
1639         return TRUE;
1924   /* compile the delay slot using temporary compiler state */
1925   assert(desc->delay != NULL);
1926   compile_one(drc, &compiler_temp, desc->delay);                                 // <next instruction>
16401927
1641      case 0x0c:   /* ANDI */
1642         if (RTREG != 0)
1643         {
1644            if (RSREG == RTREG)
1645               emit_and_m64_imm(DRCTOP, REGADDR(RTREG), UIMMVAL);                  // and  [rtreg],UIMMVAL
1646            else if (RSREG != 0)
1647            {
1648               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
1649               emit_and_r64_imm(DRCTOP, REG_EAX, UIMMVAL);                        // and  rax,UIMMVAL
1650               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1651            }
1652            else
1653               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // mov  [rtreg],0
1654         }
1655         return TRUE;
1928   /* if we have cycles, subtract them now */
1929   if (compiler_temp.cycles != 0)
1930      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler_temp.cycles);                     // sub  [icount],cycles
16561931
1657      case 0x0d:   /* ORI */
1658         if (RTREG != 0)
1659         {
1660            if (RSREG == RTREG)
1661               emit_or_m64_imm(DRCTOP, REGADDR(RTREG), UIMMVAL);                  // or   [rtreg],UIMMVAL
1662            else if (RSREG != 0)
1663            {
1664               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
1665               emit_or_r64_imm(DRCTOP, REG_EAX, UIMMVAL);                        // or   rax,UIMMVAL
1666               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1667            }
1668            else
1669               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), UIMMVAL);                  // mov  [rtreg],UIMMVAL
1670         }
1671         return TRUE;
1932   /* load the target PC into P1 */
1933   if (desc->targetpc != ~0)
1934      emit_mov_r32_imm(DRCTOP, REG_P1, desc->targetpc);                           // mov  p1,desc->targetpc
1935   else
1936      emit_mov_r32_m32(DRCTOP, REG_P1, MBD(REG_RSP, SPOFFS_NEXTPC));                  // mov  p1,[esp+nextpc]
16721937
1673      case 0x0e:   /* XORI */
1674         if (RTREG != 0)
1675         {
1676            if (RSREG == RTREG)
1677               emit_xor_m64_imm(DRCTOP, REGADDR(RTREG), UIMMVAL);                  // xor  [rtreg],UIMMVAL
1678            else if (RSREG != 0)
1679            {
1680               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
1681               emit_xor_r64_imm(DRCTOP, REG_EAX, UIMMVAL);                        // xor  rax,UIMMVAL
1682               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1683            }
1684            else
1685               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), UIMMVAL);                  // mov  [rtreg],UIMMVAL
1686         }
1687         return TRUE;
1938   /* flush any live registers */
1939   compiler_register_flush_all(drc, &compiler_temp);
16881940
1689      case 0x0f:   /* LUI */
1690         if (RTREG != 0)
1691            emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), SIMMVAL << 16);               // mov  [rtreg],const << 16
1692         return TRUE;
1941   /* if we subtracted cycles and went negative, time to exit */
1942   if (compiler_temp.cycles != 0)
1943      emit_jcc(DRCTOP, COND_S, mips3.drc->exit_point);                           // js   exit_point
16931944
1694      case 0x10:   /* COP0 */
1695         return recompile_cop0(drc, compiler, desc);
1945   /* otherwise, append a dispatcher */
1946   if (desc->targetpc != ~0)
1947      drc_append_tentative_fixed_dispatcher(drc, desc->targetpc, FALSE);               // <redispatch>
1948   else
1949      drc_append_dispatcher(drc);                                             // <redispatch>
1950}
16961951
1697      case 0x11:   /* COP1 */
1698         return recompile_cop1(drc, compiler, desc);
16991952
1700      case 0x12:   /* COP2 */
1701         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_invalidop_exception);
1702                                                                     // jmp  generate_invalidop_exception
1703         return TRUE;
1953/*------------------------------------------------------------------
1954    emit_fixed_byte_read
1955------------------------------------------------------------------*/
17041956
1705      case 0x13:   /* COP1X - R5000 */
1706         return recompile_cop1x(drc, compiler, desc);
1957static int emit_fixed_byte_read(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 destreg, int is_unsigned, offs_t address)
1958{
1959   void *fastram = fastram_ptr(address, 1, FALSE);
17071960
1708      case 0x18:   /* DADDI */
1709         if (RSREG != 0)
1710         {
1711            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
1712            emit_add_r64_imm(DRCTOP, REG_RAX, SIMMVAL);                           // add  rax,SIMMVAL
1713            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
1714                                                                     // jo   generate_overflow_exception
1715            if (RTREG != 0)
1716               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1717         }
1718         else if (RTREG != 0)
1719            emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), SIMMVAL);                     // mov  [rtreg],const
1720         return TRUE;
1961   /* if we can't do fast RAM, we need to make the call */
1962   if (fastram == NULL)
1963   {
1964      emit_mov_r32_imm(DRCTOP, REG_P1, address);                                 // mov  p1,address
1965      if (is_unsigned)
1966         emit_call(DRCTOP, mips3.drcdata->general.read_byte_unsigned);               // call read_byte_unsigned
1967      else
1968         emit_call(DRCTOP, mips3.drcdata->general.read_byte_signed);                  // call read_byte_signed
17211969
1722      case 0x19:   /* DADDIU */
1723         if (RTREG != 0)
1724         {
1725            if (RSREG == RTREG)
1726               emit_add_m64_imm(DRCTOP, REGADDR(RTREG), SIMMVAL);                  // add  [rtreg],SIMMVAL
1727            else if (RSREG != 0)
1728            {
1729               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
1730               emit_add_r64_imm(DRCTOP, REG_RAX, SIMMVAL);                        // add  rax,SIMMVAL
1731               emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                  // mov  [rtreg],rax
1732            }
1733            else
1734               emit_mov_m64_imm(DRCTOP, REGADDR(RTREG), SIMMVAL);                  // mov  [rtreg],const
1735         }
1736         return TRUE;
1970      /* handle exceptions */
1971      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1972      if (destreg != REG_RAX)
1973         emit_mov_r64_r64(DRCTOP, destreg, REG_RAX);                              // mov  <rt>,rax
1974   }
17371975
1738      case 0x1a:   /* LDL */
1739         if (RSREG != 0)
1740         {
1741            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1742            if (SIMMVAL != 0)
1743               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
1744         }
1976   /* if we can do fastram, emit the right form */
1977   else
1978   {
1979      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
1980      int raxrel = ((INT32)fastdisp != fastdisp);
1981
1982      /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
1983      if (raxrel)
1984      {
1985         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                        // mov  rax,fastram
1986         if (is_unsigned)
1987            emit_movzx_r64_m8(DRCTOP, destreg, MBD(REG_RAX, 0));                  // movzx destreg,byte ptr [rax]
17451988         else
1746            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
1747         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
1748         emit_or_r64_imm(DRCTOP, REG_P2, -1);                                 // or   p2,-1
1749         if (!mips3.core->bigendian)
1750            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x38);                           // xor  ecx,0x38
1751         emit_and_r32_imm(DRCTOP, REG_EAX, ~7);                                 // and  eax,~7
1752         emit_shr_r64_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
1753         emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);               // mov  [sp+savecl],cl
1754         emit_not_r64(DRCTOP, REG_P2);                                       // not  p2
1755         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
1756         emit_call(DRCTOP, mips3.drcdata->general.read_double_masked);               // call general.read_double_masked
1757         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1758         if (RTREG != 0)
1759         {
1760            emit_mov_r8_m8(DRCTOP, REG_CL, MBD(REG_RSP, SPOFFS_SAVECL));            // mov  cl,[sp+savecl]
1761            emit_or_r64_imm(DRCTOP, REG_P2, -1);                              // or   p2,-1
1762            emit_shl_r64_cl(DRCTOP, REG_P2);                                 // shl  p2,cl
1763            emit_not_r64(DRCTOP, REG_P2);                                    // not  p2
1764            emit_shl_r64_cl(DRCTOP, REG_RAX);                                 // shl  rax,cl
1765            emit_and_r64_m64(DRCTOP, REG_P2, REGADDR(RTREG));                     // and  p2,[rtreg]
1766            emit_or_r64_r64(DRCTOP, REG_RAX, REG_P2);                           // or   rax,p2
1767            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1768         }
1769         return TRUE;
1989            emit_movsx_r64_m8(DRCTOP, destreg, MBD(REG_RAX, 0));                  // movsx destreg,byte ptr [rax]
1990      }
17701991
1771      case 0x1b:   /* LDR */
1772         if (RSREG != 0)
1773         {
1774            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1775            if (SIMMVAL != 0)
1776               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
1777         }
1992      /* read drc-relative */
1993      else
1994      {
1995         if (is_unsigned)
1996            emit_movzx_r64_m8(DRCTOP, destreg, MDRC(fastram));                     // movzx destreg,byte ptr [p1 + adjbase]
17781997         else
1779            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
1780         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
1781         emit_or_r64_imm(DRCTOP, REG_P2, -1);                                 // or   p2,-1
1782         if (mips3.core->bigendian)
1783            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x38);                           // xor  ecx,0x38
1784         emit_and_r32_imm(DRCTOP, REG_EAX, ~7);                                 // and  eax,~7
1785         emit_shl_r64_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
1786         emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);               // mov  [sp+savecl],cl
1787         emit_not_r64(DRCTOP, REG_P2);                                       // not  p2
1788         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
1789         emit_call(DRCTOP, mips3.drcdata->general.read_double_masked);               // call general.read_double_masked
1790         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1791         if (RTREG != 0)
1792         {
1793            emit_mov_r8_m8(DRCTOP, REG_CL, MBD(REG_RSP, SPOFFS_SAVECL));            // mov  cl,[sp+savecl]
1794            emit_or_r64_imm(DRCTOP, REG_P2, -1);                              // or   p2,-1
1795            emit_shr_r64_cl(DRCTOP, REG_P2);                                 // shr  p2,cl
1796            emit_not_r64(DRCTOP, REG_P2);                                    // not  p2
1797            emit_shr_r64_cl(DRCTOP, REG_RAX);                                 // shr  rax,cl
1798            emit_and_r64_m64(DRCTOP, REG_P2, REGADDR(RTREG));                     // and  p2,[rtreg]
1799            emit_or_r64_r64(DRCTOP, REG_RAX, REG_P2);                           // or   rax,p2
1800            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1801         }
1802         return TRUE;
1998            emit_movsx_r64_m8(DRCTOP, destreg, MDRC(fastram));                     // movsx destreg,byte ptr [p1 + adjbase]
1999      }
2000   }
2001   return (fastram != NULL);
2002}
18032003
1804      case 0x1c:   /* IDT-specific opcodes: mad/madu/mul on R4640/4650, msub on RC32364 */
1805#if 0
1806         switch (op & 0x1f)
1807         {
1808            case 0: /* MAD */
1809               if (RSREG != 0 && RTREG != 0)
1810               {
1811                  emit_mov_r32_m32(REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1812                  emit_mov_r32_m32(REG_EDX, REGADDR(RTREG));                     // mov  edx,[rtreg]
1813                  emit_imul_r32(DRCTOP, REG_EDX);                              // imul edx
1814                  emit_add_r32_m32(DRCTOP, LOADDR);                           // add  eax,[lo]
1815                  emit_adc_r32_m32(DRCTOP, HIADDR);                           // adc  edx,[hi]
1816                  emit_mov_r32_r32(DRCTOP, REG_EBX, REG_EDX);                     // mov  ebx,edx
1817                  emit_cdq(DRCTOP);                                       // cdq
1818                  emit_mov_m64_r64(DRCTOP, LOADDR, REG_EAX);                     // mov  [lo],edx:eax
1819                  emit_mov_r32_r32(DRCTOP, REG_EAX, REG_EBX);                     // mov  eax,ebx
1820                  emit_cdq(DRCTOP);                                       // cdq
1821                  emit_mov_m64_r64(DRCTOP, HIADDR, REG_EAX);                     // mov  [hi],edx:eax
1822               }
1823               return RECOMPILE_SUCCESSFUL_CP(3,4);
18242004
1825            case 1: /* MADU */
1826               if (RSREG != 0 && RTREG != 0)
1827               {
1828                  emit_mov_r32_m32(REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1829                  emit_mov_r32_m32(REG_EDX, REGADDR(RTREG));                     // mov  edx,[rtreg]
1830                  emit_mul_r32(DRCTOP, REG_EDX);                              // mul  edx
1831                  emit_add_r32_m32(DRCTOP, LOADDR);                           // add  eax,[lo]
1832                  emit_adc_r32_m32(DRCTOP, HIADDR);                           // adc  edx,[hi]
1833                  emit_mov_r32_r32(DRCTOP, REG_EBX, REG_EDX);                     // mov  ebx,edx
1834                  emit_cdq(DRCTOP);                                       // cdq
1835                  emit_mov_m64_r64(DRCTOP, LOADDR, REG_EDX, REG_EAX);               // mov  [lo],edx:eax
1836                  emit_mov_r32_r32(DRCTOP, REG_EAX, REG_EBX);                     // mov  eax,ebx
1837                  emit_cdq(DRCTOP);                                       // cdq
1838                  emit_mov_m64_r64(DRCTOP, HIADDR, REG_EDX, REG_EAX);               // mov  [hi],edx:eax
1839               }
1840               return RECOMPILE_SUCCESSFUL_CP(3,4);
2005/*------------------------------------------------------------------
2006    emit_fixed_half_read
2007------------------------------------------------------------------*/
18412008
1842            case 2: /* MUL */
1843               if (RDREG != 0)
1844               {
1845                  if (RSREG != 0 && RTREG != 0)
1846                  {
1847                     emit_mov_r32_m32(REG_EAX, REGADDR(RSREG));                  // mov  eax,[rsreg]
1848                     emit_imul_r32_m32(REG_EAX, REGADDR(RTREG));                  // imul eax,[rtreg]
1849                     emit_cdq(DRCTOP);                                    // cdq
1850                     emit_mov_m64_r64(REG_ESI, REGADDR(RDREG), REG_EDX, REG_EAX);   // mov  [rdreg],edx:eax
1851                  }
1852                  else
1853                     emit_zero_m64(REG_ESI, REGADDR(RDREG));
1854               }
1855               return RECOMPILE_SUCCESSFUL_CP(3,4);
1856         }
1857#endif
1858         return FALSE;
2009static int emit_fixed_half_read(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 destreg, int is_unsigned, offs_t address)
2010{
2011   void *fastram = fastram_ptr(address & ~1, 2, FALSE);
18592012
1860      case 0x20:   /* LB */
1861         if (RSREG != 0)
1862         {
1863            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
1864            if (SIMMVAL != 0)
1865               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
1866         }
1867         else
1868            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
1869         emit_call(DRCTOP, mips3.drcdata->general.read_byte_signed);                  // call general.read_byte_signed
1870         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1871         if (RTREG != 0)
1872            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1873         return TRUE;
2013   /* if we can't do fast RAM, we need to make the call */
2014   if (fastram == NULL)
2015   {
2016      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~1);                              // mov  p1,address & ~1
2017      if (is_unsigned)
2018         emit_call(DRCTOP, mips3.drcdata->general.read_half_unsigned);               // call read_half_unsigned
2019      else
2020         emit_call(DRCTOP, mips3.drcdata->general.read_half_signed);                  // call read_half_signed
18742021
1875      case 0x21:   /* LH */
1876         if (RSREG != 0)
1877         {
1878            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
1879            if (SIMMVAL != 0)
1880               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
1881         }
1882         else
1883            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
1884         emit_call(DRCTOP, mips3.drcdata->general.read_word_signed);                  // call general.read_word_signed
1885         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1886         if (RTREG != 0)
1887            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1888         return TRUE;
2022      /* handle exceptions */
2023      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2024      if (destreg != REG_RAX)
2025         emit_mov_r64_r64(DRCTOP, destreg, REG_RAX);                              // mov  <rt>,rax
2026   }
18892027
1890      case 0x22:   /* LWL */
1891         if (RSREG != 0)
1892         {
1893            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1894            if (SIMMVAL != 0)
1895               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
1896         }
1897         else
1898            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
1899         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
1900         emit_or_r32_imm(DRCTOP, REG_P2, -1);                                 // or   p2,-1
1901         if (!mips3.core->bigendian)
1902            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
1903         emit_and_r32_imm(DRCTOP, REG_EAX, ~3);                                 // and  eax,~3
1904         emit_shr_r32_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
1905         emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);               // mov  [sp+savecl],cl
1906         emit_not_r32(DRCTOP, REG_P2);                                       // not  p2
1907         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
1908         emit_call(DRCTOP, mips3.drcdata->general.read_long_masked);                  // call general.read_long_masked
1909         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1910         if (RTREG != 0)
1911         {
1912            emit_mov_r8_m8(DRCTOP, REG_CL, MBD(REG_RSP, SPOFFS_SAVECL));            // mov  cl,[sp+savecl]
1913            emit_or_r32_imm(DRCTOP, REG_P2, -1);                              // or   p2,-1
1914            emit_shl_r32_cl(DRCTOP, REG_P2);                                 // shl  p2,cl
1915            emit_not_r32(DRCTOP, REG_P2);                                    // not  p2
1916            emit_shl_r32_cl(DRCTOP, REG_EAX);                                 // shl  eax,cl
1917            emit_and_r32_m32(DRCTOP, REG_P2, REGADDR(RTREG));                     // and  p2,[rtreg]
1918            emit_or_r32_r32(DRCTOP, REG_EAX, REG_P2);                           // or   eax,p2
1919            emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                        // movsxd rax,eax
1920            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1921         }
1922         return TRUE;
2028   /* if we can do fastram, emit the right form */
2029   else
2030   {
2031      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2032      int raxrel = ((INT32)fastdisp != fastdisp);
19232033
1924      case 0x23:   /* LW */
1925         if (RSREG != 0)
1926         {
1927            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
1928            if (SIMMVAL != 0)
1929               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
1930         }
2034      /* read rax-relative */
2035      if (raxrel)
2036      {
2037         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                        // mov  rax,fastram
2038         if (is_unsigned)
2039            emit_movzx_r64_m16(DRCTOP, destreg, MBD(REG_RAX, 0));                  // movzx destreg,word ptr [rax]
19312040         else
1932            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
1933         emit_call(DRCTOP, mips3.drcdata->general.read_long_signed);                  // call general.read_long_signed
1934         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1935         if (RTREG != 0)
1936            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1937         return TRUE;
2041            emit_movsx_r64_m16(DRCTOP, destreg, MBD(REG_RAX, 0));                  // movsx destreg,word ptr [rax]
2042      }
19382043
1939      case 0x24:   /* LBU */
1940         if (RSREG != 0)
1941         {
1942            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
1943            if (SIMMVAL != 0)
1944               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
1945         }
2044      /* read drc-relative */
2045      else
2046      {
2047         if (is_unsigned)
2048            emit_movzx_r64_m16(DRCTOP, destreg, MDRC(fastram));                     // movzx destreg,word ptr [p1 + adjbase]
19462049         else
1947            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
1948         emit_call(DRCTOP, mips3.drcdata->general.read_byte_unsigned);               // call general.read_byte_unsigned
1949         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1950         if (RTREG != 0)
1951            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1952         return TRUE;
2050            emit_movsx_r64_m16(DRCTOP, destreg, MDRC(fastram));                     // movsx destreg,word ptr [p1 + adjbase]
2051      }
2052   }
2053   return (fastram != NULL);
2054}
19532055
1954      case 0x25:   /* LHU */
1955         if (RSREG != 0)
1956         {
1957            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
1958            if (SIMMVAL != 0)
1959               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
1960         }
1961         else
1962            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
1963         emit_call(DRCTOP, mips3.drcdata->general.read_word_unsigned);               // call general.read_word_unsigned
1964         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1965         if (RTREG != 0)
1966            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
1967         return TRUE;
19682056
1969      case 0x26:   /* LWR */
1970         if (RSREG != 0)
1971         {
1972            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
1973            if (SIMMVAL != 0)
1974               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
1975         }
1976         else
1977            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
1978         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
1979         emit_or_r32_imm(DRCTOP, REG_P2, -1);                                 // or   p2,-1
1980         if (mips3.core->bigendian)
1981            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
1982         emit_and_r32_imm(DRCTOP, REG_EAX, ~3);                                 // and  eax,~3
1983         emit_shl_r32_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
1984         emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);               // mov  [sp+32],savecl
1985         emit_not_r32(DRCTOP, REG_P2);                                       // not  p2
1986         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
1987         emit_call(DRCTOP, mips3.drcdata->general.read_long_masked);                  // call general.read_long_masked
1988         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
1989         if (RTREG != 0)
1990         {
1991            emit_mov_r8_m8(DRCTOP, REG_CL, MBD(REG_RSP, SPOFFS_SAVECL));            // mov  cl,[sp+savecl]
1992            emit_or_r32_imm(DRCTOP, REG_P2, -1);                              // or   p2,-1
1993            emit_shr_r32_cl(DRCTOP, REG_P2);                                 // shr  p2,cl
1994            emit_not_r32(DRCTOP, REG_P2);                                    // not  p2
1995            emit_shr_r32_cl(DRCTOP, REG_EAX);                                 // shr  eax,cl
1996            emit_and_r32_m32(DRCTOP, REG_P2, REGADDR(RTREG));                     // and  p2,[rtreg]
1997            emit_or_r32_r32(DRCTOP, REG_EAX, REG_P2);                           // or   eax,p2
1998            emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                        // movsxd rax,eax
1999            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
2000         }
2001         return TRUE;
2057/*------------------------------------------------------------------
2058    emit_fixed_word_read
2059------------------------------------------------------------------*/
20022060
2003      case 0x27:   /* LWU */
2004         if (RSREG != 0)
2005         {
2006            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2007            if (SIMMVAL != 0)
2008               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2009         }
2010         else
2011            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2012         emit_call(DRCTOP, mips3.drcdata->general.read_long_unsigned);               // call general.read_long_unsigned
2013         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2014         if (RTREG != 0)
2015            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
2016         return TRUE;
2061static int emit_fixed_word_read(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 destreg, int is_unsigned, offs_t address, UINT32 mask)
2062{
2063   void *fastram = fastram_ptr(address & ~3, 4, FALSE);
20172064
2018      case 0x28:   /* SB */
2019         if (RSREG != 0)
2020         {
2021            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2022            if (SIMMVAL != 0)
2023               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2024         }
2025         else
2026            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2027         if (RTREG != 0)
2028            emit_movzx_r64_m8(DRCTOP, REG_P2, REGADDR(RTREG));                     // movzx p2,byte ptr [rtreg]
2029         else
2030            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2031         emit_call(DRCTOP, mips3.drcdata->general.write_byte);                     // call general.write_byte
2032         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2033         return TRUE;
2065   /* if we can't do fast RAM, we need to make the call */
2066   if (fastram == NULL)
2067   {
2068      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~3);                              // mov  p1,address & ~3
2069      if (mask != 0)
2070      {
2071         emit_mov_r32_imm(DRCTOP, REG_P2, (INT32)mask);                           // mov  p2,mask
2072         emit_call(DRCTOP, mips3.drcdata->general.read_word_masked);                  // call read_word_masked
2073      }
2074      else if (is_unsigned)
2075         emit_call(DRCTOP, mips3.drcdata->general.read_word_unsigned);               // call read_word_unsigned
2076      else
2077         emit_call(DRCTOP, mips3.drcdata->general.read_word_signed);                  // call read_word_signed
20342078
2035      case 0x29:   /* SH */
2036         if (RSREG != 0)
2037         {
2038            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2039            if (SIMMVAL != 0)
2040               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2041         }
2042         else
2043            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2044         if (RTREG != 0)
2045            emit_movzx_r64_m16(DRCTOP, REG_P2, REGADDR(RTREG));                     // movzx p2,word ptr [rtreg]
2046         else
2047            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2048         emit_call(DRCTOP, mips3.drcdata->general.write_word);                     // call general.write_word
2049         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2050         return TRUE;
2079      /* handle exceptions */
2080      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2081      if (destreg != REG_RAX)
2082         emit_mov_r64_r64(DRCTOP, destreg, REG_RAX);                              // mov  <rt>,rax
2083   }
20512084
2052      case 0x2a:   /* SWL */
2053         if (RSREG != 0)
2054         {
2055            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2056            if (SIMMVAL != 0)
2057               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
2058         }
2059         else
2060            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
2061         emit_or_r32_imm(DRCTOP, REG_P3, -1);                                 // or   p3,-1
2062         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
2063         if (RTREG != 0)
2064            emit_mov_r32_m32(DRCTOP, REG_P2, REGADDR(RTREG));                     // mov  p2,[rtreg]
2065         else
2066            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2067         if (!mips3.core->bigendian)
2068            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
2069         emit_and_r32_imm(DRCTOP, REG_EAX, ~3);                                 // and  eax,~3
2070         emit_shr_r32_cl(DRCTOP, REG_P3);                                    // shr  p3,cl
2071         emit_shr_r32_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
2072         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
2073         emit_not_r32(DRCTOP, REG_P3);                                       // not  p3
2074         emit_call(DRCTOP, mips3.drcdata->general.write_long_masked);               // call general.write_long_masked
2075         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2076         return TRUE;
2085   /* if we can do fastram, emit the right form */
2086   else
2087   {
2088      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2089      int raxrel = ((INT32)fastdisp != fastdisp);
20772090
2078      case 0x2b:   /* SW */
2079         if (RSREG != 0)
2080         {
2081            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2082            if (SIMMVAL != 0)
2083               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2084         }
2091      /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
2092      if (raxrel)
2093      {
2094         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                        // mov  rax,fastram
2095         if (is_unsigned)
2096            emit_mov_r32_m32(DRCTOP, destreg, MBD(REG_RAX, 0));                     // mov   destreg,word ptr [rax]
20852097         else
2086            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2087         if (RTREG != 0)
2088            emit_mov_r32_m32(DRCTOP, REG_P2, REGADDR(RTREG));                     // mov  p2,[rtreg]
2089         else
2090            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2091         emit_call(DRCTOP, mips3.drcdata->general.write_long);                     // call general.write_long
2092         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2093         return TRUE;
2098            emit_movsxd_r64_m32(DRCTOP, destreg, MBD(REG_RAX, 0));                  // movsxd destreg,dword ptr [rax]
2099      }
20942100
2095      case 0x2c:   /* SDL */
2096         if (RSREG != 0)
2097         {
2098            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2099            if (SIMMVAL != 0)
2100               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
2101         }
2101      /* read drc-relative */
2102      else
2103      {
2104         if (is_unsigned)
2105            emit_mov_r32_m32(DRCTOP, destreg, MDRC(fastram));                     // mov   destreg,word ptr [p1 + adjbase]
21022106         else
2103            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
2104         emit_or_r64_imm(DRCTOP, REG_P3, -1);                                 // or   p3,-1
2105         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
2106         if (RTREG != 0)
2107            emit_mov_r64_m64(DRCTOP, REG_P2, REGADDR(RTREG));                     // mov  p2,[rtreg]
2108         else
2109            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2110         if (!mips3.core->bigendian)
2111            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x38);                           // xor  ecx,0x38
2112         emit_and_r32_imm(DRCTOP, REG_EAX, ~7);                                 // and  eax,~7
2113         emit_shr_r64_cl(DRCTOP, REG_P3);                                    // shr  p3,cl
2114         emit_shr_r64_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
2115         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
2116         emit_not_r64(DRCTOP, REG_P3);                                       // not  p3
2117         emit_call(DRCTOP, mips3.drcdata->general.write_double_masked);               // call general.write_double_masked
2118         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2119         return TRUE;
2107            emit_movsxd_r64_m32(DRCTOP, destreg, MDRC(fastram));                  // movsxd destreg,dword ptr [p1 + adjbase]
2108      }
2109   }
2110   return (fastram != NULL);
2111}
21202112
2121      case 0x2d:   /* SDR */
2122         if (RSREG != 0)
2123         {
2124            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2125            if (SIMMVAL != 0)
2126               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
2127         }
2128         else
2129            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
2130         emit_or_r64_imm(DRCTOP, REG_P3, -1);                                 // or   p3,-1
2131         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
2132         if (RTREG != 0)
2133            emit_mov_r64_m64(DRCTOP, REG_P2, REGADDR(RTREG));                     // mov  p2,[rtreg]
2134         else
2135            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2136         if (mips3.core->bigendian)
2137            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x38);                           // xor  ecx,0x38
2138         emit_and_r32_imm(DRCTOP, REG_EAX, ~7);                                 // and  eax,~7
2139         emit_shl_r64_cl(DRCTOP, REG_P3);                                    // shl  p3,cl
2140         emit_shl_r64_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
2141         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
2142         emit_not_r64(DRCTOP, REG_P3);                                       // not  p3
2143         emit_call(DRCTOP, mips3.drcdata->general.write_double_masked);               // call general.write_double_masked
2144         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2145         return TRUE;
21462113
2147      case 0x2e:   /* SWR */
2148         if (RSREG != 0)
2149         {
2150            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2151            if (SIMMVAL != 0)
2152               emit_add_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                        // add  eax,SIMMVAL
2153         }
2154         else
2155            emit_mov_r32_imm(DRCTOP, REG_EAX, SIMMVAL);                           // mov  eax,SIMMVAL
2156         emit_or_r32_imm(DRCTOP, REG_P3, -1);                                 // or   p3,-1
2157         emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                     // lea  ecx,[rax*8]
2158         if (RTREG != 0)
2159            emit_mov_r32_m32(DRCTOP, REG_P2, REGADDR(RTREG));                     // mov  p2,[rtreg]
2160         else
2161            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2162         if (mips3.core->bigendian)
2163            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
2164         emit_and_r32_imm(DRCTOP, REG_EAX, ~3);                                 // and  eax,~3
2165         emit_shl_r32_cl(DRCTOP, REG_P3);                                    // shl  p3,cl
2166         emit_shl_r32_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
2167         emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                              // mov  p1,eax
2168         emit_not_r32(DRCTOP, REG_P3);                                       // not  p3
2169         emit_call(DRCTOP, mips3.drcdata->general.write_long_masked);               // call general.write_long_masked
2170         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2171         return TRUE;
2114/*------------------------------------------------------------------
2115    emit_fixed_double_read
2116------------------------------------------------------------------*/
21722117
2173      case 0x2f:   /* CACHE */
2174         return TRUE;
2118static int emit_fixed_double_read(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 destreg, offs_t address, UINT64 mask)
2119{
2120   void *fastram = fastram_ptr(address & ~7, 8, FALSE);
21752121
2176//      case 0x30:  /* LL */        logerror("mips3 Unhandled op: LL\n");                                   break;
2122   /* if we can't do fast RAM, we need to make the call */
2123   if (fastram == NULL)
2124   {
2125      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~7);                              // mov  p1,address & ~7
2126      if (mask != 0)
2127      {
2128         emit_mov_r64_imm(DRCTOP, REG_P2, mask);                                 // mov  p2,mask
2129         emit_call(DRCTOP, mips3.drcdata->general.read_double_masked);               // call read_double_masked
2130      }
2131      else
2132         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call read_double
21772133
2178      case 0x31:   /* LWC1 */
2179         if (RSREG != 0)
2180         {
2181            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2182            if (SIMMVAL != 0)
2183               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2184         }
2185         else
2186            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2187         emit_call(DRCTOP, mips3.drcdata->general.read_long_unsigned);               // call general.read_long_unsigned
2188         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2189         emit_mov_m32_r32(DRCTOP, FPR32ADDR(RTREG), REG_EAX);                     // mov  [rtreg],eax
2190         return TRUE;
2134      /* handle exceptions */
2135      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2136      if (destreg != REG_RAX)
2137         emit_mov_r64_r64(DRCTOP, destreg, REG_RAX);                              // mov  <rt>,rax
2138   }
21912139
2192      case 0x32:   /* LWC2 */
2193         if (RSREG != 0)
2194         {
2195            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2196            if (SIMMVAL != 0)
2197               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2198         }
2199         else
2200            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2201         emit_call(DRCTOP, mips3.drcdata->general.read_long_unsigned);               // call general.read_long_unsigned
2202         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2203         emit_mov_m32_r32(DRCTOP, CPR2ADDR(RTREG), REG_EAX);                        // mov  [rtreg],eax
2204         return TRUE;
2140   /* if we can do fastram, emit the right form */
2141   else
2142   {
2143      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2144      int raxrel = ((INT32)fastdisp != fastdisp);
22052145
2206      case 0x33:   /* PREF */
2207         return TRUE;
2146      /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
2147      if (raxrel)
2148      {
2149         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                        // mov  rax,fastram
2150         emit_mov_r64_m64(DRCTOP, destreg, MBD(REG_RAX, 0));                        // mov  destreg,[rax]
2151      }
22082152
2209//      case 0x34:  /* LLD */       logerror("mips3 Unhandled op: LLD\n");                                  break;
2153      /* read drc-relative */
2154      else
2155         emit_mov_r64_m64(DRCTOP, destreg, MDRC(fastram));                        // mov  destreg,[p1 + adjbase]
22102156
2211      case 0x35:   /* LDC1 */
2212         if (RSREG != 0)
2213         {
2214            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2215            if (SIMMVAL != 0)
2216               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2217         }
2218         else
2219            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2220         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
2221         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2222         emit_mov_m64_r64(DRCTOP, FPR64ADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
2223         return TRUE;
2157      /* adjust for endianness */
2158      if (mips3.core->bigendian)
2159         emit_ror_r64_imm(DRCTOP, destreg, 32);                                 // ror  destreg,32
2160   }
2161   return (fastram != NULL);
2162}
22242163
2225      case 0x36:   /* LDC2 */
2226         if (RSREG != 0)
2227         {
2228            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2229            if (SIMMVAL != 0)
2230               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2231         }
2232         else
2233            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2234         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
2235         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2236         emit_mov_m64_r64(DRCTOP, CPR2ADDR(RTREG), REG_RAX);                        // mov  [rtreg],rax
2237         return TRUE;
22382164
2239      case 0x37:   /* LD */
2240         if (RSREG != 0)
2241         {
2242            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2243            if (SIMMVAL != 0)
2244               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2245         }
2246         else
2247            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2248         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
2249         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
2250         if (RTREG != 0)
2251            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
2252         return TRUE;
2165/*------------------------------------------------------------------
2166    emit_fixed_byte_write
2167------------------------------------------------------------------*/
22532168
2254//      case 0x38:  /* SC */        logerror("mips3 Unhandled op: SC\n");                                   break;
2169static int emit_fixed_byte_write(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, mipsreg_state srcreg, offs_t address)
2170{
2171   void *fastram = fastram_ptr(address, 1, TRUE);
22552172
2256      case 0x39:   /* SWC1 */
2257         if (RSREG != 0)
2258         {
2259            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2260            if (SIMMVAL != 0)
2261               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2262         }
2173   assert(ISCONST(srcreg) || X86REG(srcreg != REG_P1));
2174
2175   /* if we can't do fast RAM, we need to make the call */
2176   if (fastram == NULL)
2177   {
2178      emit_mov_r32_imm(DRCTOP, REG_P1, address);                                 // mov  p1,address
2179      if (ISCONST(srcreg))
2180         emit_mov_r64_imm(DRCTOP, REG_P2, CONSTVAL(srcreg));                        // mov  p2,<srcreg>
2181      else if (X86REG(srcreg) != REG_P2)
2182         emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                        // mov  p2,<srcreg>
2183      emit_call(DRCTOP, mips3.drcdata->general.write_byte);                        // call write_byte
2184
2185      /* handle exceptions */
2186      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2187   }
2188
2189   /* if we can do fastram, emit the right form */
2190   else
2191   {
2192      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2193      int raxrel = ((INT32)fastdisp != fastdisp);
2194
2195      /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
2196      if (raxrel)
2197      {
2198         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                        // mov  rax,fastram
2199         if (ISCONST(srcreg))
2200            emit_mov_m8_imm(DRCTOP, MBD(REG_RAX, 0), CONSTVAL(srcreg));               // mov  [rax],constval
22632201         else
2264            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2265         emit_mov_r32_m32(DRCTOP, REG_P2, FPR32ADDR(RTREG));                        // mov  p2,[rtreg]
2266         emit_call(DRCTOP, mips3.drcdata->general.write_long);                     // call general.write_long
2267         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2268         return TRUE;
2202            emit_mov_m8_r8(DRCTOP, MBD(REG_RAX, 0), X86REG(srcreg));               // mov  [rax],<srcreg>
2203      }
22692204
2270      case 0x3a:   /* SWC2 */
2271         if (RSREG != 0)
2272         {
2273            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2274            if (SIMMVAL != 0)
2275               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2276         }
2205      /* write drc-relative */
2206      else
2207      {
2208         if (ISCONST(srcreg))
2209            emit_mov_m8_imm(DRCTOP, MDRC(fastram), CONSTVAL(srcreg));               // mov  [fastram],constval
22772210         else
2278            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2279         emit_mov_r32_m32(DRCTOP, REG_P2, CPR2ADDR(RTREG));                        // mov  p2,[rtreg]
2280         emit_call(DRCTOP, mips3.drcdata->general.write_long);                     // call general.write_long
2281         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2282         return TRUE;
2211            emit_mov_m8_r8(DRCTOP, MDRC(fastram), X86REG(srcreg));                  // mov  [fastram],srcreg
2212      }
2213   }
2214   return (fastram != NULL);
2215}
22832216
2284//      case 0x3b:  /* SWC3 */      invalid_instruction(op);                                                break;
2285//      case 0x3c:  /* SCD */       logerror("mips3 Unhandled op: SCD\n");                                  break;
22862217
2287      case 0x3d:   /* SDC1 */
2288         if (RSREG != 0)
2289         {
2290            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2291            if (SIMMVAL != 0)
2292               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2293         }
2294         else
2295            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2296         emit_mov_r64_m64(DRCTOP, REG_P2, FPR64ADDR(RTREG));                        // mov  p2,[rtreg]
2297         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call general.write_double
2298         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2299         return TRUE;
2218/*------------------------------------------------------------------
2219    emit_fixed_half_write
2220------------------------------------------------------------------*/
23002221
2301      case 0x3e:   /* SDC2 */
2302         if (RSREG != 0)
2303         {
2304            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2305            if (SIMMVAL != 0)
2306               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2307         }
2222static int emit_fixed_half_write(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, mipsreg_state srcreg, offs_t address)
2223{
2224   void *fastram = fastram_ptr(address & ~1, 2, TRUE);
2225
2226   assert(ISCONST(srcreg) || X86REG(srcreg) != REG_P1);
2227
2228   /* if we can't do fast RAM, we need to make the call */
2229   if (fastram == NULL)
2230   {
2231      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~1);                              // mov  p1,address & ~1
2232      if (ISCONST(srcreg))
2233         emit_mov_r64_imm(DRCTOP, REG_P2, CONSTVAL(srcreg));                        // mov  p2,constval
2234      else if (X86REG(srcreg) != REG_P2)
2235         emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                        // mov  p2,srcreg
2236      emit_call(DRCTOP, mips3.drcdata->general.write_half);                        // call write_half
2237
2238      /* handle exceptions */
2239      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2240   }
2241
2242   /* if we can do fastram, emit the right form */
2243   else
2244   {
2245      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2246      int raxrel = ((INT32)fastdisp != fastdisp);
2247
2248      /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
2249      if (raxrel)
2250      {
2251         emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                        // mov  rax,fastram
2252         if (ISCONST(srcreg))
2253            emit_mov_m16_imm(DRCTOP, MBD(REG_RAX, 0), CONSTVAL(srcreg));            // mov  [rax],constval
23082254         else
2309            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2310         emit_mov_r64_m64(DRCTOP, REG_P2, CPR2ADDR(RTREG));                        // mov  p2,[rtreg]
2311         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call general.write_double
2312         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2313         return TRUE;
2255            emit_mov_m16_r16(DRCTOP, MBD(REG_RAX, 0), X86REG(srcreg));               // mov  [rax],srcreg
2256      }
23142257
2315      case 0x3f:   /* SD */
2316         if (RSREG != 0)
2317         {
2318            emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                     // mov  p1,[rsreg]
2319            if (SIMMVAL != 0)
2320               emit_add_r32_imm(DRCTOP, REG_P1, SIMMVAL);                        // add  p1,SIMMVAL
2321         }
2258      /* write drc-relative */
2259      else
2260      {
2261         if (ISCONST(srcreg))
2262            emit_mov_m16_imm(DRCTOP, MDRC(fastram), CONSTVAL(srcreg));               // mov  [fastram],constval
23222263         else
2323            emit_mov_r32_imm(DRCTOP, REG_P1, SIMMVAL);                           // mov  p1,SIMMVAL
2324         if (RTREG != 0)
2325            emit_mov_r64_m64(DRCTOP, REG_P2, REGADDR(RTREG));                     // mov  p2,[rtreg]
2326         else
2327            emit_xor_r32_r32(DRCTOP, REG_P2, REG_P2);                           // xor  p2,p2
2328         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call general.write_double
2329         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2330         return TRUE;
2331
2332//      default:    /* ??? */       invalid_instruction(op);                                                break;
2264            emit_mov_m16_r16(DRCTOP, MDRC(fastram), X86REG(srcreg));               // mov  [fastram],srcreg
2265      }
23332266   }
2334
2335   return FALSE;
2267   return (fastram != NULL);
23362268}
23372269
23382270
23392271/*------------------------------------------------------------------
2340    recompile_special
2272    emit_fixed_word_write
23412273------------------------------------------------------------------*/
23422274
2343static int recompile_special1(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
2275static int emit_fixed_word_write(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, mipsreg_state srcreg, offs_t address, UINT32 mask)
23442276{
2345   UINT32 op = *desc->opptr;
2346   emit_link link1;
2277   void *fastram = fastram_ptr(address & ~3, 4, TRUE);
23472278
2348   switch (op & 63)
2279   assert(ISCONST(srcreg) || X86REG(srcreg) != REG_P1);
2280   assert(ISCONST(srcreg) || X86REG(srcreg) != REG_P3);
2281
2282   /* if we can't do fast RAM, we need to make the call */
2283   if (fastram == NULL)
23492284   {
2350      case 0x00:   /* SLL - MIPS I */
2351         if (RDREG != 0)
2352         {
2353            if (RTREG != 0)
2354            {
2355               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // mov  eax,[rtreg]
2356               if (SHIFT != 0)
2357                  emit_shl_r32_imm(DRCTOP, REG_EAX, SHIFT);                     // shl  eax,SHIFT
2358               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2359               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2360            }
2361            else
2362               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2363         }
2364         return TRUE;
2285      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~3);                              // mov  p1,address & ~3
2286      if (ISCONST(srcreg))
2287         emit_mov_r64_imm(DRCTOP, REG_P2, CONSTVAL(srcreg));                        // mov  p2,constval
2288      else if (X86REG(srcreg) != REG_P2)
2289         emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                        // mov  p2,srcreg
2290      if (mask == 0)
2291         emit_call(DRCTOP, mips3.drcdata->general.write_word);                     // call write_word
2292      else
2293      {
2294         emit_mov_r32_imm(DRCTOP, REG_P3, mask);                                 // mov  p3,mask
2295         emit_call(DRCTOP, mips3.drcdata->general.write_word_masked);               // call write_word_masked
2296      }
23652297
2366      case 0x01:   /* MOVF - MIPS IV */
2367         emit_cmp_m8_imm(DRCTOP, CF1ADDR((op >> 18) & 7), 0);                     // cmp  fcc[x],0
2368         emit_jcc_short_link(DRCTOP, ((op >> 16) & 1) ? COND_Z : COND_NZ, &link1);      // jz/nz skip
2369         emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                        // mov  rax,[rsreg]
2370         emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                        // mov  [rdreg],rax
2371         resolve_link(DRCTOP, &link1);                                    // skip:
2372         return TRUE;
2298      /* handle exceptions */
2299      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2300   }
23732301
2374      case 0x02:   /* SRL - MIPS I */
2375         if (RDREG != 0)
2376         {
2377            if (RTREG != 0)
2378            {
2379               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // mov  eax,[rtreg]
2380               if (SHIFT != 0)
2381                  emit_shr_r32_imm(DRCTOP, REG_EAX, SHIFT);                     // shr  eax,SHIFT
2382               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2383               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2384            }
2385            else
2386               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2387         }
2388         return TRUE;
2302   /* if we can do fastram, emit the right form */
2303   else
2304   {
2305      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2306      int raxrel = ((INT32)fastdisp != fastdisp);
23892307
2390      case 0x03:   /* SRA - MIPS I */
2391         if (RDREG != 0)
2308      /* non-masked case */
2309      if (mask == 0)
2310      {
2311         /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
2312         if (raxrel)
23922313         {
2393            if (RTREG != 0)
2394            {
2395               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // mov  eax,[rtreg]
2396               if (SHIFT != 0)
2397                  emit_sar_r32_imm(DRCTOP, REG_EAX, SHIFT);                     // sar  eax,SHIFT
2398               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2399               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2400            }
2314            emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                     // mov  rax,fastram
2315            if (ISCONST(srcreg))
2316               emit_mov_m32_imm(DRCTOP, MBD(REG_RAX, 0), CONSTVAL(srcreg));         // mov  [rax],constval
24012317            else
2402               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2318               emit_mov_m32_r32(DRCTOP, MBD(REG_RAX, 0), X86REG(srcreg));            // mov  [rax],srcreg
24032319         }
2404         return TRUE;
24052320
2406      case 0x04:   /* SLLV - MIPS I */
2407         if (RDREG != 0)
2321         /* write drc-relative */
2322         else
24082323         {
2409            if (RTREG != 0)
2410            {
2411               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // mov  eax,[rtreg]
2412               if (RSREG != 0)
2413               {
2414                  emit_mov_r8_m8(DRCTOP, REG_CL, REGADDR(RSREG));                  // mov  cl,[rsreg]
2415                  emit_shl_r32_cl(DRCTOP, REG_EAX);                           // shl  eax,cl
2416               }
2417               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2418               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2419            }
2324            if (ISCONST(srcreg))
2325               emit_mov_m32_imm(DRCTOP, MDRC(fastram), CONSTVAL(srcreg));            // mov  [fastram],constval
24202326            else
2421               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2327               emit_mov_m32_r32(DRCTOP, MDRC(fastram), X86REG(srcreg));            // mov  [fastram],srcreg
24222328         }
2423         return TRUE;
2329      }
24242330
2425      case 0x06:   /* SRLV - MIPS I */
2426         if (RDREG != 0)
2427         {
2428            if (RTREG != 0)
2429            {
2430               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // mov  eax,[rtreg]
2431               if (RSREG != 0)
2432               {
2433                  emit_mov_r8_m8(DRCTOP, REG_CL, REGADDR(RSREG));                  // mov  cl,[rsreg]
2434                  emit_shr_r32_cl(DRCTOP, REG_EAX);                           // shr  eax,cl
2435               }
2436               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2437               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2438            }
2439            else
2440               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2441         }
2442         return TRUE;
2331      /* masked case */
2332      else
2333      {
2334         if (raxrel)
2335            emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                     // mov  rax,fastram
2336         else
2337            emit_lea_r64_m64(DRCTOP, REG_RAX, MDRC(fastram));                     // lea   rax,[fastram]
24432338
2444      case 0x07:   /* SRAV - MIPS I */
2445         if (RDREG != 0)
2339         /* always write rax-relative */
2340         if (ISCONST(srcreg))
24462341         {
2447            if (RTREG != 0)
2448            {
2449               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // mov  eax,[rtreg]
2450               if (RSREG != 0)
2451               {
2452                  emit_mov_r8_m8(DRCTOP, REG_CL, REGADDR(RSREG));                  // mov  cl,[rsreg]
2453                  emit_sar_r32_cl(DRCTOP, REG_EAX);                           // sar  eax,cl
2454               }
2455               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2456               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2457            }
2458            else
2459               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2342            emit_mov_r32_m32(DRCTOP, REG_P2, MBD(REG_RAX, 0));                     // mov  p2,[rax]
2343            emit_and_r32_imm(DRCTOP, REG_P2, mask);                              // and  p2,mask
2344            emit_or_r32_imm(DRCTOP, REG_P2, CONSTVAL(srcreg) & ~mask);               // or   p2,constval & ~mask
2345            emit_mov_m32_r32(DRCTOP, MBD(REG_RAX, 0), REG_P2);                     // mov  [rax],p2
24602346         }
2461         return TRUE;
2462
2463      case 0x08:   /* JR - MIPS I */
2464         assert(desc->delay != NULL);
2465         emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                        // mov  eax,[rsreg]
2466         emit_mov_m32_r32(DRCTOP, MBD(REG_RSP, SPOFFS_NEXTPC), REG_EAX);               // mov  [esp+nextpc],eax
2467         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
2468         return TRUE;
2469
2470      case 0x09:   /* JALR - MIPS I */
2471         assert(desc->delay != NULL);
2472         emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                        // mov  eax,[rsreg]
2473         emit_mov_m32_r32(DRCTOP, MBD(REG_RSP, SPOFFS_NEXTPC), REG_EAX);               // mov  [esp+nextpc],eax
2474         if (RDREG != 0)
2475            emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), (INT32)(desc->pc + 8));         // mov  [rdreg],pc + 8
2476         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
2477         return TRUE;
2478
2479      case 0x0a:   /* MOVZ - MIPS IV */
2480         if (RDREG != 0)
2347         else
24812348         {
2482            if (RTREG != 0)
2483            {
2484               emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // cmp  [rtreg],0
2485               emit_jcc_short_link(DRCTOP, COND_NE, &link1);                     // jne  skip
2486            }
2487            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
2488            emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                     // mov  [rdreg],rax
2489            if (RTREG != 0)
2490               resolve_link(DRCTOP, &link1);                              // skip:
2349            emit_mov_r32_m32(DRCTOP, REG_P3, MBD(REG_RAX, 0));                     // mov  p3,[rax]
2350            if (X86REG(srcreg) != REG_P2)
2351               emit_mov_r32_r32(DRCTOP, REG_P2, X86REG(srcreg));                  // mov  p2,srcreg
2352            emit_and_r32_imm(DRCTOP, REG_P3, mask);                              // and  p3,mask
2353            emit_and_r32_imm(DRCTOP, REG_P2, ~mask);                           // and  p2,~mask
2354            emit_or_r32_r32(DRCTOP, REG_P3, REG_P2);                           // or   p3,p2
2355            emit_mov_m32_r32(DRCTOP, MBD(REG_RAX, 0), REG_P3);                     // mov  [rax],p3
24912356         }
2492         return TRUE;
2357      }
2358   }
2359   return (fastram != NULL);
2360}
24932361
2494      case 0x0b:   /* MOVN - MIPS IV */
2495         if (RDREG != 0 && RTREG != 0)
2496         {
2497            emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                        // cmp  [rtreg],0
2498            emit_jcc_short_link(DRCTOP, COND_E, &link1);                        // je   skip
2499            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
2500            emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                     // mov  [rdreg],rax
2501            resolve_link(DRCTOP, &link1);                                 // skip:
2502         }
2503         return TRUE;
25042362
2505      case 0x0c:   /* SYSCALL - MIPS I */
2506         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_syscall_exception);
2507                                                                     // jmp  generate_syscall_exception
2508         return TRUE;
2363/*------------------------------------------------------------------
2364    emit_fixed_double_write
2365------------------------------------------------------------------*/
25092366
2510      case 0x0d:   /* BREAK - MIPS I */
2511         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_break_exception);
2512                                                                     // jmp  generate_break_exception
2513         return TRUE;
2367static int emit_fixed_double_write(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, mipsreg_state srcreg, offs_t address, UINT64 mask)
2368{
2369   void *fastram = fastram_ptr(address & ~7, 8, TRUE);
25142370
2515      case 0x0f:   /* SYNC - MIPS II */
2516         return TRUE;
2371   assert(ISCONST(srcreg) || X86REG(srcreg) != REG_P1);
2372   assert(ISCONST(srcreg) || X86REG(srcreg) != REG_P3);
2373   assert((INT32)CONSTVAL(srcreg) == (INT64)CONSTVAL(srcreg));
25172374
2518      case 0x10:   /* MFHI - MIPS I */
2519         if (RDREG != 0)
2520         {
2521            emit_mov_r64_m64(DRCTOP, REG_RAX, HIADDR);                           // mov  rax,[hi]
2522            emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                     // mov  [rdreg],rax
2523         }
2524         return TRUE;
2375   /* if we can't do fast RAM, we need to make the call */
2376   if (fastram == NULL)
2377   {
2378      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~7);                              // mov  p1,address & ~7
2379      if (ISCONST(srcreg))
2380         emit_mov_r64_imm(DRCTOP, REG_P2, CONSTVAL(srcreg));                        // mov  p2,constval
2381      else if (X86REG(srcreg) != REG_P2)
2382         emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                        // mov  p2,srcreg
2383      if (mask == 0)
2384         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call write_double
2385      else
2386      {
2387         emit_mov_r64_imm(DRCTOP, REG_P3, mask);                                 // mov  p3,mask
2388         emit_call(DRCTOP, mips3.drcdata->general.write_double_masked);               // call write_double_masked
2389      }
25252390
2526      case 0x11:   /* MTHI - MIPS I */
2527         if (RSREG != 0)
2528         {
2529            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
2530            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RAX);                           // mov  [hi],rax
2531         }
2532         else
2533            emit_mov_m64_imm(DRCTOP, HIADDR, 0);                              // mov  [hi],0
2534         return TRUE;
2391      /* handle exceptions */
2392      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
2393   }
25352394
2536      case 0x12:   /* MFLO - MIPS I */
2537         if (RDREG != 0)
2538         {
2539            emit_mov_r64_m64(DRCTOP, REG_RAX, LOADDR);                           // mov  rax,[lo]
2540            emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                     // mov  [rdreg],rax
2541         }
2542         return TRUE;
2395   /* if we can do fastram, emit the right form */
2396   else
2397   {
2398      INT64 fastdisp = (UINT8 *)fastram - (UINT8 *)drc->baseptr;
2399      int raxrel = ((INT32)fastdisp != fastdisp);
2400      INT64 constval = CONSTVAL(srcreg);
25432401
2544      case 0x13:   /* MTLO - MIPS I */
2545         if (RSREG != 0)
2546         {
2547            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
2548            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2549         }
2402      /* adjust values for endianness */
2403      if (mips3.core->bigendian)
2404      {
2405         if (ISCONST(srcreg))
2406            constval = (constval << 32) | (constval >> 32);
25502407         else
2551            emit_mov_m64_imm(DRCTOP, LOADDR, 0);                              // mov  [lo],0
2552         return TRUE;
2553
2554      case 0x14:   /* DSLLV - MIPS III */
2555         if (RDREG != 0)
25562408         {
2557            if (RTREG != 0)
2558            {
2559               if (RSREG != 0)
2560               {
2561                  emit_mov_r8_m8(DRCTOP, REG_CL, REGADDR(RSREG));                  // mov  cl,[rsreg]
2562                  if (RTREG == RDREG)
2563                     emit_shl_m64_cl(DRCTOP, REGADDR(RDREG));                  // shl  [rdreg],cl
2564                  else
2565                  {
2566                     emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));            // mov  rax,[rtreg]
2567                     emit_shl_r64_cl(DRCTOP, REG_RAX);                        // shl  rax,cl
2568                     emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);            // mov  [rdreg],rax
2569                  }
2570               }
2571               else if (RTREG != RDREG)
2572               {
2573                  emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));               // mov  rax,[rtreg]
2574                  emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);               // mov  [rdreg],rax
2575               }
2576            }
2577            else
2578               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2409            emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                     // mov  p2,srcreg
2410            emit_ror_r64_imm(DRCTOP, REG_P2, 32);                              // ror  p2,32
2411            srcreg = REG_P2;
25792412         }
2580         return TRUE;
2413         mask = (mask << 32) | (mask >> 32);
2414      }
25812415
2582      case 0x16:   /* DSRLV - MIPS III */
2583         if (RDREG != 0)
2416      /* non-masked case */
2417      if (mask == 0)
2418      {
2419         /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
2420         if (raxrel)
25842421         {
2585            if (RTREG != 0)
2586            {
2587               if (RSREG != 0)
2588               {
2589                  emit_mov_r8_m8(DRCTOP, REG_CL, REGADDR(RSREG));                  // mov  cl,[rsreg]
2590                  if (RTREG == RDREG)
2591                     emit_shr_m64_cl(DRCTOP, REGADDR(RDREG));                  // shr  [rdreg],cl
2592                  else
2593                  {
2594                     emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));            // mov  rax,[rtreg]
2595                     emit_shr_r64_cl(DRCTOP, REG_RAX);                        // shr  rax,cl
2596                     emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);            // mov  [rdreg],rax
2597                  }
2598               }
2599               else if (RTREG != RDREG)
2600               {
2601                  emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));               // mov  rax,[rtreg]
2602                  emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);               // mov  [rdreg],rax
2603               }
2604            }
2422            emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                     // mov  rax,fastram
2423            if (ISCONST(srcreg))
2424               emit_mov_m64_imm(DRCTOP, MBD(REG_RAX, 0), constval);               // mov  [rax],constval
26052425            else
2606               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2426               emit_mov_m64_r64(DRCTOP, MBD(REG_RAX, 0), X86REG(srcreg));            // mov  [rax],srcreg
26072427         }
2608         return TRUE;
26092428
2610      case 0x17:   /* DSRAV - MIPS III */
2611         if (RDREG != 0)
2429         /* write drc-relative */
2430         else
26122431         {
2613            if (RTREG != 0)
2614            {
2615               if (RSREG != 0)
2616               {
2617                  emit_mov_r8_m8(DRCTOP, REG_CL, REGADDR(RSREG));                  // mov  cl,[rsreg]
2618                  if (RTREG == RDREG)
2619                     emit_sar_m64_cl(DRCTOP, REGADDR(RDREG));                  // sar  [rdreg],cl
2620                  else
2621                  {
2622                     emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));            // mov  rax,[rtreg]
2623                     emit_sar_r64_cl(DRCTOP, REG_RAX);                        // sar  rax,cl
2624                     emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);            // mov  [rdreg],rax
2625                  }
2626               }
2627               else if (RTREG != RDREG)
2628               {
2629                  emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));               // mov  rax,[rtreg]
2630                  emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);               // mov  [rdreg],rax
2631               }
2632            }
2432            if (ISCONST(srcreg))
2433               emit_mov_m64_imm(DRCTOP, MDRC(fastram), constval);                  // mov  [fastram],constval
26332434            else
2634               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2435               emit_mov_m64_r64(DRCTOP, MDRC(fastram), X86REG(srcreg));                  // mov  [fastram],srcreg
26352436         }
2636         return TRUE;
2437      }
26372438
2638      case 0x18:   /* MULT - MIPS I */
2639         if (RSREG == 0 || RTREG == 0)
2640         {
2641            emit_mov_m64_imm(DRCTOP, HIADDR, 0);                              // mov  [hi],0
2642            emit_mov_m64_imm(DRCTOP, LOADDR, 0);                              // mov  [lo],0
2643         }
2439      /* masked case */
2440      else
2441      {
2442         if (raxrel)
2443            emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                     // mov  rax,fastram
26442444         else
2645         {
2646            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // mov  eax,[rtreg]
2647            emit_imul_m32(DRCTOP, REGADDR(RSREG));                              // imul [rsreg]
2648            emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                        // movsxd rax,eax
2649            emit_movsxd_r64_r32(DRCTOP, REG_RDX, REG_EDX);                        // movsxd rdx,edx
2650            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2651            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2652         }
2653         return TRUE;
2445            emit_lea_r64_m64(DRCTOP, REG_RAX, MDRC(fastram));                     // lea  rax,[fastram]
2446         emit_mov_r64_imm(DRCTOP, REG_P4, mask);                                 // mov  p4,mask
26542447
2655      case 0x19:   /* MULTU - MIPS I */
2656         if (RSREG == 0 || RTREG == 0)
2448         /* always write rax-relative */
2449         if (ISCONST(srcreg))
26572450         {
2658            emit_mov_m64_imm(DRCTOP, HIADDR, 0);                              // mov  [hi],0
2659            emit_mov_m64_imm(DRCTOP, LOADDR, 0);                              // mov  [lo],0
2451            emit_and_r64_m64(DRCTOP, REG_P4, MBD(REG_RAX, 0));                     // and  p4,[rax]
2452            emit_mov_r64_imm(DRCTOP, REG_P3, constval & ~mask);                     // mov  p3,constval & ~mask
2453            emit_or_r64_r64(DRCTOP, REG_P4, REG_P3);                           // or   p4,p3
2454            emit_mov_m64_r64(DRCTOP, MBD(REG_RAX, 0), REG_P4);                     // mov  [rax],p4
26602455         }
26612456         else
26622457         {
2663            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // mov  eax,[rtreg]
2664            emit_mul_m32(DRCTOP, REGADDR(RSREG));                              // mul  [rsreg]
2665            emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                        // movsxd rax,eax
2666            emit_movsxd_r64_r32(DRCTOP, REG_RDX, REG_EDX);                        // movsxd rdx,edx
2667            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2668            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2458            emit_mov_r64_m64(DRCTOP, REG_P3, MBD(REG_RAX, 0));                     // mov  p3,[rax]
2459            if (X86REG(srcreg) != REG_P2)
2460               emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                  // mov  p2,srcreg
2461            emit_and_r64_r64(DRCTOP, REG_P3, REG_P4);                           // and  p3,p4
2462            emit_not_r64(DRCTOP, REG_P4);                                    // not  p4
2463            emit_and_r64_r64(DRCTOP, REG_P2, REG_P4);                           // and  p2,p4
2464            emit_or_r64_r64(DRCTOP, REG_P3, REG_P2);                           // or   p3,p2
2465            emit_mov_m64_r64(DRCTOP, MBD(REG_RAX, 0), REG_P3);                     // mov  [rax],p3
26692466         }
2670         return TRUE;
2467      }
2468   }
2469   return (fastram != NULL);
2470}
26712471
2672      case 0x1a:   /* DIV - MIPS I */
2673         if (RTREG != 0)
2674         {
2675            emit_cmp_m32_imm(DRCTOP, REGADDR(RTREG), 0);                        // cmp  [rtreg],0
2676            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2677            emit_jcc_short_link(DRCTOP, COND_E, &link1);                        // je   skip
2678            emit_cdq(DRCTOP);                                             // cdq
2679            emit_idiv_m32(DRCTOP, REGADDR(RTREG));                              // idiv [rtreg]
2680            emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                        // movsxd rax,eax
2681            emit_movsxd_r64_r32(DRCTOP, REG_RDX, REG_EDX);                        // movsxd rdx,edx
2682            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2683            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2684            resolve_link(DRCTOP, &link1);                                 // skip:
2685         }
2472
2473
2474/***************************************************************************
2475    CORE RECOMPILATION
2476***************************************************************************/
2477
2478/*-------------------------------------------------
2479    compile_instruction - master switch statement
2480    for compiling a given opcode
2481-------------------------------------------------*/
2482
2483static int compile_instruction(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
2484{
2485   UINT32 op = *desc->opptr;
2486   UINT8 opswitch = op >> 26;
2487
2488   switch (opswitch)
2489   {
2490      /* ----- sub-groups ----- */
2491
2492      case 0x00:   /* SPECIAL */
2493         return compile_special(drc, compiler, desc);
2494
2495      case 0x01:   /* REGIMM */
2496         return compile_regimm(drc, compiler, desc);
2497
2498      case 0x1c:   /* IDT-specific */
2499         return compile_idt(drc, compiler, desc);
2500
2501
2502      /* ----- jumps and branches ----- */
2503
2504      case 0x02:   /* J */
2505      case 0x03:   /* JAL */
2506         emit_delay_slot_and_branch(drc, compiler, desc, (opswitch == 0x02) ? 0 : 31);   // <next instruction + redispatch>
26862507         return TRUE;
26872508
2688      case 0x1b:   /* DIVU - MIPS I */
2509      case 0x04:   /* BEQ */
2510      case 0x14:   /* BEQL */
2511      case 0x05:   /* BNE */
2512      case 0x15:   /* BNEL */
2513         return compile_branchcc(drc, compiler, desc, (opswitch & 1) ? COND_NE : COND_E);
2514
2515      case 0x06:   /* BLEZ */
2516      case 0x16:   /* BLEZL */
2517      case 0x07:   /* BGTZ */
2518      case 0x17:   /* BGTZL */
2519         return compile_branchcz(drc, compiler, desc, (opswitch & 1) ? COND_G : COND_LE, FALSE);
2520
2521
2522      /* ----- immediate arithmetic ----- */
2523
2524      case 0x0f:   /* LUI */
26892525         if (RTREG != 0)
2690         {
2691            emit_cmp_m32_imm(DRCTOP, REGADDR(RTREG), 0);                        // cmp  [rtreg],0
2692            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2693            emit_jcc_short_link(DRCTOP, COND_E, &link1);                        // je   skip
2694            emit_xor_r32_r32(DRCTOP, REG_EDX, REG_EDX);                           // xor  edx,edx
2695            emit_div_m32(DRCTOP, REGADDR(RTREG));                              // div  [rtreg]
2696            emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                        // movsxd rax,eax
2697            emit_movsxd_r64_r32(DRCTOP, REG_RDX, REG_EDX);                        // movsxd rdx,edx
2698            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2699            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2700            resolve_link(DRCTOP, &link1);                                 // skip:
2701         }
2526            emit_set_constant_value(drc, compiler, desc, RTREG, SIMMVAL << 16);
27022527         return TRUE;
27032528
2704      case 0x1c:   /* DMULT - MIPS III */
2705         if (RSREG == 0 || RTREG == 0)
2706         {
2707            emit_mov_m64_imm(DRCTOP, HIADDR, 0);                              // mov  [hi],0
2708            emit_mov_m64_imm(DRCTOP, LOADDR, 0);                              // mov  [lo],0
2709         }
2710         else
2711         {
2712            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // mov  rax,[rtreg]
2713            emit_imul_m64(DRCTOP, REGADDR(RSREG));                              // imul [rsreg]
2714            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2715            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2716         }
2717         return TRUE;
2529      case 0x08:   /* ADDI */
2530      case 0x09:   /* ADDIU */
2531         return compile_add(drc, compiler, desc, opswitch & 1, TRUE);
27182532
2719      case 0x1d:   /* DMULTU - MIPS III */
2720         if (RSREG == 0 || RTREG == 0)
2721         {
2722            emit_mov_m64_imm(DRCTOP, HIADDR, 0);                              // mov  [hi],0
2723            emit_mov_m64_imm(DRCTOP, LOADDR, 0);                              // mov  [lo],0
2724         }
2725         else
2726         {
2727            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // mov  rax,[rtreg]
2728            emit_mul_m64(DRCTOP, REGADDR(RSREG));                              // mul  [rsreg]
2729            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2730            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2731         }
2533      case 0x18:   /* DADDI */
2534      case 0x19:   /* DADDIU */
2535         return compile_dadd(drc, compiler, desc, opswitch & 1, TRUE);
2536
2537      case 0x0c:   /* ANDI */
2538      case 0x0d:   /* ORI */
2539      case 0x0e:   /* XORI */
2540         return compile_logical(drc, compiler, desc, opswitch & 3, TRUE);
2541
2542      case 0x0a:   /* SLTI */
2543      case 0x0b:   /* SLTIU */
2544         return compile_slt(drc, compiler, desc, opswitch & 1, TRUE);
2545
2546
2547      /* ----- memory load operations ----- */
2548
2549      case 0x20:   /* LB */
2550      case 0x21:   /* LH */
2551      case 0x23:   /* LW */
2552      case 0x24:   /* LBU */
2553      case 0x25:   /* LHU */
2554      case 0x27:   /* LWU */
2555         return compile_load(drc, compiler, desc, (opswitch & 3) + 1, opswitch & 4);
2556
2557      case 0x37:   /* LD */
2558         return compile_load(drc, compiler, desc, 8, FALSE);
2559
2560      case 0x31:   /* LWC1 */
2561         return compile_load_cop(drc, compiler, desc, 4, FPR32(RTREG));
2562
2563      case 0x35:   /* LDC1 */
2564         return compile_load_cop(drc, compiler, desc, 8, FPR64(RTREG));
2565
2566      case 0x32:   /* LWC2 */
2567      case 0x36:   /* LDC2 */
2568         return compile_load_cop(drc, compiler, desc, (opswitch & 4) ? 8 : 4, &mips3.core->cpr[2][RTREG]);
2569
2570      case 0x1a:   /* LDL */
2571      case 0x1b:   /* LDR */
2572         return compile_load_double_partial(drc, compiler, desc, opswitch & 1);
2573
2574      case 0x22:   /* LWL */
2575      case 0x26:   /* LWR */
2576         return compile_load_word_partial(drc, compiler, desc, opswitch & 4);
2577
2578
2579      /* ----- memory store operations ----- */
2580
2581      case 0x28:   /* SB */
2582      case 0x29:   /* SH */
2583      case 0x2b:   /* SW */
2584         return compile_store(drc, compiler, desc, (opswitch & 3) + 1);
2585
2586      case 0x3f:   /* SD */
2587         return compile_store(drc, compiler, desc, 8);
2588
2589      case 0x39:   /* SWC1 */
2590         return compile_store_cop(drc, compiler, desc, 4, FPR32(RTREG));
2591
2592      case 0x3d:   /* SDC1 */
2593         return compile_store_cop(drc, compiler, desc, 8, FPR64(RTREG));
2594
2595      case 0x3a:   /* SWC2 */
2596         return compile_store_cop(drc, compiler, desc, (opswitch & 4) ? 8 : 4, &mips3.core->cpr[2][RTREG]);
2597
2598      case 0x2a:   /* SWL */
2599      case 0x2e:   /* SWR */
2600         return compile_store_word_partial(drc, compiler, desc, opswitch & 4);
2601
2602      case 0x2c:   /* SDL */
2603      case 0x2d:   /* SDR */
2604         return compile_store_double_partial(drc, compiler, desc, opswitch & 1);
2605
2606
2607      /* ----- effective no-ops ----- */
2608
2609      case 0x2f:   /* CACHE */
2610      case 0x33:   /* PREF */
27322611         return TRUE;
27332612
2734      case 0x1e:   /* DDIV - MIPS III */
2735         if (RTREG != 0)
2736         {
2737            emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                        // cmp  [rtreg],0
2738            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
2739            emit_jcc_short_link(DRCTOP, COND_E, &link1);                        // je   skip
2740            emit_cqo(DRCTOP);                                             // cqo
2741            emit_idiv_m64(DRCTOP, REGADDR(RTREG));                              // idiv [rtreg]
2742            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2743            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2744            resolve_link(DRCTOP, &link1);                                 // skip:
2745         }
2613
2614      /* ----- coprocessor instructions ----- */
2615
2616      case 0x10:   /* COP0 */
2617         return compile_cop0(drc, compiler, desc);
2618
2619      case 0x11:   /* COP1 */
2620         return compile_cop1(drc, compiler, desc);
2621
2622      case 0x13:   /* COP1X - R5000 */
2623         return compile_cop1x(drc, compiler, desc);
2624
2625      case 0x12:   /* COP2 */
2626         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_invalidop_exception);
2627                                                                     // jmp  generate_invalidop_exception
27462628         return TRUE;
27472629
2748      case 0x1f:   /* DDIVU - MIPS III */
2749         if (RTREG != 0)
2750         {
2751            emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                        // cmp  [rtreg],0
2752            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
2753            emit_jcc_short_link(DRCTOP, COND_E, &link1);                        // je   skip
2754            emit_xor_r32_r32(DRCTOP, REG_RDX, REG_RDX);                           // xor  rdx,rdx
2755            emit_div_m64(DRCTOP, REGADDR(RTREG));                              // div  [rtreg]
2756            emit_mov_m64_r64(DRCTOP, LOADDR, REG_RAX);                           // mov  [lo],rax
2757            emit_mov_m64_r64(DRCTOP, HIADDR, REG_RDX);                           // mov  [hi],rdx
2758            resolve_link(DRCTOP, &link1);                                 // skip:
2759         }
2760         return TRUE;
2630
2631      /* ----- unimplemented/illegal instructions ----- */
2632
2633//      case 0x30:  /* LL */        logerror("mips3 Unhandled op: LL\n");                                   break;
2634//      case 0x34:  /* LLD */       logerror("mips3 Unhandled op: LLD\n");                                  break;
2635//      case 0x38:  /* SC */        logerror("mips3 Unhandled op: SC\n");                                   break;
2636//      case 0x3c:  /* SCD */       logerror("mips3 Unhandled op: SCD\n");                                  break;
2637//      case 0x3b:  /* SWC3 */      invalid_instruction(op);                                                break;
2638//      default:    /* ??? */       invalid_instruction(op);                                                break;
27612639   }
2640
27622641   return FALSE;
27632642}
27642643
2765static int recompile_special2(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
2644
2645/*-------------------------------------------------
2646    compile_special - compile opcodes in the
2647    'SPECIAL' group
2648-------------------------------------------------*/
2649
2650static int compile_special(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
27662651{
27672652   UINT32 op = *desc->opptr;
2653   UINT8 opswitch = op & 63;
2654   emit_link link1;
27682655
2769   switch (op & 63)
2656   switch (opswitch)
27702657   {
2658      /* ----- shift instructions ----- */
2659
2660      case 0x00:   /* SLL - MIPS I */
2661      case 0x02:   /* SRL - MIPS I */
2662      case 0x03:   /* SRA - MIPS I */
2663      case 0x04:   /* SLLV - MIPS I */
2664      case 0x06:   /* SRLV - MIPS I */
2665      case 0x07:   /* SRAV - MIPS I */
2666         return compile_shift(drc, compiler, desc, opswitch & 0x03, opswitch & 0x04);
2667
2668      case 0x14:   /* DSLLV - MIPS III */
2669      case 0x16:   /* DSRLV - MIPS III */
2670      case 0x17:   /* DSRAV - MIPS III */
2671      case 0x38:   /* DSLL - MIPS III */
2672      case 0x3a:   /* DSRL - MIPS III */
2673      case 0x3b:   /* DSRA - MIPS III */
2674      case 0x3c:   /* DSLL32 - MIPS III */
2675      case 0x3e:   /* DSRL32 - MIPS III */
2676      case 0x3f:   /* DSRA32 - MIPS III */
2677         return compile_dshift(drc, compiler, desc, opswitch & 0x03, ~opswitch & 0x20, opswitch & 0x04);
2678
2679
2680      /* ----- basic arithmetic ----- */
2681
27712682      case 0x20:   /* ADD - MIPS I */
2772         if (RSREG != 0 && RTREG != 0)
2773         {
2774            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2775            emit_add_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // add  eax,[rtreg]
2776            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
2777                                                                     // jo   generate_overflow_exception
2778            if (RDREG != 0)
2779            {
2780               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2781               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2782            }
2783         }
2784         else if (RDREG != 0)
2785         {
2786            if (RSREG != 0)
2787            {
2788               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RSREG));               // movsxd rax,[rsreg]
2789               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2790            }
2791            else if (RTREG != 0)
2792            {
2793               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RTREG));               // movsxd rax,[rtreg]
2794               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2795            }
2796            else
2797               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2798         }
2799         return TRUE;
2800
28012683      case 0x21:   /* ADDU - MIPS I */
2802         if (RDREG != 0)
2803         {
2804            if (RSREG != 0 && RTREG != 0)
2805            {
2806               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                  // mov  eax,[rsreg]
2807               emit_add_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // add  eax,[rtreg]
2808               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2809               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2810            }
2811            else if (RSREG != 0)
2812            {
2813               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RSREG));               // movsxd rax,[rsreg]
2814               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2815            }
2816            else if (RTREG != 0)
2817            {
2818               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RTREG));               // movsxd rax,[rtreg]
2819               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2820            }
2821            else
2822               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2823         }
2824         return TRUE;
2684         return compile_add(drc, compiler, desc, opswitch & 1, FALSE);
28252685
2686      case 0x2c:   /* DADD - MIPS III */
2687      case 0x2d:   /* DADDU - MIPS III */
2688         return compile_dadd(drc, compiler, desc, opswitch & 1, FALSE);
2689
28262690      case 0x22:   /* SUB - MIPS I */
2827         if (RSREG != 0 && RTREG != 0)
2828         {
2829            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2830            emit_sub_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // sub  eax,[rtreg]
2831            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
2832                                                                     // jo   generate_overflow_exception
2833            if (RDREG != 0)
2834            {
2835               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2836               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2837            }
2838         }
2839         else if (RDREG != 0)
2840         {
2841            if (RSREG != 0)
2842            {
2843               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RSREG));               // movsxd rax,[rsreg]
2844               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2845            }
2846            else if (RTREG != 0)
2847            {
2848               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RTREG));               // movsxd rax,[rtreg]
2849               emit_neg_r64(DRCTOP, REG_RAX);                                 // neg  rax
2850               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2851            }
2852            else
2853               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2854         }
2855         return TRUE;
2856
28572691      case 0x23:   /* SUBU - MIPS I */
2858         if (RDREG != 0)
2859         {
2860            if (RSREG != 0 && RTREG != 0)
2861            {
2862               emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RSREG));                  // mov  eax,[rsreg]
2863               emit_sub_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                  // sub  eax,[rtreg]
2864               emit_movsxd_r64_r32(DRCTOP, REG_RAX, REG_EAX);                     // movsxd rax,eax
2865               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2866            }
2867            else if (RSREG != 0)
2868            {
2869               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RSREG));               // movsxd rax,[rsreg]
2870               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2871            }
2872            else if (RTREG != 0)
2873            {
2874               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RTREG));               // movsxd rax,[rtreg]
2875               emit_neg_r64(DRCTOP, REG_RAX);                                 // neg  rax
2876               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2877            }
2878            else
2879               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2880         }
2881         return TRUE;
2692         return compile_sub(drc, compiler, desc, opswitch & 1);
28822693
2694      case 0x2e:   /* DSUB - MIPS III */
2695      case 0x2f:   /* DSUBU - MIPS III */
2696         return compile_dsub(drc, compiler, desc, opswitch & 1);
2697
2698      case 0x18:   /* MULT - MIPS I */
2699      case 0x19:   /* MULTU - MIPS I */
2700         return compile_mult(drc, compiler, desc, opswitch & 1);
2701
2702      case 0x1c:   /* DMULT - MIPS III */
2703      case 0x1d:   /* DMULTU - MIPS III */
2704         return compile_dmult(drc, compiler, desc, opswitch & 1);
2705
2706      case 0x1a:   /* DIV - MIPS I */
2707      case 0x1b:   /* DIVU - MIPS I */
2708         return compile_div(drc, compiler, desc, opswitch & 1);
2709
2710      case 0x1e:   /* DDIV - MIPS III */
2711      case 0x1f:   /* DDIVU - MIPS III */
2712         return compile_ddiv(drc, compiler, desc, opswitch & 1);
2713
2714
2715      /* ----- basic logical ops ----- */
2716
28832717      case 0x24:   /* AND - MIPS I */
2884         if (RDREG != 0)
2885         {
2886            if (RSREG != 0 && RTREG != 0)
2887            {
2888               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2889               emit_and_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // and  rax,[rtreg]
2890               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2891            }
2892            else
2893               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2894         }
2895         return TRUE;
2896
28972718      case 0x25:   /* OR - MIPS I */
2898         if (RDREG != 0)
2899         {
2900            if (RSREG != 0 && RTREG != 0)
2901            {
2902               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2903               emit_or_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // or   rax,[rtreg]
2904               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2905            }
2906            else if (RSREG != 0)
2907            {
2908               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2909               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2910            }
2911            else if (RTREG != 0)
2912            {
2913               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
2914               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2915            }
2916            else
2917               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2918         }
2919         return TRUE;
2920
29212719      case 0x26:   /* XOR - MIPS I */
2922         if (RDREG != 0)
2923         {
2924            if (RSREG != 0 && RTREG != 0)
2925            {
2926               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2927               emit_xor_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // xor  rax,[rtreg]
2928               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2929            }
2930            else if (RSREG != 0)
2931            {
2932               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2933               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2934            }
2935            else if (RTREG != 0)
2936            {
2937               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
2938               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2939            }
2940            else
2941               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2942         }
2943         return TRUE;
2944
29452720      case 0x27:   /* NOR - MIPS I */
2946         if (RDREG != 0)
2947         {
2948            if (RSREG != 0 && RTREG != 0)
2949            {
2950               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2951               emit_or_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // or   rax,[rtreg]
2952               emit_not_r64(DRCTOP, REG_RAX);                                 // not  rax
2953               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2954            }
2955            else if (RSREG != 0)
2956            {
2957               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2958               emit_not_r64(DRCTOP, REG_RAX);                                 // not  rax
2959               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2960            }
2961            else if (RTREG != 0)
2962            {
2963               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
2964               emit_not_r64(DRCTOP, REG_RAX);                                 // not  rax
2965               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2966            }
2967            else
2968               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), ~0);                     // mov  [rdreg],~0
2969         }
2970         return TRUE;
2721         return compile_logical(drc, compiler, desc, opswitch & 3, FALSE);
29712722
2723
2724      /* ----- basic comparisons ----- */
2725
29722726      case 0x2a:   /* SLT - MIPS I */
2973         if (RDREG != 0)
2974         {
2975            if (RSREG != 0)
2976               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2977            else
2978               emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                        // xor  rax,rax
2979            if (RTREG != 0)
2980               emit_sub_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // sub  rax,[rtreg]
2981            emit_shr_r64_imm(DRCTOP, REG_RAX, 63);                              // shr  rax,63
2982            emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                     // mov  [rdreg],rax
2983         }
2984         return TRUE;
2985
29862727      case 0x2b:   /* SLTU - MIPS I */
2987         if (RDREG != 0)
2988         {
2989            if (RSREG != 0)
2990               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
2991            else
2992               emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                        // xor  rax,rax
2993            if (RTREG != 0)
2994               emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // cmp  rax,[rtreg]
2995            else
2996               emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                           // cmp  rax,0
2997            emit_setcc_r8(DRCTOP, COND_B, REG_AL);                              // setb  al
2998            emit_movsx_r64_r8(DRCTOP, REG_RAX, REG_AL);                           // movsx rax,al
2999            emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                     // mov  [rdreg],rax
3000         }
3001         return TRUE;
2728         return compile_slt(drc, compiler, desc, opswitch & 1, FALSE);
30022729
3003      case 0x2c:   /* DADD - MIPS III */
3004         if (RSREG != 0 && RTREG != 0)
3005         {
3006            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3007            emit_add_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // add  rax,[rtreg]
3008            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
3009                                                                     // jo   generate_overflow_exception
3010            if (RDREG != 0)
3011               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3012         }
3013         else if (RDREG != 0)
3014         {
3015            if (RSREG != 0)
3016            {
3017               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RSREG));               // movsxd rax,[rsreg]
3018               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3019            }
3020            else if (RTREG != 0)
3021            {
3022               emit_movsxd_r64_m32(DRCTOP, REG_RAX, REGADDR(RTREG));               // movsxd rax,[rtreg]
3023               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3024            }
3025            else
3026               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
3027         }
3028         return TRUE;
30292730
3030      case 0x2d:   /* DADDU - MIPS III */
2731      /* ----- conditional traps ----- */
2732
2733      case 0x30:   /* TGE - MIPS II */
2734      case 0x31:   /* TGEU - MIPS II */
2735      case 0x32:   /* TLT - MIPS II */
2736      case 0x33:   /* TLTU - MIPS II */
2737      case 0x34:   /* TEQ - MIPS II */
2738      case 0x36:   /* TNE - MIPS II */
2739         return compile_trapcc(drc, compiler, desc, opswitch & 7, FALSE);
2740
2741
2742      /* ----- conditional moves ----- */
2743
2744      case 0x0a:   /* MOVZ - MIPS IV */
2745      case 0x0b:   /* MOVN - MIPS IV */
2746         return compile_movzn(drc, compiler, desc, opswitch & 1);
2747
2748      case 0x01:   /* MOVF - MIPS IV */
30312749         if (RDREG != 0)
30322750         {
3033            if (RSREG != 0 && RTREG != 0)
3034            {
3035               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
3036               emit_add_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // add  rax,[rtreg]
3037               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3038            }
3039            else if (RSREG != 0)
3040            {
3041               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
3042               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3043            }
3044            else if (RTREG != 0)
3045            {
3046               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3047               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3048            }
3049            else
3050               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
3051         }
3052         return TRUE;
2751            mipsreg_state rs, rd;
30532752
3054      case 0x2e:   /* DSUB - MIPS III */
3055         if (RSREG != 0 && RTREG != 0)
3056         {
3057            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3058            emit_sub_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // sub  rax,[rtreg]
3059            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
3060                                                                     // jo   generate_overflow_exception
3061            if (RDREG != 0)
3062               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
2753            /* allocate source registers */
2754            rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
2755            rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_SRC | ALLOC_DST | ALLOC_DIRTY);
2756
2757            emit_cmp_m8_imm(DRCTOP, CF1ADDR((op >> 18) & 7), 0);                  // cmp  fcc[x],0
2758            emit_jcc_short_link(DRCTOP, ((op >> 16) & 1) ? COND_Z : COND_NZ, &link1);   // jz/nz skip
2759            emit_load_register_value(drc, compiler, X86REG(rd), rs);               // mov  <rd>,<rs>
30632760         }
3064         else if (RDREG != 0)
3065         {
3066            if (RSREG != 0)
3067            {
3068               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
3069               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3070            }
3071            else if (RTREG != 0)
3072            {
3073               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3074               emit_neg_r64(DRCTOP, REG_RAX);                                 // neg  rax
3075               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3076            }
3077            else
3078               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
3079         }
2761         resolve_link(DRCTOP, &link1);                                    // skip:
30802762         return TRUE;
30812763
3082      case 0x2f:   /* DSUBU - MIPS III */
3083         if (RDREG != 0)
2764
2765      /* ----- jumps and branches ----- */
2766
2767      case 0x08:   /* JR - MIPS I */
2768      case 0x09:   /* JALR - MIPS I */
30842769         {
3085            if (RSREG != 0 && RTREG != 0)
3086            {
3087               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
3088               emit_sub_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // sub  rax,[rtreg]
3089               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3090            }
3091            else if (RSREG != 0)
3092            {
3093               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                  // mov  rax,[rsreg]
3094               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3095            }
3096            else if (RTREG != 0)
3097            {
3098               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3099               emit_neg_r64(DRCTOP, REG_RAX);                                 // neg  rax
3100               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3101            }
2770            mipsreg_state rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
2771            if (ISCONST(rs))
2772               emit_mov_m32_imm(DRCTOP, MBD(REG_RSP, SPOFFS_NEXTPC), CONSTVAL(rs));   // mov  [esp+nextpc],rs
31022773            else
3103               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2774               emit_mov_m32_r32(DRCTOP, MBD(REG_RSP, SPOFFS_NEXTPC), X86REG(rs));      // mov  [esp+nextpc],rs
2775            emit_delay_slot_and_branch(drc, compiler, desc, (opswitch == 0x09) ? RDREG : 0);
2776                                                                     // <next instruction + redispatch>
31042777         }
31052778         return TRUE;
31062779
3107      case 0x30:   /* TGE - MIPS II */
3108         if (RSREG != 0)
3109            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3110         else
3111            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3112         if (RTREG != 0)
3113            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
3114         else
3115            emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                              // cmp  rax,0
3116         oob_request_callback(drc, COND_GE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3117                                                                     // jge  generate_overflow_exception
3118         return TRUE;
31192780
3120      case 0x31:   /* TGEU - MIPS II */
3121         if (RSREG != 0)
3122            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3123         else
3124            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3125         if (RTREG != 0)
3126            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
3127         else
3128            emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                              // cmp  rax,0
3129         oob_request_callback(drc, COND_AE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3130                                                                     // jae  generate_overflow_exception
3131         return TRUE;
2781      /* ----- system calls ----- */
31322782
3133      case 0x32:   /* TLT - MIPS II */
3134         if (RSREG != 0)
3135            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3136         else
3137            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3138         if (RTREG != 0)
3139            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
3140         else
3141            emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                              // cmp  rax,0
3142         oob_request_callback(drc, COND_L, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3143                                                                     // jl   generate_overflow_exception
2783      case 0x0c:   /* SYSCALL - MIPS I */
2784         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_syscall_exception);
2785                                                                     // jmp  generate_syscall_exception
31442786         return TRUE;
31452787
3146      case 0x33:   /* TLTU - MIPS II */
3147         if (RSREG != 0)
3148            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3149         else
3150            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3151         if (RTREG != 0)
3152            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
3153         else
3154            emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                              // cmp  rax,0
3155         oob_request_callback(drc, COND_B, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3156                                                                     // jb  generate_overflow_exception
2788      case 0x0d:   /* BREAK - MIPS I */
2789         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_break_exception);
2790                                                                     // jmp  generate_break_exception
31572791         return TRUE;
31582792
3159      case 0x34:   /* TEQ - MIPS II */
3160         if (RSREG != 0)
3161            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3162         else
3163            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3164         if (RTREG != 0)
3165            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
3166         else
3167            emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                              // cmp  rax,0
3168         oob_request_callback(drc, COND_E, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3169                                                                     // je   generate_overflow_exception
3170         return TRUE;
31712793
3172      case 0x36:   /* TNE - MIPS II */
3173         if (RSREG != 0)
3174            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RSREG));                     // mov  rax,[rsreg]
3175         else
3176            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3177         if (RTREG != 0)
3178            emit_cmp_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // cmp  rax,[rtreg]
3179         else
3180            emit_cmp_r64_imm(DRCTOP, REG_RAX, 0);                              // cmp  rax,0
3181         oob_request_callback(drc, COND_NE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3182                                                                     // jne  generate_overflow_exception
3183         return TRUE;
2794      /* ----- effective no-ops ----- */
31842795
3185      case 0x38:   /* DSLL - MIPS III */
3186         if (RDREG != 0)
3187         {
3188            if (RTREG != 0)
3189            {
3190               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3191               if (SHIFT != 0)
3192                  emit_shl_r64_imm(DRCTOP, REG_EAX, SHIFT);                     // shl  rax,SHIFT
3193               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3194            }
3195            else
3196               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
3197         }
2796      case 0x0f:   /* SYNC - MIPS II */
31982797         return TRUE;
31992798
3200      case 0x3a:   /* DSRL - MIPS III */
3201         if (RDREG != 0)
3202         {
3203            if (RTREG != 0)
3204            {
3205               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3206               if (SHIFT != 0)
3207                  emit_shr_r64_imm(DRCTOP, REG_EAX, SHIFT);                     // shr  rax,SHIFT
3208               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3209            }
3210            else
3211               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
3212         }
3213         return TRUE;
32142799
3215      case 0x3b:   /* DSRA - MIPS III */
2800      /* ----- hi/lo register access ----- */
2801
2802      case 0x10:   /* MFHI - MIPS I */
32162803         if (RDREG != 0)
32172804         {
3218            if (RTREG != 0)
3219            {
3220               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3221               if (SHIFT != 0)
3222                  emit_sar_r64_imm(DRCTOP, REG_EAX, SHIFT);                     // sar  rax,SHIFT
3223               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3224            }
3225            else
3226               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2805            mipsreg_state hi = compiler_register_allocate(drc, compiler, desc, REG_HI, ALLOC_SRC);
2806            mipsreg_state rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DST | ALLOC_DIRTY);
2807            emit_load_register_value(drc, compiler, X86REG(rd), hi);               // mov  <rd>,<hi>
32272808         }
32282809         return TRUE;
32292810
3230      case 0x3c:   /* DSLL32 - MIPS III */
3231         if (RDREG != 0)
2811      case 0x11:   /* MTHI - MIPS I */
2812         if (RSREG != 0)
32322813         {
3233            if (RTREG != 0)
3234            {
3235               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3236               emit_shl_r64_imm(DRCTOP, REG_EAX, SHIFT + 32);                     // shl  rax,SHIFT+32
3237               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3238            }
3239            else
3240               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2814            mipsreg_state rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
2815            mipsreg_state hi = compiler_register_allocate(drc, compiler, desc, REG_HI, ALLOC_DST | ALLOC_DIRTY);
2816            emit_load_register_value(drc, compiler, X86REG(hi), rs);               // mov  hi,<rs>
32412817         }
32422818         return TRUE;
32432819
3244      case 0x3e:   /* DSRL32 - MIPS III */
2820      case 0x12:   /* MFLO - MIPS I */
32452821         if (RDREG != 0)
32462822         {
3247            if (RTREG != 0)
3248            {
3249               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3250               emit_shr_r64_imm(DRCTOP, REG_EAX, SHIFT + 32);                     // shr  rax,SHIFT+32
3251               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3252            }
3253            else
3254               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2823            mipsreg_state lo = compiler_register_allocate(drc, compiler, desc, REG_LO, ALLOC_SRC);
2824            mipsreg_state rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DST | ALLOC_DIRTY);
2825            emit_load_register_value(drc, compiler, X86REG(rd), lo);               // mov  <rd>,<lo>
32552826         }
32562827         return TRUE;
32572828
3258      case 0x3f:   /* DSRA32 - MIPS III */
3259         if (RDREG != 0)
2829      case 0x13:   /* MTLO - MIPS I */
2830         if (RSREG != 0)
32602831         {
3261            if (RTREG != 0)
3262            {
3263               emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                  // mov  rax,[rtreg]
3264               emit_sar_r64_imm(DRCTOP, REG_EAX, SHIFT + 32);                     // sar  rax,SHIFT+32
3265               emit_mov_m64_r64(DRCTOP, REGADDR(RDREG), REG_RAX);                  // mov  [rdreg],rax
3266            }
3267            else
3268               emit_mov_m64_imm(DRCTOP, REGADDR(RDREG), 0);                     // mov  [rdreg],0
2832            mipsreg_state rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
2833            mipsreg_state lo = compiler_register_allocate(drc, compiler, desc, REG_LO, ALLOC_DST | ALLOC_DIRTY);
2834            emit_load_register_value(drc, compiler, X86REG(lo), rs);               // mov  lo,<rs>
32692835         }
32702836         return TRUE;
32712837   }
r1051r1052
32732839}
32742840
32752841
3276static int recompile_special(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
3277{
3278   if (!(*desc->opptr & 32))
3279      return recompile_special1(drc, compiler, desc);
3280   else
3281      return recompile_special2(drc, compiler, desc);
3282}
2842/*-------------------------------------------------
2843    compile_regimm - compile opcodes in the
2844    'REGIMM' group
2845-------------------------------------------------*/
32832846
3284
3285/*------------------------------------------------------------------
3286    recompile_regimm
3287------------------------------------------------------------------*/
3288
3289static int recompile_regimm(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
2847static int compile_regimm(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
32902848{
32912849   UINT32 op = *desc->opptr;
3292   emit_link link1;
2850   UINT8 opswitch = RTREG;
32932851
3294   switch (RTREG)
2852   switch (opswitch)
32952853   {
32962854      case 0x00:   /* BLTZ */
2855      case 0x01:   /* BGEZ */
32972856      case 0x02:   /* BLTZL */
3298         assert(desc->delay != NULL);
3299         if (RSREG == 0)
3300            return TRUE;
3301         else
3302         {
3303            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
3304            emit_jcc_near_link(DRCTOP, COND_GE, &link1);                        // jge  skip
3305         }
3306         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
3307         resolve_link(DRCTOP, &link1);                                    // skip:
3308         return TRUE;
3309
3310      case 0x01:   /* BGEZ */
33112857      case 0x03:   /* BGEZL */
3312         if (RSREG != 0)
3313         {
3314            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
3315            emit_jcc_near_link(DRCTOP, COND_L, &link1);                           // jl   skip
3316         }
3317         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
3318         if (RSREG != 0)
3319            resolve_link(DRCTOP, &link1);                                 // skip:
3320         return TRUE;
2858      case 0x10:   /* BLTZAL */
2859      case 0x11:   /* BGEZAL */
2860      case 0x12:   /* BLTZALL */
2861      case 0x13:   /* BGEZALL */
2862         return compile_branchcz(drc, compiler, desc, (opswitch & 1) ? COND_GE : COND_L, opswitch & 0x10);
33212863
33222864      case 0x08:   /* TGEI */
3323         if (RSREG != 0)
3324         {
3325            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                     // cmp  [rsreg],SIMMVAL
3326            oob_request_callback(drc, COND_GE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3327                                                                     // jge  generate_trap_exception
3328         }
3329         else
3330         {
3331            if (0 >= SIMMVAL)
3332               oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3333                                                                     // jmp  generate_trap_exception
3334         }
3335         return TRUE;
3336
33372865      case 0x09:   /* TGEIU */
3338         if (RSREG != 0)
3339         {
3340            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                     // cmp  [rsreg],SIMMVAL
3341            oob_request_callback(drc, COND_AE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3342                                                                     // jae  generate_trap_exception
3343         }
3344         else
3345         {
3346            if (0 >= (UINT64)SIMMVAL)
3347               oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3348                                                                     // jmp  generate_trap_exception
3349         }
3350         return TRUE;
3351
33522866      case 0x0a:   /* TLTI */
3353         if (RSREG != 0)
3354         {
3355            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                     // cmp  [rsreg],SIMMVAL
3356            oob_request_callback(drc, COND_L, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3357                                                                     // jl   generate_trap_exception
3358         }
3359         else
3360         {
3361            if (0 < SIMMVAL)
3362               oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3363                                                                     // jmp  generate_trap_exception
3364         }
3365         return TRUE;
3366
33672867      case 0x0b:   /* TLTIU */
3368         if (RSREG != 0)
3369         {
3370            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                     // cmp  [rsreg],SIMMVAL
3371            oob_request_callback(drc, COND_B, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3372                                                                     // jb   generate_trap_exception
3373         }
3374         else
3375         {
3376            if (0 < (UINT64)SIMMVAL)
3377               oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3378                                                                     // jmp  generate_trap_exception
3379         }
3380         return TRUE;
3381
33822868      case 0x0c:   /* TEQI */
3383         if (RSREG != 0)
3384         {
3385            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                     // cmp  [rsreg],SIMMVAL
3386            oob_request_callback(drc, COND_E, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3387                                                                     // je   generate_trap_exception
3388         }
3389         else
3390         {
3391            if (0 == SIMMVAL)
3392               oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3393                                                                     // jmp  generate_trap_exception
3394         }
3395         return TRUE;
2869      case 0x0e:   /* TNEI */
2870         return compile_trapcc(drc, compiler, desc, opswitch & 7, TRUE);
2871   }
2872   return FALSE;
2873}
33962874
3397      case 0x0e:   /* TNEI */
3398         if (RSREG != 0)
2875
2876/*-------------------------------------------------
2877    compile_idt - compile opcodes in the IDT-
2878    specific group
2879-------------------------------------------------*/
2880
2881static int compile_idt(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
2882{
2883   fatalerror("Unimplemented IDT instructions");
2884#if 0
2885   UINT32 op = *desc->opptr;
2886   UINT8 opswitch = op & 0x1f;
2887
2888   switch (opswitch)
2889   {
2890      case 0: /* MAD */
2891         if (RSREG != 0 && RTREG != 0)
33992892         {
3400            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), SIMMVAL);                     // cmp  [rsreg],SIMMVAL
3401            oob_request_callback(drc, COND_NE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3402                                                                     // jne  generate_trap_exception
2893            emit_mov_r32_m32(REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2894            emit_mov_r32_m32(REG_EDX, REGADDR(RTREG));                     // mov  edx,[rtreg]
2895            emit_imul_r32(DRCTOP, REG_EDX);                              // imul edx
2896            emit_add_r32_m32(DRCTOP, LOADDR);                           // add  eax,[lo]
2897            emit_adc_r32_m32(DRCTOP, HIADDR);                           // adc  edx,[hi]
2898            emit_mov_r32_r32(DRCTOP, REG_EBX, REG_EDX);                     // mov  ebx,edx
2899            emit_cdq(DRCTOP);                                       // cdq
2900            emit_mov_m64_r64(DRCTOP, LOADDR, REG_EAX);                     // mov  [lo],edx:eax
2901            emit_mov_r32_r32(DRCTOP, REG_EAX, REG_EBX);                     // mov  eax,ebx
2902            emit_cdq(DRCTOP);                                       // cdq
2903            emit_mov_m64_r64(DRCTOP, HIADDR, REG_EAX);                     // mov  [hi],edx:eax
34032904         }
3404         else
3405         {
3406            if (0 != SIMMVAL)
3407               oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
3408                                                                     // jmp  generate_trap_exception
3409         }
3410         return TRUE;
2905         return compile_SUCCESSFUL_CP(3,4);
34112906
3412      case 0x10:   /* BLTZAL */
3413      case 0x12:   /* BLTZALL */
3414         assert(desc->delay != NULL);
3415         if (RSREG == 0)
3416            return TRUE;
3417         else
2907      case 1: /* MADU */
2908         if (RSREG != 0 && RTREG != 0)
34182909         {
3419            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
3420            emit_jcc_near_link(DRCTOP, COND_GE, &link1);                        // jge  skip
2910            emit_mov_r32_m32(REG_EAX, REGADDR(RSREG));                     // mov  eax,[rsreg]
2911            emit_mov_r32_m32(REG_EDX, REGADDR(RTREG));                     // mov  edx,[rtreg]
2912            emit_mul_r32(DRCTOP, REG_EDX);                              // mul  edx
2913            emit_add_r32_m32(DRCTOP, LOADDR);                           // add  eax,[lo]
2914            emit_adc_r32_m32(DRCTOP, HIADDR);                           // adc  edx,[hi]
2915            emit_mov_r32_r32(DRCTOP, REG_EBX, REG_EDX);                     // mov  ebx,edx
2916            emit_cdq(DRCTOP);                                       // cdq
2917            emit_mov_m64_r64(DRCTOP, LOADDR, REG_EDX, REG_EAX);               // mov  [lo],edx:eax
2918            emit_mov_r32_r32(DRCTOP, REG_EAX, REG_EBX);                     // mov  eax,ebx
2919            emit_cdq(DRCTOP);                                       // cdq
2920            emit_mov_m64_r64(DRCTOP, HIADDR, REG_EDX, REG_EAX);               // mov  [hi],edx:eax
34212921         }
3422         emit_mov_m64_imm(DRCTOP, REGADDR(31), (INT32)(desc->pc + 8));               // mov  [r31],pc + 8
3423         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
3424         resolve_link(DRCTOP, &link1);                                    // skip:
3425         return TRUE;
2922         return compile_SUCCESSFUL_CP(3,4);
34262923
3427      case 0x11:   /* BGEZAL */
3428      case 0x13:   /* BGEZALL */
3429         if (RSREG != 0)
2924      case 2: /* MUL */
2925         if (RDREG != 0)
34302926         {
3431            emit_cmp_m64_imm(DRCTOP, REGADDR(RSREG), 0);                        // cmp  [rsreg],0
3432            emit_jcc_near_link(DRCTOP, COND_L, &link1);                           // jl   skip
2927            if (RSREG != 0 && RTREG != 0)
2928            {
2929               emit_mov_r32_m32(REG_EAX, REGADDR(RSREG));                  // mov  eax,[rsreg]
2930               emit_imul_r32_m32(REG_EAX, REGADDR(RTREG));                  // imul eax,[rtreg]
2931               emit_cdq(DRCTOP);                                    // cdq
2932               emit_mov_m64_r64(REG_ESI, REGADDR(RDREG), REG_EDX, REG_EAX);   // mov  [rd],edx:eax
2933            }
2934            else
2935               emit_zero_m64(REG_ESI, REGADDR(RDREG));
34332936         }
3434         emit_mov_m64_imm(DRCTOP, REGADDR(31), (INT32)(desc->pc + 8));               // mov  [r31],pc + 8
3435         append_delay_slot_and_branch(drc, compiler, desc);                        // <next instruction + redispatch>
3436         if (RSREG != 0)
3437            resolve_link(DRCTOP, &link1);                                 // skip:
3438         return TRUE;
2937         return compile_SUCCESSFUL_CP(3,4);
34392938   }
2939#endif
34402940   return FALSE;
34412941}
34422942
r1051r1052
34462946    COP0 RECOMPILATION
34472947***************************************************************************/
34482948
3449/*------------------------------------------------------------------
3450    recompile_set_cop0_reg
3451------------------------------------------------------------------*/
2949/*-------------------------------------------------
2950    compile_set_cop0_reg - generate code to
2951    handle special COP0 registers
2952-------------------------------------------------*/
34522953
3453static int recompile_set_cop0_reg(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 reg)
2954static int compile_set_cop0_reg(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 reg)
34542955{
34552956   emit_link link1;
34562957
r1051r1052
35213022}
35223023
35233024
3524/*------------------------------------------------------------------
3525    recompile_get_cop0_reg
3526------------------------------------------------------------------*/
3025/*-------------------------------------------------
3026    compile_get_cop0_reg - generate code to
3027    read special COP0 registers
3028-------------------------------------------------*/
35273029
3528static int recompile_get_cop0_reg(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 reg)
3030static int compile_get_cop0_reg(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, UINT8 reg)
35293031{
35303032   emit_link link1, link2;
35313033
r1051r1052
35883090}
35893091
35903092
3591/*------------------------------------------------------------------
3592    recompile_cop0
3593------------------------------------------------------------------*/
3093/*-------------------------------------------------
3094    compile_cop0 - compile COP0 opcodes
3095-------------------------------------------------*/
35943096
3595static int recompile_cop0(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
3097static int compile_cop0(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
35963098{
35973099   UINT32 op = *desc->opptr;
3100   UINT8 opswitch = RSREG;
35983101
35993102   /* generate an exception if COP0 is disabled or we are not in kernel mode */
36003103   if (mips3.drcoptions & MIPS3DRC_STRICT_COP0)
r1051r1052
36093112      resolve_link(DRCTOP, &checklink);                                    // okay:
36103113   }
36113114
3612   switch (RSREG)
3115   switch (opswitch)
36133116   {
36143117      case 0x00:   /* MFCz */
36153118      case 0x01:   /* DMFCz */
36163119         if (RTREG != 0)
36173120         {
3618            recompile_get_cop0_reg(drc, compiler, desc, RDREG);                     // mov  eax,cpr0[rdreg])
3619            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
3121            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_DST | ALLOC_DIRTY);
3122            compile_get_cop0_reg(drc, compiler, desc, RDREG);                     // mov  eax,cpr0[rd])
3123            if (!(opswitch & 1))
3124               emit_movsxd_r64_r32(DRCTOP, X86REG(rt), REG_EAX);                  // movsxd <rt>,eax
3125            else
3126               emit_mov_r64_r64(DRCTOP, X86REG(rt), REG_RAX);                     // mov  <rt>,rax
36203127         }
36213128         return TRUE;
36223129
3623      case 0x02:   /* CFCz */
3624         if (RTREG != 0)
3625         {
3626            emit_movsxd_r64_m32(DRCTOP, REG_RAX, CCR0ADDR(RDREG));                  // movsxd rax,ccr0[rdreg]
3627            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
3628         }
3629         return TRUE;
3630
36313130      case 0x04:   /* MTCz */
36323131      case 0x05:   /* DMTCz */
3633         if (RTREG != 0)
3634            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // mov  eax,[rtreg]
3635         else
3636            emit_xor_r32_r32(DRCTOP, REG_RAX, REG_RAX);                           // xor  rax,rax
3637         recompile_set_cop0_reg(drc, compiler, desc, RDREG);                        // mov  cpr0[rdreg],rax
3638         return TRUE;
3639
3640      case 0x06:   /* CTCz */
3641         if (RTREG != 0)
36423132         {
3643            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // mov  eax,[rtreg]
3644            emit_mov_m32_r32(DRCTOP, CCR0ADDR(RDREG), REG_EAX);                     // mov  ccr0[rdreg],eax
3133            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
3134            emit_load_register_value(drc, compiler, REG_EAX, rt);                  // mov  eax,<rt>
3135            compile_set_cop0_reg(drc, compiler, desc, RDREG);                     // mov  cpr0[rd],rax
36453136         }
3646         else
3647            emit_mov_m32_imm(DRCTOP, CCR0ADDR(RDREG), 0);                        // mov  ccr0[rdreg],0
36483137         return TRUE;
36493138
3650//      case 0x08:  /* BC */
3651//          switch (RTREG)
3652//          {
3653//              case 0x00:  /* BCzF */  if (!mips3.core->fcc[0][0]) ADDPC(SIMMVAL);                break;
3654//              case 0x01:  /* BCzF */  if (mips3.core->fcc[0][0]) ADDPC(SIMMVAL);                 break;
3655//              case 0x02:  /* BCzFL */ invalid_instruction(op);                            break;
3656//              case 0x03:  /* BCzTL */ invalid_instruction(op);                            break;
3657//              default:    invalid_instruction(op);                                        break;
3658//          }
3659//          break;
3660
36613139      case 0x10:
36623140      case 0x11:
36633141      case 0x12:
r1051r1052
36993177            case 0x18:   /* ERET */
37003178               emit_mov_r32_m32(DRCTOP, REG_P1, CPR0ADDR(COP0_EPC));               // mov  p1,[EPC]
37013179               emit_and_m32_imm(DRCTOP, CPR0ADDR(COP0_Status), ~SR_EXL);            // and  [SR],~SR_EXL
3180               compiler_register_flush_all(drc, compiler);                        // <flush registers>
37023181               drc_append_dispatcher(drc);                                    // <dispatch>
37033182               return TRUE;
37043183
r1051r1052
37173196    COP1 RECOMPILATION
37183197***************************************************************************/
37193198
3720/*------------------------------------------------------------------
3721    recompile_cop1
3722------------------------------------------------------------------*/
3199/*-------------------------------------------------
3200    compile_cop1 - compile COP1 opcodes
3201-------------------------------------------------*/
37233202
3724static int recompile_cop1(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
3203static int compile_cop1(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
37253204{
37263205   UINT32 op = *desc->opptr;
37273206   emit_link link1;
r1051r1052
37393218      case 0x00:   /* MFCz */
37403219         if (RTREG != 0)
37413220         {
3742            emit_movsxd_r64_m32(DRCTOP, REG_RAX, FPR32ADDR(RDREG));                  // movsxd rax,cpr[rdreg]
3743            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
3221            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_DST | ALLOC_DIRTY);
3222            emit_movsxd_r64_m32(DRCTOP, X86REG(rt), FPR32ADDR(RDREG));                  // movsxd <rt>,cpr[rd]
37443223         }
37453224         return TRUE;
37463225
37473226      case 0x01:   /* DMFCz */
37483227         if (RTREG != 0)
37493228         {
3750            emit_mov_r64_m64(DRCTOP, REG_RAX, FPR32ADDR(RDREG));                  // mov  rax,cpr[rdreg]
3751            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
3229            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_DST | ALLOC_DIRTY);
3230            emit_mov_r64_m64(DRCTOP, X86REG(rt), FPR64ADDR(RDREG));                     // mov  <rt>,cpr[rd]
37523231         }
37533232         return TRUE;
37543233
37553234      case 0x02:   /* CFCz */
37563235         if (RTREG != 0)
37573236         {
3237            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_DST | ALLOC_DIRTY);
37583238            if (RDREG != 31)
3759               emit_movsxd_r64_m32(DRCTOP, REG_RAX, CCR1ADDR(RDREG));               // movsxd rax,ccr1[rdreg]
3239               emit_movsxd_r64_m32(DRCTOP, X86REG(rt), CCR1ADDR(RDREG));               // movsxd <rt>,ccr1[rd]
37603240            else
3761               emit_call(DRCTOP, mips3.drcdata->recover_ccr31);                  // call recover_ccr31
3762            emit_mov_m64_r64(DRCTOP, REGADDR(RTREG), REG_RAX);                     // mov  [rtreg],rax
3241            {
3242               emit_call(DRCTOP, mips3.drcdata->recover_ccr31);                     // call recover_ccr31
3243               emit_mov_r64_r64(DRCTOP, X86REG(rt), REG_RAX);                        // mov  [X86REG(rt)],rax
3244            }
37633245         }
37643246         return TRUE;
37653247
37663248      case 0x04:   /* MTCz */
3767         if (RTREG != 0)
37683249         {
3769            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // mov  eax,[mips3.core->r[RTREG]]
3770            emit_mov_m32_r32(DRCTOP, FPR32ADDR(RDREG), REG_EAX);                  // mov  cpr1[rdreg],eax
3250            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
3251            UINT8 tempreg = ISCONST(rt) ? REG_EAX : X86REG(rt);
3252            emit_load_register_value(drc, compiler, tempreg, rt);                     // mov  <tempreg>,<rt>
3253            emit_mov_m32_r32(DRCTOP, FPR32ADDR(RDREG), tempreg);                     // mov  cpr1[rd],<tempreg>
37713254         }
3772         else
3773            emit_mov_m32_imm(DRCTOP, FPR32ADDR(RDREG), 0);                        // mov  cpr1[rdreg],0
37743255         return TRUE;
37753256
37763257      case 0x05:   /* DMTCz */
3777         if (RTREG != 0)
37783258         {
3779            emit_mov_r64_m64(DRCTOP, REG_RAX, REGADDR(RTREG));                     // mov  rax,[rtreg]
3780            emit_mov_m64_r64(DRCTOP, FPR64ADDR(RDREG), REG_RAX);                  // mov  cpr1[rdreg],rax
3259            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
3260            UINT8 tempreg = ISCONST(rt) ? REG_EAX : X86REG(rt);
3261            emit_load_register_value(drc, compiler, tempreg, rt);                     // mov  <tempreg>,<rt>
3262            emit_mov_m64_r64(DRCTOP, FPR64ADDR(RDREG), tempreg);                     // mov  cpr1[rd],<tempreg>
37813263         }
3782         else
3783            emit_mov_m64_imm(DRCTOP, FPR64ADDR(RDREG), 0);                        // mov  cpr1[rdreg],0
37843264         return TRUE;
37853265
37863266      case 0x06:   /* CTCz */
3787         if (RTREG != 0)
3788            emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDR(RTREG));                     // mov  eax,[mips3.core->r[RTREG]]
3789         else
3790            emit_xor_r32_r32(DRCTOP, REG_EAX, REG_EAX);                           // xor  eax,eax
3791         if (RDREG != 31)
3792            emit_mov_m32_r32(DRCTOP, CCR1ADDR(RDREG), REG_EAX);                     // mov  ccr1[rdreg],eax
3793         else
3794            emit_call(DRCTOP, mips3.drcdata->explode_ccr31);                     // call explode_ccr31
3267         {
3268            mipsreg_state rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
3269            emit_load_register_value(drc, compiler, REG_EAX, rt);                     // mov  eax,<rt>
3270            if (RDREG != 31)
3271               emit_mov_m32_r32(DRCTOP, CCR1ADDR(RDREG), REG_EAX);                     // mov  ccr1[rd],eax
3272            else
3273               emit_call(DRCTOP, mips3.drcdata->explode_ccr31);                     // call explode_ccr31
3274         }
37953275         return TRUE;
37963276
37973277      case 0x08:   /* BC */
r1051r1052
38013281            case 0x02:   /* BCzFL */
38023282               emit_cmp_m8_imm(DRCTOP, CF1ADDR((op >> 18) & 7), 0);               // cmp  fcc[which],0
38033283               emit_jcc_near_link(DRCTOP, COND_NZ, &link1);                     // jnz  link1
3804               append_delay_slot_and_branch(drc, compiler, desc);                  // <next instruction + redispatch>
3284               emit_delay_slot_and_branch(drc, compiler, desc, 0);                  // <next instruction + redispatch>
38053285               resolve_link(DRCTOP, &link1);                              // skip:
38063286               return TRUE;
38073287
r1051r1052
38093289            case 0x03:   /* BCzTL */
38103290               emit_cmp_m8_imm(DRCTOP, CF1ADDR((op >> 18) & 7), 0);               // cmp  fcc[which],0
38113291               emit_jcc_near_link(DRCTOP, COND_Z, &link1);                        // jz  link1
3812               append_delay_slot_and_branch(drc, compiler, desc);                  // <next instruction + redispatch>
3292               emit_delay_slot_and_branch(drc, compiler, desc, 0);                  // <next instruction + redispatch>
38133293               resolve_link(DRCTOP, &link1);                              // skip:
38143294               return TRUE;
38153295         }
r1051r1052
40363516               return TRUE;
40373517
40383518            case 0x12:   /* R5000 */
4039               emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // cmp  [rtreg],0
3519               emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // cmp  [X86REG(rt)],0
40403520               emit_jcc_short_link(DRCTOP, COND_NZ, &link1);                     // jnz  skip
40413521               if (IS_SINGLE(op))   /* MOVZ.S */
40423522               {
r1051r1052
40523532               return TRUE;
40533533
40543534            case 0x13:   /* R5000 */
4055               emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // cmp  [rtreg],0
3535               emit_cmp_m64_imm(DRCTOP, REGADDR(RTREG), 0);                     // cmp  [X86REG(rt)],0
40563536               emit_jcc_short_link(DRCTOP, COND_Z, &link1);                     // jz  skip
40573537               if (IS_SINGLE(op))   /* MOVN.S */
40583538               {
r1051r1052
42503730    COP1X RECOMPILATION
42513731***************************************************************************/
42523732
4253/*------------------------------------------------------------------
4254    recompile_cop1x
4255------------------------------------------------------------------*/
3733/*-------------------------------------------------
3734    compile_cop1x - compile COP1X opcodes
3735-------------------------------------------------*/
42563736
4257static int recompile_cop1x(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
3737static int compile_cop1x(drc_core *drc, compiler_state *compiler, mips3_opcode_desc *desc)
42583738{
42593739   UINT32 op = *desc->opptr;
42603740
r1051r1052
42683748   switch (op & 0x3f)
42693749   {
42703750      case 0x00:      /* LWXC1 */
4271         emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                        // mov  p1,[rsreg]
4272         emit_add_r32_m32(DRCTOP, REG_P1, REGADDR(RTREG));                        // add  p1,[rtreg]
4273         emit_call(DRCTOP, mips3.drcdata->general.read_long_unsigned);               // call general.read_long_unsigned
4274         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
4275         emit_mov_m32_r32(DRCTOP, FPR32ADDR(FDREG), REG_EAX);                     // mov  [fdreg],eax
4276         return TRUE;
3751         return compile_loadx_cop(drc, compiler, desc, 4, FPR32(FDREG));
42773752
42783753      case 0x01:      /* LDXC1 */
4279         emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                        // mov  p1,[rsreg]
4280         emit_add_r32_m32(DRCTOP, REG_P1, REGADDR(RTREG));                        // add  p1,[rtreg]
4281         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
4282         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
4283         emit_mov_m64_r64(DRCTOP, FPR64ADDR(FDREG), REG_RAX);                     // mov  [fdreg],rax
4284         return TRUE;
3754         return compile_loadx_cop(drc, compiler, desc, 8, FPR64(FDREG));
42853755
42863756      case 0x08:      /* SWXC1 */
4287         emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                        // mov  p1,[rsreg]
4288         emit_mov_r32_m32(DRCTOP, REG_P2, FPR32ADDR(FSREG));                        // mov  p2,[fsreg]
4289         emit_add_r32_m32(DRCTOP, REG_P1, REGADDR(RTREG));                        // add  p1,[rtreg]
4290         emit_call(DRCTOP, mips3.drcdata->general.write_long);                     // call general.write_long
4291         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
4292         return TRUE;
3757         return compile_storex_cop(drc, compiler, desc, 4, FPR32(FDREG));
42933758
42943759      case 0x09:      /* SDXC1 */
4295         emit_mov_r32_m32(DRCTOP, REG_P1, REGADDR(RSREG));                        // mov  p1,[rsreg]
4296         emit_mov_r64_m64(DRCTOP, REG_P2, FPR64ADDR(FSREG));                        // mov  p2,[fsreg]
4297         emit_add_r32_m32(DRCTOP, REG_P1, REGADDR(RTREG));                        // add  p1,[rtreg]
4298         emit_call(DRCTOP, mips3.drcdata->general.write_long);                     // call general.write_long
4299         oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
4300         return TRUE;
3760         return compile_storex_cop(drc, compiler, desc, 8, FPR64(FDREG));
43013761
43023762      case 0x0f:      /* PREFX */
43033763         return TRUE;
r1051r1052
43783838   }
43793839   return FALSE;
43803840}
3841
3842
3843
3844/***************************************************************************
3845    INDIVIDUAL INSTRUCTION COMPILATION
3846***************************************************************************/
3847
3848/*-------------------------------------------------
3849    compile_shift - compile a 32-bit
3850    shift, both fixed and variable counts
3851
3852    0: sll/sllv rD,rT,rS
3853    2: srl/srlv rD,rT,rS
3854    3: sra/srav rD,rT,rS
3855-------------------------------------------------*/
3856
3857static int compile_shift(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int shift_type, int shift_variable)
3858{
3859   UINT32 op = *desc->opptr;
3860   mipsreg_state rd, rs, rt;
3861
3862   assert(shift_type == 0 || shift_type == 2 || shift_type == 3);
3863
3864   /* if the destination is r0, bail */
3865   if (RDREG == 0)
3866      return TRUE;
3867
3868   /* allocate source registers */
3869   rs = shift_variable ? compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC) : MAKE_CONST(SHIFT);
3870   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
3871
3872   /* if rS and rT are both constant, we can compute the constant result */
3873   if (ISCONST(rs) && ISCONST(rt))
3874   {
3875      if (shift_type == 0)
3876         emit_set_constant_value(drc, compiler, desc, RDREG, (INT32)((UINT32)CONSTVAL(rt) << CONSTVAL(rs)));
3877      else if (shift_type == 2)
3878         emit_set_constant_value(drc, compiler, desc, RDREG, (INT32)((UINT32)CONSTVAL(rt) >> CONSTVAL(rs)));
3879      else
3880         emit_set_constant_value(drc, compiler, desc, RDREG, (INT32)((INT32)CONSTVAL(rt) >> CONSTVAL(rs)));
3881   }
3882
3883   /* otherwise, handle generically */
3884   else
3885   {
3886      /* allocate the register and load rT into it */
3887      rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DST | ALLOC_DIRTY);
3888      emit_load_register_value(drc, compiler, X86REG(rd), rt);                     // mov  <rd>,<rt>
3889
3890      /* if rs is constant, use immediate forms of the shift */
3891      if (ISCONST(rs))
3892      {
3893         if (shift_type == 0)
3894            emit_shl_r32_imm(DRCTOP, X86REG(rd), CONSTVAL(rs) & 31);               // shl  <rd>,<rs>
3895         else if (shift_type == 2)
3896            emit_shr_r32_imm(DRCTOP, X86REG(rd), CONSTVAL(rs) & 31);               // shr  <rd>,<rs>
3897         else
3898            emit_sar_r32_imm(DRCTOP, X86REG(rd), CONSTVAL(rs) & 31);               // sar  <rd>,<rs>
3899      }
3900
3901      /* otherwise, load rs into cl so we can do a variable shift */
3902      else
3903      {
3904         emit_load_register_value(drc, compiler, REG_ECX, rs);                     // mov  ecx,<rs>
3905         if (shift_type == 0)
3906            emit_shl_r32_cl(DRCTOP, X86REG(rd));                              // shl  <rd>,cl
3907         else if (shift_type == 2)
3908            emit_shr_r32_cl(DRCTOP, X86REG(rd));                              // shr  <rd>,cl
3909         else
3910            emit_sar_r32_cl(DRCTOP, X86REG(rd));                              // sar  <rd>,cl
3911      }
3912      emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rd));                        // movsxd <rd>,<rd>
3913   }
3914   return TRUE;
3915}
3916
3917
3918/*-------------------------------------------------
3919    compile_dshift - compile a 64-bit
3920    shift, both fixed and variable counts
3921
3922    0: dsll/dsll32/dsllv rD,rT,rS
3923    2: dsrl/dsrl32/dsrlv rD,rT,rS
3924    3: dsra/dsra32/dsrav rD,rT,rS
3925-------------------------------------------------*/
3926
3927static int compile_dshift(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int shift_type, int shift_variable, int shift_const_plus32)
3928{
3929   UINT32 op = *desc->opptr;
3930   mipsreg_state rd, rs, rt;
3931
3932   assert(shift_type == 0 || shift_type == 2 || shift_type == 3);
3933
3934   /* if the destination is r0, bail */
3935   if (RDREG == 0)
3936      return TRUE;
3937
3938   /* allocate source registers */
3939   rs = shift_variable ? compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC) : MAKE_CONST(SHIFT + (shift_const_plus32 ? 32 : 0));
3940   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
3941
3942   /* if rS and rT are both constant, we can compute the constant result */
3943   if (ISCONST(rs) && ISCONST(rt))
3944   {
3945      if (shift_type == 0)
3946         emit_set_constant_value(drc, compiler, desc, RDREG, (UINT64)CONSTVAL(rt) << CONSTVAL(rs));
3947      else if (shift_type == 2)
3948         emit_set_constant_value(drc, compiler, desc, RDREG, (UINT64)CONSTVAL(rt) >> CONSTVAL(rs));
3949      else
3950         emit_set_constant_value(drc, compiler, desc, RDREG, (INT64)CONSTVAL(rt) >> CONSTVAL(rs));
3951   }
3952
3953   /* otherwise, handle generically */
3954   else
3955   {
3956      /* allocate the register and load rT into it */
3957      rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DST | ALLOC_DIRTY);
3958      emit_load_register_value(drc, compiler, X86REG(rd), rt);                     // mov  <rd>,<rt>
3959
3960      /* if rs is constant, use immediate forms of the shift */
3961      if (ISCONST(rs))
3962      {
3963         if (shift_type == 0)
3964            emit_shl_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rs) & 63);               // shl  <rd>,<rs>
3965         else if (shift_type == 2)
3966            emit_shr_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rs) & 63);               // shr  <rd>,<rs>
3967         else
3968            emit_sar_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rs) & 63);               // sar  <rd>,<rs>
3969      }
3970
3971      /* otherwise, load rs into cl so we can do a variable shift */
3972      else
3973      {
3974         emit_load_register_value(drc, compiler, REG_ECX, rs);                     // mov  ecx,<rs>
3975         if (shift_type == 0)
3976            emit_shl_r64_cl(DRCTOP, X86REG(rd));                              // shl  <rd>,cl
3977         else if (shift_type == 2)
3978            emit_shr_r64_cl(DRCTOP, X86REG(rd));                              // shr  <rd>,cl
3979         else
3980            emit_sar_r64_cl(DRCTOP, X86REG(rd));                              // sar  <rd>,cl
3981      }
3982   }
3983   return TRUE;
3984}
3985
3986
3987/*-------------------------------------------------
3988    compile_movzn - compile a conditional
3989    move based on compare against 0
3990
3991    movz/movn rD,rS,rT
3992-------------------------------------------------*/
3993
3994static int compile_movzn(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_movn)
3995{
3996   UINT32 op = *desc->opptr;
3997   mipsreg_state rd, rs, rt;
3998   emit_link skip = { 0 };
3999
4000   /* if the destination is r0, bail */
4001   if (RDREG == 0)
4002      return TRUE;
4003
4004   /* allocate source registers */
4005   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4006   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4007   rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_SRC | ALLOC_DST | ALLOC_DIRTY);
4008
4009   /* if rT is constant and fails the condition, we're done */
4010   if (ISCONST(rt))
4011   {
4012      INT32 rtval = CONSTVAL(rt);
4013      if ((is_movn && rtval == 0) || (!is_movn && rtval != 0))
4014         return TRUE;
4015   }
4016
4017   /* if rT is not constant, check the condition */
4018   else
4019   {
4020      emit_test_r64_r64(DRCTOP, X86REG(rt), X86REG(rt));                           // test <rt>,<rt>
4021      emit_jcc_short_link(DRCTOP, is_movn ? COND_Z : COND_NZ, &skip);                  // jz/nz skip
4022   }
4023
4024   /* load rS into rD */
4025   emit_load_register_value(drc, compiler, X86REG(rd), rs);                        // mov  <rd>,<rs>
4026   if (!ISCONST(rt))
4027      resolve_link(DRCTOP, &skip);                                       // skip:
4028
4029   return TRUE;
4030}
4031
4032
4033/*-------------------------------------------------
4034    compile_trapcc - compile a conditional
4035    trap comparing two registers
4036
4037    0/1: tge/tgeu rS,rT / tgei/tgeiu rS,SIMM
4038    2/3: tlt/tltu rS,rT / tlti/tltiu rS,SIMM
4039      4: teq      rS,rT / teqi       rS,SIMM
4040      6: tne      rS,rT / tnei       rS,SIMM
4041-------------------------------------------------*/
4042
4043static int compile_trapcc(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int condition, int immediate)
4044{
4045   static const UINT8 condtype[] = { COND_GE, COND_AE, COND_L, COND_B, COND_E, COND_NONE, COND_NE, COND_NONE };
4046   UINT32 op = *desc->opptr;
4047   mipsreg_state rs, rt;
4048
4049   assert(condition < ARRAY_LENGTH(condtype) && condtype[condition] != COND_NONE);
4050
4051   /* allocate source registers */
4052   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4053   rt = immediate ? MAKE_CONST(SIMMVAL) : compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4054
4055   /* if both constant, we know the answer up front */
4056   if (ISCONST(rs) && ISCONST(rt))
4057   {
4058      INT32 rsval = CONSTVAL(rs);
4059      INT32 rtval = CONSTVAL(rt);
4060      int result = FALSE;
4061
4062      /* determine the fixed answer */
4063      switch (condition)
4064      {
4065         case 0:      result = ((INT64)rsval >= (INT64)rtval);      break;
4066         case 1:      result = ((UINT64)rsval >= (UINT64)rtval);      break;
4067         case 2:      result = ((INT64)rsval < (INT64)rtval);         break;
4068         case 3:      result = ((UINT64)rsval < (UINT64)rtval);      break;
4069         case 4:      result = (rsval == rtval);                  break;
4070         case 6:      result = (rsval != rtval);                  break;
4071      }
4072
4073      /* if we're not trapping, just return; otherwise, always trap */
4074      if (!result)
4075         return TRUE;
4076      condition = COND_NONE;
4077   }
4078
4079   /* if rT is constant do an immediate compare */
4080   else if (ISCONST(rt))
4081   {
4082      emit_cmp_r64_imm(DRCTOP, X86REG(rs), CONSTVAL(rt));                           // cmp  <rs>,<rt>
4083      condition = condtype[condition];
4084   }
4085
4086   /* if rS is constant do an immediate compare with opposite condition */
4087   else if (ISCONST(rs))
4088   {
4089      emit_cmp_r64_imm(DRCTOP, X86REG(rt), CONSTVAL(rs));                           // cmp  <rt>,<rs>
4090      condition = condtype[condition] ^ 1;
4091   }
4092
4093   /* otherwise, compare the two registers with a normal condition */
4094   else
4095   {
4096      emit_cmp_r64_imm(DRCTOP, X86REG(rs), X86REG(rt));                           // cmp  <rs>,<rt>
4097      condition = condtype[condition];
4098   }
4099
4100   /* generate an OOB request if the trap is taken */
4101   oob_request_callback(drc, condition, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_trap_exception);
4102   return TRUE;
4103}
4104
4105
4106/*-------------------------------------------------
4107    compile_branchcc - compile a conditional
4108    branch comparing two registers
4109
4110    beq rS,rT,dest
4111    bne rS,rT,dest
4112-------------------------------------------------*/
4113
4114static int compile_branchcc(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int condition)
4115{
4116   UINT32 op = *desc->opptr;
4117   emit_link skip = { 0 };
4118   mipsreg_state rs, rt;
4119
4120   assert(condition == COND_E || condition == COND_NE);
4121
4122   /* allocate source registers */
4123   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4124   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4125
4126   /* if both constant, we know the answer up front */
4127   if (ISCONST(rs) && ISCONST(rt))
4128   {
4129      INT32 rsval = CONSTVAL(rs);
4130      INT32 rtval = CONSTVAL(rt);
4131      if ((condition == COND_E && rsval != rtval) || (condition == COND_NE && rsval == rtval))
4132         return TRUE;
4133   }
4134
4135   /* if rT is constant do an immediate compare */
4136   else if (ISCONST(rt))
4137   {
4138      emit_cmp_r64_imm(DRCTOP, X86REG(rs), CONSTVAL(rt));                           // cmp  <rs>,<rt>
4139      emit_jcc_near_link(DRCTOP, condition ^ 1, &skip);                           // jncc skip
4140   }
4141
4142   /* if rS is constant do an immediate compare */
4143   else if (ISCONST(rs))
4144   {
4145      emit_cmp_r64_imm(DRCTOP, X86REG(rt), CONSTVAL(rs));                           // cmp  <rt>,<rs>
4146      emit_jcc_near_link(DRCTOP, condition ^ 1, &skip);                           // jncc skip
4147   }
4148
4149   /* otherwise, compare the two registers with a normal condition */
4150   else
4151   {
4152      emit_cmp_r64_r64(DRCTOP, X86REG(rs), X86REG(rt));                           // cmp  <rs>,<rt>
4153      emit_jcc_near_link(DRCTOP, condition ^ 1, &skip);                           // jncc skip
4154   }
4155
4156   /* append the branch logic */
4157   emit_delay_slot_and_branch(drc, compiler, desc, 0);                              // <next instruction + redispatch>
4158
4159   if (!(ISCONST(rs) && ISCONST(rt)))
4160      resolve_link(DRCTOP, &skip);                                       // skip:
4161   return TRUE;
4162}
4163
4164
4165/*-------------------------------------------------
4166    compile_branchcz - compile a conditional
4167    branch comparing one register against 0
4168
4169    blez    rS,dest
4170    blezl   rS,dest
4171    bgtz    rS,dest
4172    bgtzl   rS,dest
4173    bltz    rS,dest
4174    bltzl   rS,dest
4175    bltzal  rS,dest
4176    bltzall rS,dest
4177    bgez    rS,dest
4178    bgezl   rS,dest
4179    bgezal  rS,dest
4180    bgezall rS,dest
4181-------------------------------------------------*/
4182
4183static int compile_branchcz(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int condition, int link)
4184{
4185   UINT32 op = *desc->opptr;
4186   emit_link skip = { 0 };
4187   mipsreg_state rs;
4188
4189   /* allocate source registers */
4190   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4191
4192   /* if the register is constant, we know the answer up front */
4193   if (ISCONST(rs))
4194   {
4195      INT32 rsval = CONSTVAL(rs);
4196      if ((condition == COND_LE && rsval > 0) || (condition == COND_G && rsval <= 0) ||
4197         (condition == COND_L && rsval >= 0) || (condition == COND_GE && rsval < 0))
4198         return TRUE;
4199   }
4200
4201   /* otherwise, perform the compare */
4202   else
4203   {
4204      emit_cmp_r64_imm(DRCTOP, X86REG(rs), 0);                                 // cmp  <rs>,0
4205      emit_jcc_near_link(DRCTOP, condition ^ 1, &skip);                           // jncc skip
4206   }
4207
4208   /* append the branch logic */
4209   emit_delay_slot_and_branch(drc, compiler, desc, link ? 31 : 0);                     // <next instruction + redispatch>
4210
4211   if (!ISCONST(rs))
4212      resolve_link(DRCTOP, &skip);                                       // skip:
4213   return TRUE;
4214}
4215
4216
4217/*-------------------------------------------------
4218    compile_add - compile an add with or without
4219    overflow
4220
4221    add  rD,rS,rT / addi  rT,rS,SIMM
4222    addu rD,rS,rT / addiu rT,rS,SIMM
4223-------------------------------------------------*/
4224
4225static int compile_add(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions, int immediate)
4226{
4227   UINT32 op = *desc->opptr;
4228   UINT8 destreg = immediate ? RTREG : RDREG;
4229   mipsreg_state rd, rs, rt;
4230
4231   /* note that we still must perform this operation even if destreg == 0
4232       in the overflow case */
4233   if (destreg == 0 && suppress_exceptions)
4234      return TRUE;
4235
4236   /* allocate source registers */
4237   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4238   rt = immediate ? MAKE_CONST(SIMMVAL) : compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4239
4240   /* if both constant, we know the answer up front */
4241   if (ISCONST(rs) && ISCONST(rt))
4242   {
4243      INT64 result = (INT64)CONSTVAL(rs) + (INT64)CONSTVAL(rt);
4244
4245      /* if we overflow, always generate an exception */
4246      if (!suppress_exceptions && (INT32)result != result)
4247         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4248
4249      /* else just set the new constant value */
4250      else if (destreg != 0)
4251         emit_set_constant_value(drc, compiler, desc, destreg, (INT32)result);
4252   }
4253
4254   /* otherwise, handle generically */
4255   else
4256   {
4257      rd = compiler_register_allocate(drc, compiler, desc, destreg, ALLOC_DST);
4258
4259      /* perform the operating in EAX so we don't trash rD if an exception happens */
4260      if (!suppress_exceptions)
4261      {
4262         emit_load_register_value(drc, compiler, REG_EAX, rs);                     // mov  eax,<rs>
4263         if (!ISCONST(rt))
4264            emit_add_r32_r32(DRCTOP, REG_EAX, X86REG(rt));                        // add  eax,<rt>
4265         else if (CONSTVAL(rt) != 0)
4266            emit_add_r32_imm(DRCTOP, REG_EAX, CONSTVAL(rt));                     // add  eax,<rt>
4267         oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4268                                                                     // jo   generate_overflow_exception
4269         if (destreg != 0)
4270            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), REG_EAX);                     // movsxd <rd>,eax
4271      }
4272      else
4273      {
4274         if (ISCONST(rs) && CONSTVAL(rs) == 0)
4275            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rt));                  // movsxd <rd>,<rt>
4276         else if (ISCONST(rt) && CONSTVAL(rt) == 0)
4277            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rs));                  // movsxd <rd>,<rs>
4278         else if (ISCONST(rs))
4279         {
4280            emit_lea_r32_m32(DRCTOP, X86REG(rd), MBD(X86REG(rt), CONSTVAL(rs)));      // lea  <rd>,[<rt> + <rs>]
4281            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rd));                  // movsxd <rd>,<rd>
4282         }
4283         else if (ISCONST(rt))
4284         {
4285            emit_lea_r32_m32(DRCTOP, X86REG(rd), MBD(X86REG(rs), CONSTVAL(rt)));      // lea  <rd>,[<rs> + <rt>]
4286            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rd));                  // movsxd <rd>,<rd>
4287         }
4288         else
4289         {
4290            emit_lea_r32_m32(DRCTOP, X86REG(rd), MBISD(X86REG(rs), X86REG(rt), 1, 0));   // lea  <rd>,[<rs> + <rt>]
4291            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rd));                  // movsxd <rd>,<rd>
4292         }
4293      }
4294
4295      /* only mark it dirty after the exception risk is over */
4296      compiler_register_allocate(drc, compiler, desc, destreg, ALLOC_DIRTY);
4297   }
4298   return TRUE;
4299}
4300
4301
4302/*-------------------------------------------------
4303    compile_dadd - compile an add with or without
4304    overflow
4305
4306    dadd  rD,rS,rT
4307    daddu rD,rS,rT
4308-------------------------------------------------*/
4309
4310static int compile_dadd(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions, int immediate)
4311{
4312   UINT32 op = *desc->opptr;
4313   UINT8 destreg = immediate ? RTREG : RDREG;
4314   mipsreg_state rd, rs, rt;
4315
4316   /* note that we still must perform this operation even if destreg == 0
4317       in the overflow case */
4318   if (destreg == 0 && suppress_exceptions)
4319      return TRUE;
4320
4321   /* allocate source registers */
4322   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4323   rt = immediate ? MAKE_CONST(SIMMVAL) : compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4324
4325   /* if both constant, we know the answer up front */
4326   if (ISCONST(rs) && ISCONST(rt))
4327   {
4328      INT64 result = (INT64)CONSTVAL(rs) + (INT64)CONSTVAL(rt);
4329
4330      /* if we overflow, always generate an exception */
4331      if (!suppress_exceptions && (INT32)result != result)
4332         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4333
4334      /* else just set the new constant value */
4335      else if (destreg != 0)
4336         emit_set_constant_value(drc, compiler, desc, destreg, result);
4337   }
4338
4339   /* otherwise, handle generically */
4340   else
4341   {
4342      rd = compiler_register_allocate(drc, compiler, desc, destreg, ALLOC_DST);
4343
4344      /* perform the operating in EAX so we don't trash RTREG if an exception happens */
4345      if (!suppress_exceptions)
4346      {
4347         emit_load_register_value(drc, compiler, REG_RAX, rs);                     // mov  rax,<rs>
4348         if (!ISCONST(rt))
4349            emit_add_r64_r64(DRCTOP, REG_RAX, X86REG(rt));                        // add  rax,<rt>
4350         else if (CONSTVAL(rt) != 0)
4351            emit_add_r64_imm(DRCTOP, REG_RAX, CONSTVAL(rt));                     // add  rax,<rt>
4352         oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4353                                                                     // jo   generate_overflow_exception
4354         if (destreg != 0)
4355            emit_mov_r64_r64(DRCTOP, X86REG(rd), REG_RAX);                        // mov  <rd>,rax
4356      }
4357      else
4358      {
4359         if (ISCONST(rs))
4360            emit_lea_r64_m64(DRCTOP, X86REG(rd), MBD(X86REG(rt), CONSTVAL(rs)));      // lea  <rd>,[<rt> + <rs>]
4361         else if (ISCONST(rt))
4362            emit_lea_r64_m64(DRCTOP, X86REG(rd), MBD(X86REG(rs), CONSTVAL(rt)));      // lea  <rd>,[<rs> + <rt>]
4363         else
4364            emit_lea_r64_m64(DRCTOP, X86REG(rd), MBISD(X86REG(rs), X86REG(rt), 1, 0));   // lea  <rd>,[<rs> + <rt>]
4365      }
4366
4367      /* only mark it dirty after the exception risk is over */
4368      compiler_register_allocate(drc, compiler, desc, destreg, ALLOC_DIRTY);
4369   }
4370   return TRUE;
4371}
4372
4373
4374/*-------------------------------------------------
4375    compile_sub - compile an add with or without
4376    overflow
4377
4378    sub  rD,rS,rT
4379    subu rD,rS,rT
4380-------------------------------------------------*/
4381
4382static int compile_sub(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions)
4383{
4384   UINT32 op = *desc->opptr;
4385   mipsreg_state rd, rs, rt;
4386
4387   /* note that we still must perform this operation even if RDREG == 0
4388       in the overflow case */
4389   if (RDREG == 0 && suppress_exceptions)
4390      return TRUE;
4391
4392   /* allocate source registers */
4393   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4394   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4395
4396   /* if both constant, we know the answer up front */
4397   if (ISCONST(rs) && ISCONST(rt))
4398   {
4399      INT64 result = (INT64)CONSTVAL(rs) - (INT64)CONSTVAL(rt);
4400
4401      /* if we overflow, always generate an exception */
4402      if (!suppress_exceptions && (INT32)result != result)
4403         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4404
4405      /* else just set the new constant value */
4406      else if (RDREG != 0)
4407         emit_set_constant_value(drc, compiler, desc, RDREG, (INT32)result);
4408   }
4409
4410   /* if rS == rT, the result is 0 */
4411   else if (RSREG == RTREG)
4412   {
4413      if (RDREG != 0)
4414         emit_set_constant_value(drc, compiler, desc, RDREG, 0);
4415   }
4416
4417   /* otherwise, handle generically */
4418   else
4419   {
4420      rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DST);
4421
4422      /* perform the operating in EAX so we don't trash RTREG if an exception happens */
4423      if (!suppress_exceptions)
4424      {
4425         emit_load_register_value(drc, compiler, REG_EAX, rs);                     // mov  eax,<rs>
4426         if (!ISCONST(rt))
4427            emit_sub_r32_r32(DRCTOP, REG_EAX, X86REG(rt));                        // sub  eax,<rt>
4428         else if (CONSTVAL(rt) != 0)
4429            emit_sub_r32_imm(DRCTOP, REG_EAX, CONSTVAL(rt));                     // sub  eax,<rt>
4430         if (!ISCONST(rt) || CONSTVAL(rt) != 0)
4431            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4432                                                                     // jo   generate_overflow_exception
4433         if (RDREG != 0)
4434            emit_movsxd_r64_r32(DRCTOP, X86REG(rd), REG_EAX);                     // movsxd <rd>,eax
4435      }
4436      else
4437      {
4438         /* if rD and rT aren't the same, it is pretty basic */
4439         if (X86REG(rd) != X86REG(rt))
4440         {
4441            emit_load_register_value(drc, compiler, X86REG(rd), rs);               // mov  <rd>,<rs>
4442            if (!ISCONST(rt))
4443               emit_sub_r32_r32(DRCTOP, X86REG(rd), X86REG(rt));                  // sub  <rd>,<rt>
4444            else if (CONSTVAL(rt) != 0)
4445               emit_sub_r32_imm(DRCTOP, X86REG(rd), CONSTVAL(rt));                  // sub  <rd>,<rt>
4446         }
4447
4448         /* otherwise, we negate rT and add rS */
4449         else
4450         {
4451            emit_neg_r32(DRCTOP, X86REG(rd));                                 // neg  <rd>
4452            if (!ISCONST(rs))
4453               emit_add_r32_r32(DRCTOP, X86REG(rd), X86REG(rs));                  // add  <rd>,<rs>
4454            else if (CONSTVAL(rs) != 0)
4455               emit_add_r32_imm(DRCTOP, X86REG(rd), CONSTVAL(rs));                  // add  <rd>,<rs>
4456         }
4457         emit_movsxd_r64_r32(DRCTOP, X86REG(rd), X86REG(rd));                     // movsxd <rd>,<rd>
4458      }
4459
4460      /* only mark it dirty after the exception risk is over */
4461      compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DIRTY);
4462   }
4463   return TRUE;
4464}
4465
4466
4467/*-------------------------------------------------
4468    compile_dsub - compile an add with or without
4469    overflow
4470
4471    dsub  rD,rS,rT
4472    dsubu rD,rS,rT
4473-------------------------------------------------*/
4474
4475static int compile_dsub(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int suppress_exceptions)
4476{
4477   UINT32 op = *desc->opptr;
4478   mipsreg_state rd, rs, rt;
4479
4480   /* note that we still must perform this operation even if RDREG == 0
4481       in the overflow case */
4482   if (RDREG == 0 && suppress_exceptions)
4483      return TRUE;
4484
4485   /* allocate source registers */
4486   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4487   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4488
4489   /* if both constant, we know the answer up front */
4490   if (ISCONST(rs) && ISCONST(rt))
4491   {
4492      INT64 result = (INT64)CONSTVAL(rs) - (INT64)CONSTVAL(rt);
4493
4494      /* if we overflow, always generate an exception */
4495      if (!suppress_exceptions && (INT32)result != result)
4496         oob_request_callback(drc, COND_NONE, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4497
4498      /* else just set the new constant value */
4499      else if (RDREG != 0)
4500         emit_set_constant_value(drc, compiler, desc, RDREG, result);
4501   }
4502
4503   /* if rS == rT, the result is 0 */
4504   else if (RSREG == RTREG)
4505   {
4506      if (RDREG != 0)
4507         emit_set_constant_value(drc, compiler, desc, RDREG, 0);
4508   }
4509
4510   /* otherwise, handle generically */
4511   else
4512   {
4513      rd = compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DST);
4514
4515      /* perform the operating in EAX so we don't trash RTREG if an exception happens */
4516      if (!suppress_exceptions)
4517      {
4518         emit_load_register_value(drc, compiler, REG_EAX, rs);                  // mov  eax,<rs>
4519         if (!ISCONST(rt))
4520            emit_sub_r64_r64(DRCTOP, REG_RAX, X86REG(rt));                        // sub  rax,<rt>
4521         else if (CONSTVAL(rt) != 0)
4522            emit_sub_r64_imm(DRCTOP, REG_RAX, CONSTVAL(rt));                     // sub  rax,<rt>
4523         if (!ISCONST(rt) || CONSTVAL(rt) != 0)
4524            oob_request_callback(drc, COND_O, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_overflow_exception);
4525                                                                     // jo   generate_overflow_exception
4526         if (RDREG != 0)
4527            emit_mov_r64_r64(DRCTOP, X86REG(rd), REG_RAX);                        // mov  <rd>,rax
4528      }
4529      else
4530      {
4531         /* if rD and rT aren't the same, it is pretty basic */
4532         if (X86REG(rd) != X86REG(rt))
4533         {
4534            emit_load_register_value(drc, compiler, X86REG(rd), rs);               // mov  <rd>,<rs>
4535            if (!ISCONST(rt))
4536               emit_sub_r64_r64(DRCTOP, X86REG(rd), X86REG(rt));                  // sub  <rd>,<rt>
4537            else if (CONSTVAL(rt) != 0)
4538               emit_sub_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rt));                  // sub  <rd>,<rt>
4539         }
4540
4541         /* otherwise, we negate rT and add rS */
4542         else
4543         {
4544            emit_neg_r64(DRCTOP, X86REG(rd));                                 // neg  <rd>
4545            if (!ISCONST(rs))
4546               emit_add_r64_r64(DRCTOP, X86REG(rd), X86REG(rs));                  // add  <rd>,<rs>
4547            else if (CONSTVAL(rs) != 0)
4548               emit_add_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rs));                  // add  <rd>,<rs>
4549         }
4550      }
4551
4552      /* only mark it dirty after the exception risk is over */
4553      compiler_register_allocate(drc, compiler, desc, RDREG, ALLOC_DIRTY);
4554   }
4555   return TRUE;
4556}
4557
4558
4559/*-------------------------------------------------
4560    compile_mult - compile a 32-bit multiply
4561    instruction
4562
4563    mult  rS,rT
4564    multu rS,rT
4565-------------------------------------------------*/
4566
4567static int compile_mult(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned)
4568{
4569   UINT32 op = *desc->opptr;
4570   mipsreg_state rs, rt, lo, hi;
4571
4572   /* allocate source registers */
4573   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4574   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4575
4576   /* if both constant, we know the answer up front */
4577   if (ISCONST(rs) && ISCONST(rt))
4578   {
4579      UINT64 result = is_unsigned ? ((UINT64)CONSTVAL(rs) * (UINT64)CONSTVAL(rt)) : ((INT64)CONSTVAL(rs) * (INT64)CONSTVAL(rt));
4580      emit_set_constant_value(drc, compiler, desc, REG_LO, (INT32)result);
4581      emit_set_constant_value(drc, compiler, desc, REG_HI, (INT32)(result >> 32));
4582   }
4583
4584   /* otherwise, handle generically */
4585   else
4586   {
4587      UINT8 mulreg = ISCONST(rt) ? REG_ECX : X86REG(rt);
4588
4589      hi = compiler_register_allocate(drc, compiler, desc, REG_HI, ALLOC_DST | ALLOC_DIRTY);
4590      lo = compiler_register_allocate(drc, compiler, desc, REG_LO, ALLOC_DST | ALLOC_DIRTY);
4591
4592      emit_load_register_value(drc, compiler, REG_EAX, rs);                        // mov  eax,<rs>
4593      emit_load_register_value(drc, compiler, mulreg, rt);                        // mov  <mulreg>,<rt>
4594      if (is_unsigned)
4595         emit_mul_r32(DRCTOP, mulreg);                                       // mul  <mulreg>
4596      else
4597         emit_imul_r32(DRCTOP, mulreg);                                       // imul <mulreg>
4598      emit_movsxd_r64_r32(DRCTOP, X86REG(hi), REG_EDX);                           // movsxd <hireg>,edx
4599      emit_movsxd_r64_r32(DRCTOP, X86REG(lo), REG_EAX);                           // movsxd <loreg>,eax
4600   }
4601   return TRUE;
4602}
4603
4604
4605/*-------------------------------------------------
4606    compile_dmult - compile a 64-bit multiply
4607    instruction
4608
4609    dmult  rS,rT
4610    dmultu rS,rT
4611-------------------------------------------------*/
4612
4613static int compile_dmult(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned)
4614{
4615   UINT32 op = *desc->opptr;
4616   mipsreg_state rs, rt, lo, hi;
4617
4618   /* allocate source registers */
4619   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4620   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4621
4622   /* if both constant, we know the answer up front */
4623   if (ISCONST(rs) && ISCONST(rt))
4624   {
4625      UINT64 result = is_unsigned ? ((UINT64)CONSTVAL(rs) * (UINT64)CONSTVAL(rt)) : ((INT64)CONSTVAL(rs) * (INT64)CONSTVAL(rt));
4626      emit_set_constant_value(drc, compiler, desc, REG_LO, (INT64)result);
4627      emit_set_constant_value(drc, compiler, desc, REG_HI, (INT64)(result >> 63));
4628   }
4629
4630   /* otherwise, handle generically */
4631   else
4632   {
4633      UINT8 mulreg = ISCONST(rt) ? REG_ECX : X86REG(rt);
4634
4635      hi = compiler_register_allocate(drc, compiler, desc, REG_HI, ALLOC_DST | ALLOC_DIRTY);
4636      lo = compiler_register_allocate(drc, compiler, desc, REG_LO, ALLOC_DST | ALLOC_DIRTY);
4637
4638      emit_load_register_value(drc, compiler, REG_RAX, rs);                        // mov  rax,<rs>
4639      emit_load_register_value(drc, compiler, mulreg, rt);                        // mov  <mulreg>,<rt>
4640      if (is_unsigned)
4641         emit_mul_r64(DRCTOP, mulreg);                                       // mul  <mulreg>
4642      else
4643         emit_imul_r64(DRCTOP, mulreg);                                       // imul <mulreg>
4644      emit_mov_r64_r64(DRCTOP, X86REG(hi), REG_RDX);                              // mov  <hi>,rdx
4645      emit_mov_r64_r64(DRCTOP, X86REG(lo), REG_RAX);                              // mov  <lo>,rax
4646   }
4647   return TRUE;
4648}
4649
4650
4651/*-------------------------------------------------
4652    compile_div - compile a 32-bit divide
4653    instruction
4654
4655    div   rS,rT
4656    divu  rS,rT
4657-------------------------------------------------*/
4658
4659static int compile_div(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned)
4660{
4661   UINT32 op = *desc->opptr;
4662   mipsreg_state rs, rt, lo, hi;
4663
4664   /* allocate source registers */
4665   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4666   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4667
4668   /* if rT is constant and 0, just skip */
4669   if (ISCONST(rt) && CONSTVAL(rt) == 0)
4670      return TRUE;
4671
4672   /* if both constant, we know the answer up front */
4673   if (ISCONST(rs) && ISCONST(rt))
4674   {
4675      UINT32 result = is_unsigned ? ((UINT32)CONSTVAL(rs) / (UINT32)CONSTVAL(rt)) : ((INT32)CONSTVAL(rs) / (INT32)CONSTVAL(rt));
4676      UINT32 remainder = is_unsigned ? ((UINT32)CONSTVAL(rs) % (UINT32)CONSTVAL(rt)) : ((INT32)CONSTVAL(rs) % (INT32)CONSTVAL(rt));
4677
4678      emit_set_constant_value(drc, compiler, desc, REG_LO, (INT32)result);
4679      emit_set_constant_value(drc, compiler, desc, REG_HI, (INT32)remainder);
4680   }
4681
4682   /* otherwise, handle generically */
4683   else
4684   {
4685      UINT8 divreg = ISCONST(rt) ? REG_ECX : X86REG(rt);
4686      emit_link skip = { 0 };
4687
4688      hi = compiler_register_allocate(drc, compiler, desc, REG_HI, ALLOC_DST | ALLOC_DIRTY);
4689      lo = compiler_register_allocate(drc, compiler, desc, REG_LO, ALLOC_DST | ALLOC_DIRTY);
4690
4691      emit_load_register_value(drc, compiler, REG_RAX, rs);                        // mov  rax,<rs>
4692      emit_load_register_value(drc, compiler, divreg, rt);                        // mov  <divreg>,<rt>
4693      if (!ISCONST(rt))
4694      {
4695         emit_test_r32_r32(DRCTOP, divreg, divreg);                              // test <divreg>,<divreg>
4696         emit_jcc_short_link(DRCTOP, COND_Z, &skip);                              // jz   skip
4697      }
4698      if (is_unsigned)
4699      {
4700         emit_xor_r32_r32(DRCTOP, REG_EDX, REG_EDX);                              // xor  edx,edx
4701         emit_div_r32(DRCTOP, divreg);                                       // div  <divreg>
4702      }
4703      else
4704      {
4705         emit_cdq(DRCTOP);                                                // cdq
4706         emit_idiv_r32(DRCTOP, divreg);                                       // idiv <divreg>
4707      }
4708      emit_movsxd_r64_r32(DRCTOP, X86REG(hi), REG_EDX);                           // movsxd <hi>,edx
4709      emit_movsxd_r64_r32(DRCTOP, X86REG(lo), REG_EAX);                           // movsxd <lo>,eax
4710      if (!ISCONST(rt))
4711         resolve_link(DRCTOP, &skip);                                    // skip:
4712   }
4713   return TRUE;
4714}
4715
4716
4717/*-------------------------------------------------
4718    compile_ddiv - compile a 64-bit divide
4719    instruction
4720
4721    ddiv   rS,rT
4722    ddivu  rS,rT
4723-------------------------------------------------*/
4724
4725static int compile_ddiv(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned)
4726{
4727   UINT32 op = *desc->opptr;
4728   mipsreg_state rs, rt, lo, hi;
4729
4730   /* allocate source registers */
4731   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4732   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4733
4734   /* if rT is constant and 0, just skip */
4735   if (ISCONST(rt) && CONSTVAL(rt) == 0)
4736      return TRUE;
4737
4738   /* if both constant, we know the answer up front */
4739   if (ISCONST(rs) && ISCONST(rt))
4740   {
4741      UINT32 result = is_unsigned ? ((UINT32)CONSTVAL(rs) / (UINT32)CONSTVAL(rt)) : ((INT32)CONSTVAL(rs) / (INT32)CONSTVAL(rt));
4742      UINT32 remainder = is_unsigned ? ((UINT32)CONSTVAL(rs) % (UINT32)CONSTVAL(rt)) : ((INT32)CONSTVAL(rs) % (INT32)CONSTVAL(rt));
4743
4744      emit_set_constant_value(drc, compiler, desc, REG_LO, (INT32)result);
4745      emit_set_constant_value(drc, compiler, desc, REG_HI, (INT32)remainder);
4746   }
4747
4748   /* if one is a constant, load the constant into EAX and multiple from there */
4749   else
4750   {
4751      UINT8 divreg = ISCONST(rt) ? REG_ECX : X86REG(rt);
4752      emit_link skip = { 0 };
4753
4754      hi = compiler_register_allocate(drc, compiler, desc, REG_HI, ALLOC_DST | ALLOC_DIRTY);
4755      lo = compiler_register_allocate(drc, compiler, desc, REG_LO, ALLOC_DST | ALLOC_DIRTY);
4756
4757      emit_load_register_value(drc, compiler, REG_RAX, rs);                        // mov  rax,<rs>
4758      emit_load_register_value(drc, compiler, divreg, rt);                        // mov  <divreg>,<rt>
4759      emit_test_r64_r64(DRCTOP, divreg, divreg);                                 // test <divreg>,<divreg>
4760      emit_jcc_short_link(DRCTOP, COND_Z, &skip);                                 // jz   skip
4761      if (is_unsigned)
4762      {
4763         emit_xor_r32_r32(DRCTOP, REG_EDX, REG_EDX);                              // xor  edx,edx
4764         emit_div_r64(DRCTOP, divreg);                                       // div  <divreg>
4765      }
4766      else
4767      {
4768         emit_cqo(DRCTOP);                                                // cqo
4769         emit_idiv_r64(DRCTOP, divreg);                                       // idiv <divreg>
4770      }
4771      emit_mov_r64_r64(DRCTOP, X86REG(hi), REG_EDX);                              // mov  <hi>,edx
4772      emit_mov_r64_r64(DRCTOP, X86REG(lo), REG_EAX);                              // mov  <loreg>,eax
4773      resolve_link(DRCTOP, &skip);                                       // skip:
4774   }
4775   return TRUE;
4776}
4777
4778
4779/*-------------------------------------------------
4780    compile_logical - compile a logical
4781    operation between two registers
4782
4783    0: and rD,rS,rT / and rT,rS,UIMM
4784    1: or  rD,rS,rT / or  rT,rS,UIMM
4785    2: xor rD,rS,rT / xor rT,rS,UIMM
4786    3: nor rD,rS,rT
4787-------------------------------------------------*/
4788
4789static int compile_logical(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int operation, int immediate)
4790{
4791   UINT32 op = *desc->opptr;
4792   UINT8 destreg = immediate ? RTREG : RDREG;
4793   mipsreg_state rd, rs, rt;
4794
4795   assert(operation >= 0 && operation <= 3);
4796   assert(!immediate || operation != 3);
4797
4798   /* if the destination is r0, bail */
4799   if (destreg == 0)
4800      return TRUE;
4801
4802   /* allocate source registers */
4803   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4804   rt = immediate ? MAKE_CONST(UIMMVAL) : compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4805
4806   /* if both constant, we know the answer up front */
4807   if (ISCONST(rs) && ISCONST(rt))
4808   {
4809      UINT64 result = (operation == 0) ? (CONSTVAL(rs) & CONSTVAL(rt)) : (operation == 1) ? (CONSTVAL(rs) | CONSTVAL(rt)) : (operation == 2) ? (CONSTVAL(rs) ^ CONSTVAL(rt)) : ~(CONSTVAL(rs) | CONSTVAL(rt));
4810      emit_set_constant_value(drc, compiler, desc, destreg, result);
4811   }
4812
4813   /* an AND against 0 is constant as well */
4814   else if (operation == 0 && ISCONST(rt) && CONSTVAL(rt) == 0)
4815      emit_set_constant_value(drc, compiler, desc, destreg, 0);
4816
4817   /* else do the operation in code */
4818   else
4819   {
4820      rd = compiler_register_allocate(drc, compiler, desc, destreg, ALLOC_DST | ALLOC_DIRTY);
4821
4822      /* if rD matches rT, or if rS is const and rT isn't, then swap rT and rS */
4823      if (X86REG(rd) == X86REG(rt) || (ISCONST(rs) && !ISCONST(rt)))
4824      {
4825         mipsreg_state temp = rs;
4826         rs = rt;
4827         rt = temp;
4828      }
4829
4830      /* load rS into rD */
4831      emit_load_register_value(drc, compiler, X86REG(rd), rs);                     // mov  <rd>,<rs>
4832
4833      /* if rD does not match rT, we can work directly in rD */
4834      if (!ISCONST(rt))
4835      {
4836         if (operation == 0)
4837            emit_and_r64_r64(DRCTOP, X86REG(rd), X86REG(rt));                     // and  <rd>,<rt>
4838         else if (operation == 1)
4839            emit_or_r64_r64(DRCTOP, X86REG(rd), X86REG(rt));                     // or   <rd>,<rt>
4840         else if (operation == 2)
4841            emit_xor_r64_r64(DRCTOP, X86REG(rd), X86REG(rt));                     // xor  <rd>,<rt>
4842         else if (operation == 3)
4843         {
4844            emit_or_r64_r64(DRCTOP, X86REG(rd), X86REG(rt));                     // or   <rd>,<rt>
4845            emit_not_r64(DRCTOP, X86REG(rd));                                 // not  <rd>
4846         }
4847      }
4848      else
4849      {
4850         if (operation == 0)
4851            emit_and_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rt));                     // and  <rd>,CONSTVAL(rt)
4852         else if (operation == 1 && CONSTVAL(rt) != 0)
4853            emit_or_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rt));                     // or   <rd>,CONSTVAL(rt)
4854         else if (operation == 2 && CONSTVAL(rt) != 0)
4855            emit_xor_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rt));                     // xor  <rd>,CONSTVAL(rt)
4856         else if (operation == 3)
4857         {
4858            if (CONSTVAL(rt) != 0)
4859               emit_or_r64_imm(DRCTOP, X86REG(rd), CONSTVAL(rt));                  // or   <rd>,CONSTVAL(rt)
4860            emit_not_r64(DRCTOP, X86REG(rd));                                 // not  <rd>
4861         }
4862      }
4863   }
4864   return TRUE;
4865}
4866
4867
4868/*-------------------------------------------------
4869    compile_slt - compile a set if less
4870    than btween two registers
4871
4872    slti  rD,rS,rT / slti  rT,rS,SIMM
4873    sltiu rD,rS,rT / sltiu rT,rS,SIMM
4874-------------------------------------------------*/
4875
4876static int compile_slt(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_unsigned, int immediate)
4877{
4878   UINT32 op = *desc->opptr;
4879   UINT8 destreg = immediate ? RTREG : RDREG;
4880   mipsreg_state rd, rs, rt;
4881
4882   /* if the destination is r0, bail */
4883   if (destreg == 0)
4884      return TRUE;
4885
4886   /* allocate source registers */
4887   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4888   rt = immediate ? MAKE_CONST(SIMMVAL) : compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
4889
4890   /* if the source is constant, compute as constant */
4891   if (ISCONST(rs) && ISCONST(rt))
4892   {
4893      INT64 result = is_unsigned ? ((UINT32)CONSTVAL(rs) < (UINT32)CONSTVAL(rt)) : ((INT32)CONSTVAL(rs) < (INT32)CONSTVAL(rt));
4894      emit_set_constant_value(drc, compiler, desc, destreg, result);
4895   }
4896
4897   /* else do the operation in code */
4898   else
4899   {
4900      UINT8 rsreg = ISCONST(rs) ? REG_RAX : X86REG(rs);
4901
4902      rd = compiler_register_allocate(drc, compiler, desc, destreg, ALLOC_DST | ALLOC_DIRTY);
4903
4904      emit_load_register_value(drc, compiler, rsreg, rs);                           // mov  <rsreg>,<rs>
4905      if (ISCONST(rt))
4906         emit_cmp_r64_imm(DRCTOP, rsreg, CONSTVAL(rt));                           // cmp  <rsreg>,<rt>
4907      else
4908         emit_cmp_r64_r64(DRCTOP, rsreg, X86REG(rt));                           // cmp  <rsreg>,<rt>
4909      emit_setcc_r8(DRCTOP, is_unsigned ? COND_B : COND_L, X86REG(rd));               // setb/l <rd>
4910      emit_movzx_r32_r8(DRCTOP, X86REG(rd), X86REG(rd));                           // movzx <rd>,<rd>
4911   }
4912   return TRUE;
4913}
4914
4915
4916/*-------------------------------------------------
4917    compile_load - compile a memory load
4918    instruction
4919
4920    lb   rT,SIMM(rS)
4921    lbu  rT,SIMM(rS)
4922    lh   rT,SIMM(rS)
4923    lhu  rT,SIMM(rS)
4924    lw   rT,SIMM(rS)
4925    lwu  rT,SIMM(rS)
4926    ld   rT,SIMM(rS)
4927-------------------------------------------------*/
4928
4929static int compile_load(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, int is_unsigned)
4930{
4931   UINT32 op = *desc->opptr;
4932   mipsreg_state rs, rt;
4933   int was_fixed = FALSE;
4934
4935   /* allocate source registers */
4936   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
4937   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_DST);
4938
4939   /* if rS is constant, we know the address at compile time; this simplifies the code */
4940   if (ISCONST(rs) && !DISABLE_FIXED_RAM_LOAD)
4941   {
4942      UINT8 destreg = (RTREG == 0) ? REG_RAX : X86REG(rt);
4943
4944      /* perform a fixed read if we can */
4945      if (size == 1)
4946         was_fixed = emit_fixed_byte_read(drc, compiler, desc, destreg, is_unsigned, CONSTVAL(rs) + SIMMVAL);
4947      else if (size == 2)
4948         was_fixed = emit_fixed_half_read(drc, compiler, desc, destreg, is_unsigned, CONSTVAL(rs) + SIMMVAL);
4949      else if (size == 4)
4950         was_fixed = emit_fixed_word_read(drc, compiler, desc, destreg, is_unsigned, CONSTVAL(rs) + SIMMVAL, 0);
4951      else
4952         was_fixed = emit_fixed_double_read(drc, compiler, desc, destreg, CONSTVAL(rs) + SIMMVAL, 0);
4953   }
4954
4955   /* otherwise, we just need to call the appropriate subroutine */
4956   else
4957   {
4958      if (ISCONST(rs))
4959         emit_mov_r32_imm(DRCTOP, REG_P1, CONSTVAL(rs) + SIMMVAL);                  // mov  p1,<rs> + SIMMVAL
4960      else
4961         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rs), SIMMVAL));                  // lea  p1,[<rs> + SIMMVAL]
4962      if (size == 1 && is_unsigned)
4963         emit_call(DRCTOP, mips3.drcdata->general.read_byte_unsigned);               // call general.read_byte_unsigned
4964      else if (size == 1 && !is_unsigned)
4965         emit_call(DRCTOP, mips3.drcdata->general.read_byte_signed);                  // call general.read_byte_signed
4966      else if (size == 2 && is_unsigned)
4967         emit_call(DRCTOP, mips3.drcdata->general.read_half_unsigned);               // call general.read_half_unsigned
4968      else if (size == 2 && !is_unsigned)
4969         emit_call(DRCTOP, mips3.drcdata->general.read_half_signed);                  // call general.read_half_signed
4970      else if (size == 4 && is_unsigned)
4971         emit_call(DRCTOP, mips3.drcdata->general.read_word_unsigned);               // call general.read_word_unsigned
4972      else if (size == 4 && !is_unsigned)
4973         emit_call(DRCTOP, mips3.drcdata->general.read_word_signed);                  // call general.read_word_signed
4974      else
4975         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
4976      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
4977      if (RTREG != 0)
4978         emit_mov_r64_r64(DRCTOP, X86REG(rt), REG_RAX);                           // mov  <rt>,rax
4979   }
4980
4981   /* only mark dirty after the exception risk is over */
4982   compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_DIRTY);
4983
4984   /* update cycle counts */
4985   if (!was_fixed)
4986   {
4987      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
4988      compiler->cycles = 0;
4989      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
4990   }
4991   return TRUE;
4992}
4993
4994
4995/*-------------------------------------------------
4996    compile_load_cop - compile a COP memory load
4997    instruction
4998
4999    lwc1 rT,SIMM(rs)
5000    lwc2 rT,SIMM(rs)
5001    ldc1 rT,SIMM(rs)
5002    ldc2 rT,SIMM(rs)
5003-------------------------------------------------*/
5004
5005static int compile_load_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *dest)
5006{
5007   UINT32 op = *desc->opptr;
5008   int was_fixed = FALSE;
5009   mipsreg_state rs;
5010
5011   /* allocate source registers */
5012   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5013
5014   /* if rS is constant, we know the address at compile time; this simplifies the code */
5015   if (ISCONST(rs) && !DISABLE_FIXED_RAM_LOAD)
5016   {
5017      /* perform a fixed read if we can */
5018      if (size == 4)
5019         was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, CONSTVAL(rs) + SIMMVAL, 0);
5020      else
5021         was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, CONSTVAL(rs) + SIMMVAL, 0);
5022   }
5023
5024   /* otherwise, we just need to call the appropriate subroutine */
5025   else
5026   {
5027      if (ISCONST(rs))
5028         emit_mov_r32_imm(DRCTOP, REG_P1, CONSTVAL(rs) + SIMMVAL);                  // mov  p1,<rs> + SIMMVAL
5029      else
5030         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rs), SIMMVAL));                  // lea  p1,[<rs> + SIMMVAL]
5031      if (size == 4)
5032         emit_call(DRCTOP, mips3.drcdata->general.read_word_unsigned);               // call general.read_word_unsigned
5033      else
5034         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
5035      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
5036   }
5037
5038   /* complete the load by moving to the destination address */
5039   if (size == 4)
5040      emit_mov_m32_r32(DRCTOP, MDRC(dest), REG_EAX);                              // mov  [dest],eax
5041   else
5042      emit_mov_m64_r64(DRCTOP, MDRC(dest), REG_RAX);                              // mov  [dest],rax
5043
5044   /* update cycle counts */
5045   if (!was_fixed)
5046   {
5047      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5048      compiler->cycles = 0;
5049      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5050   }
5051   return TRUE;
5052}
5053
5054
5055/*-------------------------------------------------
5056    compile_loadx_cop - compile a COP indexed
5057    memory load instruction
5058
5059    lwxc1 fD,rS,rT
5060    ldxc1 fD,rS,rT
5061-------------------------------------------------*/
5062
5063static int compile_loadx_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *dest)
5064{
5065   UINT32 op = *desc->opptr;
5066   int was_fixed = FALSE;
5067   mipsreg_state rs, rt;
5068
5069   /* allocate source registers */
5070   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5071   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
5072
5073   /* if rS is constant, we know the address at compile time; this simplifies the code */
5074   if (ISCONST(rs) && ISCONST(rt) && !DISABLE_FIXED_RAM_LOAD)
5075   {
5076      /* perform a fixed read if we can */
5077      if (size == 4)
5078         was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, CONSTVAL(rs) + CONSTVAL(rt), 0);
5079      else
5080         was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, CONSTVAL(rs) + CONSTVAL(rt), 0);
5081   }
5082
5083   /* otherwise, we just need to call the appropriate subroutine */
5084   else
5085   {
5086      if (ISCONST(rs) && ISCONST(rt))
5087         emit_mov_r32_imm(DRCTOP, REG_P1, CONSTVAL(rs) + CONSTVAL(rt));               // mov  p1,<rs> + <rt>
5088      else if (ISCONST(rs))
5089         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rt), CONSTVAL(rs)));            // lea  p1,[<rt> + <rs>]
5090      else if (ISCONST(rt))
5091         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rs), CONSTVAL(rt)));            // lea  p1,[<rs> + <rt>]
5092      else
5093         emit_lea_r32_m32(DRCTOP, REG_P1, MBISD(X86REG(rs), X86REG(rt), 1, 0));         // lea  p1,[<rs> + <rt>]
5094      if (size == 4)
5095         emit_call(DRCTOP, mips3.drcdata->general.read_word_unsigned);               // call general.read_word_unsigned
5096      else
5097         emit_call(DRCTOP, mips3.drcdata->general.read_double);                     // call general.read_double
5098      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
5099   }
5100
5101   /* complete the load by moving to the destination address */
5102   if (size == 4)
5103      emit_mov_m32_r32(DRCTOP, MDRC(dest), REG_EAX);                              // mov  [dest],eax
5104   else
5105      emit_mov_m64_r64(DRCTOP, MDRC(dest), REG_RAX);                              // mov  [dest],rax
5106
5107   /* update cycle counts */
5108   if (!was_fixed)
5109   {
5110      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5111      compiler->cycles = 0;
5112      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5113   }
5114   return TRUE;
5115}
5116
5117
5118/*-------------------------------------------------
5119    compile_load_word_partial - compile a lwl/lwr
5120    instruction
5121
5122    lwl   rT,SIMM(rS)
5123    lwr   rT,SIMM(rS)
5124-------------------------------------------------*/
5125
5126static int compile_load_word_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right)
5127{
5128   UINT32 op = *desc->opptr;
5129   int was_fixed = FALSE;
5130   mipsreg_state rs, rt;
5131
5132   /* allocate source/dest registers */
5133   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5134   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC | ALLOC_DST | ALLOC_DIRTY);
5135
5136   /* if rS is constant, we know the address at compile time; this simplifies the code */
5137   if (ISCONST(rs) && !DISABLE_FIXED_RAM_LOAD)
5138   {
5139      INT32 addr = CONSTVAL(rs) + SIMMVAL;
5140      int shift = (addr & 3) * 8;
5141
5142      /* shift the opposite amount depending on right/left and endianness */
5143      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5144         shift ^= 0x18;
5145
5146      /* read the double value into rax, handling exceptions */
5147      was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, addr, is_right ? (~((UINT32)-1 << shift)) : (~((UINT32)-1 >> shift)));
5148
5149      /* handle writing back the register */
5150      if (RTREG != 0)
5151      {
5152         UINT32 mask = is_right ? (~((UINT32)-1 >> shift)) : (~((UINT32)-1 << shift));
5153
5154         /* AND rT with the mask */
5155         emit_and_r32_imm(DRCTOP, X86REG(rt), mask);                              // and  <rt>,mask
5156
5157         /* shift and merge rax into the X86REG(rt) */
5158         if (!is_right)
5159            emit_shl_r32_imm(DRCTOP, REG_EAX, shift);                           // shl  eax,shift
5160         else
5161            emit_shr_r32_imm(DRCTOP, REG_EAX, shift);                           // shr  eax,shift
5162         emit_or_r32_r32(DRCTOP, X86REG(rt), REG_EAX);                           // or   <rtdst>,eax
5163         emit_movsxd_r64_r32(DRCTOP, X86REG(rt), X86REG(rt));                     // movsxd <rt>,<rt>
5164      }
5165   }
5166
5167   /* otherwise, we need to compute everything at runtime */
5168   else
5169   {
5170      /* compute the address and mask values */
5171      emit_lea_r32_m32(DRCTOP, REG_EAX, MBD(X86REG(rs), SIMMVAL));                  // lea  eax,[<rs> + SIMMVAL]
5172      emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                        // lea  ecx,[rax*8]
5173      emit_or_r32_imm(DRCTOP, REG_P2, -1);                                    // or   p2,-1
5174      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5175         emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                              // xor  ecx,0x18
5176      emit_and_r32_imm(DRCTOP, REG_EAX, ~3);                                    // and  eax,~3
5177      if (!is_right)
5178         emit_shr_r32_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
5179      else
5180         emit_shl_r32_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
5181      emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);                  // mov  [sp+savecl],cl
5182      emit_not_r32(DRCTOP, REG_P2);                                          // not  p2
5183      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                                 // mov  p1,eax
5184      emit_call(DRCTOP, mips3.drcdata->general.read_word_masked);                     // call general.read_word_masked
5185      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
5186
5187      /* handle writing back the register */
5188      if (RTREG != 0)
5189      {
5190         /* recompute the mask */
5191         emit_mov_r8_m8(DRCTOP, REG_CL, MBD(REG_RSP, SPOFFS_SAVECL));               // mov  cl,[sp+savecl]
5192         emit_or_r32_imm(DRCTOP, REG_P2, -1);                                 // or   p2,-1
5193         if (!is_right)
5194            emit_shl_r32_cl(DRCTOP, REG_P2);                                 // shl  p2,cl
5195         else
5196            emit_shr_r32_cl(DRCTOP, REG_P2);                                 // shr  p2,cl
5197
5198         /* apply the shifts and masks */
5199         emit_not_r32(DRCTOP, REG_P2);                                       // not  p2
5200         if (!is_right)
5201            emit_shl_r32_cl(DRCTOP, REG_RAX);                                 // shl  rax,cl
5202         else
5203            emit_shr_r32_cl(DRCTOP, REG_RAX);                                 // shr  rax,cl
5204         emit_and_r32_r32(DRCTOP, X86REG(rt), REG_P2);                           // and  <rt>,p2
5205         emit_or_r32_r32(DRCTOP, X86REG(rt), REG_RAX);                           // or   <rt>,rax
5206         emit_movsxd_r64_r32(DRCTOP, X86REG(rt), X86REG(rt));                     // movsxd <rt>,<rt>
5207      }
5208   }
5209
5210   /* update cycle counts */
5211   if (!was_fixed)
5212   {
5213      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5214      compiler->cycles = 0;
5215      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5216   }
5217   return TRUE;
5218}
5219
5220
5221/*-------------------------------------------------
5222    compile_load_double_partial - compile a
5223    ldl/ldr instruction
5224
5225    ldl   rT,SIMM(rS)
5226    ldr   rT,SIMM(rS)
5227-------------------------------------------------*/
5228
5229static int compile_load_double_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right)
5230{
5231   UINT32 op = *desc->opptr;
5232   int was_fixed = FALSE;
5233   mipsreg_state rs, rt;
5234
5235   /* allocate source/dest registers */
5236   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5237   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC | ALLOC_DST | ALLOC_DIRTY);
5238
5239   /* if rS is constant, we know the address at compile time; this simplifies the code */
5240   if (ISCONST(rs) && !DISABLE_FIXED_RAM_LOAD)
5241   {
5242      INT32 addr = CONSTVAL(rs) + SIMMVAL;
5243      int shift = (addr & 7) * 8;
5244
5245      /* shift the opposite amount depending on right/left and endianness */
5246      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5247         shift ^= 0x38;
5248
5249      /* read the double value into rax, handling exceptions */
5250      was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, addr, is_right ? (~((UINT64)-1 << shift)) : (~((UINT64)-1 >> shift)));
5251
5252      /* handle writing back the register */
5253      if (RTREG != 0)
5254      {
5255         UINT64 mask = is_right ? (~((UINT64)-1 >> shift)) : (~((UINT64)-1 << shift));
5256
5257         /* AND rT with the mask, using 32 bits if we can */
5258         if ((INT32)mask == (INT64)mask)
5259            emit_and_r64_imm(DRCTOP, X86REG(rt), (INT32)mask);                     // and  <rt>,mask
5260         else
5261         {
5262            emit_mov_r64_imm(DRCTOP, REG_P2, mask);                              // mov  p2,mask
5263            emit_and_r64_r64(DRCTOP, X86REG(rt), REG_P2);                        // and  <rt>,p2
5264         }
5265
5266         /* shift and merge rax into the X86REG(rt) */
5267         if (!is_right)
5268            emit_shl_r64_imm(DRCTOP, REG_RAX, shift);                           // shl  rax,shift
5269         else
5270            emit_shr_r64_imm(DRCTOP, REG_RAX, shift);                           // shr  rax,shift
5271         emit_or_r64_r64(DRCTOP, X86REG(rt), REG_RAX);                           // or   <rt>,rax
5272      }
5273   }
5274
5275   /* otherwise, we need to compute everything at runtime */
5276   else
5277   {
5278      /* compute the address and mask values */
5279      emit_lea_r32_m32(DRCTOP, REG_EAX, MBD(X86REG(rs), SIMMVAL));                  // lea  eax,[<rs> + SIMMVAL]
5280      emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                        // lea  ecx,[rax*8]
5281      emit_or_r64_imm(DRCTOP, REG_P2, -1);                                    // or   p2,-1
5282      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5283         emit_xor_r32_imm(DRCTOP, REG_ECX, 0x38);                              // xor  ecx,0x38
5284      emit_and_r32_imm(DRCTOP, REG_EAX, ~7);                                    // and  eax,~7
5285      if (!is_right)
5286         emit_shr_r64_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
5287      else
5288         emit_shl_r64_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
5289      emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);                  // mov  [sp+savecl],cl
5290      emit_not_r64(DRCTOP, REG_P2);                                          // not  p2
5291      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                                 // mov  p1,eax
5292      emit_call(DRCTOP, mips3.drcdata->general.read_double_masked);                  // call general.read_double_masked
5293      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
5294
5295      /* handle writing back the register */
5296      if (RTREG != 0)
5297      {
5298         /* recompute the mask */
5299         emit_mov_r8_m8(DRCTOP, REG_CL, MBD(REG_RSP, SPOFFS_SAVECL));               // mov  cl,[sp+savecl]
5300         emit_or_r64_imm(DRCTOP, REG_P2, -1);                                 // or   p2,-1
5301         if (!is_right)
5302            emit_shl_r64_cl(DRCTOP, REG_P2);                                 // shl  p2,cl
5303         else
5304            emit_shr_r64_cl(DRCTOP, REG_P2);                                 // shr  p2,cl
5305
5306         /* apply the shifts and masks */
5307         emit_not_r64(DRCTOP, REG_P2);                                       // not  p2
5308         if (!is_right)
5309            emit_shl_r64_cl(DRCTOP, REG_RAX);                                 // shl  rax,cl
5310         else
5311            emit_shr_r64_cl(DRCTOP, REG_RAX);                                 // shr  rax,cl
5312         emit_and_r64_r64(DRCTOP, X86REG(rt), REG_P2);                           // and  <rt>,p2
5313         emit_or_r64_r64(DRCTOP, X86REG(rt), REG_RAX);                           // or   <rt>,rax
5314      }
5315   }
5316
5317   /* update cycle counts */
5318   if (!was_fixed)
5319   {
5320      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5321      compiler->cycles = 0;
5322      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5323   }
5324   return TRUE;
5325}
5326
5327
5328/*-------------------------------------------------
5329    compile_store - compile a memory store
5330    instruction
5331
5332    sb   rT,SIMM(rS)
5333    sh   rT,SIMM(rS)
5334    sw   rT,SIMM(rS)
5335    sd   rT,SIMM(rS)
5336-------------------------------------------------*/
5337
5338static int compile_store(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size)
5339{
5340   UINT32 op = *desc->opptr;
5341   int was_fixed = FALSE;
5342   mipsreg_state rs, rt;
5343
5344   /* allocate source registers */
5345   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5346   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
5347
5348   /* if rS is constant, we know the address at compile time; this simplifies the code */
5349   if (ISCONST(rs) && !DISABLE_FIXED_RAM_STORE)
5350   {
5351      /* perform a fixed write if we can */
5352      if (size == 1)
5353         was_fixed = emit_fixed_byte_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL);
5354      else if (size == 2)
5355         was_fixed = emit_fixed_half_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL);
5356      else if (size == 4)
5357         was_fixed = emit_fixed_word_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL, 0);
5358      else
5359         was_fixed = emit_fixed_double_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL, 0);
5360   }
5361
5362   /* otherwise, we just need to call the appropriate subroutine */
5363   else
5364   {
5365      if (ISCONST(rs))
5366         emit_mov_r32_imm(DRCTOP, REG_P1, CONSTVAL(rs) + SIMMVAL);                  // mov  p1,<rs> + SIMMVAL
5367      else
5368         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rs), SIMMVAL));                  // lea  p1,[<rs> + SIMMVAL]
5369      emit_load_register_value(drc, compiler, REG_P2, rt);                        // mov  p2,<rt>
5370      if (size == 1)
5371         emit_call(DRCTOP, mips3.drcdata->general.write_byte);                     // call general.write_byte
5372      else if (size == 2)
5373         emit_call(DRCTOP, mips3.drcdata->general.write_half);                     // call general.write_half
5374      else if (size == 4)
5375         emit_call(DRCTOP, mips3.drcdata->general.write_word);                     // call general.write_word
5376      else if (size == 8)
5377         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call general.write_double
5378      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
5379   }
5380
5381   /* update cycle counts */
5382   if (!was_fixed)
5383   {
5384      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5385      compiler->cycles = 0;
5386      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5387   }
5388   return TRUE;
5389}
5390
5391
5392/*-------------------------------------------------
5393    compile_store_cop - compile a COP memory
5394    store instruction
5395
5396    swc1 rT,SIMM(rs)
5397    swc2 rT,SIMM(rs)
5398    sdc1 rT,SIMM(rs)
5399    sdc2 rT,SIMM(rs)
5400-------------------------------------------------*/
5401
5402static int compile_store_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *src)
5403{
5404   UINT32 op = *desc->opptr;
5405   int was_fixed = FALSE;
5406   mipsreg_state rs;
5407
5408   /* allocate source registers */
5409   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5410
5411   /* load the value into P2 */
5412   if (size == 4)
5413      emit_mov_r32_m32(DRCTOP, REG_P2, MDRC(src));                              // mov  p2,[src]
5414   else
5415      emit_mov_r64_m64(DRCTOP, REG_P2, MDRC(src));                              // mov  p2,[src]
5416
5417   /* if rS is constant, we know the address at compile time; this simplifies the code */
5418   if (ISCONST(rs) && !DISABLE_FIXED_RAM_STORE)
5419   {
5420      /* perform a fixed write if we can */
5421      if (size == 4)
5422         was_fixed = emit_fixed_word_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + SIMMVAL, 0);
5423      else
5424         was_fixed = emit_fixed_double_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + SIMMVAL, 0);
5425   }
5426
5427   /* otherwise, we just need to call the appropriate subroutine */
5428   else
5429   {
5430      if (ISCONST(rs))
5431         emit_mov_r32_imm(DRCTOP, REG_P1, CONSTVAL(rs) + SIMMVAL);                  // mov  p1,<rs> + SIMMVAL
5432      else
5433         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rs), SIMMVAL));                  // lea  p1,[<rs> + SIMMVAL]
5434      if (size == 4)
5435         emit_call(DRCTOP, mips3.drcdata->general.write_word);                     // call general.write_word
5436      else if (size == 8)
5437         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call general.write_double
5438      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
5439   }
5440
5441   /* update cycle counts */
5442   if (!was_fixed)
5443   {
5444      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5445      compiler->cycles = 0;
5446      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5447   }
5448   return TRUE;
5449}
5450
5451
5452/*-------------------------------------------------
5453    compile_storex_cop - compile a COP indexed
5454    memory store instruction
5455
5456    swxc1 fD,rS,rT
5457    sdxc1 fD,rS,rT
5458-------------------------------------------------*/
5459
5460static int compile_storex_cop(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int size, void *src)
5461{
5462   UINT32 op = *desc->opptr;
5463   int was_fixed = FALSE;
5464   mipsreg_state rs, rt;
5465
5466   /* allocate source registers */
5467   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5468   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
5469
5470   /* load the value into P2 */
5471   if (size == 4)
5472      emit_mov_r32_m32(DRCTOP, REG_P2, MDRC(src));                              // mov  p2,[src]
5473   else
5474      emit_mov_r64_m64(DRCTOP, REG_P2, MDRC(src));                              // mov  p2,[src]
5475
5476   /* if rS is constant, we know the address at compile time; this simplifies the code */
5477   if (ISCONST(rs) && ISCONST(rt) && !DISABLE_FIXED_RAM_STORE)
5478   {
5479      /* perform a fixed write if we can */
5480      if (size == 4)
5481         was_fixed = emit_fixed_word_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + CONSTVAL(rt), 0);
5482      else
5483         was_fixed = emit_fixed_double_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + CONSTVAL(rt), 0);
5484   }
5485
5486   /* otherwise, we just need to call the appropriate subroutine */
5487   else
5488   {
5489      if (ISCONST(rs) && ISCONST(rt))
5490         emit_mov_r32_imm(DRCTOP, REG_P1, CONSTVAL(rs) + CONSTVAL(rt));               // mov  p1,<rs> + <rt>
5491      else if (ISCONST(rs))
5492         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rt), CONSTVAL(rs)));            // lea  p1,[<rt> + <rs>]
5493      else if (ISCONST(rt))
5494         emit_lea_r32_m32(DRCTOP, REG_P1, MBD(X86REG(rs), CONSTVAL(rt)));            // lea  p1,[<rs> + <rt>]
5495      else
5496         emit_lea_r32_m32(DRCTOP, REG_P1, MBISD(X86REG(rs), X86REG(rt), 1, 0));         // lea  p1,[<rs> + <rt>]
5497      if (size == 4)
5498         emit_call(DRCTOP, mips3.drcdata->general.write_word);                     // call general.write_word
5499      else if (size == 8)
5500         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call general.write_double
5501      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
5502   }
5503
5504   /* update cycle counts */
5505   if (!was_fixed)
5506   {
5507      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5508      compiler->cycles = 0;
5509      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5510   }
5511   return TRUE;
5512}
5513
5514
5515/*-------------------------------------------------
5516    compile_store_word_partial - compile a swl/swr
5517    instruction
5518
5519    swl   rT,SIMM(rS)
5520    swr   rT,SIMM(rS)
5521-------------------------------------------------*/
5522
5523static int compile_store_word_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right)
5524{
5525   UINT32 op = *desc->opptr;
5526   int was_fixed = FALSE;
5527   mipsreg_state rs, rt;
5528
5529   /* allocate source registers */
5530   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5531   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
5532
5533   /* if rS is constant, we know the address at compile time; this simplifies the code */
5534   if (ISCONST(rs) && !DISABLE_FIXED_RAM_STORE)
5535   {
5536      INT32 addr = CONSTVAL(rs) + SIMMVAL;
5537      int shift = (addr & 3) * 8;
5538      UINT32 mask;
5539
5540      /* shift the opposite amount depending on right/left and endianness */
5541      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5542         shift ^= 0x18;
5543
5544      /* if rT is not constant, load and shift it */
5545      if (!ISCONST(rt))
5546      {
5547         emit_mov_r32_r32(DRCTOP, REG_EAX, X86REG(rt));                           // mov  eax,X86REG(rt)
5548         emit_shr_r32_imm(DRCTOP, REG_EAX, shift);                              // shr  eax,shift
5549         rt = MAKE_DESTREG(REG_EAX);
5550      }
5551
5552      /* compute shifted value and mask */
5553      if (!is_right)
5554      {
5555         if (ISCONST(rt))
5556            rt = MAKE_CONST((UINT32)CONSTVAL(rt) >> shift);
5557         mask = ~((UINT64)-1 >> shift);
5558      }
5559      else
5560      {
5561         if (ISCONST(rt))
5562            rt = MAKE_CONST((UINT32)CONSTVAL(rt) << shift);
5563         mask = ~((UINT64)-1 << shift);
5564      }
5565
5566      /* perform a fixed write */
5567      was_fixed = emit_fixed_word_write(drc, compiler, desc, rt, addr & ~3, mask);
5568   }
5569
5570   /* otherwise, we need to compute everything at runtime */
5571   else
5572   {
5573      /* compute the address and mask values */
5574      emit_lea_r32_m32(DRCTOP, REG_EAX, MBD(X86REG(rs), SIMMVAL));                  // lea  eax,[<rs> + SIMMVAL]
5575      emit_or_r32_imm(DRCTOP, REG_P3, -1);                                    // or   p3,-1
5576      emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                        // lea  ecx,[rax*8]
5577      emit_load_register_value(drc, compiler, REG_P2, rt);                        // mov  p2,<rt>
5578      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5579         emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                              // xor  ecx,0x18
5580      emit_and_r32_imm(DRCTOP, REG_EAX, ~3);                                    // and  eax,~3
5581      if (!is_right)
5582      {
5583         emit_shr_r32_cl(DRCTOP, REG_P3);                                    // shr  p3,cl
5584         emit_shr_r32_cl(DRCTOP, REG_P2);                                    // shr  p2,cl
5585      }
5586      else
5587      {
5588         emit_shl_r32_cl(DRCTOP, REG_P3);                                    // shl  p3,cl
5589         emit_shl_r32_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
5590      }
5591      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                                 // mov  p1,eax
5592      emit_not_r32(DRCTOP, REG_P3);                                          // not  p3
5593
5594      /* perform the write */
5595      emit_call(DRCTOP, mips3.drcdata->general.write_word_masked);                  // call general.write_word_masked
5596      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
5597   }
5598
5599   /* update cycle counts */
5600   if (!was_fixed)
5601   {
5602      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5603      compiler->cycles = 0;
5604      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5605   }
5606   return TRUE;
5607}
5608
5609
5610/*-------------------------------------------------
5611    compile_store_double_partial - compile a
5612    sdl/sdr instruction
5613
5614    sdl   rT,SIMM(rS)
5615    sdr   rT,SIMM(rS)
5616-------------------------------------------------*/
5617
5618static int compile_store_double_partial(drc_core *drc, compiler_state *compiler, const mips3_opcode_desc *desc, int is_right)
5619{
5620   UINT32 op = *desc->opptr;
5621   int was_fixed = FALSE;
5622   mipsreg_state rs, rt;
5623
5624   /* allocate source registers */
5625   rs = compiler_register_allocate(drc, compiler, desc, RSREG, ALLOC_SRC);
5626   rt = compiler_register_allocate(drc, compiler, desc, RTREG, ALLOC_SRC);
5627
5628   /* if rS is constant, we know the address at compile time; this simplifies the code */
5629   if (ISCONST(rs) && !DISABLE_FIXED_RAM_STORE)
5630   {
5631      INT32 addr = CONSTVAL(rs) + SIMMVAL;
5632      int shift = (addr & 7) * 8;
5633      UINT64 mask;
5634
5635      /* shift the opposite amount depending on right/left and endianness */
5636      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5637         shift ^= 0x38;
5638
5639      /* if rT is not constant, load and shift it */
5640      if (!ISCONST(rt))
5641      {
5642         emit_mov_r64_r64(DRCTOP, REG_RAX, X86REG(rt));                              // mov  rax,X86REG(rt)
5643         emit_shr_r64_imm(DRCTOP, REG_RAX, shift);                              // shr  rax,shift
5644         rt = MAKE_DESTREG(REG_RAX);
5645      }
5646
5647      /* compute shifted value and mask */
5648      if (!is_right)
5649      {
5650         if (ISCONST(rt))
5651            rt = MAKE_CONST((UINT64)CONSTVAL(rt) >> shift);
5652         mask = ~((UINT64)-1 >> shift);
5653      }
5654      else
5655      {
5656         if (ISCONST(rt))
5657            rt = MAKE_CONST((UINT64)CONSTVAL(rt) << shift);
5658         mask = ~((UINT64)-1 << shift);
5659      }
5660
5661      /* perform a fixed write */
5662      was_fixed = emit_fixed_double_write(drc, compiler, desc, rt, addr & ~7, mask);
5663   }
5664
5665   /* otherwise, we need to compute everything at runtime */
5666   else
5667   {
5668      /* compute the address and mask values */
5669      emit_lea_r32_m32(DRCTOP, REG_EAX, MBD(X86REG(rs), SIMMVAL));            // lea  eax,[<rs> + SIMMVAL]
5670      emit_or_r64_imm(DRCTOP, REG_P3, -1);                              // or   p3,-1
5671      emit_lea_r32_m32(DRCTOP, REG_ECX, MISD(REG_RAX, 8, 0));                  // lea  ecx,[rax*8]
5672      emit_load_register_value(drc, compiler, REG_P2, rt);                  // mov  p2,<rt>
5673      if ((!mips3.core->bigendian && !is_right) || (mips3.core->bigendian && is_right))
5674         emit_xor_r32_imm(DRCTOP, REG_ECX, 0x38);                        // xor  ecx,0x38
5675      emit_and_r32_imm(DRCTOP, REG_EAX, ~7);                              // and  eax,~7
5676      if (!is_right)
5677      {
5678         emit_shr_r64_cl(DRCTOP, REG_P3);                              // shr  p3,cl
5679         emit_shr_r64_cl(DRCTOP, REG_P2);                              // shr  p2,cl
5680      }
5681      else
5682      {
5683         emit_shl_r64_cl(DRCTOP, REG_P3);                              // shl  p3,cl
5684         emit_shl_r64_cl(DRCTOP, REG_P2);                              // shl  p2,cl
5685      }
5686      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                           // mov  p1,eax
5687      emit_not_r64(DRCTOP, REG_P3);                                    // not  p3
5688
5689      /* perform the write */
5690      emit_call(DRCTOP, mips3.drcdata->general.write_double_masked);            // call general.write_double_masked
5691      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbstore_exception);
5692   }
5693
5694   /* update cycle counts */
5695   if (!was_fixed)
5696   {
5697      emit_sub_m32_imm(DRCTOP, ICOUNTADDR, compiler->cycles);
5698      compiler->cycles = 0;
5699      oob_request_callback(drc, COND_S, oob_interrupt_cleanup, compiler, desc, mips3.drc->exit_point);
5700   }
5701   return TRUE;
5702}
src/emu/cpu/mips/mips3fe.c
r1051r1052
4747    FUNCTION PROTOTYPES
4848***************************************************************************/
4949
50static mips3_opcode_desc **build_sequence(mips3_opcode_desc **tailptr, int start, int end, UINT32 endflag, int maxseq);
51
5052static int describe_one(mips3_state *mips, UINT32 curpc, mips3_opcode_desc *curdesc);
5153static void describe_instruction(mips3_state *mips, UINT32 pc, UINT32 op, mips3_opcode_desc *desc);
5254static void describe_instruction_special(mips3_state *mips, UINT32 pc, UINT32 op, mips3_opcode_desc *desc);
r1051r1052
140142    the given range
141143-------------------------------------------------*/
142144
143mips3_opcode_desc *mips3fe_describe_sequence(mips3_state *mips, UINT32 startpc, UINT32 minpc, UINT32 maxpc)
145mips3_opcode_desc *mips3fe_describe_sequence(mips3_state *mips, UINT32 startpc, UINT32 minpc, UINT32 maxpc, int maxseq)
144146{
145147   pc_stack_entry pcstack[MAX_STACK_DEPTH];
146148   pc_stack_entry *pcstackptr = &pcstack[0];
147149   mips3_opcode_desc *head, **tailptr;
148   int descnum, descend;
149150
150151   /* make sure our array is big enough */
151152   if ((maxpc - minpc) / 4 + 10 > desc_array_size)
r1051r1052
221222   }
222223
223224   /* now build the list of descriptions in order */
225   /* first from startpc -> maxpc, then from minpc -> startpc */
224226   head = NULL;
225   tailptr = &head;
226
227   /* first from startpc -> maxpc */
228   descend = (maxpc - minpc) / 4;
229   for (descnum = (startpc - minpc) / 4; descnum < descend; descnum++)
230      if (desc_array[descnum] != NULL)
231      {
232         /* if this is a likely branch and we need the delay slot, mark it as end-of-sequence */
233         if ((desc_array[descnum]->flags & IDESC_IS_LIKELY_BRANCH) && desc_array[descnum + 1] != NULL)
234            desc_array[descnum]->flags |= IDESC_END_SEQUENCE;
235
236         /* if the next instruction is a branch target, mark this instruction as end of sequence */
237         if (descnum != descend - 1 && desc_array[descnum + 1] != NULL && (desc_array[descnum + 1]->flags & IDESC_IS_BRANCH_TARGET))
238            desc_array[descnum]->flags |= IDESC_END_SEQUENCE;
239
240         /* if we are the last instruction, indicate end-of-sequence and redispatch */
241         if (descnum == descend - 1 || (descnum == descend - 2 && (desc_array[descnum]->flags & IDESC_IS_LIKELY_BRANCH)))
242            desc_array[descnum]->flags |= IDESC_REDISPATCH | IDESC_END_SEQUENCE;
243
244         /* add us to the end of the list */
245         *tailptr = desc_array[descnum];
246         tailptr = &desc_array[descnum]->next;
247         desc_array[descnum] = NULL;
248      }
249
250   /* then from minpc -> startpc */
251   descend = (startpc - minpc) / 4;
252   for (descnum = (minpc - minpc) / 4; descnum < descend; descnum++)
253      if (desc_array[descnum] != NULL)
254      {
255         /* if this is a likely branch and we need the delay slot, mark it as end-of-sequence */
256         if ((desc_array[descnum]->flags & IDESC_IS_LIKELY_BRANCH) && desc_array[descnum + 1] != NULL)
257            desc_array[descnum]->flags |= IDESC_END_SEQUENCE;
258
259         /* if the next instruction is a branch target, mark this instruction as end of sequence */
260         if (descnum != descend - 1 && desc_array[descnum + 1] != NULL && (desc_array[descnum + 1]->flags & IDESC_IS_BRANCH_TARGET))
261            desc_array[descnum]->flags |= IDESC_END_SEQUENCE;
262
263         /* if we are the last instruction, indicate return-to-start and redispatch */
264         if (descnum == descend - 1 || (descnum == descend - 2 && (desc_array[descnum]->flags & IDESC_IS_LIKELY_BRANCH)))
265            desc_array[descnum]->flags |= IDESC_RETURN_TO_START | IDESC_END_SEQUENCE;
266
267         /* add us to the end of the list */
268         *tailptr = desc_array[descnum];
269         tailptr = &desc_array[descnum]->next;
270         desc_array[descnum] = NULL;
271      }
272
227   tailptr = build_sequence(&head, (startpc - minpc) / 4, (maxpc - minpc) / 4, IDESC_REDISPATCH, maxseq);
228   tailptr = build_sequence(tailptr, (minpc - minpc) / 4, (startpc - minpc) / 4, IDESC_RETURN_TO_START, maxseq);
273229   return head;
274230}
275231
r1051r1052
294250
295251
296252/***************************************************************************
253    INTERNAL HELPERS
254***************************************************************************/
255
256/*-------------------------------------------------
257    accumulate_live_info_forwards - recursively
258    accumulate live register liveness information
259    walking in a forward direction
260-------------------------------------------------*/
261
262static void accumulate_live_info_forwards(mips3_opcode_desc *desc, UINT64 *gprread, UINT64 *gprwrite, UINT64 *fprread, UINT64 *fprwrite)
263{
264   /* set the initial information */
265   desc->gpr.liveread = (*gprread |= desc->gpr.used);
266   desc->gpr.livewrite = (*gprwrite |= desc->gpr.modified);
267   desc->fpr.liveread = (*fprread |= desc->fpr.used);
268   desc->fpr.livewrite = (*fprwrite |= desc->fpr.modified);
269
270   /* recursively handle delay slots */
271   if (desc->delay != NULL)
272      accumulate_live_info_forwards(desc->delay, gprread, gprwrite, fprread, fprwrite);
273}
274
275
276/*-------------------------------------------------
277    accumulate_live_info_backwards - recursively
278    accumulate live register liveness information
279    walking in a backwards direction
280-------------------------------------------------*/
281
282static void accumulate_live_info_backwards(mips3_opcode_desc *desc, UINT64 *gprread, UINT64 *gprwrite, UINT64 *fprread, UINT64 *fprwrite)
283{
284   /* recursively handle delay slots */
285   if (desc->delay != NULL)
286      accumulate_live_info_backwards(desc->delay, gprread, gprwrite, fprread, fprwrite);
287
288   /* accumulate the info from this instruction */
289   desc->gpr.liveread &= (*gprread |= desc->gpr.used);
290   desc->gpr.livewrite &= (*gprwrite |= desc->gpr.modified);
291   desc->fpr.liveread &= (*fprread |= desc->fpr.used);
292   desc->fpr.livewrite &= (*fprwrite |= desc->fpr.modified);
293}
294
295
296/*-------------------------------------------------
297    build_sequence - build an ordered sequence
298    of instructions
299-------------------------------------------------*/
300
301static mips3_opcode_desc **build_sequence(mips3_opcode_desc **tailptr, int start, int end, UINT32 endflag, int maxseq)
302{
303   UINT64 gprread = 0, gprwrite = 0;
304   UINT64 fprread = 0, fprwrite = 0;
305   int consecutive = 0;
306   int seqstart = -1;
307   int descnum;
308
309   /* iterate in order from start to end, picking up all non-NULL instructions */
310   for (descnum = start; descnum < end; descnum++)
311      if (desc_array[descnum] != NULL)
312      {
313         mips3_opcode_desc *desc = desc_array[descnum];
314         mips3_opcode_desc *next = NULL;
315         int nextoffs;
316
317         /* determine the next instruction */
318         nextoffs = (desc->flags & IDESC_IS_LIKELY_BRANCH) ? 2 : 1;
319         if (descnum + nextoffs < end)
320            next = desc_array[descnum + nextoffs];
321
322         /* start a new sequence if we aren't already in the middle of one */
323         if (seqstart == -1)
324            seqstart = descnum;
325
326         /* if this is a likely branch and there is a branch into the delay slot, mark it as */
327         /* end-of-sequence so that the common flow will branch over it */
328         if ((desc->flags & IDESC_IS_LIKELY_BRANCH) && desc_array[descnum + 1] != NULL)
329            desc->flags |= IDESC_END_SEQUENCE;
330
331         /* if the next instruction is a branch target, mark this instruction as end of sequence */
332         if (next != NULL && (next->flags & IDESC_IS_BRANCH_TARGET))
333            desc->flags |= IDESC_END_SEQUENCE;
334
335         /* if we are the last instruction, indicate end-of-sequence and redispatch */
336         if (next == NULL)
337            desc->flags |= IDESC_END_SEQUENCE | endflag;
338
339         /* if we exceed the maximum consecutive count, cut off the sequence */
340         if (!(desc->flags & IDESC_END_SEQUENCE) && ++consecutive >= maxseq)
341            desc->flags |= IDESC_END_SEQUENCE;
342         if (desc->flags & IDESC_END_SEQUENCE)
343            consecutive = 0;
344
345         /* update register accumulators */
346         accumulate_live_info_forwards(desc, &gprread, &gprwrite, &fprread, &fprwrite);
347
348         /* if this is the end of a sequence, work backwards */
349         if (desc->flags & IDESC_END_SEQUENCE)
350         {
351            int backdesc;
352
353            /* loop until all the registers have been accounted for */
354            gprread = gprwrite = 0;
355            fprread = fprwrite = 0;
356            for (backdesc = descnum; backdesc != seqstart - 1; backdesc--)
357               if (desc_array[backdesc] != NULL)
358                  accumulate_live_info_backwards(desc_array[backdesc], &gprread, &gprwrite, &fprread, &fprwrite);
359
360            /* reset the register states */
361            seqstart = -1;
362            gprread = gprwrite = 0;
363            fprread = fprwrite = 0;
364         }
365
366         /* add us to the end of the list and clear our array slot */
367         *tailptr = desc;
368         tailptr = &desc->next;
369      }
370
371   /* zap the array */
372   memset(&desc_array[start], 0, (end - start) * sizeof(desc_array[0]));
373
374   /* return the final tailptr */
375   return tailptr;
376}
377
378
379
380/***************************************************************************
297381    INSTRUCTION PARSERS
298382***************************************************************************/
299383
r1051r1052
310394   curdesc->targetpc = ~0;
311395   curdesc->flags = 0;
312396   curdesc->cycles = 1;
313   curdesc->intused = 0;
314   curdesc->intmod = 0;
315   curdesc->fpused = 0;
316   curdesc->fpmod = 0;
397   curdesc->gpr.used = 0;
398   curdesc->gpr.modified = 0;
399   curdesc->gpr.liveread = 0;
400   curdesc->gpr.livewrite = 0;
401   curdesc->fpr.used = 0;
402   curdesc->fpr.modified = 0;
403   curdesc->fpr.liveread = 0;
404   curdesc->fpr.livewrite = 0;
317405
318406   /* determine the physical PC and pointer to opcode for this instruction */
319407   curdesc->physpc = curpc;
r1051r1052
391479         break;
392480
393481      case 0x03:   /* JAL */
394         desc->intmod |= REGFLAG_R(31);
482         desc->gpr.modified |= REGFLAG_R(31);
395483         desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
396484         desc->targetpc = (pc & 0xf0000000) | (LIMMVAL << 2);
397485         break;
r1051r1052
407495            desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
408496         else
409497         {
410            desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
498            desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
411499            desc->flags |= IDESC_IS_CONDITIONAL_BRANCH;
412500         }
413501         desc->targetpc = pc + 4 + (SIMMVAL << 2);
r1051r1052
424512            desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
425513         else
426514         {
427            desc->intused |= REGFLAG_R(RSREG);
515            desc->gpr.used |= REGFLAG_R(RSREG);
428516            desc->flags |= IDESC_IS_CONDITIONAL_BRANCH;
429517         }
430518         desc->targetpc = pc + 4 + (SIMMVAL << 2);
r1051r1052
432520
433521      case 0x08:   /* ADDI */
434522      case 0x18:   /* DADDI */
435         desc->intused |= REGFLAG_R(RSREG);
436         desc->intmod |= REGFLAG_R(RTREG);
523         desc->gpr.used |= REGFLAG_R(RSREG);
524         desc->gpr.modified |= REGFLAG_R(RTREG);
437525         desc->flags |= IDESC_CAN_CAUSE_EXCEPTION;
438526         break;
439527
r1051r1052
444532      case 0x0d:   /* ORI */
445533      case 0x0e:   /* XORI */
446534      case 0x19:   /* DADDIU */
447         desc->intused |= REGFLAG_R(RSREG);
448         desc->intmod |= REGFLAG_R(RTREG);
535         desc->gpr.used |= REGFLAG_R(RSREG);
536         desc->gpr.modified |= REGFLAG_R(RTREG);
449537         break;
450538
451539      case 0x0f:   /* LUI */
452         desc->intmod |= REGFLAG_R(RTREG);
540         desc->gpr.modified |= REGFLAG_R(RTREG);
453541         break;
454542
455543      case 0x1a:   /* LDL */
456544      case 0x1b:   /* LDR */
545      case 0x22:   /* LWL */
546      case 0x26:   /* LWR */
547         desc->gpr.used |= REGFLAG_R(RTREG);
457548      case 0x20:   /* LB */
458549      case 0x21:   /* LH */
459      case 0x22:   /* LWL */
460550      case 0x23:   /* LW */
461551      case 0x24:   /* LBU */
462552      case 0x25:   /* LHU */
463      case 0x26:   /* LWR */
464553      case 0x27:   /* LWU */
465554      case 0x30:   /* LL */
466555      case 0x34:   /* LLD */
467556      case 0x37:   /* LD */
468         desc->intused |= REGFLAG_R(RSREG);
469         desc->intmod |= REGFLAG_R(RTREG);
557         desc->gpr.used |= REGFLAG_R(RSREG);
558         desc->gpr.modified |= REGFLAG_R(RTREG);
470559         desc->flags |= IDESC_READS_MEMORY | IDESC_CAN_CAUSE_EXCEPTION;
471560         break;
472561
r1051r1052
480569      case 0x38:   /* SC */
481570      case 0x3c:   /* SCD */
482571      case 0x3f:   /* SD */
483         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
572         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
484573         desc->flags |= IDESC_WRITES_MEMORY | IDESC_CAN_CAUSE_EXCEPTION;
485574         break;
486575
487576      case 0x31:   /* LWC1 */
488577      case 0x35:   /* LDC1 */
489         desc->intused |= REGFLAG_R(RSREG);
490         desc->fpmod |= REGFLAG_CPR1(RTREG);
578         desc->gpr.used |= REGFLAG_R(RSREG);
579         desc->fpr.modified |= REGFLAG_CPR1(RTREG);
491580         desc->flags |= IDESC_READS_MEMORY | IDESC_CAN_CAUSE_EXCEPTION;
492581         break;
493582
494583      case 0x39:   /* SWC1 */
495584      case 0x3d:   /* SDC1 */
496         desc->intused |= REGFLAG_R(RSREG);
497         desc->fpused |= REGFLAG_CPR1(RTREG);
585         desc->gpr.used |= REGFLAG_R(RSREG);
586         desc->fpr.used |= REGFLAG_CPR1(RTREG);
498587         desc->flags |= IDESC_WRITES_MEMORY | IDESC_CAN_CAUSE_EXCEPTION;
499588         break;
500589
501590      case 0x32:   /* LWC2 */
502591      case 0x36:   /* LDC2 */
503         desc->intused |= REGFLAG_R(RSREG);
592         desc->gpr.used |= REGFLAG_R(RSREG);
504593         desc->flags |= IDESC_READS_MEMORY | IDESC_CAN_CAUSE_EXCEPTION;
505594         break;
506595
507596      case 0x3a:   /* SWC2 */
508597      case 0x3e:   /* SDC2 */
509         desc->intused |= REGFLAG_R(RSREG);
598         desc->gpr.used |= REGFLAG_R(RSREG);
510599         desc->flags |= IDESC_WRITES_MEMORY | IDESC_CAN_CAUSE_EXCEPTION;
511600         break;
512601
r1051r1052
527616   }
528617
529618   /* remove any modifications of R0 */
530   desc->intmod &= ~REGFLAG_R(0);
619   desc->gpr.modified &= ~REGFLAG_R(0);
531620}
532621
533622
r1051r1052
550639      case 0x3c:   /* DSLL32 */
551640      case 0x3e:   /* DSRL32 */
552641      case 0x3f:   /* DSRA32 */
553         desc->intused |= REGFLAG_R(RTREG);
554         desc->intmod |= REGFLAG_R(RDREG);
642         desc->gpr.used |= REGFLAG_R(RTREG);
643         desc->gpr.modified |= REGFLAG_R(RDREG);
555644         break;
556645
557646      case 0x0a:   /* MOVZ - MIPS IV */
r1051r1052
561650            invalid_opcode(desc);
562651            break;
563652         }
653         desc->gpr.used |= REGFLAG_R(RDREG);
564654      case 0x04:   /* SLLV */
565655      case 0x06:   /* SRLV */
566656      case 0x07:   /* SRAV */
r1051r1052
577667      case 0x2b:   /* SLTU */
578668      case 0x2d:   /* DADDU */
579669      case 0x2f:   /* DSUBU */
580         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
581         desc->intmod |= REGFLAG_R(RDREG);
670         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
671         desc->gpr.modified |= REGFLAG_R(RDREG);
582672         break;
583673
584674      case 0x20:   /* ADD */
585675      case 0x22:   /* SUB */
586676      case 0x2c:   /* DADD */
587677      case 0x2e:   /* DSUB */
588         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
589         desc->intmod |= REGFLAG_R(RDREG);
678         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
679         desc->gpr.modified |= REGFLAG_R(RDREG);
590680         desc->flags |= IDESC_CAN_CAUSE_EXCEPTION;
591681         break;
592682
r1051r1052
596686      case 0x33:   /* TLTU */
597687      case 0x34:   /* TEQ */
598688      case 0x36:   /* TNE */
599         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
689         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
600690         desc->flags |= IDESC_CAN_CAUSE_EXCEPTION;
601691         break;
602692
r1051r1052
606696            invalid_opcode(desc);
607697            break;
608698         }
609         desc->intused |= REGFLAG_R(RSREG);
610         desc->fpused |= REGFLAG_FCC;
611         desc->intmod |= REGFLAG_R(RDREG);
699         desc->gpr.used |= REGFLAG_R(RSREG);
700         desc->fpr.used |= REGFLAG_FCC;
701         desc->gpr.modified |= REGFLAG_R(RDREG);
612702         break;
613703
614704      case 0x08:   /* JR */
615         desc->intused |= REGFLAG_R(RSREG);
705         desc->gpr.used |= REGFLAG_R(RSREG);
616706         desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
617707         break;
618708
619709      case 0x09:   /* JALR */
620         desc->intused |= REGFLAG_R(RSREG);
621         desc->intmod |= REGFLAG_R(RDREG);
710         desc->gpr.used |= REGFLAG_R(RSREG);
711         desc->gpr.modified |= REGFLAG_R(RDREG);
622712         desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
623713         break;
624714
625715      case 0x10:   /* MFHI */
626         desc->intused |= REGFLAG_HI;
627         desc->intmod |= REGFLAG_R(RDREG);
716         desc->gpr.used |= REGFLAG_HI;
717         desc->gpr.modified |= REGFLAG_R(RDREG);
628718         break;
629719
630720      case 0x11:   /* MTHI */
631         desc->intused |= REGFLAG_R(RSREG);
632         desc->intmod |= REGFLAG_HI;
721         desc->gpr.used |= REGFLAG_R(RSREG);
722         desc->gpr.modified |= REGFLAG_HI;
633723         break;
634724
635725      case 0x12:   /* MFLO */
636         desc->intused |= REGFLAG_LO;
637         desc->intmod |= REGFLAG_R(RDREG);
726         desc->gpr.used |= REGFLAG_LO;
727         desc->gpr.modified |= REGFLAG_R(RDREG);
638728         break;
639729
640730      case 0x13:   /* MTLO */
641         desc->intused |= REGFLAG_R(RSREG);
642         desc->intmod |= REGFLAG_LO;
731         desc->gpr.used |= REGFLAG_R(RSREG);
732         desc->gpr.modified |= REGFLAG_LO;
643733         break;
644734
645735      case 0x18:   /* MULT */
646736      case 0x19:   /* MULTU */
647         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
648         desc->intmod |= REGFLAG_LO | REGFLAG_HI;
737         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
738         desc->gpr.modified |= REGFLAG_LO | REGFLAG_HI;
649739         desc->cycles = 3;
650740         break;
651741
652742      case 0x1a:   /* DIV */
653743      case 0x1b:   /* DIVU */
654         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
655         desc->intmod |= REGFLAG_LO | REGFLAG_HI;
744         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
745         desc->gpr.modified |= REGFLAG_LO | REGFLAG_HI;
656746         desc->cycles = 35;
657747         break;
658748
659749      case 0x1c:   /* DMULT */
660750      case 0x1d:   /* DMULTU */
661         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
662         desc->intmod |= REGFLAG_LO | REGFLAG_HI;
751         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
752         desc->gpr.modified |= REGFLAG_LO | REGFLAG_HI;
663753         desc->cycles = 7;
664754         break;
665755
666756      case 0x1e:   /* DDIV */
667757      case 0x1f:   /* DDIVU */
668         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
669         desc->intmod |= REGFLAG_LO | REGFLAG_HI;
758         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
759         desc->gpr.modified |= REGFLAG_LO | REGFLAG_HI;
670760         desc->cycles = 67;
671761         break;
672762
r1051r1052
707797            desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
708798         else
709799         {
710            desc->intused |= REGFLAG_R(RSREG);
800            desc->gpr.used |= REGFLAG_R(RSREG);
711801            desc->flags |= IDESC_IS_CONDITIONAL_BRANCH;
712802         }
713803         desc->targetpc = pc + 4 + (SIMMVAL << 2);
r1051r1052
719809      case 0x0b:   /* TLTIU */
720810      case 0x0c:   /* TEQI */
721811      case 0x0e:   /* TNEI */
722         desc->intused |= REGFLAG_R(RSREG);
812         desc->gpr.used |= REGFLAG_R(RSREG);
723813         desc->flags |= IDESC_CAN_CAUSE_EXCEPTION;
724814         break;
725815
r1051r1052
734824            desc->flags |= IDESC_IS_UNCONDITIONAL_BRANCH | IDESC_END_SEQUENCE;
735825         else
736826         {
737            desc->intused |= REGFLAG_R(RSREG);
827            desc->gpr.used |= REGFLAG_R(RSREG);
738828            desc->flags |= IDESC_IS_CONDITIONAL_BRANCH;
739829         }
740         desc->intmod |= REGFLAG_R(31);
830         desc->gpr.modified |= REGFLAG_R(31);
741831         desc->targetpc = pc + 4 + (SIMMVAL << 2);
742832         break;
743833
r1051r1052
758848{
759849   switch (op & 0x1f)
760850   {
851      case 0: /* MAD */
852      case 1: /* MADU */
853         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG) | REGFLAG_LO | REGFLAG_HI;
854         desc->gpr.modified |= REGFLAG_LO | REGFLAG_HI;
855         break;
856
761857      case 2: /* MUL */
762         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
763         desc->intmod |= REGFLAG_R(RDREG);
858         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
859         desc->gpr.modified |= REGFLAG_R(RDREG);
764860         desc->cycles = 3;
765861         break;
766862
r1051r1052
787883      case 0x00:   /* MFCz */
788884      case 0x01:   /* DMFCz */
789885      case 0x02:   /* CFCz */
790         desc->intmod |= REGFLAG_R(RTREG);
886         desc->gpr.modified |= REGFLAG_R(RTREG);
791887         break;
792888
793889      case 0x04:   /* MTCz */
794890      case 0x05:   /* DMTCz */
795891      case 0x06:   /* CTCz */
796         desc->intused |= REGFLAG_R(RTREG);
892         desc->gpr.used |= REGFLAG_R(RTREG);
797893         if (RSREG == 0x04 || RSREG == 0x05)
798894         {
799895            if (RDREG == COP0_Cause)
r1051r1052
824920         {
825921            case 0x01:   /* TLBR */
826922            case 0x08:   /* TLBP */
923            case 0x20:   /* WAIT */
827924               break;
828925
829926            case 0x02:   /* TLBWI */
r1051r1052
863960   {
864961      case 0x00:   /* MFCz */
865962      case 0x01:   /* DMFCz */
866         desc->fpused |= REGFLAG_CPR1(RDREG);
867         desc->intmod |= REGFLAG_R(RTREG);
963         desc->fpr.used |= REGFLAG_CPR1(RDREG);
964         desc->gpr.modified |= REGFLAG_R(RTREG);
868965         break;
869966
870967      case 0x02:   /* CFCz */
871         desc->intmod |= REGFLAG_R(RTREG);
968         desc->gpr.modified |= REGFLAG_R(RTREG);
872969         break;
873970
874971      case 0x04:   /* MTCz */
875972      case 0x05:   /* DMTCz */
876         desc->intused |= REGFLAG_R(RTREG);
877         desc->fpmod |= REGFLAG_CPR1(RDREG);
973         desc->gpr.used |= REGFLAG_R(RTREG);
974         desc->fpr.modified |= REGFLAG_CPR1(RDREG);
878975         break;
879976
880977      case 0x06:   /* CTCz */
881         desc->intused |= REGFLAG_R(RTREG);
978         desc->gpr.used |= REGFLAG_R(RTREG);
882979         break;
883980
884981      case 0x08:   /* BC */
r1051r1052
891988
892989            case 0x00:   /* BCzF */
893990            case 0x01:   /* BCzT */
894               desc->fpused |= REGFLAG_FCC;
991               desc->fpr.used |= REGFLAG_FCC;
895992               desc->flags |= IDESC_IS_CONDITIONAL_BRANCH;
896993               desc->targetpc = pc + 4 + (SIMMVAL << 2);
897994               break;
r1051r1052
9171014            case 0x01:   /* SUB */
9181015            case 0x02:   /* MUL */
9191016            case 0x03:   /* DIV */
920               desc->fpused |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG);
921               desc->fpmod |= REGFLAG_CPR1(FDREG);
1017               desc->fpr.used |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG);
1018               desc->fpr.modified |= REGFLAG_CPR1(FDREG);
9221019               break;
9231020
9241021            case 0x15:   /* RECIP - MIPS IV */
r1051r1052
9441041            case 0x21:   /* CVT.D */
9451042            case 0x24:   /* CVT.W */
9461043            case 0x25:   /* CVT.L */
947               desc->fpused |= REGFLAG_CPR1(FSREG);
948               desc->fpmod |= REGFLAG_CPR1(FDREG);
1044               desc->fpr.used |= REGFLAG_CPR1(FSREG);
1045               desc->fpr.modified |= REGFLAG_CPR1(FDREG);
9491046               break;
9501047
9511048            case 0x11:   /* MOVT/F - MIPS IV */
r1051r1052
9541051                  invalid_opcode(desc);
9551052                  break;
9561053               }
957               desc->fpused |= REGFLAG_CPR1(FSREG) | REGFLAG_FCC;
958               desc->fpmod |= REGFLAG_CPR1(FDREG);
1054               desc->fpr.used |= REGFLAG_CPR1(FSREG) | REGFLAG_FCC;
1055               desc->fpr.modified |= REGFLAG_CPR1(FDREG);
9591056               break;
9601057
9611058            case 0x30:   case 0x38:   /* C.F */
9621059            case 0x31:   case 0x39:   /* C.UN */
963               desc->fpmod |= REGFLAG_FCC;
1060               desc->fpr.modified |= REGFLAG_FCC;
9641061               break;
9651062
9661063            case 0x32:   case 0x3a:   /* C.EQ */
r1051r1052
9691066            case 0x35:   case 0x3d:   /* C.ULT */
9701067            case 0x36:   case 0x3e:   /* C.OLE */
9711068            case 0x37:   case 0x3f:   /* C.ULE */
972               desc->fpused |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG);
973               desc->fpmod |= REGFLAG_FCC;
1069               desc->fpr.used |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG);
1070               desc->fpr.modified |= REGFLAG_FCC;
9741071               break;
9751072
9761073            default: /* anything else */
r1051r1052
10011098   {
10021099      case 0x00:   /* LWXC1 */
10031100      case 0x01:   /* LDXC1 */
1004         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
1005         desc->fpmod |= REGFLAG_CPR1(FDREG);
1101         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
1102         desc->fpr.modified |= REGFLAG_CPR1(FDREG);
10061103         desc->flags |= IDESC_READS_MEMORY;
10071104         break;
10081105
10091106      case 0x02:   /* SWXC1 */
10101107      case 0x03:   /* SDXC1 */
1011         desc->intused |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
1012         desc->fpused |= REGFLAG_CPR1(FDREG);
1108         desc->gpr.used |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG);
1109         desc->fpr.used |= REGFLAG_CPR1(FDREG);
10131110         desc->flags |= IDESC_WRITES_MEMORY;
10141111         break;
10151112
r1051r1052
10211118      case 0x28:   case 0x29:   /* MSUB */
10221119      case 0x30:   case 0x31:   /* NMADD */
10231120      case 0x32:   case 0x39:   /* NMSUB */
1024         desc->fpused |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG) | REGFLAG_CPR1(FRREG);
1025         desc->fpmod |= REGFLAG_CPR1(FDREG);
1121         desc->fpr.used |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG) | REGFLAG_CPR1(FRREG);
1122         desc->fpr.modified |= REGFLAG_CPR1(FDREG);
10261123         break;
10271124
10281125      default: /* anything else */
r1051r1052
10481145      case 0x00:   /* MFCz */
10491146      case 0x01:   /* DMFCz */
10501147      case 0x02:   /* CFCz */
1051         desc->intmod |= REGFLAG_R(RTREG);
1148         desc->gpr.modified |= REGFLAG_R(RTREG);
10521149         break;
10531150
10541151      case 0x04:   /* MTCz */
10551152      case 0x05:   /* DMTCz */
10561153      case 0x06:   /* CTCz */
1057         desc->intused |= REGFLAG_R(RTREG);
1154         desc->gpr.used |= REGFLAG_R(RTREG);
10581155         break;
10591156
10601157      case 0x08:   /* BC */
src/emu/cpu/mips/mips3fe.h
r1051r1052
1818
1919/* register flags */
2020#define REGFLAG_R(n)               ((UINT64)1 << (n))
21#define REGFLAG_HI                  (REGFLAG_R(32))
22#define REGFLAG_LO                  (REGFLAG_R(33))
21#define REGFLAG_LO                  (REGFLAG_R(REG_LO))
22#define REGFLAG_HI                  (REGFLAG_R(REG_HI))
2323#define REGFLAG_CPR1(n)               ((UINT64)1 << (n))
2424#define REGFLAG_FCC                  (REGFLAG_CPR1(32))
2525
r1051r1052
5252    TYPE DEFINITIONS
5353***************************************************************************/
5454
55typedef struct _mips3_reginfo mips3_reginfo;
56struct _mips3_reginfo
57{
58   UINT64         used;                  /* bitmask of used registers */
59   UINT64         modified;               /* bitmask of modified registers */
60   UINT64         liveread;               /* bitmask of registers that are live for reading */
61   UINT64         livewrite;               /* bitmask of registers that are live for writing */
62};
63
64
5565typedef struct _mips3_opcode_desc mips3_opcode_desc;
5666struct _mips3_opcode_desc
5767{
r1051r1052
6777   UINT32         flags;                  /* opcode flags */
6878   UINT32         cycles;                  /* number of cycles needed to execute */
6979
70   UINT64         intused;               /* integer registers used */
71   UINT64         intmod;                  /* integer registers modified */
72   UINT64         fpused;                  /* FPU registers used */
73   UINT64         fpmod;                  /* FPU registers modified */
80   mips3_reginfo   gpr;                  /* register info for GPRs */
81   mips3_reginfo   fpr;                  /* register info for FPRs */
7482};
7583
7684
r1051r1052
8290void mips3fe_init(void);
8391void mips3fe_exit(void);
8492
85mips3_opcode_desc *mips3fe_describe_sequence(mips3_state *mips, UINT32 startpc, UINT32 minpc, UINT32 maxpc);
93mips3_opcode_desc *mips3fe_describe_sequence(mips3_state *mips, UINT32 startpc, UINT32 minpc, UINT32 maxpc, int maxseq);
8694void mips3fe_release_descriptions(mips3_opcode_desc *desc);
8795
8896#endif
src/emu/cpu/mips/mips3drc.c
r1051r1052
1515#include "cpuintrf.h"
1616#include "debugger.h"
1717#include "mips3com.h"
18#include "cpu/x86log.h"
1819
1920#ifdef PTR64
2021#include "cpu/x64drc.h"
r1051r1052
2324#include "cpu/x86drc.h"
2425#endif
2526
27extern unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op);
2628
2729
30
2831/***************************************************************************
2932    DEBUGGING
3033***************************************************************************/
r1051r1052
4750#define CACHE_SIZE            (32 * 1024 * 1024)
4851
4952
53/* hack when running comparison against the C core */
54#if COMPARE_AGAINST_C
55#undef  MIPS3_COUNT_READ_CYCLES
56#undef  MIPS3_CAUSE_READ_CYCLES
57#define MIPS3_COUNT_READ_CYCLES         0
58#define MIPS3_CAUSE_READ_CYCLES         0
59#endif
5060
61
62
5163/***************************************************************************
5264    MACROS
5365***************************************************************************/
r1051r1052
6274    STRUCTURES & TYPEDEFS
6375***************************************************************************/
6476
65/* code logging info */
66typedef struct _code_log_entry code_log_entry;
67struct _code_log_entry
68{
69   UINT32      pc;
70   UINT32      op;
71   x86code *   base;
72   const char *string;
73};
74
75
7677/* fast RAM info */
7778typedef struct _fast_ram_info fast_ram_info;
7879struct _fast_ram_info
r1051r1052
121122   UINT32         hotspot_select;
122123   hotspot_info   hotspot[MIPS3_MAX_HOTSPOTS];
123124
125   /* code logging */
126   x86log_context *log;
127
124128#if COMPARE_AGAINST_C
125129   /* memory state */
126130   UINT8         access_size;
r1051r1052
182186
183187   /* initialize the DRC to use the cache */
184188   mips3drc_init();
189
190   /* start up code logging */
191   if (LOG_CODE)
192      mips3.log = x86log_create_context("mips3drc.asm");
185193}
186194
187195
r1051r1052
229237
230238static void mips3_exit(void)
231239{
240   /* clean up code logging */
241   if (LOG_CODE)
242      x86log_free_context(mips3.log);
243
232244   /* clean up the DRC */
233245   mips3drc_exit();
234246   drc_exit(mips3.drc);
r1051r1052
288300
289301
290302/***************************************************************************
291    CODE LOGGING
303    COMMON UTILITIES
292304***************************************************************************/
293305
294#if LOG_CODE
295
296static code_log_entry code_log_buffer[MAX_INSTRUCTIONS*2];
297static int code_log_index;
298static FILE *logfile;
299
300
301306/*-------------------------------------------------
302    open_logfile - open the log file if it is
303    not already opened
307    fastram_ptr - return a pointer to the base of
308    memory containing the given address, if it
309    is within a fast RAM range; returns 0
310    otherwise
304311-------------------------------------------------*/
305312
306INLINE int open_logfile(void)
313#ifdef PTR64
314static void *fastram_ptr(offs_t addr, int size, int iswrite)
307315{
308   if (logfile == NULL)
309      logfile = fopen("mips3drc.asm", "w");
310   return (logfile != NULL);
311}
316   int ramnum;
312317
318   /* only direct maps are supported */
319   if (addr < 0x80000000 || addr >= 0xc0000000)
320      return NULL;
321   addr &= 0x1fffffff;
313322
314/*-------------------------------------------------
315    code_log_reset - reset the logging index
316-------------------------------------------------*/
323   /* adjust address for endianness */
324   if (mips3.core->bigendian)
325   {
326      if (size == 1)
327         addr ^= 3;
328      else if (size == 2)
329         addr ^= 2;
330   }
317331
318INLINE void code_log_reset(void)
319{
320   code_log_index = 0;
321}
332   /* search for fastram */
333   for (ramnum = 0; ramnum < MIPS3_MAX_FASTRAM; ramnum++)
334      if (mips3.fastram[ramnum].base != NULL && (!iswrite || !mips3.fastram[ramnum].readonly) &&
335         addr >= mips3.fastram[ramnum].start && addr <= mips3.fastram[ramnum].end)
336      {
337         return (UINT8 *)mips3.fastram[ramnum].base + (addr - mips3.fastram[ramnum].start);
338      }
322339
323
324/*-------------------------------------------------
325    code_log_add_entry - add an entry to the log
326-------------------------------------------------*/
327
328INLINE void code_log_add_entry(x86code *base, UINT32 pc, UINT32 op)
329{
330   code_log_buffer[code_log_index].base = base;
331   code_log_buffer[code_log_index].pc = pc;
332   code_log_buffer[code_log_index].op = op;
333   code_log_buffer[code_log_index].string = NULL;
334   code_log_index++;
340   return NULL;
335341}
342#endif
336343
337344
338/*-------------------------------------------------
339    code_log_add_entry_string - add a string
340    entry to the log
341-------------------------------------------------*/
342345
343INLINE void code_log_add_entry_string(x86code *base, const char *string, UINT32 param)
344{
345   code_log_buffer[code_log_index].base = base;
346   code_log_buffer[code_log_index].string = string;
347   code_log_buffer[code_log_index].op = param;
348   code_log_buffer[code_log_index].pc = 0;
349   code_log_index++;
350}
346/***************************************************************************
347    CODE LOGGING HELPERS
348***************************************************************************/
351349
352
353350/*-------------------------------------------------
354    code_log - actually log some code
351    log_add_disasm_comment - add a comment
352    including disassembly of a MIPS instruction
355353-------------------------------------------------*/
356354
357static void print_log_entry(code_log_entry *entry, x86code *cur, const char *x86buffer)
355static void log_add_disasm_comment(x86log_context *log, x86code *base, UINT32 pc, UINT32 op)
358356{
359   extern unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op);
360
361   /* if we have a match and a string, print it */
362   if (entry->string != NULL)
357   if (LOG_CODE)
363358   {
364      fprintf(logfile, "%p: %-50s ", cur, x86buffer);
365      fprintf(logfile, entry->string, entry->op);
366      fprintf(logfile, "\n");
367   }
368
369   /* otherwise, output with the original instruction to the right */
370   else
371   {
372      char buffer2[100];
373      dasmmips3(buffer2, entry->pc, entry->op);
374      fprintf(logfile, "%p: %-50s %08X: %s\n", cur, x86buffer, entry->pc, buffer2);
375   }
376}
377
378static void code_log(const char *label, x86code *start, x86code *stop)
379{
380   extern int i386_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, int mode);
381   x86code *cur = start;
382   int data_remaining = 0;
383
384   /* open the file, creating it if necessary */
385   if (!open_logfile())
386      return;
387   fprintf(logfile, "\n%s\n", label);
388
389   /* loop from the start until the cache top */
390   while (cur < stop)
391   {
392359      char buffer[100];
393      int op, lastop;
394      int bytes;
395
396      /* skip filler opcodes */
397      if (*cur == 0xcc)
398      {
399         cur++;
400         continue;
401      }
402
403      /* disassemble this instruction */
404#ifdef PTR64
405      /* look for special signatures and output as data */
406      if (cur[0] == 0x90 && cur[1] == 0xcc && cur[2] == 0x90 && cur[3] == 0xcc &&
407         cur[4] == 0x90 && cur[5] == 0xcc && cur[6] == 0x90 && cur[7] == 0xcc)
408         data_remaining = 2;
409
410      /* handle data cases first */
411      if (data_remaining > 0)
412      {
413         UINT64 data = *(UINT64 *)cur;
414         data_remaining--;
415         sprintf(buffer, "dq      %08X%08X", (UINT32)(data >> 32), (UINT32)data);
416         bytes = 8;
417      }
418      else
419         bytes = i386_dasm_one(buffer, (UINT32)(FPTR)cur, cur, 64) & DASMFLAG_LENGTHMASK;
420#else
421      bytes = i386_dasm_one(buffer, (UINT32)cur, cur, 32) & DASMFLAG_LENGTHMASK;
422#endif
423
424      /* look for a match in the registered opcodes */
425      lastop = -1;
426      for (op = 0; op < code_log_index; op++)
427         if (code_log_buffer[op].base == cur)
428         {
429            if (lastop != -1)
430               print_log_entry(&code_log_buffer[lastop], cur, "");
431            lastop = op;
432         }
433
434      /* if no match, just output the current instruction */
435      if (lastop == -1)
436         fprintf(logfile, "%p: %s\n", cur, buffer);
437
438      /* if we have a match and a string, print it */
439      else
440         print_log_entry(&code_log_buffer[lastop], cur, buffer);
441
442      /* advance past this instruction */
443      cur += bytes;
360      dasmmips3(buffer, pc, op);
361      x86log_add_comment(log, base, "%08X: %s", pc, buffer);
444362   }
445
446   /* flush the file */
447   fflush(logfile);
448363}
449364
450365
451366#ifdef PTR64
452367
453368/*-------------------------------------------------
454    desc_flags_log - generate a string
369    desc_flags_to_string - generate a string
455370    representing the instruction description
456371    flags
457372-------------------------------------------------*/
458373
459static const char *desc_flags_log(UINT32 flags)
374static const char *desc_flags_to_string(UINT32 flags)
460375{
461376   static char tempbuf[30];
462377   char *dest = tempbuf;
r1051r1052
507422
508423
509424/*-------------------------------------------------
510    desc_log - log a list of descriptions
425    log_register_list - log a list of GPR registers
511426-------------------------------------------------*/
512427
513static void desc_log(const mips3_opcode_desc *desclist, int indent)
428static void log_register_list(x86log_context *log, const char *string, UINT64 gprmask, UINT64 fprmask)
514429{
515   /* open the file, creating it if necessary */
516   if (!open_logfile())
430   int count = 0;
431   int regnum;
432
433   /* skip if nothing */
434   if ((gprmask & ~1) == 0 && fprmask == 0)
517435      return;
436
437   x86log_printf(log, "[%s:", string);
438
439   for (regnum = 1; regnum < 32; regnum++)
440      if (gprmask & ((UINT64)1 << regnum))
441         x86log_printf(log, "%sr%d", (count++ == 0) ? "" : ",", regnum);
442   if (gprmask & ((UINT64)1 << REG_LO))
443      x86log_printf(log, "%slo", (count++ == 0) ? "" : ",");
444   if (gprmask & ((UINT64)1 << REG_HI))
445      x86log_printf(log, "%shi", (count++ == 0) ? "" : ",");
446
447   for (regnum = 0; regnum < 32; regnum++)
448      if (fprmask & ((UINT64)1 << regnum))
449         x86log_printf(log, "%sfpr%d", (count++ == 0) ? "" : ",", regnum);
450   if (fprmask & REGFLAG_FCC)
451      x86log_printf(log, "%sfcc", (count++ == 0) ? "" : ",");
452   x86log_printf(log, "] ");
453}
454
455
456/*-------------------------------------------------
457    log_opcode_desc - log a list of descriptions
458-------------------------------------------------*/
459
460static void log_opcode_desc(x86log_context *log, const mips3_opcode_desc *desclist, int indent)
461{
462   /* open the file, creating it if necessary */
518463   if (indent == 0)
519      fprintf(logfile, "\nDescriptor list @ %08X\n", desclist->pc);
464      x86log_printf(log, "\nDescriptor list @ %08X\n", desclist->pc);
520465
521466   /* output each descriptor */
522   while (desclist != NULL)
467   for ( ; desclist != NULL; desclist = desclist->next)
523468   {
524469      char buffer[100];
470
471      /* disassemle the current instruction and output it to the log */
472#if LOG_CODE
525473      dasmmips3(buffer, desclist->pc, *desclist->opptr);
526      fprintf(logfile, "%08X [%08X] t:%08X f:%s: %-30s\n", desclist->pc, desclist->physpc, desclist->targetpc, desc_flags_log(desclist->flags), buffer);
527      if (desclist->delay)
528         desc_log(desclist->delay, indent + 1);
529      if (desclist->flags & IDESC_END_SEQUENCE)
530         fprintf(logfile, "-----\n");
531      desclist = desclist->next;
532   }
533}
474#else
475      strcpy(buffer, "???");
534476#endif
477      x86log_printf(log, "%08X [%08X] t:%08X f:%s: %-30s", desclist->pc, desclist->physpc, desclist->targetpc, desc_flags_to_string(desclist->flags), buffer);
535478
536#else
479      /* output register states */
480      log_register_list(log, "use", desclist->gpr.used, desclist->fpr.used);
481      log_register_list(log, "mod", desclist->gpr.modified, desclist->fpr.modified);
482      log_register_list(log, "lrd", desclist->gpr.liveread, desclist->fpr.liveread);
483      log_register_list(log, "lwr", desclist->gpr.livewrite, desclist->fpr.livewrite);
484      x86log_printf(log, "\n");
537485
538#define code_log_reset()
539#define code_log_add_entry(a,b,c)
540#define code_log_add_entry_string(a,b,c)
541#define code_log(a,b,c)
542#define desc_log(a,b)
486      /* if we have a delay slot, output it recursively */
487      if (desclist->delay != NULL)
488         log_opcode_desc(log, desclist->delay, indent + 1);
543489
490      /* at the end of a sequence add a dividing line */
491      if (desclist->flags & IDESC_END_SEQUENCE)
492         x86log_printf(log, "-----\n");
493   }
494}
544495#endif
545496
546497
r1051r1052
949900
950901#if !defined(MAME_DEBUG) && (LOG_CODE)
951902#include "mips3dsm.c"
952#include "cpu/i386/i386dasm.c"
953903#endif
954904
955905
r1051r1052
13071257   check_irqs();
13081258
13091259   assert(c_mips3.core.pc == mips3.core->pc);
1310   assert(c_mips3.core.hi == mips3.core->hi);
1311   assert(c_mips3.core.lo == mips3.core->lo);
1260   assert(c_mips3.core.r[REG_HI] == mips3.core->r[REG_HI]);
1261   assert(c_mips3.core.r[REG_LO] == mips3.core->r[REG_LO]);
13121262   for (i = 0; i < 32; i++)
13131263   {
13141264      assert(c_mips3.core.r[i] == mips3.core->r[i]);
src/emu/cpu/mips/mdrcold.c
r1051r1052
4141#define REGADDRLO(reg)      MBD(REG_ESI, REGDISP(reg))
4242#define REGADDRHI(reg)      MBD(REG_ESI, REGDISP(reg)+4)
4343
44#define HIADDR            MABS((UINT8 *)&mips3.core->hi)
45#define HIADDRLO         MABS((UINT8 *)&mips3.core->hi)
46#define HIADDRHI         MABS((UINT8 *)&mips3.core->hi + 4)
44#define HIADDR            REGADDR(REG_HI)
45#define HIADDRLO         REGADDRLO(REG_HI)
46#define HIADDRHI         REGADDRHI(REG_HI)
4747
48#define LOADDR            MABS((UINT8 *)&mips3.core->lo)
49#define LOADDRLO         MABS((UINT8 *)&mips3.core->lo)
50#define LOADDRHI         MABS((UINT8 *)&mips3.core->lo + 4)
48#define LOADDR            REGADDR(REG_LO)
49#define LOADDRLO         REGADDRLO(REG_LO)
50#define LOADDRHI         REGADDRHI(REG_LO)
5151
5252#define CPR0ADDR(reg)      MABS((UINT8 *)&mips3.core->cpr[0][reg])
5353#define CPR0ADDRLO(reg)      MABS((UINT8 *)&mips3.core->cpr[0][reg])
r1051r1052
163163   x86code *      handle_pc_tlb_mismatch;
164164   x86code *      read_and_translate_byte_signed;
165165   x86code *      read_and_translate_byte_unsigned;
166   x86code *      read_and_translate_word_signed;
167   x86code *      read_and_translate_word_unsigned;
168   x86code *      read_and_translate_long;
169   x86code *      read_and_translate_long_masked;
166   x86code *      read_and_translate_half_signed;
167   x86code *      read_and_translate_half_unsigned;
168   x86code *      read_and_translate_word;
169   x86code *      read_and_translate_word_masked;
170170   x86code *      read_and_translate_double;
171171   x86code *      read_and_translate_double_masked;
172172   x86code *      write_and_translate_byte;
173   x86code *      write_and_translate_half;
173174   x86code *      write_and_translate_word;
174   x86code *      write_and_translate_long;
175   x86code *      write_and_translate_long_masked;
175   x86code *      write_and_translate_word_masked;
176176   x86code *      write_and_translate_double;
177177   x86code *      write_and_translate_double_masked;
178178};
r1051r1052
280280
281281static void drc_reset_callback(drc_core *drc)
282282{
283   code_log_reset();
283   if (LOG_CODE)
284   {
285      x86log_disasm_code_range(mips3.log, "entry_point:", (x86code *)drc->entry_point, drc->out_of_cycles);
286      x86log_disasm_code_range(mips3.log, "out_of_cycles:", drc->out_of_cycles, drc->recompile);
287      x86log_disasm_code_range(mips3.log, "recompile:", drc->recompile, drc->dispatch);
288      x86log_disasm_code_range(mips3.log, "dispatch:", drc->dispatch, drc->flush);
289      x86log_disasm_code_range(mips3.log, "flush:", drc->flush, drc->cache_top);
290   }
284291
285   code_log("entry_point:", (x86code *)drc->entry_point, drc->out_of_cycles);
286   code_log("out_of_cycles:", drc->out_of_cycles, drc->recompile);
287   code_log("recompile:", drc->recompile, drc->dispatch);
288   code_log("dispatch:", drc->dispatch, drc->flush);
289   code_log("flush:", drc->flush, drc->cache_top);
290
291292   mips3.drcdata->generate_interrupt_exception = drc->cache_top;
292293   append_generate_exception(drc, EXCEPTION_INTERRUPT);
293   code_log("generate_interrupt_exception:", mips3.drcdata->generate_interrupt_exception, drc->cache_top);
294   if (LOG_CODE)
295      x86log_disasm_code_range(mips3.log, "generate_interrupt_exception:", mips3.drcdata->generate_interrupt_exception, drc->cache_top);
294296
295297   mips3.drcdata->generate_cop_exception = drc->cache_top;
296298   append_generate_exception(drc, EXCEPTION_BADCOP);
297   code_log("generate_cop_exception:", mips3.drcdata->generate_cop_exception, drc->cache_top);
299   if (LOG_CODE)
300      x86log_disasm_code_range(mips3.log, "generate_cop_exception:", mips3.drcdata->generate_cop_exception, drc->cache_top);
298301
299302   mips3.drcdata->generate_overflow_exception = drc->cache_top;
300303   append_generate_exception(drc, EXCEPTION_OVERFLOW);
301   code_log("generate_overflow_exception:", mips3.drcdata->generate_overflow_exception, drc->cache_top);
304   if (LOG_CODE)
305      x86log_disasm_code_range(mips3.log, "generate_overflow_exception:", mips3.drcdata->generate_overflow_exception, drc->cache_top);
302306
303307   mips3.drcdata->generate_invalidop_exception = drc->cache_top;
304308   append_generate_exception(drc, EXCEPTION_INVALIDOP);
305   code_log("generate_invalidop_exception:", mips3.drcdata->generate_invalidop_exception, drc->cache_top);
309   if (LOG_CODE)
310      x86log_disasm_code_range(mips3.log, "generate_invalidop_exception:", mips3.drcdata->generate_invalidop_exception, drc->cache_top);
306311
307312   mips3.drcdata->generate_syscall_exception = drc->cache_top;
308313   append_generate_exception(drc, EXCEPTION_SYSCALL);
309   code_log("generate_syscall_exception:", mips3.drcdata->generate_syscall_exception, drc->cache_top);
314   if (LOG_CODE)
315      x86log_disasm_code_range(mips3.log, "generate_syscall_exception:", mips3.drcdata->generate_syscall_exception, drc->cache_top);
310316
311317   mips3.drcdata->generate_break_exception = drc->cache_top;
312318   append_generate_exception(drc, EXCEPTION_BREAK);
313   code_log("generate_break_exception:", mips3.drcdata->generate_break_exception, drc->cache_top);
319   if (LOG_CODE)
320      x86log_disasm_code_range(mips3.log, "generate_break_exception:", mips3.drcdata->generate_break_exception, drc->cache_top);
314321
315322   mips3.drcdata->generate_trap_exception = drc->cache_top;
316323   append_generate_exception(drc, EXCEPTION_TRAP);
317   code_log("generate_trap_exception:", mips3.drcdata->generate_trap_exception, drc->cache_top);
324   if (LOG_CODE)
325      x86log_disasm_code_range(mips3.log, "generate_trap_exception:", mips3.drcdata->generate_trap_exception, drc->cache_top);
318326
319327   mips3.drcdata->generate_tlbload_exception = drc->cache_top;
320328   append_generate_exception(drc, EXCEPTION_TLBLOAD);
321   code_log("generate_tlbload_exception:", mips3.drcdata->generate_tlbload_exception, drc->cache_top);
329   if (LOG_CODE)
330      x86log_disasm_code_range(mips3.log, "generate_tlbload_exception:", mips3.drcdata->generate_tlbload_exception, drc->cache_top);
322331
323332   mips3.drcdata->generate_tlbstore_exception = drc->cache_top;
324333   append_generate_exception(drc, EXCEPTION_TLBSTORE);
325   code_log("generate_tlbstore_exception:", mips3.drcdata->generate_tlbstore_exception, drc->cache_top);
334   if (LOG_CODE)
335      x86log_disasm_code_range(mips3.log, "generate_tlbstore_exception:", mips3.drcdata->generate_tlbstore_exception, drc->cache_top);
326336
327337   mips3.drcdata->handle_pc_tlb_mismatch = drc->cache_top;
328338   emit_mov_r32_r32(DRCTOP, REG_EAX, REG_EDI);                                    // mov  eax,edi
r1051r1052
333343   emit_jcc(DRCTOP, COND_NZ, mips3.drcdata->generate_tlbload_exception);               // jnz  generate_tlbload_exception
334344   emit_mov_m32_r32(DRCTOP, MABS(drc->pcptr), REG_EDI);                           // mov  [pcptr],edi
335345   emit_jmp(DRCTOP, drc->recompile);                                          // jmp  recompile
336   code_log("handle_pc_tlb_mismatch:", mips3.drcdata->handle_pc_tlb_mismatch, drc->cache_top);
346   if (LOG_CODE)
347      x86log_disasm_code_range(mips3.log, "handle_pc_tlb_mismatch:", mips3.drcdata->handle_pc_tlb_mismatch, drc->cache_top);
337348
338349   mips3.drcdata->read_and_translate_byte_signed = drc->cache_top;
339350   append_readwrite_and_translate(drc, 1, ARW_READ | ARW_SIGNED);
340   code_log("read_and_translate_byte_signed:", mips3.drcdata->read_and_translate_byte_signed, drc->cache_top);
351   if (LOG_CODE)
352      x86log_disasm_code_range(mips3.log, "read_and_translate_byte_signed:", mips3.drcdata->read_and_translate_byte_signed, drc->cache_top);
341353
342354   mips3.drcdata->read_and_translate_byte_unsigned = drc->cache_top;
343355   append_readwrite_and_translate(drc, 1, ARW_READ | ARW_UNSIGNED);
344   code_log("read_and_translate_byte_unsigned:", mips3.drcdata->read_and_translate_byte_unsigned, drc->cache_top);
356   if (LOG_CODE)
357      x86log_disasm_code_range(mips3.log, "read_and_translate_byte_unsigned:", mips3.drcdata->read_and_translate_byte_unsigned, drc->cache_top);
345358
346   mips3.drcdata->read_and_translate_word_signed = drc->cache_top;
359   mips3.drcdata->read_and_translate_half_signed = drc->cache_top;
347360   append_readwrite_and_translate(drc, 2, ARW_READ | ARW_SIGNED);
348   code_log("read_and_translate_word_signed:", mips3.drcdata->read_and_translate_word_signed, drc->cache_top);
361   if (LOG_CODE)
362      x86log_disasm_code_range(mips3.log, "read_and_translate_half_signed:", mips3.drcdata->read_and_translate_half_signed, drc->cache_top);
349363
350   mips3.drcdata->read_and_translate_word_unsigned = drc->cache_top;
364   mips3.drcdata->read_and_translate_half_unsigned = drc->cache_top;
351365   append_readwrite_and_translate(drc, 2, ARW_READ | ARW_UNSIGNED);
352   code_log("read_and_translate_word_unsigned:", mips3.drcdata->read_and_translate_word_unsigned, drc->cache_top);
366   if (LOG_CODE)
367      x86log_disasm_code_range(mips3.log, "read_and_translate_half_unsigned:", mips3.drcdata->read_and_translate_half_unsigned, drc->cache_top);
353368
354   mips3.drcdata->read_and_translate_long = drc->cache_top;
369   mips3.drcdata->read_and_translate_word = drc->cache_top;
355370   append_readwrite_and_translate(drc, 4, ARW_READ);
356   code_log("read_and_translate_long:", mips3.drcdata->read_and_translate_long, drc->cache_top);
371   if (LOG_CODE)
372      x86log_disasm_code_range(mips3.log, "read_and_translate_word:", mips3.drcdata->read_and_translate_word, drc->cache_top);
357373
358   mips3.drcdata->read_and_translate_long_masked = drc->cache_top;
374   mips3.drcdata->read_and_translate_word_masked = drc->cache_top;
359375   append_readwrite_and_translate(drc, 4, ARW_READ | ARW_MASKED);
360   code_log("read_and_translate_long_masked:", mips3.drcdata->read_and_translate_long_masked, drc->cache_top);
376   if (LOG_CODE)
377      x86log_disasm_code_range(mips3.log, "read_and_translate_word_masked:", mips3.drcdata->read_and_translate_word_masked, drc->cache_top);
361378
362379   mips3.drcdata->read_and_translate_double = drc->cache_top;
363380   append_readwrite_and_translate(drc, 8, ARW_READ);
364   code_log("read_and_translate_double:", mips3.drcdata->read_and_translate_double, drc->cache_top);
381   if (LOG_CODE)
382      x86log_disasm_code_range(mips3.log, "read_and_translate_double:", mips3.drcdata->read_and_translate_double, drc->cache_top);
365383
366384   mips3.drcdata->read_and_translate_double_masked = drc->cache_top;
367385   append_readwrite_and_translate(drc, 8, ARW_READ | ARW_MASKED);
368   code_log("read_and_translate_double_masked:", mips3.drcdata->read_and_translate_double_masked, drc->cache_top);
386   if (LOG_CODE)
387      x86log_disasm_code_range(mips3.log, "read_and_translate_double_masked:", mips3.drcdata->read_and_translate_double_masked, drc->cache_top);
369388
370389   mips3.drcdata->write_and_translate_byte = drc->cache_top;
371390   append_readwrite_and_translate(drc, 1, ARW_WRITE);
372   code_log("write_and_translate_byte:", mips3.drcdata->write_and_translate_byte, drc->cache_top);
391   if (LOG_CODE)
392      x86log_disasm_code_range(mips3.log, "write_and_translate_byte:", mips3.drcdata->write_and_translate_byte, drc->cache_top);
373393
374   mips3.drcdata->write_and_translate_word = drc->cache_top;
394   mips3.drcdata->write_and_translate_half = drc->cache_top;
375395   append_readwrite_and_translate(drc, 2, ARW_WRITE);
376   code_log("write_and_translate_word:", mips3.drcdata->write_and_translate_word, drc->cache_top);
396   if (LOG_CODE)
397      x86log_disasm_code_range(mips3.log, "write_and_translate_half:", mips3.drcdata->write_and_translate_half, drc->cache_top);
377398
378   mips3.drcdata->write_and_translate_long = drc->cache_top;
399   mips3.drcdata->write_and_translate_word = drc->cache_top;
379400   append_readwrite_and_translate(drc, 4, ARW_WRITE);
380   code_log("write_and_translate_long:", mips3.drcdata->write_and_translate_long, drc->cache_top);
401   if (LOG_CODE)
402      x86log_disasm_code_range(mips3.log, "write_and_translate_word:", mips3.drcdata->write_and_translate_word, drc->cache_top);
381403
382   mips3.drcdata->write_and_translate_long_masked = drc->cache_top;
404   mips3.drcdata->write_and_translate_word_masked = drc->cache_top;
383405   append_readwrite_and_translate(drc, 4, ARW_WRITE | ARW_MASKED);
384   code_log("write_and_translate_long_masked:", mips3.drcdata->write_and_translate_long_masked, drc->cache_top);
406   if (LOG_CODE)
407      x86log_disasm_code_range(mips3.log, "write_and_translate_word_masked:", mips3.drcdata->write_and_translate_word_masked, drc->cache_top);
385408
386409   mips3.drcdata->write_and_translate_double = drc->cache_top;
387410   append_readwrite_and_translate(drc, 8, ARW_WRITE);
388   code_log("write_and_translate_double:", mips3.drcdata->write_and_translate_double, drc->cache_top);
411   if (LOG_CODE)
412      x86log_disasm_code_range(mips3.log, "write_and_translate_double:", mips3.drcdata->write_and_translate_double, drc->cache_top);
389413
390414   mips3.drcdata->write_and_translate_double_masked = drc->cache_top;
391415   append_readwrite_and_translate(drc, 8, ARW_WRITE | ARW_MASKED);
392   code_log("write_and_translate_double_masked:", mips3.drcdata->write_and_translate_double_masked, drc->cache_top);
416   if (LOG_CODE)
417      x86log_disasm_code_range(mips3.log, "write_and_translate_double_masked:", mips3.drcdata->write_and_translate_double_masked, drc->cache_top);
393418}
394419
395420
r1051r1052
409434
410435   /* begin the sequence */
411436   drc_begin_sequence(drc, pc);
412   code_log_reset();
413437
414438   /* make sure our FR flag matches the last time */
415439   emit_test_m32_imm(DRCTOP, CPR0ADDR(COP0_Status), SR_FR);                        // test [COP0_Status],SR_FR
r1051r1052
462486   /* end the sequence */
463487   drc_end_sequence(drc);
464488
465#if LOG_CODE
466{
467   char label[40];
468   physpc = mips3.core->pc;
469   mips3com_translate_address(mips3.core, ADDRESS_SPACE_PROGRAM, &physpc);
470   sprintf(label, "Code @ %08X (%08X physical)", mips3.core->pc, physpc);
471   code_log(label, start, drc->cache_top);
489   /* log the generated code */
490   if (LOG_CODE)
491   {
492      char label[60];
493      physpc = mips3.core->pc;
494      mips3com_translate_address(mips3.core, ADDRESS_SPACE_PROGRAM, &physpc);
495      sprintf(label, "Code @ %08X (%08X physical)", mips3.core->pc, physpc);
496      x86log_disasm_code_range(mips3.log, label, start, drc->cache_top);
497   }
472498}
473#endif
474}
475499
476500
477501/*------------------------------------------------------------------
r1051r1052
777801      if (size == 1)
778802         emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writebyte);                  // jmp  writebyte
779803      else if (size == 2)
780         emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writeword);                  // jmp  writeword
804         emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writehalf);                  // jmp  writehalf
781805      else if (size == 4)
782806      {
783807         if (!(flags & ARW_MASKED))
784            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writelong);               // jmp  writelong
808            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writeword);               // jmp  writeword
785809         else
786            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writelong_masked);         // jmp  writelong_masked
810            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.writeword_masked);         // jmp  writeword_masked
787811      }
788812      else
789813      {
r1051r1052
811835      {
812836         emit_sub_r32_imm(DRCTOP, REG_ESP, 8);                                 // sub  esp,8
813837         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
814         emit_call(DRCTOP, (x86code *)mips3.core->memory.readword);                  // call  readword
838         emit_call(DRCTOP, (x86code *)mips3.core->memory.readhalf);                  // call  readhalf
815839         if (flags & ARW_SIGNED)
816840            emit_movsx_r32_r16(DRCTOP, REG_EAX, REG_AX);                        // movsx eax,ax
817841         else
r1051r1052
823847      {
824848         emit_mov_m32_r32(DRCTOP, MBD(REG_ESP, 4), REG_EBX);                        // mov  [esp+4],ebx
825849         if (!(flags & ARW_MASKED))
826            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.readlong);               // jmp  readlong
850            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.readword);               // jmp  readword
827851         else
828            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.readlong_masked);         // jmp  readlong_masked
852            emit_jmp(DRCTOP, (x86code *)mips3.core->memory.readword_masked);         // jmp  readword_masked
829853      }
830854      else
831855      {
r1051r1052
949973{
950974   if (*rt)
951975   {
952      mips3.core->lo = *rs / *rt;
953      mips3.core->hi = *rs % *rt;
976      mips3.core->r[REG_LO] = *rs / *rt;
977      mips3.core->r[REG_HI] = *rs % *rt;
954978   }
955979}
956980
r1051r1052
958982{
959983   if (*rt)
960984   {
961      mips3.core->lo = *rs / *rt;
962      mips3.core->hi = *rs % *rt;
985      mips3.core->r[REG_LO] = *rs / *rt;
986      mips3.core->r[REG_HI] = *rs % *rt;
963987   }
964988}
965989
r1051r1052
10151039   UINT32 op = cpu_readop32(physpc);
10161040   int cycles;
10171041
1018   code_log_add_entry(drc->cache_top, pc, op);
1042   if (LOG_CODE)
1043      log_add_disasm_comment(mips3.log, drc->cache_top, pc, op);
10191044
10201045   switch (op >> 26)
10211046   {
r1051r1052
16171642            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
16181643         else
16191644            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
1620         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word_signed);            // call read_and_translate_word_signed
1645         emit_call(DRCTOP, mips3.drcdata->read_and_translate_half_signed);            // call read_and_translate_half_signed
16211646         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
16221647         if (RTREG != 0)
16231648         {
r1051r1052
16441669         emit_push_r32(DRCTOP, REG_ECX);                                       // push ecx
16451670         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
16461671         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
1647         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long_masked);            // call read_and_translate_long_masked
1672         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word_masked);            // call read_and_translate_word_masked
16481673         emit_add_r32_imm(DRCTOP, REG_ESP, 8);                                 // add  esp,8
16491674         emit_pop_r32(DRCTOP, REG_ECX);                                       // pop  ecx
16501675
r1051r1052
16771702            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
16781703         else
16791704            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
1680         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long);                  // call read_and_translate_long
1705         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word);                  // call read_and_translate_word
16811706         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
16821707         if (RTREG != 0)
16831708         {
r1051r1052
17251750            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
17261751         else
17271752            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
1728         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word_unsigned);            // call read_and_translate_word_unsigned
1753         emit_call(DRCTOP, mips3.drcdata->read_and_translate_half_unsigned);            // call read_and_translate_half_unsigned
17291754         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
17301755         if (RTREG != 0)
17311756         {
r1051r1052
17521777         emit_push_r32(DRCTOP, REG_ECX);                                       // push ecx
17531778         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
17541779         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
1755         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long_masked);            // call read_and_translate_long_masked
1780         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word_masked);            // call read_and_translate_word_masked
17561781         emit_add_r32_imm(DRCTOP, REG_ESP, 8);                                 // add  esp,8
17571782         emit_pop_r32(DRCTOP, REG_ECX);                                       // pop  ecx
17581783
r1051r1052
17851810            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
17861811         else
17871812            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
1788         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long);                  // call read_and_translate_long
1813         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word);                  // call read_and_translate_word
17891814         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
17901815         if (RTREG != 0)
17911816         {
r1051r1052
18361861            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
18371862         else
18381863            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
1839         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word);                  // call writeword
1864         emit_call(DRCTOP, mips3.drcdata->write_and_translate_half);                  // call writehalf
18401865         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
18411866         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
18421867         return RECOMPILE_SUCCESSFUL_CP(1,4);
r1051r1052
18651890         else
18661891            emit_push_imm(DRCTOP, 0);                                       // push 0
18671892         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
1868         emit_call(DRCTOP, mips3.drcdata->write_and_translate_long_masked);            // call write_and_translate_long_masked
1893         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word_masked);            // call write_and_translate_word_masked
18691894         emit_add_r32_imm(DRCTOP, REG_ESP, 16);                                 // add  esp,16
18701895         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
18711896         return RECOMPILE_SUCCESSFUL_CP(1,4);
r1051r1052
18881913            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
18891914         else
18901915            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
1891         emit_call(DRCTOP, mips3.drcdata->write_and_translate_long);                  // call write_and_translate_long
1916         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word);                  // call write_and_translate_word
18921917         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
18931918         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
18941919         return RECOMPILE_SUCCESSFUL_CP(1,4);
r1051r1052
20012026         else
20022027            emit_push_imm(DRCTOP, 0);                                       // push 0
20032028         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
2004         emit_call(DRCTOP, mips3.drcdata->write_and_translate_long_masked);            // call write_and_translate_long_masked
2029         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word_masked);            // call write_and_translate_word_masked
20052030         emit_add_r32_imm(DRCTOP, REG_ESP, 16);                                 // add  esp,16
20062031         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
20072032         return RECOMPILE_SUCCESSFUL_CP(1,4);
r1051r1052
20252050            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
20262051         else
20272052            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
2028         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long);                  // call read_and_translate_long
2053         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word);                  // call read_and_translate_word
20292054         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
20302055         emit_mov_m32_r32(DRCTOP, FPR32ADDR(RTREG), REG_EAX);                     // mov  [rtreg],eax
20312056         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
r1051r1052
20452070            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
20462071         else
20472072            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
2048         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long);                  // call read_and_translate_long
2073         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word);                  // call read_and_translate_word
20492074         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
20502075         emit_mov_m32_r32(DRCTOP, CPR2ADDR(RTREG), REG_EAX);                        // mov  [rtreg],eax
20512076         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
r1051r1052
20962121            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
20972122         else
20982123            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
2099         emit_call(DRCTOP, mips3.drcdata->read_and_translate_double);               // call read_and_translate_long
2124         emit_call(DRCTOP, mips3.drcdata->read_and_translate_double);               // call read_and_translate_word
21002125         emit_mov_m64_r64(DRCTOP, CPR2ADDR(RTREG), REG_EDX, REG_EAX);               // mov  [rtreg],edx:eax
21012126         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
21022127         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
r1051r1052
21402165            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
21412166         else
21422167            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
2143         emit_call(DRCTOP, mips3.drcdata->write_and_translate_long);                  // call write_and_translate_long
2168         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word);                  // call write_and_translate_word
21442169         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
21452170         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
21462171         return RECOMPILE_SUCCESSFUL_CP(1,4);
r1051r1052
21602185            emit_push_m32(DRCTOP, REGADDRLO(RSREG));                           // push [rsreg].lo
21612186         else
21622187            emit_push_imm(DRCTOP, SIMMVAL);                                    // push SIMMVAL
2163         emit_call(DRCTOP, mips3.drcdata->write_and_translate_long);                  // call write_and_translate_long
2188         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word);                  // call write_and_translate_word
21642189         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
21652190         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
21662191         return RECOMPILE_SUCCESSFUL_CP(1,4);
r1051r1052
26342659         emit_xor_r32_r32(DRCTOP, REG_EBX, REG_EBX);                              // xor  ebx,ebx
26352660         emit_xor_r32_r32(DRCTOP, REG_ECX, REG_ECX);                              // xor  ecx,ecx
26362661         emit_xor_r32_r32(DRCTOP, REG_EDX, REG_EDX);                              // xor  edx,edx
2637         emit_sub_r32_m32(DRCTOP, REG_EAX, MABS(LO(&mips3.core->lo)));               // sub  eax,[lo].lo
2638         emit_sbb_r32_m32(DRCTOP, REG_EBX, MABS(HI(&mips3.core->lo)));               // sbb  ebx,[lo].hi
2639         emit_sbb_r32_m32(DRCTOP, REG_ECX, MABS(LO(&mips3.core->hi)));               // sbb  ecx,[hi].lo
2640         emit_sbb_r32_m32(DRCTOP, REG_EDX, MABS(HI(&mips3.core->hi)));               // sbb  edx,[hi].hi
2662         emit_sub_r32_m32(DRCTOP, REG_EAX, LOADDRLO);                           // sub  eax,[lo].lo
2663         emit_sbb_r32_m32(DRCTOP, REG_EBX, LOADDRHI);                           // sbb  ebx,[lo].hi
2664         emit_sbb_r32_m32(DRCTOP, REG_ECX, HIADDRLO);                           // sbb  ecx,[hi].lo
2665         emit_sbb_r32_m32(DRCTOP, REG_EDX, HIADDRHI);                           // sbb  edx,[hi].hi
26412666         emit_mov_m64_r64(DRCTOP, LOADDR, REG_EBX, REG_EAX);                        // mov  [lo],ebx:eax
26422667         emit_mov_m64_r64(DRCTOP, HIADDR, REG_EDX, REG_ECX);                        // mov  [hi],edx:ecx
26432668         resolve_link(DRCTOP, &link3);                                    // noflip:
r1051r1052
46304655         emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDRLO(RSREG));                     // mov  eax,[rsreg]
46314656         emit_add_r32_m32(DRCTOP, REG_EAX, REGADDRLO(RTREG));                     // add  eax,[rtreg]
46324657         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
4633         emit_call(DRCTOP, mips3.drcdata->read_and_translate_long);                  // call read_and_translate_long
4658         emit_call(DRCTOP, mips3.drcdata->read_and_translate_word);                  // call read_and_translate_word
46344659         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,12
46354660         emit_mov_m32_r32(DRCTOP, FPR32ADDR(FDREG), REG_EAX);                     // mov  [fdreg],eax
46364661         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
r1051r1052
46584683         emit_mov_r32_m32(DRCTOP, REG_EAX, REGADDRLO(RSREG));                     // mov  eax,[rsreg]
46594684         emit_add_r32_m32(DRCTOP, REG_EAX, REGADDRLO(RTREG));                     // add  eax,[rtreg]
46604685         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
4661         emit_call(DRCTOP, mips3.drcdata->write_and_translate_long);                  // call write_and_translate_long
4686         emit_call(DRCTOP, mips3.drcdata->write_and_translate_word);                  // call write_and_translate_word
46624687         emit_add_r32_imm(DRCTOP, REG_ESP, 12);                                 // add  esp,8
46634688         emit_mov_r32_m32(DRCTOP, REG_EBP, ICOUNTADDR);                           // mov  ebp,[icount]
46644689         return RECOMPILE_SUCCESSFUL_CP(1,4);
src/emu/cpu/mips/mips3com.c
r1051r1052
476476      case CPUINFO_INT_REGISTER + MIPS3_R30:         mips->r[30] = info->i;               break;
477477      case CPUINFO_INT_SP:
478478      case CPUINFO_INT_REGISTER + MIPS3_R31:         mips->r[31] = info->i;               break;
479      case CPUINFO_INT_REGISTER + MIPS3_HI:         mips->hi = info->i;                  break;
480      case CPUINFO_INT_REGISTER + MIPS3_LO:         mips->lo = info->i;                  break;
479      case CPUINFO_INT_REGISTER + MIPS3_HI:         mips->r[REG_HI] = info->i;            break;
480      case CPUINFO_INT_REGISTER + MIPS3_LO:         mips->r[REG_LO] = info->i;            break;
481481
482482      case CPUINFO_INT_REGISTER + MIPS3_FPR0:         mips->cpr[1][0] = info->i;            break;
483483      case CPUINFO_INT_REGISTER + MIPS3_FPR1:         mips->cpr[1][1] = info->i;            break;
r1051r1052
599599      case CPUINFO_INT_REGISTER + MIPS3_R30:         info->i = mips->r[30];               break;
600600      case CPUINFO_INT_SP:
601601      case CPUINFO_INT_REGISTER + MIPS3_R31:         info->i = mips->r[31];               break;
602      case CPUINFO_INT_REGISTER + MIPS3_HI:         info->i = mips->hi;                  break;
603      case CPUINFO_INT_REGISTER + MIPS3_LO:         info->i = mips->lo;                  break;
602      case CPUINFO_INT_REGISTER + MIPS3_HI:         info->i = mips->r[REG_HI];            break;
603      case CPUINFO_INT_REGISTER + MIPS3_LO:         info->i = mips->r[REG_LO];            break;
604604
605605      /* --- the following bits of info are returned as pointers to data or functions --- */
606606      case CPUINFO_PTR_SET_INFO:                  /* provided by core */               break;
r1051r1052
617617      /* --- the following bits of info are returned as NULL-terminated strings --- */
618618      case CPUINFO_STR_NAME:                     strcpy(info->s, "MIPS III");         break;
619619      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "MIPS III");         break;
620      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "2.0");               break;
620      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "3.0");               break;
621621      case CPUINFO_STR_CORE_FILE:                  /* provided by core */               break;
622622      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 2000-2007"); break;
623623
r1051r1052
670670      case CPUINFO_STR_REGISTER + MIPS3_R29:         sprintf(info->s, "R29:%08X%08X", (UINT32)(mips->r[29] >> 32), (UINT32)mips->r[29]); break;
671671      case CPUINFO_STR_REGISTER + MIPS3_R30:         sprintf(info->s, "R30:%08X%08X", (UINT32)(mips->r[30] >> 32), (UINT32)mips->r[30]); break;
672672      case CPUINFO_STR_REGISTER + MIPS3_R31:         sprintf(info->s, "R31:%08X%08X", (UINT32)(mips->r[31] >> 32), (UINT32)mips->r[31]); break;
673      case CPUINFO_STR_REGISTER + MIPS3_HI:         sprintf(info->s, "HI: %08X%08X", (UINT32)(mips->hi >> 32), (UINT32)mips->hi); break;
674      case CPUINFO_STR_REGISTER + MIPS3_LO:         sprintf(info->s, "LO: %08X%08X", (UINT32)(mips->lo >> 32), (UINT32)mips->lo); break;
673      case CPUINFO_STR_REGISTER + MIPS3_HI:         sprintf(info->s, "HI: %08X%08X", (UINT32)(mips->r[REG_HI] >> 32), (UINT32)mips->r[REG_HI]); break;
674      case CPUINFO_STR_REGISTER + MIPS3_LO:         sprintf(info->s, "LO: %08X%08X", (UINT32)(mips->r[REG_LO] >> 32), (UINT32)mips->r[REG_LO]); break;
675675
676676      case CPUINFO_STR_REGISTER + MIPS3_FPR0:         sprintf(info->s, "FPR0: %08X%08X", (UINT32)(mips->cpr[1][0] >> 32), (UINT32)mips->cpr[1][0]); break;
677677      case CPUINFO_STR_REGISTER + MIPS3_FPR1:         sprintf(info->s, "FPR1: %08X%08X", (UINT32)(mips->cpr[1][1] >> 32), (UINT32)mips->cpr[1][1]); break;
src/emu/cpu/mips/mips3.c
r1051r1052
6565#define SETPC(x)   mips3.nextpc = (x)
6666#define SETPCL(x,l)   { mips3.nextpc = (x); mips3.core.r[l] = (INT32)(mips3.core.pc + 4); }
6767
68#define HIVAL      (UINT32)mips3.core.hi
69#define LOVAL      (UINT32)mips3.core.lo
70#define HIVAL64      mips3.core.hi
71#define LOVAL64      mips3.core.lo
68#define HIVAL      (UINT32)mips3.core.r[REG_HI]
69#define LOVAL      (UINT32)mips3.core.r[REG_LO]
70#define HIVAL64      mips3.core.r[REG_HI]
71#define LOVAL64      mips3.core.r[REG_LO]
7272#define SR         mips3.core.cpr[0][COP0_Status]
7373#define CAUSE      mips3.core.cpr[0][COP0_Cause]
7474
r1051r1052
340340}
341341
342342
343INLINE int RWORD(offs_t address, UINT32 *result)
343INLINE int RHALF(offs_t address, UINT32 *result)
344344{
345345   UINT32 tlbval = mips3.core.tlb_table[address >> 12];
346346   if (tlbval == 0xffffffff)
r1051r1052
348348      generate_tlb_exception(EXCEPTION_TLBLOAD, address);
349349      return 0;
350350   }
351   *result = (*mips3.core.memory.readword)((tlbval & ~0xfff) | (address & 0xfff));
351   *result = (*mips3.core.memory.readhalf)((tlbval & ~0xfff) | (address & 0xfff));
352352   return 1;
353353}
354354
355355
356INLINE int RLONG(offs_t address, UINT32 *result)
356INLINE int RWORD(offs_t address, UINT32 *result)
357357{
358358   UINT32 tlbval = mips3.core.tlb_table[address >> 12];
359359   if (tlbval == 0xffffffff)
r1051r1052
361361      generate_tlb_exception(EXCEPTION_TLBLOAD, address);
362362      return 0;
363363   }
364   *result = (*mips3.core.memory.readlong)((tlbval & ~0xfff) | (address & 0xfff));
364   *result = (*mips3.core.memory.readword)((tlbval & ~0xfff) | (address & 0xfff));
365365   return 1;
366366}
367367
368368
369INLINE int RLONG_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask)
369INLINE int RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask)
370370{
371371   UINT32 tlbval = mips3.core.tlb_table[address >> 12];
372372   if (tlbval == 0xffffffff)
r1051r1052
374374      generate_tlb_exception(EXCEPTION_TLBLOAD, address);
375375      return 0;
376376   }
377   *result = (*mips3.core.memory.readlong_masked)((tlbval & ~0xfff) | (address & 0xfff), mem_mask);
377   *result = (*mips3.core.memory.readword_masked)((tlbval & ~0xfff) | (address & 0xfff), mem_mask);
378378   return 1;
379379}
380380
r1051r1052
415415}
416416
417417
418INLINE void WWORD(offs_t address, UINT16 data)
418INLINE void WHALF(offs_t address, UINT16 data)
419419{
420420   UINT32 tlbval = mips3.core.tlb_table[address >> 12];
421421   if (tlbval & 1)
422422      generate_tlb_exception(EXCEPTION_TLBSTORE, address);
423423   else
424      (*mips3.core.memory.writeword)(tlbval | (address & 0xfff), data);
424      (*mips3.core.memory.writehalf)(tlbval | (address & 0xfff), data);
425425}
426426
427427
428INLINE void WLONG(offs_t address, UINT32 data)
428INLINE void WWORD(offs_t address, UINT32 data)
429429{
430430   UINT32 tlbval = mips3.core.tlb_table[address >> 12];
431431   if (tlbval & 1)
432432      generate_tlb_exception(EXCEPTION_TLBSTORE, address);
433433   else
434      (*mips3.core.memory.writelong)(tlbval | (address & 0xfff), data);
434      (*mips3.core.memory.writeword)(tlbval | (address & 0xfff), data);
435435}
436436
437437
438INLINE void WLONG_MASKED(offs_t address, UINT32 data, UINT32 mem_mask)
438INLINE void WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_mask)
439439{
440440   UINT32 tlbval = mips3.core.tlb_table[address >> 12];
441441   if (tlbval & 1)
442442      generate_tlb_exception(EXCEPTION_TLBSTORE, address);
443443   else
444      (*mips3.core.memory.writelong_masked)(tlbval | (address & 0xfff), data, mem_mask);
444      (*mips3.core.memory.writeword_masked)(tlbval | (address & 0xfff), data, mem_mask);
445445}
446446
447447
r1051r1052
14391439   switch (op & 0x3f)
14401440   {
14411441      case 0x00:      /* LWXC1 */
1442         if (RLONG(RSVAL32 + RTVAL32, &temp)) FDVALW_FR0 = temp;
1442         if (RWORD(RSVAL32 + RTVAL32, &temp)) FDVALW_FR0 = temp;
14431443         break;
14441444
14451445      case 0x01:      /* LDXC1 */
r1051r1052
14471447         break;
14481448
14491449      case 0x08:      /* SWXC1 */
1450         WLONG(RSVAL32 + RTVAL32, get_cop1_reg32(FDREG));
1450         WWORD(RSVAL32 + RTVAL32, get_cop1_reg32(FDREG));
14511451         break;
14521452
14531453      case 0x09:      /* SDXC1 */
r1051r1052
15151515   switch (op & 0x3f)
15161516   {
15171517      case 0x00:      /* LWXC1 */
1518         if (RLONG(RSVAL32 + RTVAL32, &temp)) FDVALW_FR1 = temp;
1518         if (RWORD(RSVAL32 + RTVAL32, &temp)) FDVALW_FR1 = temp;
15191519         break;
15201520
15211521      case 0x01:      /* LDXC1 */
r1051r1052
15231523         break;
15241524
15251525      case 0x08:      /* SWXC1 */
1526         WLONG(RSVAL32 + RTVAL32, get_cop1_reg32(FDREG));
1526         WWORD(RSVAL32 + RTVAL32, get_cop1_reg32(FDREG));
15271527         break;
15281528
15291529      case 0x09:      /* SDXC1 */
r1051r1052
18841884            }
18851885            break;
18861886         case 0x20:   /* LB */      if (RBYTE(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT8)temp;      break;
1887         case 0x21:   /* LH */      if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT16)temp;      break;
1887         case 0x21:   /* LH */      if (RHALF(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT16)temp;      break;
18881888         case 0x22:   /* LWL */      (*mips3.lwl)(op);                                          break;
1889         case 0x23:   /* LW */      if (RLONG(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT32)temp;      break;
1889         case 0x23:   /* LW */      if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT32)temp;      break;
18901890         case 0x24:   /* LBU */      if (RBYTE(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT8)temp;      break;
1891         case 0x25:   /* LHU */      if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT16)temp;      break;
1891         case 0x25:   /* LHU */      if (RHALF(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT16)temp;      break;
18921892         case 0x26:   /* LWR */      (*mips3.lwr)(op);                                          break;
1893         case 0x27:   /* LWU */      if (RLONG(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT32)temp;      break;
1893         case 0x27:   /* LWU */      if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT32)temp;      break;
18941894         case 0x28:   /* SB */      WBYTE(SIMMVAL+RSVAL32, RTVAL32);                              break;
1895         case 0x29:   /* SH */      WWORD(SIMMVAL+RSVAL32, RTVAL32);                               break;
1895         case 0x29:   /* SH */      WHALF(SIMMVAL+RSVAL32, RTVAL32);                               break;
18961896         case 0x2a:   /* SWL */      (*mips3.swl)(op);                                          break;
1897         case 0x2b:   /* SW */      WLONG(SIMMVAL+RSVAL32, RTVAL32);                              break;
1897         case 0x2b:   /* SW */      WWORD(SIMMVAL+RSVAL32, RTVAL32);                              break;
18981898         case 0x2c:   /* SDL */      (*mips3.sdl)(op);                                          break;
18991899         case 0x2d:   /* SDR */      (*mips3.sdr)(op);                                          break;
19001900         case 0x2e:   /* SWR */      (*mips3.swr)(op);                                          break;
19011901         case 0x2f:   /* CACHE */      /* effective no-op */                                       break;
1902         case 0x30:   /* LL */      if (RLONG(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT32)temp; mips3.ll_value = RTVAL32;      break;
1903         case 0x31:   /* LWC1 */      if (RLONG(SIMMVAL+RSVAL32, &temp)) set_cop1_reg32(RTREG, temp);         break;
1904         case 0x32:   /* LWC2 */      if (RLONG(SIMMVAL+RSVAL32, &temp)) set_cop2_reg(RTREG, temp);         break;
1902         case 0x30:   /* LL */      if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT32)temp; mips3.ll_value = RTVAL32;      break;
1903         case 0x31:   /* LWC1 */      if (RWORD(SIMMVAL+RSVAL32, &temp)) set_cop1_reg32(RTREG, temp);         break;
1904         case 0x32:   /* LWC2 */      if (RWORD(SIMMVAL+RSVAL32, &temp)) set_cop2_reg(RTREG, temp);         break;
19051905         case 0x33:   /* PREF */      /* effective no-op */                                       break;
19061906         case 0x34:   /* LLD */      if (RDOUBLE(SIMMVAL+RSVAL32, &temp64) && RTREG) RTVAL64 = temp64; mips3.lld_value = temp64;      break;
19071907         case 0x35:   /* LDC1 */      if (RDOUBLE(SIMMVAL+RSVAL32, &temp64)) set_cop1_reg64(RTREG, temp64);      break;
19081908         case 0x36:   /* LDC2 */      if (RDOUBLE(SIMMVAL+RSVAL32, &temp64)) set_cop2_reg(RTREG, temp64);      break;
19091909         case 0x37:   /* LD */      if (RDOUBLE(SIMMVAL+RSVAL32, &temp64) && RTREG) RTVAL64 = temp64;      break;
1910         case 0x38:   /* SC */      if (RLONG(SIMMVAL+RSVAL32, &temp) && RTREG)
1910         case 0x38:   /* SC */      if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG)
19111911                        {
19121912                           if (temp == mips3.ll_value)
19131913                           {
1914                              WLONG(SIMMVAL+RSVAL32, RTVAL32);
1914                              WWORD(SIMMVAL+RSVAL32, RTVAL32);
19151915                              RTVAL64 = (UINT32)1;
19161916                           }
19171917                           else
r1051r1052
19201920                           }
19211921                        }
19221922                        break;
1923         case 0x39:   /* SWC1 */      WLONG(SIMMVAL+RSVAL32, get_cop1_reg32(RTREG));                     break;
1924         case 0x3a:   /* SWC2 */      WLONG(SIMMVAL+RSVAL32, get_cop2_reg(RTREG));                     break;
1923         case 0x39:   /* SWC1 */      WWORD(SIMMVAL+RSVAL32, get_cop1_reg32(RTREG));                     break;
1924         case 0x3a:   /* SWC2 */      WWORD(SIMMVAL+RSVAL32, get_cop2_reg(RTREG));                     break;
19251925         case 0x3b:   /* SWC3 */      invalid_instruction(op);                                    break;
19261926         case 0x3c:   /* SCD */      if (RDOUBLE(SIMMVAL+RSVAL32, &temp64) && RTREG)
19271927                        {
r1051r1052
19631963   UINT32 mask = 0xffffffffUL << shift;
19641964   UINT32 temp;
19651965
1966   if (RLONG_MASKED(offs & ~3, &temp, ~(mask >> shift)) && RTREG)
1966   if (RWORD_MASKED(offs & ~3, &temp, ~(mask >> shift)) && RTREG)
19671967      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp << shift));
19681968}
19691969
r1051r1052
19741974   UINT32 mask = 0xffffffffUL >> shift;
19751975   UINT32 temp;
19761976
1977   if (RLONG_MASKED(offs & ~3, &temp, ~(mask << shift)) && RTREG)
1977   if (RWORD_MASKED(offs & ~3, &temp, ~(mask << shift)) && RTREG)
19781978      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp >> shift));
19791979}
19801980
r1051r1052
20052005   offs_t offs = SIMMVAL + RSVAL32;
20062006   int shift = 8 * (offs & 3);
20072007   UINT32 mask = ~(0xffffffffUL >> shift);
2008   WLONG_MASKED(offs & ~3, RTVAL32 >> shift, mask);
2008   WWORD_MASKED(offs & ~3, RTVAL32 >> shift, mask);
20092009}
20102010
20112011static void swr_be(UINT32 op)
r1051r1052
20132013   offs_t offs = SIMMVAL + RSVAL32;
20142014   int shift = 8 * (~offs & 3);
20152015   UINT32 mask = ~(0xffffffffUL << shift);
2016   WLONG_MASKED(offs & ~3, RTVAL32 << shift, mask);
2016   WWORD_MASKED(offs & ~3, RTVAL32 << shift, mask);
20172017}
20182018
20192019static void sdl_be(UINT32 op)
r1051r1052
20412041   UINT32 mask = 0xffffffffUL << shift;
20422042   UINT32 temp;
20432043
2044   if (RLONG_MASKED(offs & ~3, &temp, ~(mask >> shift)) && RTREG)
2044   if (RWORD_MASKED(offs & ~3, &temp, ~(mask >> shift)) && RTREG)
20452045      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp << shift));
20462046}
20472047
r1051r1052
20522052   UINT32 mask = 0xffffffffUL >> shift;
20532053   UINT32 temp;
20542054
2055   if (RLONG_MASKED(offs & ~3, &temp, ~(mask << shift)) && RTREG)
2055   if (RWORD_MASKED(offs & ~3, &temp, ~(mask << shift)) && RTREG)
20562056      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp >> shift));
20572057}
20582058
r1051r1052
20832083   offs_t offs = SIMMVAL + RSVAL32;
20842084   int shift = 8 * (~offs & 3);
20852085   UINT32 mask = ~(0xffffffffUL >> shift);
2086   WLONG_MASKED(offs & ~3, RTVAL32 >> shift, mask);
2086   WWORD_MASKED(offs & ~3, RTVAL32 >> shift, mask);
20872087}
20882088
20892089static void swr_le(UINT32 op)
r1051r1052
20912091   offs_t offs = SIMMVAL + RSVAL32;
20922092   int shift = 8 * (offs & 3);
20932093   UINT32 mask = ~(0xffffffffUL << shift);
2094   WLONG_MASKED(offs & ~3, RTVAL32 << shift, mask);
2094   WWORD_MASKED(offs & ~3, RTVAL32 << shift, mask);
20952095}
20962096
20972097static void sdl_le(UINT32 op)
src/emu/cpu/x86emit.h
r1051r1052
11311131
11321132INLINE void emit_op(x86code **emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 sib, UINT8 rm)
11331133{
1134   if (opsize == OP_16BIT)
1135      emit_byte(emitptr, PREFIX_OPSIZE);
1136
11341137#ifdef PTR64
1138{
11351139   UINT8 rex;
11361140
11371141   assert(opsize == OP_16BIT || opsize == OP_32BIT || opsize == OP_64BIT);
r1051r1052
11391143   rex = (opsize & 8) | ((reg & 8) >> 1) | ((sib & 8) >> 2) | ((rm & 8) >> 3);
11401144   if (rex != 0 || ((op & OPFLAG_8BITREG) && reg >= 4) || ((op & OPFLAG_8BITRM) && rm >= 4))
11411145      emit_byte(emitptr, OP_REX + rex);
1146}
11421147#else
11431148   assert(opsize != OP_64BIT);
11441149#endif
11451150
1146   if (opsize == OP_16BIT)
1147      emit_byte(emitptr, PREFIX_OPSIZE);
11481151   if ((op & 0xff0000) != 0)
11491152      emit_byte(emitptr, op >> 16);
11501153   if ((op & 0xff00) != 0)
src/emu/cpu/x64drc.h
r1051r1052
1818#include "x86emit.h"
1919
2020
21
2122/***************************************************************************
2223    CONSTANTS
2324***************************************************************************/
2425
2526/* ABI-specific configuration */
26#define REG_DRC      REG_RBP         /* pointer to DRC base */
27#define REG_DRC            REG_RBP         /* pointer to DRC base */
2728
2829#ifdef X64_WINDOWS_ABI
2930
30#define REG_P1      REG_RCX         /* 1st function parameter */
31#define REG_P2      REG_RDX         /* 2nd function parameter */
32#define REG_P3      REG_R8         /* 3rd function parameter */
33#define REG_P4      REG_R9         /* 4th function parameter */
34#define REG_V5      REG_R10         /* volatile register 5 */
35#define REG_V6      REG_R11         /* volatile register 6 */
36#define REG_NV0      REG_RBX         /* non-volatile reg 0 */
37#define REG_NV1      REG_RDI         /* non-volatile reg 1 */
38#define REG_NV2      REG_RSI         /* non-volatile reg 2 */
39#define REG_NV3      REG_R12         /* non-volatile reg 3 */
40#define REG_NV4      REG_R13         /* non-volatile reg 4 */
41#define REG_NV5      REG_R14         /* non-volatile reg 5 */
42#define REG_NV6      REG_R15         /* non-volatile reg 6 */
31#define REG_P1            REG_RCX         /* 1st function parameter */
32#define REG_P2            REG_RDX         /* 2nd function parameter */
33#define REG_P3            REG_R8         /* 3rd function parameter */
34#define REG_P4            REG_R9         /* 4th function parameter */
35#define REG_V5            REG_R10         /* volatile register 5 */
36#define REG_V6            REG_R11         /* volatile register 6 */
4337
38#define NUM_NVREG         7            /* number of non-volatile registers */
39#define REG_NV0            REG_RBX         /* non-volatile reg 0 */
40#define REG_NV1            REG_RDI         /* non-volatile reg 1 */
41#define REG_NV2            REG_RSI         /* non-volatile reg 2 */
42#define REG_NV3            REG_R12         /* non-volatile reg 3 */
43#define REG_NV4            REG_R13         /* non-volatile reg 4 */
44#define REG_NV5            REG_R14         /* non-volatile reg 5 */
45#define REG_NV6            REG_R15         /* non-volatile reg 6 */
46
4447#else
4548
46#define REG_P1      REG_RDI         /* 1st function parameter */
47#define REG_P2      REG_RSI         /* 2nd function parameter */
48#define REG_P3      REG_RDX         /* 3rd function parameter */
49#define REG_P4      REG_RCX         /* 4th function parameter */
50#define REG_V5      REG_R10         /* volatile register 5 */
51#define REG_V6      REG_R11         /* volatile register 6 */
52#define REG_NV0      REG_RBX         /* non-volatile reg 0 */
53#define REG_NV1      REG_R12         /* non-volatile reg 1 */
54#define REG_NV2      REG_R13         /* non-volatile reg 2 */
55#define REG_NV3      REG_R14         /* non-volatile reg 3 */
56#define REG_NV4      REG_R15         /* non-volatile reg 4 */
57#define REG_NV5      REG_NONE      /* non-volatile reg 5 */
58#define REG_NV6      REG_NONE      /* non-volatile reg 6 */
49#define REG_P1            REG_RDI         /* 1st function parameter */
50#define REG_P2            REG_RSI         /* 2nd function parameter */
51#define REG_P3            REG_RDX         /* 3rd function parameter */
52#define REG_P4            REG_RCX         /* 4th function parameter */
53#define REG_V5            REG_R10         /* volatile register 5 */
54#define REG_V6            REG_R11         /* volatile register 6 */
5955
56#define NUM_NVREG         5            /* number of non-volatile registers */
57#define REG_NV0            REG_RBX         /* non-volatile reg 0 */
58#define REG_NV1            REG_R12         /* non-volatile reg 1 */
59#define REG_NV2            REG_R13         /* non-volatile reg 2 */
60#define REG_NV3            REG_R14         /* non-volatile reg 3 */
61#define REG_NV4            REG_R15         /* non-volatile reg 4 */
62#define REG_NV5            REG_NONE      /* non-volatile reg 5 */
63#define REG_NV6            REG_NONE      /* non-volatile reg 6 */
64
6065#endif
6166
6267
r1051r1052
193198void drc_append_fixed_dispatcher(drc_core *drc, UINT32 newpc, int loadpc);
194199void drc_append_tentative_fixed_dispatcher(drc_core *drc, UINT32 newpc, int loadpc);
195200void drc_append_call_debugger(drc_core *drc);
196
197201void drc_append_set_sse_rounding(drc_core *drc, UINT8 regindex);
198202void drc_append_set_temp_sse_rounding(drc_core *drc, UINT8 rounding);
199203void drc_append_restore_sse_rounding(drc_core *drc);
src/emu/cpu/h6280/h6280ops.h
r1051r1052
8484
8585#define CHECK_AND_TAKE_IRQ_LINES                         \
8686   if ( h6280.nmi_state != CLEAR_LINE ) {                  \
87      h6280.nmi_state = CLEAR_LINE;                     \
8788      DO_INTERRUPT(H6280_NMI_VEC);                     \
8889   }                                             \
8990   else if( !(P & _fI) )                              \
src/emu/cpu/h6280/h6280.c
r1051r1052
298298{
299299   if (irqline == INPUT_LINE_NMI)
300300   {
301      if (h6280.nmi_state == state) return;
301      if ( state != ASSERT_LINE ) return;
302302      h6280.nmi_state = state;
303303      CHECK_IRQ_LINES;
304304   }
src/emu/info.c
r1051r1052
513513               case REGION_USER6: fprintf(out, " region=\"user6\""); break;
514514               case REGION_USER7: fprintf(out, " region=\"user7\""); break;
515515               case REGION_USER8: fprintf(out, " region=\"user8\""); break;
516               case REGION_USER9: fprintf(out, " region=\"user9\""); break;
517               case REGION_USER10: fprintf(out, " region=\"user10\""); break;
518               case REGION_USER11: fprintf(out, " region=\"user11\""); break;
519               case REGION_USER12: fprintf(out, " region=\"user12\""); break;
520               case REGION_USER13: fprintf(out, " region=\"user13\""); break;
521               case REGION_USER14: fprintf(out, " region=\"user14\""); break;
522               case REGION_USER15: fprintf(out, " region=\"user15\""); break;
523               case REGION_USER16: fprintf(out, " region=\"user16\""); break;
524               case REGION_USER17: fprintf(out, " region=\"user17\""); break;
525               case REGION_USER18: fprintf(out, " region=\"user18\""); break;
526               case REGION_USER19: fprintf(out, " region=\"user19\""); break;
527               case REGION_USER20: fprintf(out, " region=\"user20\""); break;
516528               case REGION_DISKS: fprintf(out, " region=\"disks\""); break;
517529               default: fprintf(out, " region=\"0x%x\"", (int)ROMREGION_GETTYPE(region)); break;
518530         }
src/emu/tilemap.c
r1051r1052
2525/* invalid logical index */
2626#define INVALID_LOGICAL_INDEX         ((tilemap_logical_index)~0)
2727
28/* tilemap pixel grouping optimization */
29#ifdef MESS
30#define TILE_PIXEL_GROUPING            0x01
31#else
32#define TILE_PIXEL_GROUPING            0x02
33#endif
3428
3529
36
3730/***************************************************************************
3831    TYPE DEFINITIONS
3932***************************************************************************/
r1051r1052
12791272      dx0 = -1;
12801273   }
12811274
1282   /* we draw in groups of TILE_PIXEL_GROUPING pixels, so divide it out now */
1283   if ((width % TILE_PIXEL_GROUPING) != 0)
1284      fatalerror("Odd tilemap width; tilemap.c draws in groups of %d, and width=%d", TILE_PIXEL_GROUPING, width);
1285   width /= TILE_PIXEL_GROUPING;
1275   /* in 4bpp mode, we draw in groups of 2 pixels, so halve the width now */
1276   if (flags & TILE_4BPP)
1277   {
1278      assert(width % 2 == 0);
1279      width /= 2;
1280   }
12861281
12871282   /* iterate over rows */
12881283   for (ty = 0; ty < height; ty++)
r1051r1052
12901285      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
12911286      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
12921287      int xoffs = 0;
1293      int nibble = 0;
12941288
12951289      /* pre-advance to the next row */
12961290      y0 += dy0;
r1051r1052
13001294      {
13011295         for (tx = 0; tx < width; tx++)
13021296         {
1303            UINT8 pen, map;
1304            int i;
1305
1306            for (i = 0; i < TILE_PIXEL_GROUPING; i++)
1307            {
1308               pen = *pendata++;
1309               map = penmap[pen];
1310               pixptr[xoffs] = palette_base + pen;
1311               flagsptr[xoffs] = map | category;
1312               andmask &= map;
1313               ormask |= map;
1314               xoffs += dx0;
1315            }
1297            UINT8 pen = *pendata++;
1298            UINT8 map = penmap[pen];
1299            pixptr[xoffs] = palette_base + pen;
1300            flagsptr[xoffs] = map | category;
1301            andmask &= map;
1302            ormask |= map;
1303            xoffs += dx0;
13161304         }
13171305      }
13181306
r1051r1052
13211309      {
13221310         for (tx = 0; tx < width; tx++)
13231311         {
1324            UINT8 data = 0;
1312            UINT8 data = *pendata++;
13251313            UINT8 pen, map;
1326            int i;
13271314
1328            for (i = 0; i < TILE_PIXEL_GROUPING; i++)
1329            {
1330               if ((nibble++ % 2) == 0)
1331               {
1332                  data = *pendata++;
1333                  pen = data & 0x0f;
1334               }
1335               else
1336                  pen = data >> 4;
1337               map = penmap[pen];
1338               pixptr[xoffs] = palette_base + pen;
1339               flagsptr[xoffs] = map | category;
1340               andmask &= map;
1341               ormask |= map;
1342               xoffs += dx0;
1343            }
1315            pen = data & 0x0f;
1316            map = penmap[pen];
1317            pixptr[xoffs] = palette_base + pen;
1318            flagsptr[xoffs] = map | category;
1319            andmask &= map;
1320            ormask |= map;
1321            xoffs += dx0;
1322
1323            pen = data >> 4;
1324            map = penmap[pen];
1325            pixptr[xoffs] = palette_base + pen;
1326            flagsptr[xoffs] = map | category;
1327            andmask &= map;
1328            ormask |= map;
1329            xoffs += dx0;
13441330         }
13451331      }
13461332   }
r1051r1052
13841370      dx0 = -1;
13851371   }
13861372
1387   /* we draw in groups of TILE_PIXEL_GROUPING pixels, so divide it out now */
1388   if ((width % TILE_PIXEL_GROUPING) != 0)
1389      fatalerror("Odd tilemap width; tilemap.c draws in groups of %d, and width=%d", TILE_PIXEL_GROUPING, width);
1390   width /= TILE_PIXEL_GROUPING;
1373   /* in 4bpp mode, we draw in groups of 2 pixels, so halve the width now */
1374   if (flags & TILE_4BPP)
1375   {
1376      assert(width % 2 == 0);
1377      width /= 2;
1378   }
13911379
13921380   /* iterate over rows */
13931381   for (ty = 0; ty < height; ty++)
r1051r1052
13951383      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
13961384      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
13971385      int xoffs = 0;
1398      int nibble = 0;
13991386
14001387      /* pre-advance to the next row */
14011388      y0 += dy0;
r1051r1052
14051392      {
14061393         for (tx = 0; tx < width; tx++)
14071394         {
1408            pen_t pen;
1409            UINT8 map;
1410            int i;
1411
1412            for (i = 0; i < TILE_PIXEL_GROUPING; i++)
1413            {
1414               pen = *pendata++;
1415               map = penmap[pen];
1416               pixptr[xoffs] = palette_lookup[pen];
1417               flagsptr[xoffs] = map | category;
1418               andmask &= map;
1419               ormask |= map;
1420               xoffs += dx0;
1421            }
1395            UINT8 pen = *pendata++;
1396            UINT8 map = penmap[pen];
1397            pixptr[xoffs] = palette_lookup[pen];
1398            flagsptr[xoffs] = map | category;
1399            andmask &= map;
1400            ormask |= map;
1401            xoffs += dx0;
14221402         }
14231403      }
14241404
r1051r1052
14271407      {
14281408         for (tx = 0; tx < width; tx++)
14291409         {
1430            UINT8 data = 0;
1410            UINT8 data = *pendata++;
14311411            pen_t pen;
14321412            UINT8 map;
1433            int i;
14341413
1435            for (i = 0; i < TILE_PIXEL_GROUPING; i++)
1436            {
1437               if ((nibble++ % 2) == 0)
1438               {
1439                  data = *pendata++;
1440                  pen = data & 0x0f;
1441               }
1442               else
1443                  pen = data >> 4;
1444               map = penmap[pen];
1445               pixptr[xoffs] = palette_lookup[pen];
1446               flagsptr[xoffs] = map | category;
1447               andmask &= map;
1448               ormask |= map;
1449               xoffs += dx0;
1450            }
1414            pen = data & 0x0f;
1415            map = penmap[pen];
1416            pixptr[xoffs] = palette_lookup[pen];
1417            flagsptr[xoffs] = map | category;
1418            andmask &= map;
1419            ormask |= map;
1420            xoffs += dx0;
1421
1422            pen = data >> 4;
1423            map = penmap[pen];
1424            pixptr[xoffs] = palette_lookup[pen];
1425            flagsptr[xoffs] = map | category;
1426            andmask &= map;
1427            ormask |= map;
1428            xoffs += dx0;
14511429         }
14521430      }
14531431   }
r1051r1052
14901468      dx0 = -1;
14911469   }
14921470
1493   /* we draw in groups of TILE_PIXEL_GROUPING pixels, so divide it out now */
1494   if ((width % TILE_PIXEL_GROUPING) != 0)
1495      fatalerror("Odd tilemap width; tilemap.c draws in groups of %d, and width=%d", TILE_PIXEL_GROUPING, width);
1496   width /= TILE_PIXEL_GROUPING;
1471   /* in 4bpp mode, we draw in groups of 2 pixels, so halve the width now */
1472   if (flags & TILE_4BPP)
1473   {
1474      assert(width % 2 == 0);
1475      width /= 2;
1476   }
14971477
14981478   /* iterate over rows */
14991479   for (ty = 0; ty < height; ty++)
r1051r1052
15011481      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
15021482      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
15031483      int xoffs = 0;
1504      int nibble = 0;
15051484
15061485      /* pre-advance to the next row */
15071486      y0 += dy0;
r1051r1052
15111490      {
15121491         for (tx = 0; tx < width; tx++)
15131492         {
1514            pen_t pen;
1515            UINT8 map;
1516            int i;
1517
1518            for (i = 0; i < TILE_PIXEL_GROUPING; i++)
1519            {
1520               pen = palette_lookup[*pendata++];
1521               map = penmap[pen];
1522               pixptr[xoffs] = pen;
1523               flagsptr[xoffs] = map | category;
1524               andmask &= map;
1525               ormask |= map;
1526               xoffs += dx0;
1527            }
1493            pen_t pen = palette_lookup[*pendata++];
1494            UINT8 map = penmap[pen];
1495            pixptr[xoffs] = pen;
1496            flagsptr[xoffs] = map | category;
1497            andmask &= map;
1498            ormask |= map;
1499            xoffs += dx0;
15281500         }
15291501      }
15301502
r1051r1052
15331505      {
15341506         for (tx = 0; tx < width; tx++)
15351507         {
1536            UINT8 data = 0;
1508            UINT8 data = *pendata++;
15371509            pen_t pen;
15381510            UINT8 map;
1539            int i;
15401511
1541            for (i = 0; i < TILE_PIXEL_GROUPING; i++)
1542            {
1543               if ((nibble++ % 2) == 0)
1544               {
1545                  data = *pendata++;
1546                  pen = palette_lookup[data & 0x0f];
1547               }
1548               else
1549                  pen = palette_lookup[data >> 4];
1550               map = penmap[pen];
1551               pixptr[xoffs] = pen;
1552               flagsptr[xoffs] = map | category;
1553               andmask &= map;
1554               ormask |= map;
1555               xoffs += dx0;
1556            }
1512            pen = palette_lookup[data & 0x0f];
1513            map = penmap[pen];
1514            pixptr[xoffs] = pen;
1515            flagsptr[xoffs] = map | category;
1516            andmask &= map;
1517            ormask |= map;
1518            xoffs += dx0;
1519
1520            pen = palette_lookup[data >> 4];
1521            map = penmap[pen];
1522            pixptr[xoffs] = pen;
1523            flagsptr[xoffs] = map | category;
1524            andmask &= map;
1525            ormask |= map;
1526            xoffs += dx0;
15571527         }
15581528      }
15591529   }
src/emu/video.c
r1051r1052
169169static void init_buffered_spriteram(void);
170170
171171/* graphics decoding */
172static void allocate_graphics(running_machine *machine, const gfx_decode *gfxdecodeinfo);
173static void decode_graphics(running_machine *machine, const gfx_decode *gfxdecodeinfo);
172static void allocate_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo);
173static void decode_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo);
174174
175175/* global rendering */
176176static TIMER_CALLBACK( scanline0_callback );
r1051r1052
486486    graphics
487487-------------------------------------------------*/
488488
489static void allocate_graphics(running_machine *machine, const gfx_decode *gfxdecodeinfo)
489static void allocate_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo)
490490{
491491   int i;
492492
r1051r1052
595595    decode_graphics - decode the graphics
596596-------------------------------------------------*/
597597
598static void decode_graphics(running_machine *machine, const gfx_decode *gfxdecodeinfo)
598static void decode_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo)
599599{
600600   int totalgfx = 0, curgfx = 0;
601601   char buffer[200];
src/emu/memory.c
r1051r1052
392392static void find_memory(void);
393393static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset);
394394static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which);
395static void memory_exit(running_machine *machine);
395396
396397static void mem_dump(void)
397398{
r1051r1052
458459    memory_exit - free memory
459460-------------------------------------------------*/
460461
461void memory_exit(running_machine *machine)
462static void memory_exit(running_machine *machine)
462463{
463464   int cpunum, spacenum;
464465
src/emu/emu.mak
r1051r1052
8181   $(EMUOBJ)/video/resnet.o \
8282   $(EMUOBJ)/video/vector.o \
8383
84ifdef PROFILER
85EMUOBJS += \
86   $(EMUOBJ)/profiler.o
87endif
88
8489ifdef DEBUG
8590EMUOBJS += \
86   $(EMUOBJ)/profiler.o \
8791   $(EMUOBJ)/debug/debugcmd.o \
8892   $(EMUOBJ)/debug/debugcmt.o \
8993   $(EMUOBJ)/debug/debugcon.o \
src/emu/memory.h
r1051r1052
926926
927927/* ----- memory setup function ----- */
928928void      memory_init(running_machine *machine);
929void      memory_exit(running_machine *machine);
930929void      memory_set_context(int activecpu);
931930
932931/* ----- address map functions ----- */
src/emu/mame.c
r1051r1052
3838                - calls ui_init() [ui.c] to initialize the user interface
3939                - calls generic_machine_init() [machine/generic.c] to initialize generic machine structures
4040                - calls generic_video_init() [video/generic.c] to initialize generic video structures
41                - calls generic_sound_init() [audio/generic.c] to initialize generic sound structures
4142                - calls timer_init() [timer.c] to reset the timer system
4243                - calls osd_init() [osdepend.h] to do platform-specific initialization
4344                - calls code_init() [input.c] to initialize the input system
r1051r1052
235236   "REGION_USER6",
236237   "REGION_USER7",
237238   "REGION_USER8",
239   "REGION_USER9",
240   "REGION_USER10",
241   "REGION_USER11",
242   "REGION_USER12",
243   "REGION_USER13",
244   "REGION_USER14",
245   "REGION_USER15",
246   "REGION_USER16",
247   "REGION_USER17",
248   "REGION_USER18",
249   "REGION_USER19",
250   "REGION_USER20",
238251   "REGION_DISKS",
239252   "REGION_PLDS"
240253};
r1051r1052
14711484   ui_init(machine);
14721485   generic_machine_init(machine);
14731486   generic_video_init(machine);
1487   generic_sound_init();
14741488   mame->rand_seed = 0x9d14abd7;
14751489
14761490   /* initialize the timers and allocate a soft_reset timer */
src/emu/inptport.c
r1051r1052
267267static const char *seqtypestrings[] = { "standard", "decrement", "increment" };
268268
269269/* original input_ports without modifications */
270input_port_entry *input_ports_default;
270static input_port_entry *input_ports_default;
271271
272272/* recorded speed read from an INP file */
273double rec_speed;
273static double rec_speed;
274274
275275/* set to 1 if INP file being played is a standard MAME INP file */
276int no_extended_inp;
276static int no_extended_inp;
277277
278278/* for average speed calculations */
279int framecount;
280double totalspeed;
279static int framecount;
280static double totalspeed;
281281
282282
283283/***************************************************************************
src/emu/mame.h
r1051r1052
131131   REGION_USER6,
132132   REGION_USER7,
133133   REGION_USER8,
134   REGION_USER9,
135   REGION_USER10,
136   REGION_USER11,
137   REGION_USER12,
138   REGION_USER13,
139   REGION_USER14,
140   REGION_USER15,
141   REGION_USER16,
142   REGION_USER17,
143   REGION_USER18,
144   REGION_USER19,
145   REGION_USER20,
134146   REGION_DISKS,
135147   REGION_PLDS,
136148   REGION_MAX
src/emu/inptport.h
r1051r1052
615615
616616/* single pointers and UINT32s are just encoded straight */
617617#define INPUT_PORT_PTR(x)            ((input_port_token)(x))
618#define INPUT_PORT_UINT32(x)         ((input_port_token)(UINT32)(FPTR)(x))
618#define INPUT_PORT_UINT32(x)         ((input_port_token)(FPTR)(UINT32)(FPTR)(x))
619619
620620#ifdef PTR64
621621/* on 64-bit platforms, pairs of UINT32s are encoded into a single 64-bit pointer */
src/emu/cpuintrf.h
r1051r1052
379379    TYPE DEFINITIONS
380380***************************************************************************/
381381
382/* forward declaration of this union */
382383typedef union _cpuinfo cpuinfo;
384
385
386/* define the various callback functions */
387typedef void (*cpufunc_get_info)(UINT32 state, cpuinfo *info);
388typedef void (*cpufunc_set_info)(UINT32 state, cpuinfo *info);
389typedef void (*cpufunc_get_context)(void *buffer);
390typedef void (*cpufunc_set_context)(void *buffer);
391typedef void (*cpufunc_init)(int index, int clock, const void *config, int (*irqcallback)(int));
392typedef void (*cpufunc_reset)(void);
393typedef void (*cpufunc_exit)(void);
394typedef int   (*cpufunc_execute)(int cycles);
395typedef void (*cpufunc_burn)(int cycles);
396typedef offs_t (*cpufunc_disassemble)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
397typedef int   (*cpufunc_translate)(int space, offs_t *address);
398typedef int   (*cpufunc_read)(int space, UINT32 offset, int size, UINT64 *value);
399typedef int   (*cpufunc_write)(int space, UINT32 offset, int size, UINT64 value);
400typedef int   (*cpufunc_readop)(UINT32 offset, int size, UINT64 *value);
401typedef void (*cpufunc_setup_commands)(void);
402
403
404/* cpuinfo union used to pass data to/from the get_info/set_info functions */
383405union _cpuinfo
384406{
385   INT64   i;                                 /* generic integers */
386   void *   p;                                 /* generic pointers */
387   genf *  f;                                 /* generic function pointers */
388   char *   s;                                 /* generic strings */
407   INT64               i;                     /* generic integers */
408   void *               p;                     /* generic pointers */
409   genf *              f;                     /* generic function pointers */
410   char *               s;                     /* generic strings */
389411
390   void   (*setinfo)(UINT32 state, cpuinfo *info);   /* CPUINFO_PTR_SET_INFO */
391   void   (*getcontext)(void *context);            /* CPUINFO_PTR_GET_CONTEXT */
392   void   (*setcontext)(void *context);            /* CPUINFO_PTR_SET_CONTEXT */
393   void   (*init)(int index, int clock, const void *config, int (*irqcallback)(int));/* CPUINFO_PTR_INIT */
394   void   (*reset)(void);                        /* CPUINFO_PTR_RESET */
395   void   (*exit)(void);                        /* CPUINFO_PTR_EXIT */
396   int      (*execute)(int cycles);                  /* CPUINFO_PTR_EXECUTE */
397   void   (*burn)(int cycles);                  /* CPUINFO_PTR_BURN */
398   offs_t   (*disassemble)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);/* CPUINFO_PTR_DISASSEMBLE */
399   int    (*translate)(int space, offs_t *address);   /* CPUINFO_PTR_TRANSLATE */
400   int      (*read)(int space, UINT32 offset, int size, UINT64 *value);/* CPUINFO_PTR_READ */
401   int      (*write)(int space, UINT32 offset, int size, UINT64 value);/* CPUINFO_PTR_WRITE */
402   int      (*readop)(UINT32 offset, int size, UINT64 *value);/* CPUINFO_PTR_READOP */
403   void   (*setup_commands)(void);               /* CPUINFO_PTR_DEBUG_SETUP_COMMANDS */
404   int *   icount;                              /* CPUINFO_PTR_INSTRUCTION_COUNTER */
405   construct_map_t internal_map;                  /* CPUINFO_PTR_INTERNAL_MEMORY_MAP */
412   cpufunc_set_info      setinfo;               /* CPUINFO_PTR_SET_INFO */
413   cpufunc_get_context      getcontext;               /* CPUINFO_PTR_GET_CONTEXT */
414   cpufunc_set_context      setcontext;               /* CPUINFO_PTR_SET_CONTEXT */
415   cpufunc_init         init;                  /* CPUINFO_PTR_INIT */
416   cpufunc_reset         reset;                  /* CPUINFO_PTR_RESET */
417   cpufunc_exit         exit;                  /* CPUINFO_PTR_EXIT */
418   cpufunc_execute         execute;               /* CPUINFO_PTR_EXECUTE */
419   cpufunc_burn         burn;                  /* CPUINFO_PTR_BURN */
420   cpufunc_disassemble      disassemble;            /* CPUINFO_PTR_DISASSEMBLE */
421   cpufunc_translate      translate;               /* CPUINFO_PTR_TRANSLATE */
422   cpufunc_read         read;                  /* CPUINFO_PTR_READ */
423   cpufunc_write         write;                  /* CPUINFO_PTR_WRITE */
424   cpufunc_readop         readop;                  /* CPUINFO_PTR_READOP */
425   cpufunc_setup_commands   setup_commands;            /* CPUINFO_PTR_DEBUG_SETUP_COMMANDS */
426   int *               icount;                  /* CPUINFO_PTR_INSTRUCTION_COUNTER */
427   construct_map_t       internal_map;            /* CPUINFO_PTR_INTERNAL_MEMORY_MAP */
406428};
407429
408430
r1051r1052
410432struct _cpu_interface
411433{
412434   /* table of core functions */
413   void      (*get_info)(UINT32 state, cpuinfo *info);
414   void      (*set_info)(UINT32 state, cpuinfo *info);
415   void      (*get_context)(void *buffer);
416   void      (*set_context)(void *buffer);
417   void      (*init)(int index, int clock, const void *config, int (*irqcallback)(int));
418   void      (*reset)(void);
419   void      (*exit)(void);
420   int         (*execute)(int cycles);
421   void      (*burn)(int cycles);
422   offs_t      (*disassemble)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
423   int         (*translate)(int space, offs_t *address);
435   cpufunc_get_info      get_info;
436   cpufunc_set_info      set_info;
437   cpufunc_get_context      get_context;
438   cpufunc_set_context      set_context;
439   cpufunc_init         init;
440   cpufunc_reset         reset;
441   cpufunc_exit         exit;
442   cpufunc_execute         execute;
443   cpufunc_burn         burn;
444   cpufunc_disassemble      disassemble;
445   cpufunc_translate      translate;
424446
425447   /* other info */
426   size_t      context_size;
427   INT8      address_shift;
428   int *      icount;
448   size_t               context_size;
449   INT8               address_shift;
450   int *               icount;
429451};
430452
431453
src/emu/sound/scsplfo.c
r1051r1052
3535static int PSCALES[8][256];
3636static int ASCALES[8][256];
3737
38void LFO_Init(void)
38static void LFO_Init(void)
3939{
4040    int i,s;
4141    for(i=0;i<256;++i)
r1051r1052
128128   return p<<(SHIFT-LFO_SHIFT);
129129}
130130
131void LFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO)
131static void LFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO)
132132{
133133    float step=(float) LFOFreq[LFOF]*256.0/(float)44100;
134134    LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step);
src/emu/sound/x1_010.c
r1051r1052
103103/*--------------------------------------------------------------
104104 generate sound to the mix buffer
105105--------------------------------------------------------------*/
106void seta_update( void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length )
106static void seta_update( void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length )
107107{
108108   struct x1_010_info *info = param;
109109   X1_010_CHANNEL   *reg;
src/emu/sound/ay8910.c
r1051r1052
6464#define AY_PORTB   (15)
6565
6666
67void _AYWriteReg(struct AY8910 *PSG, int r, int v)
67static void _AYWriteReg(struct AY8910 *PSG, int r, int v)
6868{
6969   int old;
7070
r1051r1052
611611
612612
613613
614void ay8910_reset(int chip)
615{
616   ay8910_reset_ym(sndti_token(SOUND_AY8910, chip));
617}
618
619614static void AY8910_init(struct AY8910 *PSG, int streams,
620615      int clock,int sample_rate,
621616      read8_handler portAread,read8_handler portBread,
src/emu/sound/c6280.c
r1051r1052
8787#include "cpu/h6280/h6280.h"
8888
8989/* Local function prototypes */
90void c6280_init(c6280_t *p, double clk, double rate);
91void c6280_write(c6280_t *p, int offset, int data);
92void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
90static void c6280_init(c6280_t *p, double clk, double rate);
91static void c6280_write(c6280_t *p, int offset, int data);
92static void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
9393
9494
95void c6280_init(c6280_t *p, double clk, double rate)
95static void c6280_init(c6280_t *p, double clk, double rate)
9696{
9797    int i;
9898    double step;
r1051r1052
129129}
130130
131131
132void c6280_write(c6280_t *p, int offset, int data)
132static void c6280_write(c6280_t *p, int offset, int data)
133133{
134134    t_channel *q = &p->channel[p->select];
135135
r1051r1052
212212}
213213
214214
215void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length)
215static void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length)
216216{
217217    static int scale_tab[] = {
218218        0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
src/emu/sound/discrete.c
r1051r1052
123123 *
124124 *************************************/
125125
126void CLIB_DECL discrete_log(const char *text, ...)
126static void CLIB_DECL discrete_log(const char *text, ...)
127127{
128128   if (DISCRETE_DEBUGLOG)
129129   {
src/emu/sound/discrete.h
r1051r1052
37603760 *
37613761 *************************************/
37623762
3763#define DISCRETE_SOUND_START(STRUCTURENAME) discrete_sound_block STRUCTURENAME[] = {
3763#define MDRV_SOUND_CONFIG_DISCRETE(name) MDRV_SOUND_CONFIG(name##_discrete_interface)
3764
3765#define DISCRETE_SOUND_EXTERN(name) extern const discrete_sound_block name##_discrete_interface[]
3766#define DISCRETE_SOUND_START(name) const discrete_sound_block name##_discrete_interface[] = {
37643767#define DISCRETE_SOUND_END                                              { NODE_00, DSS_NULL     , 0, { NODE_NC }, { 0 } ,NULL  ,"End Marker" }  };
37653768
37663769/* from disc_inp.c */
src/emu/sound/scsp.c
r1051r1052
1919                             added ringbuffer support.
2020    * January 8, 2005   (RB) Added ability to specify region offset for RAM.
2121    * January 26, 2007  (ES) Added on-board DSP capability
22    * September 24, 2007 (RB+ES) Removed fake reverb.  Rewrote timers and IRQ handling.
23                              Fixed case where voice frequency is updated while looping.
24                  Enabled DSP again.
2225*/
2326
2427#include <math.h>
r1051r1052
129132      UINT16 data[0x10];   //only 0x1a bytes used
130133      UINT8 datab[0x20];
131134   } udata;
135   UINT8 Backwards;   //the wave is playing backwards
132136   UINT8 active;   //this slot is currently playing
133137   UINT8 *base;      //samples base address
134138   UINT32 cur_addr;   //current play address (24.8)
r1051r1052
165169#define SCITMA   6
166170#define SCITMB   7
167171
168//#define USEDSP
172#define USEDSP
169173
170#define REVERB_LEN   0x10000
171#define REVERB_DIF   6000
172#define REVERB_DIV   4
173
174174struct _SCSP
175175{
176176   union
r1051r1052
187187   void (*Int68kCB)(int irq);
188188   sound_stream * stream;
189189
190   signed int *buffertmpl,*buffertmpr;
190   INT32 *buffertmpl,*buffertmpr;
191191
192192   UINT32 IrqTimA;
193193   UINT32 IrqTimBC;
194194   UINT32 IrqMidi;
195195
196196   UINT8 MidiOutW,MidiOutR;
197   UINT8 MidiStack[16];
197   UINT8 MidiStack[32];
198198   UINT8 MidiW,MidiR;
199199
200200   int LPANTABLE[0x10000];
r1051r1052
203203   int TimPris[3];
204204   int TimCnt[3];
205205
206   // timers
207   mame_timer *timerA, *timerB, *timerC;
208
206209   // DMA stuff
207210   UINT32 scsp_dmea;
208211   UINT16 scsp_drga;
r1051r1052
210213
211214   int ARTABLE[64], DRTABLE[64];
212215
213   signed short bufferrevr[REVERB_LEN];
214   signed short bufferrevl[REVERB_LEN];
215   unsigned int RevR,RevW;
216
217216#ifdef USEDSP
218217   struct _SCSPDSP DSP;
219218#endif
r1051r1052
248247   return SCI;
249248}
250249
251static void ResetInterrupts(struct _SCSP *SCSP)
252{
253   UINT32 reset = SCSP->udata.data[0x22/2];
254   if (reset & 0x40)
255      SCSP->Int68kCB(-SCSP->IrqTimA);
256   if (reset & 0xc0)
257      SCSP->Int68kCB(-SCSP->IrqTimBC);
258}
259
260250static void CheckPendingIRQ(struct _SCSP *SCSP)
261251{
262252   UINT32 pend=SCSP->udata.data[0x20/2];
263253   UINT32 en=SCSP->udata.data[0x1e/2];
264254   if(SCSP->MidiW!=SCSP->MidiR)
265255   {
266      SCSP->Int68kCB(SCSP->IrqMidi);
267      return;
256      SCSP->udata.data[0x20/2] |= 8;
257      pend |= 8;
268258   }
269259   if(!pend)
270260      return;
r1051r1052
286276         SCSP->Int68kCB(SCSP->IrqTimBC);
287277         return;
288278      }
279   if(pend&8)
280      if (en&8)
281      {
282         SCSP->Int68kCB(SCSP->IrqMidi);
283         SCSP->udata.data[0x20/2] &= ~8;
284         return;
285      }
289286
290287   SCSP->Int68kCB(0);
291288}
292289
290static void ResetInterrupts(struct _SCSP *SCSP)
291{
292   UINT32 reset = SCSP->udata.data[0x22/2];
293
294   if (reset & 0x40)
295   {
296      SCSP->Int68kCB(-SCSP->IrqTimA);
297   }
298   if (reset & 0x180)
299   {
300      SCSP->Int68kCB(-SCSP->IrqTimBC);
301   }
302   if (reset & 0x8)
303   {
304      SCSP->Int68kCB(-SCSP->IrqMidi);
305   }
306
307   CheckPendingIRQ(SCSP);
308}
309
310static TIMER_CALLBACK_PTR( timerA_cb )
311{
312   struct _SCSP *SCSP = (struct _SCSP *)param;
313
314   SCSP->TimCnt[0] = 0xFFFF;
315   SCSP->udata.data[0x20/2]|=0x40;
316   SCSP->udata.data[0x18/2]&=0xff00;
317   SCSP->udata.data[0x18/2]|=SCSP->TimCnt[0]>>8;
318
319   CheckPendingIRQ(SCSP);
320}
321
322static TIMER_CALLBACK_PTR( timerB_cb )
323{
324   struct _SCSP *SCSP = (struct _SCSP *)param;
325
326   SCSP->TimCnt[1] = 0xFFFF;
327   SCSP->udata.data[0x20/2]|=0x80;
328   SCSP->udata.data[0x1a/2]&=0xff00;
329   SCSP->udata.data[0x1a/2]|=SCSP->TimCnt[0]>>8;
330
331   CheckPendingIRQ(SCSP);
332}
333
334static TIMER_CALLBACK_PTR( timerC_cb )
335{
336   struct _SCSP *SCSP = (struct _SCSP *)param;
337
338   SCSP->TimCnt[2] = 0xFFFF;
339   SCSP->udata.data[0x20/2]|=0x100;
340   SCSP->udata.data[0x1c/2]&=0xff00;
341   SCSP->udata.data[0x1c/2]|=SCSP->TimCnt[0]>>8;
342
343   CheckPendingIRQ(SCSP);
344}
345
293346static int Get_AR(struct _SCSP *SCSP,int base,int R)
294347{
295348   int Rate=base+(R<<1);
r1051r1052
412465   slot->EG.state=ATTACK;
413466   slot->EG.volume=0;
414467   slot->Prev=0;
468   slot->Backwards=0;
415469   Compute_LFO(slot);
470
471//  printf("StartSlot[%p]: SA %x PCM8B %x LPCTL %x ALFOS %x STWINH %x TL %x EFSDL %x\n", slot, SA(slot), PCM8B(slot), LPCTL(slot), ALFOS(slot), STWINH(slot), TL(slot), EFSDL(slot));
416472}
417473
418474static void SCSP_StopSlot(struct _SLOT *slot,int keyoff)
r1051r1052
431487
432488#define log_base_2(n) (log((float) n)/log((float) 2))
433489
434static void SCSP_Init(struct _SCSP *SCSP, const struct SCSPinterface *intf)
490static void SCSP_Init(struct _SCSP *SCSP, const struct SCSPinterface *intf, int sndindex)
435491{
436   int i=0;
492   int i;
437493
438494   SCSP->IrqTimA = SCSP->IrqTimBC = SCSP->IrqMidi = 0;
439495   SCSP->MidiR=SCSP->MidiW=0;
440496   SCSP->MidiOutR=SCSP->MidiOutW=0;
441   SCSP->RevR=0;
442   SCSP->RevW=REVERB_DIF;
443   memset(SCSP->bufferrevl,0,sizeof(SCSP->bufferrevl));
444   memset(SCSP->bufferrevr,0,sizeof(SCSP->bufferrevr));
445497
446498   // get SCSP RAM
447499   {
448500      memset(SCSP,0,sizeof(*SCSP));
449501
450      if (!i)
502      if (sndindex == 0)
451503      {
452504         SCSP->Master=1;
453505      }
r1051r1052
468520      }
469521   }
470522
523   SCSP->timerA = mame_timer_alloc_ptr(timerA_cb, SCSP);
524   SCSP->timerB = mame_timer_alloc_ptr(timerB_cb, SCSP);
525   SCSP->timerC = mame_timer_alloc_ptr(timerC_cb, SCSP);
526
471527   for(i=0;i<0x400;++i)
472528   {
473529      float fcent=(double) 1200.0*log_base_2((double)(((double) 1024.0+(double)i)/(double)1024.0));
r1051r1052
649705      case 0x19:
650706         if(SCSP->Master)
651707         {
708            UINT32 time;
709
652710            SCSP->TimPris[0]=1<<((SCSP->udata.data[0x18/2]>>8)&0x7);
653711            SCSP->TimCnt[0]=(SCSP->udata.data[0x18/2]&0xff)<<8;
712
713            if ((SCSP->udata.data[0x18/2]&0xff) != 255)
714            {
715               time = (44100 / SCSP->TimPris[0]) / (255-(SCSP->udata.data[0x18/2]&0xff));
716               if (time)
717               {
718                  mame_timer_adjust_ptr(SCSP->timerA, MAME_TIME_IN_HZ(time), time_never);
719               }
720            }
654721         }
655722         break;
656723      case 0x1a:
657724      case 0x1b:
658725         if(SCSP->Master)
659726         {
727            UINT32 time;
728
660729            SCSP->TimPris[1]=1<<((SCSP->udata.data[0x1A/2]>>8)&0x7);
661730            SCSP->TimCnt[1]=(SCSP->udata.data[0x1A/2]&0xff)<<8;
731
732            if ((SCSP->udata.data[0x1A/2]&0xff) != 255)
733            {
734               time = (44100 / SCSP->TimPris[1]) / (255-(SCSP->udata.data[0x1A/2]&0xff));
735               if (time)
736               {
737                  mame_timer_adjust_ptr(SCSP->timerB, MAME_TIME_IN_HZ(time), time_never);
738               }
739            }
662740         }
663741         break;
664742      case 0x1C:
665743      case 0x1D:
666744         if(SCSP->Master)
667745         {
746            UINT32 time;
747
668748            SCSP->TimPris[2]=1<<((SCSP->udata.data[0x1C/2]>>8)&0x7);
669749            SCSP->TimCnt[2]=(SCSP->udata.data[0x1C/2]&0xff)<<8;
750
751            if ((SCSP->udata.data[0x1C/2]&0xff) != 255)
752            {
753               time = (44100 / SCSP->TimPris[2]) / (255-(SCSP->udata.data[0x1C/2]&0xff));
754               if (time)
755               {
756                  mame_timer_adjust_ptr(SCSP->timerC, MAME_TIME_IN_HZ(time), time_never);
757               }
758            }
670759         }
671760         break;
672761      case 0x22:   //SCIRE
r1051r1052
709798            unsigned short v=SCSP->udata.data[0x5/2];
710799            v&=0xff00;
711800            v|=SCSP->MidiStack[SCSP->MidiR];
712            SCSP[0].Int68kCB(0);   // cancel the IRQ
801            SCSP[0].Int68kCB(-SCSP->IrqMidi);   // cancel the IRQ
713802            if(SCSP->MidiR!=SCSP->MidiW)
714803            {
715804               ++SCSP->MidiR;
716               SCSP->MidiR&=15;
805               SCSP->MidiR&=31;
717806            }
718807            SCSP->udata.data[0x5/2]=v;
719808         }
r1051r1052
727816            SCSP->udata.data[0x8/2]|=CA<<7;
728817         }
729818         break;
819
820      case 0x18:
821      case 0x19:
822         break;
823
824      case 0x1a:
825      case 0x1b:
826         break;
827
828      case 0x1c:
829      case 0x1d:
830         break;
730831   }
731832}
732833
r1051r1052
762863         *((unsigned short *) (SCSP->DSP.MPRO+(addr-0x800)/2))=val;
763864
764865      if(addr==0xBF0)
866      {
765867         SCSPDSP_Start(&SCSP->DSP);
868      }
766869#endif
767870   }
768871}
r1051r1052
794897
795898#define REVSIGN(v) ((~v)+1)
796899
797void SCSP_TimersAddTicks(struct _SCSP *SCSP, int ticks)
798{
799   if(SCSP->TimCnt[0]<=0xff00)
800   {
801       SCSP->TimCnt[0] += ticks << (8-((SCSP->udata.data[0x18/2]>>8)&0x7));
802      if (SCSP->TimCnt[0] > 0xFF00)
803      {
804         SCSP->TimCnt[0] = 0xFFFF;
805         SCSP->udata.data[0x20/2]|=0x40;
806      }
807      SCSP->udata.data[0x18/2]&=0xff00;
808      SCSP->udata.data[0x18/2]|=SCSP->TimCnt[0]>>8;
809   }
810900
811   if(SCSP->TimCnt[1]<=0xff00)
812   {
813      SCSP->TimCnt[1] += ticks << (8-((SCSP->udata.data[0x1a/2]>>8)&0x7));
814      if (SCSP->TimCnt[1] > 0xFF00)
815      {
816         SCSP->TimCnt[1] = 0xFFFF;
817         SCSP->udata.data[0x20/2]|=0x80;
818      }
819      SCSP->udata.data[0x1a/2]&=0xff00;
820      SCSP->udata.data[0x1a/2]|=SCSP->TimCnt[1]>>8;
821   }
822
823   if(SCSP->TimCnt[2]<=0xff00)
824   {
825      SCSP->TimCnt[2] += ticks << (8-((SCSP->udata.data[0x1c/2]>>8)&0x7));
826      if (SCSP->TimCnt[2] > 0xFF00)
827      {
828         SCSP->TimCnt[2] = 0xFFFF;
829         SCSP->udata.data[0x20/2]|=0x100;
830      }
831      SCSP->udata.data[0x1c/2]&=0xff00;
832      SCSP->udata.data[0x1c/2]|=SCSP->TimCnt[2]>>8;
833   }
834}
835
836901#ifndef USEDSP
837902static signed int *bufl1,*bufr1;
838903#define SCSPNAME(_8bit,lfo,alfo,loop) \
r1051r1052
868933         signed short *p=(signed short *) (slot->base+((slot->cur_addr>>(SHIFT-1))&(~1)));\
869934         sample=(p[0]);\
870935      }\
936      if(slot->Backwards)\
937         slot->cur_addr-=step;\
938      else\
871939      slot->cur_addr+=step;\
872940      addr=slot->cur_addr>>SHIFT;\
873941      if(loop==0)\
r1051r1052
897965         if(addr>=LEA(slot)) /*reached end, reverse till start*/ \
898966         {\
899967            slot->cur_addr=LEA(slot)<<SHIFT;\
900            slot->step=REVSIGN(slot->step);\
968            slot->Backwards=1;\
901969         }\
902         if(addr<=LSA(slot) || (addr&0x80000000)) /*reached start or negative*/\
970         if((addr<=LSA(slot) || (addr&0x80000000)) && (slot->Backwards))/*reached start or negative*/\
903971         {\
904972            slot->cur_addr=LSA(slot)<<SHIFT;\
905            slot->step=REVSIGN(slot->step);\
973            slot->Backwards=0;\
906974         }\
907975      }\
908976      if(alfo)\
r1051r1052
9611029
9621030typedef void (*_SCSPUpdateModes)(struct _SCSP *,struct _SLOT *,unsigned int,unsigned int);
9631031
964_SCSPUpdateModes SCSPUpdateModes[]=
1032static _SCSPUpdateModes SCSPUpdateModes[]=
9651033{
9661034   SCSPTMPL(0,0,0,0)
9671035   SCSPTMPL(0,0,0,1)
r1051r1052
10381106      signed int smpl=*bufl1>>2;
10391107      signed int smpr=*bufr1>>2;
10401108
1041//      if (!chip)
1042      {
1043         SCSP_TimersAddTicks(SCSP, 1);
1044         CheckPendingIRQ(SCSP);
1045      }
1046
10471109      *bufl=ICLIP16(smpl);
10481110      *bufr=ICLIP16(smpr);
10491111      *bufl1=0;
r1051r1052
10611123   INT32 sample;
10621124   int step=slot->step;
10631125   UINT32 addr;
1126   INT32 smp;
10641127
10651128   if(SSCTL(slot)!=0)   //no FM or noise yet
10661129      return 0;
r1051r1052
10741137   if(PCM8B(slot))
10751138      addr=slot->cur_addr>>SHIFT;
10761139   else
1077      addr=(slot->cur_addr>>(SHIFT-1))&(~1);
1140      addr=(slot->cur_addr>>(SHIFT-1)) & 0x7fffe;
10781141
10791142   if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0)
10801143   {
1081      INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
1144      smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
10821145
10831146      smp>>=11;
10841147      addr+=smp;
10851148      if(!PCM8B(slot))
1086         addr&=~1;
1149         addr&=0x7fffe;
1150      else
1151         addr&=0x7ffff;
10871152   }
10881153
10891154   if(PCM8B(slot))   //8 bit signed
r1051r1052
10971162      sample=(p[0]);
10981163   }
10991164
1165   if(slot->Backwards)
1166      slot->cur_addr-=step;
1167   else
11001168   slot->cur_addr+=step;
11011169   addr=slot->cur_addr>>SHIFT;
11021170   switch(LPCTL(slot))
r1051r1052
11161184      if(addr>LEA(slot))
11171185      {
11181186         slot->cur_addr=LEA(slot)<<SHIFT;
1119         slot->step=REVSIGN(slot->step);
1187         slot->Backwards=1;
11201188      }
11211189      if(addr<LSA(slot) || (addr&0x80000000))
11221190         slot->cur_addr=LEA(slot)<<SHIFT;
r1051r1052
11251193      if(addr>LEA(slot)) //reached end, reverse till start
11261194      {
11271195         slot->cur_addr=LEA(slot)<<SHIFT;
1128         slot->step=REVSIGN(slot->step);
1196         slot->Backwards=1;
11291197      }
1130      if(addr<LSA(slot) || (addr&0x80000000)) //reached start or negative
1198      if((addr<LSA(slot) || (addr&0x80000000)) && (slot->Backwards))//reached start or negative
11311199      {
11321200         slot->cur_addr=LSA(slot)<<SHIFT;
1133         slot->step=REVSIGN(slot->step);
1201         slot->Backwards=0;
11341202      }
11351203      break;
11361204   }
r1051r1052
11751243            sample=SCSP_UpdateSlot(SCSP, slot);
11761244            ++SCSP->BUFPTR;
11771245            SCSP->BUFPTR&=63;
1246#ifdef USEDSP
11781247            SCSPDSP_SetSample(&SCSP->DSP,sample>>SHIFT,ISEL(slot),IMXL(slot));
1179
1248#endif
11801249            Enc=((TL(slot))<<0x0)|((DIPAN(slot))<<0x8)|((DISDL(slot))<<0xd);
11811250            {
11821251               smpl+=(sample*SCSP->LPANTABLE[Enc])>>SHIFT;
r1051r1052
11911260      for(i=0;i<16;++i)
11921261      {
11931262         struct _SLOT *slot=SCSP->Slots+i;
1194         int ef=EFSDL(slot);
1195         if(ef)
1263         if(EFSDL(slot))
11961264         {
1197            unsigned short Enc=0|((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd);
1198            smpl+=(SCSP->DSP.EFREG[i]*SCSP->LPANTABLE[Enc])>>SHIFT;
1199            smpr+=(SCSP->DSP.EFREG[i]*SCSP->RPANTABLE[Enc])>>SHIFT;
1265            unsigned short Enc=(TL(slot))|((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd);
1266            smpl+=(SCSP->DSP.EFREG[i]*SCSP->LPANTABLE[Enc])>>(SHIFT-5);
1267            smpr+=(SCSP->DSP.EFREG[i]*SCSP->RPANTABLE[Enc])>>(SHIFT-5);
12001268         }
12011269      }
12021270
1203      smpl+=SCSP->bufferrevl[SCSP->RevR];
1204      smpr+=SCSP->bufferrevr[SCSP->RevR];
1205      SCSP->bufferrevl[SCSP->RevW]=((smpl<<0)/REVERB_DIV)>>0;
1206      SCSP->bufferrevr[SCSP->RevW]=((smpr<<0)/REVERB_DIV)>>0;
1207      ++SCSP->RevW;
1208      if(SCSP->RevW==REVERB_LEN)
1209         SCSP->RevW=0;
1210      ++SCSP->RevR;
1211      if(SCSP->RevR==REVERB_LEN)
1212         SCSP->RevR=0;
1213
12141271      *bufl++ = ICLIP16(smpl>>4);
12151272      *bufr++ = ICLIP16(smpr>>4);
1216
1217      SCSP_TimersAddTicks(SCSP, 1);
1218      CheckPendingIRQ(SCSP);
12191273   }
1220
12211274}
12221275#endif
12231276
r1051r1052
12271280
12281281   scsp_regs = (UINT16 *)SCSP->udata.datab;
12291282
1230   mame_printf_debug("SCSP: DMA transfer START\n"
1283   logerror("SCSP: DMA transfer START\n"
12311284          "DMEA: %04x DRGA: %04x DTLG: %04x\n"
12321285          "DGATE: %d  DDIR: %d\n",SCSP->scsp_dmea,SCSP->scsp_drga,SCSP->scsp_dtlg,scsp_dgate ? 1 : 0,scsp_ddir ? 1 : 0);
12331286
1234   /* Copy the dma values in a temp storage for resuming later *
1235     * (DMA *can't* overwrite his parameters).                  */
1287   /* Copy the dma values in a temp storage for resuming later */
1288        /* (DMA *can't* overwrite his parameters).                  */
12361289   if(!(scsp_ddir))
12371290   {
12381291      tmp_dma[0] = scsp_regs[0x12/2];
r1051r1052
12991352   intf = config;
13001353
13011354   // init the emulation
1302   SCSP_Init(SCSP, intf);
1355   SCSP_Init(SCSP, intf, sndindex);
13031356
13041357   // set up the IRQ callbacks
13051358   {
r1051r1052
13551408      case 0x412:
13561409      /*DMEA [15:1]*/
13571410      /*Sound memory address*/
1358      SCSP->scsp_dmea = (((scsp_regs[0x14/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x12/2] & 0xfffe);
1411      SCSP->scsp_dmea = (((scsp_regs[0x414/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x412/2] & 0xfffe);
13591412      break;
13601413      case 0x414:
13611414      /*DMEA [19:16]*/
1362      SCSP->scsp_dmea = (((scsp_regs[0x14/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x12/2] & 0xfffe);
1415      SCSP->scsp_dmea = (((scsp_regs[0x414/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x412/2] & 0xfffe);
13631416      /*DRGA [11:1]*/
13641417      /*Register memory address*/
1365      SCSP->scsp_drga = scsp_regs[0x14/2] & 0x0ffe;
1418      SCSP->scsp_drga = scsp_regs[0x414/2] & 0x0ffe;
13661419      break;
13671420      case 0x416:
13681421      /*DGATE[14]*/
r1051r1052
13731426      /*starting bit*/
13741427      /*DTLG[11:1]*/
13751428      /*size of transfer*/
1376      SCSP->scsp_dtlg = scsp_regs[0x16/2] & 0x0ffe;
1429      SCSP->scsp_dtlg = scsp_regs[0x416/2] & 0x0ffe;
13771430      if(scsp_dexe)
13781431      {
13791432         dma_scsp(SCSP);
1380         scsp_regs[0x16/2]^=0x1000;//disable starting bit
1433         scsp_regs[0x416/2]^=0x1000;//disable starting bit
13811434      }
13821435      break;
13831436      //check main cpu IRQ
r1051r1052
14141467WRITE16_HANDLER( SCSP_MidiIn )
14151468{
14161469   struct _SCSP *SCSP = sndti_token(SOUND_SCSP, 0);
1470
14171471   SCSP->MidiStack[SCSP->MidiW++]=data;
1418   SCSP->MidiW &= 15;
1472   SCSP->MidiW &= 31;
1473
1474   CheckPendingIRQ(SCSP);
14191475}
14201476
14211477READ16_HANDLER( SCSP_MidiOutR )
r1051r1052
14241480   unsigned char val;
14251481
14261482   val=SCSP->MidiStack[SCSP->MidiR++];
1427   SCSP->MidiR&=7;
1483   SCSP->MidiR&=31;
14281484   return val;
14291485}
14301486
r1051r1052
14581514      /* --- the following bits of info are returned as NULL-terminated strings --- */
14591515      case SNDINFO_STR_NAME:                     info->s = "SCSP";                  break;
14601516      case SNDINFO_STR_CORE_FAMILY:               info->s = "Sega/Yamaha custom";         break;
1461      case SNDINFO_STR_CORE_VERSION:               info->s = "2.0";                  break;
1517      case SNDINFO_STR_CORE_VERSION:               info->s = "2.1.1";                  break;
14621518      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
14631519      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004-2007, The MAME Team"; break;
14641520   }
src/emu/sound/fm.c
r1051r1052
19691969reset  : sel1 = in11 , sel2 = in21 (clear both)
19701970
19711971*/
1972void OPNPrescaler_w(FM_OPN *OPN , int addr, int pre_divider)
1972static void OPNPrescaler_w(FM_OPN *OPN , int addr, int pre_divider)
19731973{
19741974   static const int opn_pres[4] = { 2*12 , 2*12 , 6*12 , 3*12 };
19751975   static const int ssg_pres[4] = { 1    ,    1 ,    4 ,    2 };
src/emu/sound/tms5220.c
r1051r1052
143143static int parse_frame(struct tms5220 *tms, int the_first_frame);
144144static void check_buffer_low(struct tms5220 *tms);
145145static void set_interrupt_state(struct tms5220 *tms, int state);
146static INT16 lattice_filter(void *chip);
147static INT16 clip_and_wrap(INT16 cliptemp);
146148
147149
148150#define DEBUG_5220   0
r1051r1052
708710
709711***********************************************************************************************/
710712
711INT16 clip_and_wrap(INT16 cliptemp)
713static INT16 clip_and_wrap(INT16 cliptemp)
712714{
713715        /* clipping & wrapping, just like the patent shows */
714716
r1051r1052
735737
736738***********************************************************************************************/
737739
738INT16 lattice_filter(void *chip)
740static INT16 lattice_filter(void *chip)
739741{
740742        struct tms5220 *tms = chip;
741743        /* Lattice filter here */
src/emu/sound/tms5220.h
r1051r1052
1414int tms5220_int_read(void *chip);
1515
1616void tms5220_process(void *chip, INT16 *buffer, unsigned int size);
17INT16 lattice_filter(void *chip);
18INT16 clip_and_wrap(INT16 cliptemp);
1917
2018/* three variables added by R Nabet */
2119void tms5220_set_read(void *chip, int (*func)(int));
src/emu/profiler.c
r1051r1052
1919static int use_profiler;
2020
2121
22/*
23 * Versions of GNU C earlier that 2.7 have big problems with the UINT64
24 * so we make it into an unsigned long here.
25 */
26
27#ifdef __GNUC__
28#if (__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7))
29#define UINT64      unsigned long
30#endif
31#endif
32
3322#define MEMORY 6
3423
24typedef struct _profile_data profile_data;
3525struct _profile_data
3626{
3727   UINT64 count[MEMORY][PROFILER_TOTAL];
3828   unsigned int cpu_context_switches[MEMORY];
3929};
40typedef struct _profile_data profile_data;
4130
4231static profile_data profile;
4332static int memory;
src/emu/profiler.h
r1051r1052
6767the profiler handles a FILO list so calls may be nested.
6868*/
6969
70#ifdef MAME_DEBUG
70#ifdef MAME_PROFILER
7171void profiler_mark(int type);
7272
7373/* functions called by usrintf.c */
src/emu/driver.h
r1051r1052
193193   void             (*memcard_handler)(running_machine *machine, mame_file *file, int action); /* memory card save/load callback  */
194194
195195   UINT32            video_attributes;         /* flags describing the video system */
196   const gfx_decode *   gfxdecodeinfo;            /* pointer to graphics decoding information */
196   const gfx_decode_entry *gfxdecodeinfo;         /* pointer to array of graphics decoding information */
197197   UINT32            total_colors;            /* total number of colors in the palette */
198198   UINT32            color_table_len;         /* length of the color indirection table */
199199   const char *      default_layout;            /* default layout for this machine */
r1051r1052
365365   machine->video_attributes = (flags);                        \
366366
367367#define MDRV_GFXDECODE(gfx)                                    \
368   machine->gfxdecodeinfo = (gfx);                              \
368   machine->gfxdecodeinfo = (gfxdecodeinfo_##gfx);                              \
369369
370370#define MDRV_PALETTE_LENGTH(length)                              \
371371   machine->total_colors = (length);                           \
src/emu/drawgfx.h
r1051r1052
9898#define STEP16(START,STEP)      STEP8(START,STEP),STEP8((START)+8*(STEP),STEP)
9999#define STEP32(START,STEP)      STEP16(START,STEP),STEP16((START)+16*(STEP),STEP)
100100
101/* these macros are used for declaring gfx_decode_entry_entry info arrays. */
102#define GFXDECODE_EXTERN( name ) extern const gfx_decode_entry gfxdecodeinfo_##name[]
103#define GFXDECODE_START( name ) const gfx_decode_entry gfxdecodeinfo_##name[] = {
104#define GFXDECODE_ENTRY(region,offset,layout,start,colors) { region, offset, &layout, start, colors, 0, 0 },
105#define GFXDECODE_SCALE(region,offset,layout,start,colors,xscale,yscale) { region, offset, &layout, start, colors, xscale, yscale },
106#define GFXDECODE_END { -1 } };
101107
102108
103109/***************************************************************************
r1051r1052
142148};
143149
144150
145typedef struct _gfx_decode gfx_decode;
146struct _gfx_decode
151typedef struct _gfx_decode_entry gfx_decode_entry;
152struct _gfx_decode_entry
147153{
148154   int            memory_region;      /* memory region where the data resides; -1 marks the end of array */
149155   UINT32          start;            /* offset of beginning of data to decode */
src/emu/cheat.c
r1051r1052
79227922  PrintBinary
79237923--------------*/
79247924
7925UINT32 PrintBinary(char * buf, UINT32 data, UINT32 mask)
7925static UINT32 PrintBinary(char * buf, UINT32 data, UINT32 mask)
79267926{
79277927   UINT32   traverse = 0x80000000;
79287928   UINT32   written = 0;
r1051r1052
79477947  PrintASCII
79487948-------------*/
79497949
7950UINT32 PrintASCII(char * buf, UINT32 data, UINT8 size)
7950static UINT32 PrintASCII(char * buf, UINT32 data, UINT8 size)
79517951{
79527952   switch(size)
79537953   {
src/emu/validity.c
r1051r1052
708708   /* iterate over graphics decoding entries */
709709   for (gfxnum = 0; gfxnum < MAX_GFX_ELEMENTS && drv->gfxdecodeinfo[gfxnum].memory_region != -1; gfxnum++)
710710   {
711      const gfx_decode *gfx = &drv->gfxdecodeinfo[gfxnum];
711      const gfx_decode_entry *gfx = &drv->gfxdecodeinfo[gfxnum];
712712      int region = gfx->memory_region;
713713
714714      /* if we have a valid region, and we're not using auto-sizing, check the decode against the region length */
src/emu/drivers/empty.c
r1051r1052
5555 *
5656 *************************************/
5757
58INPUT_PORTS_START( empty )
58static INPUT_PORTS_START( empty )
5959INPUT_PORTS_END
6060
6161
src/emu/romload.c
r1051r1052
5656
5757
5858/***************************************************************************
59    FUNCTION PROTOTYPES
60***************************************************************************/
61
62static void rom_exit(running_machine *machine);
63
64
65
66/***************************************************************************
5967    HARD DISK HANDLING
6068***************************************************************************/
6169
r1051r1052
154162    debugload - log data to a file
155163-------------------------------------------------*/
156164
157void CLIB_DECL debugload(const char *string, ...)
165static void CLIB_DECL debugload(const char *string, ...)
158166{
159167#ifdef LOG_LOAD
160168   static int opened;
r1051r1052
178186    from SystemBios structure and OPTION_BIOS
179187-------------------------------------------------*/
180188
181int determine_bios_rom(const rom_entry *romp)
189static int determine_bios_rom(const rom_entry *romp)
182190{
183191   const char *specbios = options_get_string(mame_options(), OPTION_BIOS);
184192   const rom_entry *rom;
r1051r1052
11311139    rom_exit - clean up after ourselves
11321140-------------------------------------------------*/
11331141
1134void rom_exit(running_machine *machine)
1142static void rom_exit(running_machine *machine)
11351143{
11361144   open_chd *curchd;
11371145   int i;
src/lib/util/options.h
r1051r1052
146146/* output option data to an INI file */
147147void options_output_ini_file(core_options *opts, core_file *inifile);
148148
149/* output differing option data to an INI file */
150void options_output_diff_ini_file(core_options *opts, core_options *baseopts, core_file *inifile);
151
149152/* output option data to a standard file handle */
150153void options_output_ini_stdfile(core_options *opts, FILE *inifile);
151154
src/lib/util/options.c
r1051r1052
539539***************************************************************************/
540540
541541/*-------------------------------------------------
542    options_output_ini_file - output the current
543    state to an INI file
542    options_output_diff_ini_file - output the diff
543    of the current state from a base state to an
544    INI file
544545-------------------------------------------------*/
545546
546void options_output_ini_file(core_options *opts, core_file *inifile)
547void options_output_diff_ini_file(core_options *opts, core_options *baseopts, core_file *inifile)
547548{
548549   options_data *data;
550   const char *last_header = NULL;
551   const char *name;
552   const char *value;
553   options_data *basedata;
549554
550555   /* loop over all items */
551556   for (data = opts->datalist; data != NULL; data = data->next)
552557   {
553      /* header: just print */
558      /* header: record description */
554559      if ((data->flags & OPTION_HEADER) != 0)
555         core_fprintf(inifile, "\n#\n# %s\n#\n", data->description);
560         last_header = data->description;
556561
557      /* otherwise, output entries for all non-deprecated and non-command items */
562      /* otherwise, output entries for all non-deprecated and non-command items (if not in baseopts) */
558563      else if ((data->flags & (OPTION_DEPRECATED | OPTION_INTERNAL | OPTION_COMMAND)) == 0)
559564      {
560         if (astring_chr(data->data, 0, ' ') != -1)
561            core_fprintf(inifile, "%-25s \"%s\"\n", astring_c(data->links[0].name), astring_c(data->data));
562         else
563            core_fprintf(inifile, "%-25s %s\n", astring_c(data->links[0].name), astring_c(data->data));
565         /* get name and data of this value */
566         name = astring_c(data->links[0].name);
567         value = astring_c(data->data);
568
569         /* look up counterpart in baseopts, if baseopts is specified */
570         basedata = (baseopts != NULL) ? find_entry_data(baseopts, name, FALSE) : NULL;
571
572         /* is our data different, or not in baseopts? */
573         if ((basedata == NULL) || (strcmp(value, astring_c(basedata->data)) != 0))
574         {
575            /* output header, if we have one */
576            if (last_header != NULL)
577            {
578               core_fprintf(inifile, "\n#\n# %s\n#\n", last_header);
579               last_header = NULL;
580            }
581
582            /* and finally output the data */
583            if (strchr(value, ' ') != NULL)
584               core_fprintf(inifile, "%-25s \"%s\"\n", name, value);
585            else
586               core_fprintf(inifile, "%-25s %s\n", name, value);
587         }
564588      }
565589   }
566590}
r1051r1052
571595    state to an INI file
572596-------------------------------------------------*/
573597
598void options_output_ini_file(core_options *opts, core_file *inifile)
599{
600   options_output_diff_ini_file(opts, NULL, inifile);
601}
602
603
604/*-------------------------------------------------
605    options_output_ini_file - output the current
606    state to an INI file
607-------------------------------------------------*/
608
574609void options_output_ini_stdfile(core_options *opts, FILE *inifile)
575610{
576611   options_data *data;
src/lib/util/sha1.c
r1051r1052
3030#include <stdlib.h>
3131#include <string.h>
3232
33unsigned int READ_UINT32(const UINT8* data)
33static unsigned int READ_UINT32(const UINT8* data)
3434{
3535   return ((UINT32)data[0] << 24) |
3636      ((UINT32)data[1] << 16) |
r1051r1052
3838      ((UINT32)data[3]);
3939}
4040
41void WRITE_UINT32(unsigned char* data, UINT32 val)
41static void WRITE_UINT32(unsigned char* data, UINT32 val)
4242{
4343   data[0] = (val >> 24) & 0xFF;
4444   data[1] = (val >> 16) & 0xFF;
src/mess/includes/jupiter.h
r1051r1052
2626
2727/* drivers/jupiter.c */
2828
29extern gfx_layout jupiter_charlayout;
29extern const gfx_layout jupiter_charlayout;
3030                                   
src/mess/video/vic6560.c
r1051r1052
111111/* transparent, white, black */
112112static UINT32 pointercolortable[3] =
113113{0};
114static gfx_layout pointerlayout =
114static const gfx_layout pointerlayout =
115115{
116116   8, 8,
117117   1,
src/mess/video/911_vdt.c
r1051r1052
2020
2121#define MAX_VDT 1
2222
23static gfx_layout fontlayout_7bit =
23static const gfx_layout fontlayout_7bit =
2424{
2525   7, 10,         /* 7*10 characters */
2626   128,         /* 128 characters */
r1051r1052
3131   10*8          /* every char takes 10 consecutive bytes */
3232};
3333
34static gfx_layout fontlayout_8bit =
34static const gfx_layout fontlayout_8bit =
3535{
3636   7, 10,         /* 7*10 characters */
3737   128,         /* 128 characters */
r1051r1052
4242   10*8          /* every char takes 10 consecutive bytes */
4343};
4444
45gfx_decode vdt911_gfxdecodeinfo[] =
46{   /* array must use same order as vdt911_model_t!!! */
45GFXDECODE_START( vdt911_gfxdecodeinfo )
46   /* array must use same order as vdt911_model_t!!! */
4747   /* US */
48   { vdt911_chr_region, vdt911_US_chr_offset, &fontlayout_7bit, 0, 4 },
48   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_US_chr_offset, fontlayout_7bit, 0, 4 )
4949   /* UK */
50   { vdt911_chr_region, vdt911_UK_chr_offset, &fontlayout_7bit, 0, 4 },
50   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_UK_chr_offset, fontlayout_7bit, 0, 4 )
5151   /* French */
52   { vdt911_chr_region, vdt911_US_chr_offset, &fontlayout_7bit, 0, 4 },
52   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_US_chr_offset, fontlayout_7bit, 0, 4 )
5353   /* German */
54   { vdt911_chr_region, vdt911_german_chr_offset, &fontlayout_7bit, 0, 4 },
54   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_german_chr_offset, fontlayout_7bit, 0, 4 )
5555   /* Swedish */
56   { vdt911_chr_region, vdt911_swedish_chr_offset, &fontlayout_7bit, 0, 4 },
56   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_swedish_chr_offset, fontlayout_7bit, 0, 4 )
5757   /* Norwegian */
58   { vdt911_chr_region, vdt911_norwegian_chr_offset, &fontlayout_7bit, 0, 4 },
58   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_norwegian_chr_offset, fontlayout_7bit, 0, 4 )
5959   /* Japanese */
60   { vdt911_chr_region, vdt911_japanese_chr_offset, &fontlayout_8bit, 0, 4 },
60   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_japanese_chr_offset, fontlayout_8bit, 0, 4 )
6161   /* Arabic */
62   /*{ vdt911_chr_region, vdt911_arabic_chr_offset, &fontlayout_8bit, 0, 4 },*/
62   /* GFXDECODE_ENTRY( vdt911_chr_region, vdt911_arabic_chr_offset, fontlayout_8bit, 0, 4 ) */
6363   /* FrenchWP */
64   { vdt911_chr_region, vdt911_frenchWP_chr_offset, &fontlayout_7bit, 0, 4 },
65   { -1 }   /* end of array */
66};
64   GFXDECODE_ENTRY( vdt911_chr_region, vdt911_frenchWP_chr_offset, fontlayout_7bit, 0, 4 )
65GFXDECODE_END
6766
6867unsigned char vdt911_palette[vdt911_palette_size*3] =
6968{
src/mess/video/911_vdt.h
r1051r1052
2020   vdt911_chr_region_len   = vdt911_japanese_chr_offset+256*vdt911_single_char_len
2121};
2222
23extern gfx_decode vdt911_gfxdecodeinfo[];
23GFXDECODE_EXTERN( vdt911_gfxdecodeinfo );
2424
2525extern unsigned char vdt911_palette[];
2626extern unsigned short vdt911_colortable[];
src/mess/video/x68k.c
r1051r1052
778778   }
779779}
780780
781static gfx_layout x68k_pcg_8 =
781static const gfx_layout x68k_pcg_8 =
782782{
783783   8,8,
784784   256,
r1051r1052
789789   32*8
790790};
791791
792static gfx_layout x68k_pcg_16 =
792static const gfx_layout x68k_pcg_16 =
793793{
794794   16,16,
795795   256,
src/mess/video/pc_mda.c
r1051r1052
4646   8*8                /* every char takes 8 bytes (upper half) */
4747};
4848
49gfx_decode pc_mda_gfxdecodeinfo[] =
50{
51   { REGION_GFX1, 0x0000, &pc_mda_charlayout,      0, 256 },
52    { -1 } /* end of array */
53};
49GFXDECODE_START( pc_mda_gfxdecodeinfo )
50   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pc_mda_charlayout, 0, 256 )
51GFXDECODE_END
5452
5553/* to be done:
5654   only 2 digital color lines to mda/hercules monitor
src/mess/video/pc_mda.h
r1051r1052
1515pc_video_update_proc pc_mda_choosevideomode(int *width, int *height, struct crtc6845 *crtc);
1616
1717WRITE8_HANDLER ( pc_MDA_w );
18 READ8_HANDLER ( pc_MDA_r );
18READ8_HANDLER ( pc_MDA_r );
1919
2020extern unsigned char mda_palette[4][3];
2121extern gfx_layout pc_mda_charlayout;
2222extern gfx_layout pc_mda_gfxlayout_1bpp;
23extern gfx_decode pc_mda_gfxdecodeinfo[];
23GFXDECODE_EXTERN( pc_mda_gfxdecodeinfo );
2424extern unsigned short mda_colortable[256*2+1*2];
2525
2626PALETTE_INIT( pc_mda );
src/mess/video/pc_t1t.c
r1051r1052
6262    0,1,2,3, 4,5,6,7, 8,9,0xa,0xb, 0xc,0xd,0xe,0xf
6363};
6464
65static gfx_layout t1t_gfxlayout_4bpp =
65static const gfx_layout t1t_gfxlayout_4bpp =
6666{
6767   2,1,               /* 8 x 32 graphics */
6868    256,                    /* 256 codes */
r1051r1052
7575   1*8                /* every code takes 1 byte */
7676};
7777
78static gfx_layout t1t_charlayout =
78static const gfx_layout t1t_charlayout =
7979{
8080   8,8,               /* 8 x 8 characters */
8181    128,                    /* 128 characters */
r1051r1052
8989    8*8                     /* every char takes 8 bytes */
9090};
9191
92static gfx_decode t1000hx_gfxdecodeinfo[] =
93{
94   { REGION_CPU1, 0xffa6e, &t1t_charlayout,         0,            128 },   /* single width */
95   { REGION_CPU1, 0xfc0a8, &t1t_charlayout,         0,            128 },   /* single width */
96   { REGION_GFX1,  0x1000, &t1t_gfxlayout_4bpp,      256*2+16*2+2*4,   16 },   /* 160x200 4bpp gfx */
97    { -1 } /* end of array */
98};
92static GFXDECODE_START( t1000hx_gfxdecodeinfo )
93   GFXDECODE_ENTRY( REGION_CPU1, 0xffa6e, t1t_charlayout, 0, 128 )   /* single width */
94   GFXDECODE_ENTRY( REGION_CPU1, 0xfc0a8, t1t_charlayout, 0, 128 )   /* single width */
95   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, t1t_gfxlayout_4bpp, 256*2+16*2+2*4, 16 )   /* 160x200 4bpp gfx */
96GFXDECODE_END
9997
100static gfx_decode t1000sx_gfxdecodeinfo[] =
101{
102   { REGION_CPU1, 0xffa6e, &t1t_charlayout,         0,            128 },   /* single width */
103   { REGION_CPU1, 0xf40a3, &t1t_charlayout,         0,            128 },   /* single width */
104   { REGION_GFX1,  0x1000, &t1t_gfxlayout_4bpp,      256*2+16*2+2*4,   16 },   /* 160x200 4bpp gfx */
105    { -1 } /* end of array */
106};
98static GFXDECODE_START( t1000sx_gfxdecodeinfo )
99   GFXDECODE_ENTRY( REGION_CPU1, 0xffa6e, t1t_charlayout, 0, 128 )   /* single width */
100   GFXDECODE_ENTRY( REGION_CPU1, 0xf40a3, t1t_charlayout, 0, 128 )   /* single width */
101   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, t1t_gfxlayout_4bpp, 256*2+16*2+2*4, 16 )   /* 160x200 4bpp gfx */
102GFXDECODE_END
107103
108104MACHINE_DRIVER_START( pcvideo_t1000hx )
109105   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mess/video/pc_aga.c
r1051r1052
7777};
7878
7979
80gfx_decode europc_gfxdecodeinfo[] =
81{
82   { REGION_GFX1, 0x0000, &europc_cga_charlayout,      0, 256 },   /* single width */
83   { REGION_GFX1, 0x0000, &europc_cga_charlayout,                   0, 256 },   /* single width */
84   { REGION_GFX1, 0x0000, &europc_cga_charlayout,                   0, 256 },   /* single width */
85   { REGION_GFX1, 0x0000, &europc_cga_charlayout,                   0, 256 },   /* single width */
86   { REGION_GFX1, 0x1000, &europc_mda_charlayout,      256*2+16*2+96*4, 256 },   /* single width */
87   { REGION_GFX1, 0x1000, &europc_mda_charlayout,      256*2+16*2+96*4, 256 },   /* single width */
88   { REGION_GFX1, 0x1000, &europc_mda_charlayout,      256*2+16*2+96*4, 256 },   /* single width */
89   { REGION_GFX1, 0x1000, &europc_mda_charlayout,      256*2+16*2+96*4, 256 },   /* single width */
90    { -1 } /* end of array */
91};
80GFXDECODE_START( europc_gfxdecodeinfo )
81   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, europc_cga_charlayout, 0, 256 )   /* single width */
82   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, europc_cga_charlayout, 0, 256 )   /* single width */
83   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, europc_cga_charlayout, 0, 256 )   /* single width */
84   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, europc_cga_charlayout, 0, 256 )   /* single width */
85   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, europc_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
86   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, europc_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
87   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, europc_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
88   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, europc_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
89GFXDECODE_END
9290
93gfx_decode aga_gfxdecodeinfo[] =
94{
91GFXDECODE_START( aga_gfxdecodeinfo )
9592/* The four CGA fonts */
96   { REGION_GFX1, 0x1000, &pc200_cga_charlayout,         0, 256 },   /* single width */
97   { REGION_GFX1, 0x3000, &pc200_cga_charlayout,                     0, 256 },   /* single width */
98   { REGION_GFX1, 0x5000, &pc200_cga_charlayout,                     0, 256 },   /* single width */
99   { REGION_GFX1, 0x7000, &pc200_cga_charlayout,                     0, 256 },   /* single width */
93   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, pc200_cga_charlayout, 0, 256 )   /* single width */
94   GFXDECODE_ENTRY( REGION_GFX1, 0x3000, pc200_cga_charlayout, 0, 256 )   /* single width */
95   GFXDECODE_ENTRY( REGION_GFX1, 0x5000, pc200_cga_charlayout, 0, 256 )   /* single width */
96   GFXDECODE_ENTRY( REGION_GFX1, 0x7000, pc200_cga_charlayout, 0, 256 )   /* single width */
10097/* The four MDA fonts */
101   { REGION_GFX1, 0x0000, &pc200_mda_charlayout,       256*2+16*2+96*4, 256 },   /* single width */
102   { REGION_GFX1, 0x2000, &pc200_mda_charlayout,       256*2+16*2+96*4, 256 },   /* single width */
103   { REGION_GFX1, 0x4000, &pc200_mda_charlayout,       256*2+16*2+96*4, 256 },   /* single width */
104   { REGION_GFX1, 0x6000, &pc200_mda_charlayout,       256*2+16*2+96*4, 256 },   /* single width */
105    { -1 } /* end of array */
106};
98   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pc200_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
99   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, pc200_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
100   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, pc200_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
101   GFXDECODE_ENTRY( REGION_GFX1, 0x6000, pc200_mda_charlayout, 256*2+16*2+96*4, 256 )   /* single width */
102GFXDECODE_END
107103
108104/* Initialise the cga palette */
109105PALETTE_INIT( pc_aga )
src/mess/video/pc_cga.c
r1051r1052
164164   8*8                     /* every char takes 8 bytes */
165165};
166166
167static gfx_decode CGA_gfxdecodeinfo[] =
168{
167static GFXDECODE_START( CGA_gfxdecodeinfo )
169168/* Support up to four CGA fonts */
170   { REGION_GFX1, 0x0000, &CGA_charlayout,              0, 256 },   /* Font 0 */
171   { REGION_GFX1, 0x0800, &CGA_charlayout,              0, 256 },   /* Font 1 */
172   { REGION_GFX1, 0x1000, &CGA_charlayout,              0, 256 },   /* Font 2 */
173   { REGION_GFX1, 0x1800, &CGA_charlayout,              0, 256 },   /* Font 3*/
174    { -1 } /* end of array */
175};
169   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, CGA_charlayout, 0, 256 )   /* Font 0 */
170   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, CGA_charlayout, 0, 256 )   /* Font 1 */
171   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, CGA_charlayout, 0, 256 )   /* Font 2 */
172   GFXDECODE_ENTRY( REGION_GFX1, 0x1800, CGA_charlayout, 0, 256 )   /* Font 3*/
173GFXDECODE_END
176174
177175MACHINE_DRIVER_START( pcvideo_cga )
178176   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mess/video/pc_aga.h
r1051r1052
2222
2323extern gfx_layout europc_cga_charlayout;
2424extern gfx_layout europc_mda_charlayout;
25extern gfx_decode europc_gfxdecodeinfo[];
26extern gfx_decode aga_gfxdecodeinfo[];
25GFXDECODE_EXTERN( europc_gfxdecodeinfo );
26GFXDECODE_EXTERN( aga_gfxdecodeinfo );
2727
2828extern PALETTE_INIT( pc_aga );
2929
src/mess/video/avigo.c
r1051r1052
3434/* colour table filled in from avigo colour table*/
3535static UINT32 stylus_color_table[3] = {0,0,0};
3636
37static gfx_layout pointerlayout =
37static const gfx_layout pointerlayout =
3838{
3939   8, 8,
4040   1,
src/mess/video/ted7360.c
r1051r1052
511511
512512static UINT32 cursorcolortable[2] =
513513{0};
514static gfx_layout cursorlayout =
514static const gfx_layout cursorlayout =
515515{
516516   8, 8,
517517   1,
src/mess/video/saa5050.c
r1051r1052
3232   UINT8   saa5050_prvchr;
3333} saa5050_state;
3434
35static gfx_layout saa5050_charlayout =
35static const gfx_layout saa5050_charlayout =
3636{
3737   6, 10,
3838   256,
r1051r1052
4444   8 * 10
4545};
4646
47static gfx_layout saa5050_hilayout =
47static const gfx_layout saa5050_hilayout =
4848{
4949   6, 10,
5050   256,
r1051r1052
5656   8 * 10
5757};
5858
59static gfx_layout saa5050_lolayout =
59static const gfx_layout saa5050_lolayout =
6060{
6161   6, 10,
6262   256,
r1051r1052
6868   8 * 10
6969};
7070
71static gfx_decode saa5050_gfxdecodeinfo[] =
72{
73   { REGION_GFX1, 0x0000, &saa5050_charlayout, 0, 128},
74   { REGION_GFX1, 0x0000, &saa5050_hilayout, 0, 128},
75   { REGION_GFX1, 0x0000, &saa5050_lolayout, 0, 128},
76   {-1}
77};
71static GFXDECODE_START( saa5050_gfxdecodeinfo )
72   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, saa5050_charlayout, 0, 128 )
73   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, saa5050_hilayout, 0, 128 )
74   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, saa5050_lolayout, 0, 128 )
75GFXDECODE_END
7876
7977static unsigned char saa5050_palette[8 * 3] =
8078{
src/mess/video/733_asr.c
r1051r1052
9595   asrfontdata_size = 96/*128*/*8
9696};
9797
98static gfx_layout fontlayout =
98static const gfx_layout fontlayout =
9999{
100100   6, 8,         /* 6*8 characters */
101101   /*96*/128,            /* 96 characters */
r1051r1052
106106   8*8 /* every char takes 8 consecutive bytes */
107107};
108108
109gfx_decode asr733_gfxdecodeinfo[] =
110{
111   { asr733_chr_region, 0, &fontlayout, 0, 1 },
112   { -1 }   /* end of array */
113};
109GFXDECODE_START( asr733_gfxdecodeinfo )
110   GFXDECODE_ENTRY( asr733_chr_region, 0, fontlayout, 0, 1 )
111GFXDECODE_END
114112
115113PALETTE_INIT( asr733 )
116114{
src/mess/video/733_asr.h
r1051r1052
1212   asr733_chr_region_len   = 128*asr733_single_char_len
1313};
1414
15extern gfx_decode asr733_gfxdecodeinfo[];
15GFXDECODE_EXTERN( asr733_gfxdecodeinfo );
1616
1717extern unsigned char asr733_palette[];
1818extern unsigned short asr733_colortable[];
src/mess/machine/genesis.c
r1051r1052
7171
7272static genvdp genesis_vdp;
7373
74static gfx_layout charlayout =
74static const gfx_layout charlayout =
7575{
7676   8,8,
7777   0x800,
src/mess/drivers/wswan.c
r1051r1052
9696   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y2 - Up") PORT_CODE(KEYCODE_W)
9797INPUT_PORTS_END
9898
99static gfx_decode gfxdecodeinfo[] =
100{ { -1 } /* end of array */ };
99static GFXDECODE_START( gfxdecodeinfo )
100GFXDECODE_END
101101
102102/* WonderSwan can display 16 shades of grey */
103103static PALETTE_INIT( wswan )
src/mess/drivers/comquest.c
r1051r1052
167167
168168INPUT_PORTS_END
169169
170static gfx_layout comquest_charlayout =
170static const gfx_layout comquest_charlayout =
171171{
172172        8,8,
173173        256*8,                                    /* 256 characters */
r1051r1052
198198        8*8
199199};
200200
201static gfx_decode comquest_gfxdecodeinfo[] = {
202   { REGION_GFX1, 0x0000, &comquest_charlayout,                     0, 2 },
203    { -1 } /* end of array */
204};
201static GFXDECODE_START( comquest_gfxdecodeinfo )
202   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, comquest_charlayout, 0, 2 )
203GFXDECODE_END
205204
206205static unsigned char comquest_palette[] =
207206{
src/mess/drivers/zx.c
r1051r1052
304304
305305/* Graphics Layouts */
306306
307static gfx_layout zx_char_layout =
307static const gfx_layout zx_char_layout =
308308{
309309   8, 8,                        /* 8x8 pixels */
310310   64,                           /* 64 codes */
r1051r1052
319319
320320/* Graphics Decode Information */
321321
322static gfx_decode zx80_gfxdecodeinfo[] =
323{
324   { REGION_CPU1, 0x0e00, &zx_char_layout,  0, 2 },
325   { -1 }
326};
322static GFXDECODE_START( zx80_gfxdecodeinfo )
323   GFXDECODE_ENTRY( REGION_CPU1, 0x0e00, zx_char_layout, 0, 2 )
324GFXDECODE_END
327325
328static gfx_decode zx81_gfxdecodeinfo[] =
329{
330   { REGION_CPU1, 0x1e00, &zx_char_layout,  0, 2 },
331   { -1 }
332};
326static GFXDECODE_START( zx81_gfxdecodeinfo )
327   GFXDECODE_ENTRY( REGION_CPU1, 0x1e00, zx_char_layout, 0, 2 )
328GFXDECODE_END
333329
334static gfx_decode pc8300_gfxdecodeinfo[] =
335{
336   { REGION_GFX1, 0x0000, &zx_char_layout,  0, 2 },
337   { -1 }
338};
330static GFXDECODE_START( pc8300_gfxdecodeinfo )
331   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, zx_char_layout, 0, 2 )
332GFXDECODE_END
339333
340static gfx_decode pow3000_gfxdecodeinfo[] =
341{
342   { REGION_GFX1, 0x0000, &zx_char_layout,  0, 2 },
343   { -1 }
344};
334static GFXDECODE_START( pow3000_gfxdecodeinfo )
335   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, zx_char_layout, 0, 2 )
336GFXDECODE_END
345337
346338/* Palette Initialization */
347339
src/mess/drivers/pdp1.c
r1051r1052
272272INPUT_PORTS_END
273273
274274
275static gfx_layout fontlayout =
275static const gfx_layout fontlayout =
276276{
277277   6, 8,         /* 6*8 characters */
278278   pdp1_charnum,   /* 96+4 characters */
r1051r1052
283283   8*8 /* every char takes 8 consecutive bytes */
284284};
285285
286static gfx_decode gfxdecodeinfo[] =
287{
288   { REGION_GFX1, 0, &fontlayout, 0, 3 },
289   { -1 }   /* end of array */
290};
286static GFXDECODE_START( gfxdecodeinfo )
287   GFXDECODE_ENTRY( REGION_GFX1, 0, fontlayout, 0, 3 )
288GFXDECODE_END
291289
292290
293291/*
src/mess/drivers/apple2gs.c
r1051r1052
5454#include "devices/appldriv.h"
5555#include "sound/es5503.h"
5656
57static gfx_layout apple2gs_text_layout =
57static const gfx_layout apple2gs_text_layout =
5858{
5959   14,8,      /* 14*8 characters */
6060   512,      /* 256 characters */
r1051r1052
6565   8*8         /* every char takes 8 bytes */
6666};
6767
68static gfx_layout apple2gs_dbltext_layout =
68static const gfx_layout apple2gs_dbltext_layout =
6969{
7070   7,8,      /* 7*8 characters */
7171   512,      /* 256 characters */
r1051r1052
7676   8*8         /* every char takes 8 bytes */
7777};
7878
79static gfx_decode apple2gs_gfxdecodeinfo[] =
80{
81   { REGION_GFX1, 0x0000, &apple2gs_text_layout, 0, 2 },
82   { REGION_GFX1, 0x0000, &apple2gs_dbltext_layout, 0, 2 },
83   { -1 } /* end of array */
84};
79static GFXDECODE_START( apple2gs_gfxdecodeinfo )
80   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple2gs_text_layout, 0, 2 )
81   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple2gs_dbltext_layout, 0, 2 )
82GFXDECODE_END
8583
8684static const unsigned char apple2gs_palette[] =
8785{
src/mess/drivers/hp48.c
r1051r1052
145145INPUT_PORTS_END
146146
147147
148static gfx_layout hp48_charlayout =
148static const gfx_layout hp48_charlayout =
149149{
150        2,16,
151        256,                                    /* 256 characters */
152        1,                      /* 1 bits per pixel */
153        { 0 },                  /* no bitplanes; 1 bit per pixel */
154        /* x offsets */
155        { 0,0 },
156        /* y offsets */
157        {
158         7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0
159        },
160        1*8
150   2,16,
151   256,                                    /* 256 characters */
152   1,                      /* 1 bits per pixel */
153   { 0 },                  /* no bitplanes; 1 bit per pixel */
154   /* x offsets */
155   { 0,0 },
156   /* y offsets */
157   {
158      7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0
159   },
160   1*8
161161};
162162
163static gfx_decode hp48_gfxdecodeinfo[] = {
164   { REGION_GFX1, 0x0000, &hp48_charlayout,                     0, 8 },
165    { -1 } /* end of array */
166};
163static GFXDECODE_START( hp48_gfxdecodeinfo )
164   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, hp48_charlayout, 0, 8 )
165GFXDECODE_END
167166
168167static SATURN_CONFIG config={
169168   hp48_out, hp48_in,
src/mess/drivers/cbmb.c
r1051r1052
684684   0, 1
685685};
686686
687static gfx_layout cbm600_charlayout =
687static const gfx_layout cbm600_charlayout =
688688{
689689   8,16,
690690   256,                                    /* 256 characters */
r1051r1052
699699   8*16
700700};
701701
702static gfx_layout cbm700_charlayout =
702static const gfx_layout cbm700_charlayout =
703703{
704704   9,16,
705705   256,                                    /* 256 characters */
r1051r1052
714714   8*16
715715};
716716
717static gfx_decode cbm600_gfxdecodeinfo[] =
718{
719   { REGION_GFX1, 0x0000, &cbm600_charlayout, 0, 1 },
720   { REGION_GFX1, 0x1000, &cbm600_charlayout, 0, 1 },
721    { -1 } /* end of array */
722};
717static GFXDECODE_START( cbm600_gfxdecodeinfo )
718   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cbm600_charlayout, 0, 1 )
719   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, cbm600_charlayout, 0, 1 )
720GFXDECODE_END
723721
724static gfx_decode cbm700_gfxdecodeinfo[] =
725{
726   { REGION_GFX1, 0x0000, &cbm700_charlayout, 0, 1 },
727   { REGION_GFX1, 0x1000, &cbm700_charlayout, 0, 1 },
728    { -1 } /* end of array */
729};
722static GFXDECODE_START( cbm700_gfxdecodeinfo )
723   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cbm700_charlayout, 0, 1 )
724   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, cbm700_charlayout, 0, 1 )
725GFXDECODE_END
730726
731727static PALETTE_INIT( cbm700 )
732728{
src/mess/drivers/mbee.c
r1051r1052
188188    8*16                    /* every char takes 16 bytes */
189189};
190190
191static gfx_decode mbee_gfxdecodeinfo[] =
192{
193    { REGION_CPU1, 0xf000, &mbee_charlayout, 0, 256},
194   { -1 }   /* end of array */
195};
191static GFXDECODE_START( mbee_gfxdecodeinfo )
192   GFXDECODE_ENTRY( REGION_CPU1, 0xf000, mbee_charlayout, 0, 256 )
193GFXDECODE_END
196194
197195static const UINT8 palette[] =
198196{
src/mess/drivers/pocketc.c
r1051r1052
448448   PORT_DIPSETTING( 7, "7/High" )
449449INPUT_PORTS_END
450450
451static gfx_layout pc1401_charlayout =
451static const gfx_layout pc1401_charlayout =
452452{
453453   2,21,
454454   128,                                    /* 256 characters */
r1051r1052
469469   1*8
470470};
471471
472static gfx_layout pc1251_charlayout =
472static const gfx_layout pc1251_charlayout =
473473{
474474   3,21,
475475   128,                                    /* 256 characters */
r1051r1052
490490   1*8
491491};
492492
493static gfx_decode pc1401_gfxdecodeinfo[] = {
494   { REGION_GFX1, 0x0000, &pc1401_charlayout,                     0, 8 },
495    { -1 } /* end of array */
496};
493static GFXDECODE_START( pc1401_gfxdecodeinfo )
494   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pc1401_charlayout, 0, 8 )
495GFXDECODE_END
497496
498static gfx_decode pc1251_gfxdecodeinfo[] = {
499   { REGION_GFX1, 0x0000, &pc1251_charlayout,                     0, 8 },
500    { -1 } /* end of array */
501};
497static GFXDECODE_START( pc1251_gfxdecodeinfo )
498   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pc1251_charlayout, 0, 8 )
499GFXDECODE_END
502500
503501static SC61860_CONFIG config={
504502    pc1401_reset, pc1401_brk, NULL,
src/mess/drivers/gb.c
r1051r1052
464464   AM_RANGE(0xffff, 0xffff) AM_READWRITE( gb_ie_r, gb_ie_w )         /* interrupt enable register */
465465ADDRESS_MAP_END
466466
467static gfx_decode gb_gfxdecodeinfo[] =
468{
469   { -1 } /* end of array */
470};
467static GFXDECODE_START( gb_gfxdecodeinfo )
468GFXDECODE_END
471469
472470INPUT_PORTS_START( gameboy )
473471   PORT_START   /* IN0 */
src/mess/drivers/kim1.c
r1051r1052
127127   PORT_BIT (0x01, 0x00, IPT_UNUSED )
128128INPUT_PORTS_END
129129
130static gfx_layout led_layout =
130static const gfx_layout led_layout =
131131{
132132   18, 24,    /* 16 x 24 LED 7segment displays */
133133   128,      /* 128 codes */
r1051r1052
147147   24 * 24,   /* every LED code takes 32 times 18 (aligned 24) bit words */
148148};
149149
150static gfx_layout key_layout =
150static const gfx_layout key_layout =
151151{
152152   24, 18,    /* 24 * 18 keyboard icons */
153153   24,       /* 24  codes */
r1051r1052
162162   18 * 24 * 2,   /* every icon takes 18 rows of 24 * 2 bits */
163163};
164164
165static gfx_decode gfxdecodeinfo[] =
166{
167   { REGION_GFX1, 0, &led_layout, 0, 16 },
168   { REGION_GFX2, 0, &key_layout, 16*2, 2 },
169   { -1 } /* end of array */
170};
165static GFXDECODE_START( gfxdecodeinfo )
166   GFXDECODE_ENTRY( REGION_GFX1, 0, led_layout, 0, 16 )
167   GFXDECODE_ENTRY( REGION_GFX2, 0, key_layout, 16*2, 2 )
168GFXDECODE_END
171169
172170
173171static MACHINE_DRIVER_START( kim1 )
src/mess/drivers/gamecom.c
r1051r1052
3333   AM_RANGE( 0xE000, 0xFFFF )  AM_RAM                                                 /* Extended I/O, Extended RAM */
3434ADDRESS_MAP_END
3535
36static gfx_decode gamecom_gfxdecodeinfo[] =
37{
38   { -1 } /* end of array */
39};
36static GFXDECODE_START( gamecom_gfxdecodeinfo )
37GFXDECODE_END
4038
4139SM8500_CONFIG gamecom_cpu_config = {
4240   gamecom_handle_dma,
src/mess/drivers/mz700.c
r1051r1052
237237   PORT_BIT( 0x10, 0x00, IPT_JOYSTICK_RIGHT) PORT_8WAY
238238INPUT_PORTS_END
239239
240static gfx_layout char_layout =
240static const gfx_layout char_layout =
241241{
242242   8, 8,      /* 8 x 8 graphics */
243243   512,      /* 512 codes */
r1051r1052
248248   8 * 8      /* code takes 8 times 8 bits */
249249};
250250
251static gfx_decode gfxdecodeinfo[] =
252{
253   { REGION_GFX1, 0, &char_layout, 0, 256 },
254   {-1}
255};    /* end of array */
251static GFXDECODE_START( gfxdecodeinfo )
252   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout, 0, 256 )
253GFXDECODE_END
256254
257255
258256
src/mess/drivers/arcadia.c
r1051r1052
168168#endif
169169INPUT_PORTS_END
170170
171static gfx_layout arcadia_charlayout =
171static const gfx_layout arcadia_charlayout =
172172{
173        8,1,
174        256,                                    /* 256 characters */
175        1,                      /* 1 bits per pixel */
176        { 0 },                  /* no bitplanes; 1 bit per pixel */
177        /* x offsets */
178        {
179       0,
180       1,
181       2,
182       3,
183       4,
184       5,
185       6,
186       7,
187        },
188        /* y offsets */
189        { 0 },
190        1*8
173   8,1,
174   256,                                    /* 256 characters */
175   1,                      /* 1 bits per pixel */
176   { 0 },                  /* no bitplanes; 1 bit per pixel */
177   /* x offsets */
178   {
179   0,
180   1,
181   2,
182   3,
183   4,
184   5,
185   6,
186   7,
187   },
188   /* y offsets */
189   { 0 },
190   1*8
191191};
192192
193static gfx_decode arcadia_gfxdecodeinfo[] = {
194    { REGION_GFX1, 0x0000, &arcadia_charlayout,                     0, 2 },
195    { -1 } /* end of array */
196};
193static GFXDECODE_START( arcadia_gfxdecodeinfo )
194   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, arcadia_charlayout, 0, 2 )
195GFXDECODE_END
197196
198197static unsigned char arcadia_palette[] =
199198{
r1051r1052
214213static PALETTE_INIT( arcadia )
215214{
216215   palette_set_colors_rgb(machine, 0, arcadia_palette, sizeof (arcadia_palette)/3);
217    memcpy(colortable, arcadia_colortable,sizeof(arcadia_colortable));
216   memcpy(colortable, arcadia_colortable,sizeof(arcadia_colortable));
218217}
219218
220219static MACHINE_DRIVER_START( arcadia )
src/mess/drivers/aquarius.c
r1051r1052
5454
5555/* graphics output */
5656
57static gfx_layout aquarius_charlayout =
57static const gfx_layout aquarius_charlayout =
5858{
5959   8, 8,
6060   256,
r1051r1052
6666   8 * 8
6767};
6868
69static gfx_decode aquarius_gfxdecodeinfo[] =
70{
71   { REGION_GFX1, 0x0000, &aquarius_charlayout, 0, 256},
72   { -1 } /* end of array */
73};
69static GFXDECODE_START( aquarius_gfxdecodeinfo )
70   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, aquarius_charlayout, 0, 256 )
71GFXDECODE_END
7472
7573static unsigned char aquarius_palette[] =
7674{
src/mess/drivers/cgenie.c
r1051r1052
254254   8*8          /* every char takes 8 bytes */
255255};
256256
257static gfx_layout cgenie_gfxlayout =
257static const gfx_layout cgenie_gfxlayout =
258258{
259259   8,8,         /* 4*8 characters */
260260   256,         /* 256 graphics patterns */
r1051r1052
265265   8*8          /* every char takes 8 bytes */
266266};
267267
268static gfx_decode cgenie_gfxdecodeinfo[] =
269{
270   { REGION_GFX1, 0, &cgenie_charlayout,     0, 3*16},
271   { REGION_GFX2, 0, &cgenie_gfxlayout, 3*16*2, 3*4},
272   { -1 } /* end of array */
273};
268static GFXDECODE_START( cgenie_gfxdecodeinfo )
269   GFXDECODE_ENTRY( REGION_GFX1, 0, cgenie_charlayout, 0, 3*16 )
270   GFXDECODE_ENTRY( REGION_GFX2, 0, cgenie_gfxlayout, 3*16*2, 3*4 )
271GFXDECODE_END
274272
275273static unsigned char cgenie_palette[] = {
276274    0*4,  0*4,  0*4,  /* background   */
src/mess/drivers/abc80.c
r1051r1052
353353
354354/* Graphics Layout */
355355
356static gfx_layout charlayout_abc80 =
356static const gfx_layout charlayout_abc80 =
357357{
358358   6, 10,
359359   128,
r1051r1052
366366
367367/* Graphics Decode Information */
368368
369static gfx_decode gfxdecodeinfo_abc80[] =
370{
371   { REGION_GFX1, 0,     &charlayout_abc80, 0, 2 },   // normal characters
372   { REGION_GFX1, 0x500, &charlayout_abc80, 0, 2 },   // graphics characters
373   { -1 }
374};
369static GFXDECODE_START( gfxdecodeinfo_abc80 )
370   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_abc80, 0, 2 )   // normal characters
371   GFXDECODE_ENTRY( REGION_GFX1, 0x500, charlayout_abc80, 0, 2 )   // graphics characters
372GFXDECODE_END
375373
376374/* Sound Interface */
377375
src/mess/drivers/apexc.c
r1051r1052
762762   memcpy(dst, fontdata6x8, apexcfontdata_size);
763763}
764764
765static gfx_layout fontlayout =
765static const gfx_layout fontlayout =
766766{
767767   6, 8,         /* 6*8 characters */
768768   apexc_charnum,   /* 96+4 characters */
r1051r1052
773773   8*8 /* every char takes 8 consecutive bytes */
774774};
775775
776static gfx_decode gfxdecodeinfo[] =
777{
778   { REGION_GFX1, 0, &fontlayout, 0, 1 },
779   { -1 }   /* end of array */
780};
776static GFXDECODE_START( gfxdecodeinfo )
777   GFXDECODE_ENTRY( REGION_GFX1, 0, fontlayout, 0, 1 )
778GFXDECODE_END
781779
782780
783781static ADDRESS_MAP_START(apexc_mem_map, ADDRESS_SPACE_PROGRAM, 32)
src/mess/drivers/spectrum.c
r1051r1052
17641764
17651765/****************************************************************************************************/
17661766
1767static gfx_layout spectrum_charlayout = {
1767static const gfx_layout spectrum_charlayout =
1768{
17681769   8,8,
17691770   256,
17701771   1,                  /* 1 bits per pixel */
r1051r1052
17771778   8            /* every char takes 1 consecutive byte */
17781779};
17791780
1780static gfx_decode spectrum_gfxdecodeinfo[] = {
1781   { 0, 0x0, &spectrum_charlayout, 0, 0x80 },
1782   { 0, 0x0, &spectrum_charlayout, 0, 0x80 },
1783   { 0, 0x0, &spectrum_charlayout, 0, 0x80 },
1784   { -1 } /* end of array */
1785};
1781static GFXDECODE_START( spectrum_gfxdecodeinfo )
1782   GFXDECODE_ENTRY( 0, 0x0, spectrum_charlayout, 0, 0x80 )
1783   GFXDECODE_ENTRY( 0, 0x0, spectrum_charlayout, 0, 0x80 )
1784   GFXDECODE_ENTRY( 0, 0x0, spectrum_charlayout, 0, 0x80 )
1785GFXDECODE_END
17861786
17871787INPUT_PORTS_START( spectrum )
17881788   PORT_START /* [0] 0xFEFE */
src/mess/drivers/kaypro.c
r1051r1052
172172#define FW  ((KAYPRO_FONT_W+7)/8)*8
173173#define FH  KAYPRO_FONT_H
174174
175static gfx_layout charlayout =
175static const gfx_layout charlayout =
176176{
177177   FW, FH,         /* 8*16 characters */
178178   4 * 256,        /* 4 * 256 characters */
r1051r1052
191191   FW * FH         /* every char takes 16 bytes */
192192};
193193
194static gfx_decode gfxdecodeinfo[] =
195{
196   { REGION_GFX1, 0, &charlayout, 0, 4},
197   {-1}
198};   /* end of array */
194static GFXDECODE_START( gfxdecodeinfo )
195   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 4 )
196GFXDECODE_END
199197
200198static unsigned char kaypro_palette[] =
201199{
src/mess/drivers/tx0.c
r1051r1052
205205INPUT_PORTS_END
206206
207207
208static gfx_layout fontlayout =
208static const gfx_layout fontlayout =
209209{
210210   6, 8,         /* 6*8 characters */
211211   tx0_charnum,   /* 96+xx characters */
r1051r1052
216216   8*8 /* every char takes 8 consecutive bytes */
217217};
218218
219static gfx_decode gfxdecodeinfo[] =
220{
221   { REGION_GFX1, 0, &fontlayout, 0, 3 },
222   { -1 }   /* end of array */
223};
219static GFXDECODE_START( gfxdecodeinfo )
220   GFXDECODE_ENTRY( REGION_GFX1, 0, fontlayout, 0, 3 )
221GFXDECODE_END
224222
225223
226224/*
src/mess/drivers/c128.c
r1051r1052
939939   }
940940}
941941
942static gfx_layout c128_charlayout =
942static const gfx_layout c128_charlayout =
943943{
944944   8,16,
945945   512,                                    /* 256 characters */
r1051r1052
954954   8*16
955955};
956956
957static gfx_layout c128graphic_charlayout =
957static const gfx_layout c128graphic_charlayout =
958958{
959959   8,1,
960960   256,                                    /* 256 characters */
r1051r1052
967967   8
968968};
969969
970static gfx_decode c128_gfxdecodeinfo[] =
971{
972   { REGION_GFX1, 0x0000, &c128_charlayout, 0, 0x100 },
973   { REGION_GFX2, 0x0000, &c128graphic_charlayout, 0, 0x100 },
974    { -1 } /* end of array */
975};
970static GFXDECODE_START( c128_gfxdecodeinfo )
971   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, c128_charlayout, 0, 0x100 )
972   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, c128graphic_charlayout, 0, 0x100 )
973GFXDECODE_END
976974
977975#if 0
978976/* usa first 318018-02 318019-02 318020-03 rev 0*/
src/mess/drivers/pc8801.c
r1051r1052
1515#include "devices/basicdsk.h"
1616#include "sound/2203intf.h"
1717
18static gfx_layout char_layout_40L_h =
18static const gfx_layout char_layout_40L_h =
1919{
2020   8, 4,                  /* 16 x 4 graphics */
2121   1024,                  /* 256 codes */
r1051r1052
2626   8 * 2                  /* code takes 8 times 8 bits */
2727};
2828
29static gfx_layout char_layout_40R_h =
29static const gfx_layout char_layout_40R_h =
3030{
3131   8, 4,                  /* 16 x 4 graphics */
3232   1024,                  /* 256 codes */
r1051r1052
3737   8 * 2                  /* code takes 8 times 8 bits */
3838};
3939
40static gfx_layout char_layout_80_h =
40static const gfx_layout char_layout_80_h =
4141{
4242   8, 4,           /* 16 x 4 graphics */
4343   1024,            /* 256 codes */
r1051r1052
4848   8 * 2           /* code takes 8 times 8 bits */
4949};
5050
51static gfx_layout char_layout_40L_l =
51static const gfx_layout char_layout_40L_l =
5252{
5353   8, 2,           /* 16 x 4 graphics */
5454   1024,            /* 256 codes */
r1051r1052
5959   8 * 2           /* code takes 8 times 8 bits */
6060};
6161
62static gfx_layout char_layout_40R_l =
62static const gfx_layout char_layout_40R_l =
6363{
6464   8, 2,           /* 16 x 4 graphics */
6565   1024,            /* 256 codes */
r1051r1052
7070   8 * 2           /* code takes 8 times 8 bits */
7171};
7272
73static gfx_layout char_layout_80_l =
73static const gfx_layout char_layout_80_l =
7474{
7575   8, 2,           /* 16 x 4 graphics */
7676   1024,            /* 256 codes */
r1051r1052
8181   8 * 2           /* code takes 8 times 8 bits */
8282};
8383
84static gfx_decode gfxdecodeinfo[] =
85{
86   { REGION_GFX1, 0, &char_layout_80_l, 0, 16 },
87   { REGION_GFX1, 0, &char_layout_40L_l, 0, 16 },
88   { REGION_GFX1, 0, &char_layout_40R_l, 0, 16 },
89   { REGION_GFX1, 0, &char_layout_80_h, 0, 16 },
90   { REGION_GFX1, 0, &char_layout_40L_h, 0, 16 },
91   { REGION_GFX1, 0, &char_layout_40R_h, 0, 16 },
92   {-1}
93};       /* end of array */
84static GFXDECODE_START( gfxdecodeinfo )
85   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout_80_l, 0, 16 )
86   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout_40L_l, 0, 16 )
87   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout_40R_l, 0, 16 )
88   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout_80_h, 0, 16 )
89   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout_40L_h, 0, 16 )
90   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout_40R_h, 0, 16 )
91GFXDECODE_END
9492
9593/* Macro for DIPSW-1 */
9694#define DIPSW_1_1 \
src/mess/drivers/p2000t.c
r1051r1052
6868
6969/* graphics output */
7070
71static gfx_layout p2000m_charlayout =
71static const gfx_layout p2000m_charlayout =
7272{
7373   6, 10,
7474   256,
r1051r1052
8080   8 * 10
8181};
8282
83static gfx_decode p2000m_gfxdecodeinfo[] =
84{
85   { REGION_GFX1, 0x0000, &p2000m_charlayout, 0, 128 },
86   { -1 }
87};
83static GFXDECODE_START( p2000m_gfxdecodeinfo )
84   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, p2000m_charlayout, 0, 128 )
85GFXDECODE_END
8886
8987static unsigned char p2000m_palette[2 * 3] =
9088{
src/mess/drivers/pet.c
r1051r1052
505505   { 1, 0 }
506506};
507507
508static gfx_layout pet_charlayout =
508static const gfx_layout pet_charlayout =
509509{
510510   8,8,
511511   256,                                    /* 256 characters */
r1051r1052
519519   8*8
520520};
521521
522static gfx_layout pet80_charlayout =
522static const gfx_layout pet80_charlayout =
523523{
524524   8,16,
525525   256,                                    /* 256 characters */
r1051r1052
535535   8*16
536536};
537537
538static gfx_decode pet_gfxdecodeinfo[] =
539{
540   { REGION_GFX1, 0x0000, &pet_charlayout,                     0, 1 },
541   { REGION_GFX1, 0x0800, &pet_charlayout,                     0, 1 },
542    { -1 } /* end of array */
543};
538static GFXDECODE_START( pet_gfxdecodeinfo )
539   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pet_charlayout, 0, 1 )
540   GFXDECODE_ENTRY( REGION_GFX1, 0x0800, pet_charlayout, 0, 1 )
541GFXDECODE_END
544542
545static gfx_decode pet80_gfxdecodeinfo[] =
546{
547   { REGION_GFX1, 0x0000, &pet80_charlayout,                     0, 1 },
548   { REGION_GFX1, 0x1000, &pet80_charlayout,                     0, 1 },
549    { -1 } /* end of array */
550};
543static GFXDECODE_START( pet80_gfxdecodeinfo )
544   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pet80_charlayout, 0, 1 )
545   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, pet80_charlayout, 0, 1 )
546GFXDECODE_END
551547
552static gfx_decode superpet_gfxdecodeinfo[] =
553{
554   { REGION_GFX1, 0x0000, &pet80_charlayout,                     0, 1 },
555   { REGION_GFX1, 0x1000, &pet80_charlayout,                     0, 1 },
556   { REGION_GFX1, 0x2000, &pet80_charlayout,                     0, 1 },
557   { REGION_GFX1, 0x3000, &pet80_charlayout,                     0, 1 },
558    { -1 } /* end of array */
559};
548static GFXDECODE_START( superpet_gfxdecodeinfo )
549   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pet80_charlayout, 0, 1 )
550   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, pet80_charlayout, 0, 1 )
551   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, pet80_charlayout, 0, 1 )
552   GFXDECODE_ENTRY( REGION_GFX1, 0x3000, pet80_charlayout, 0, 1 )
553GFXDECODE_END
560554
561555static PALETTE_INIT( pet )
562556{
src/mess/drivers/osi.c
r1051r1052
88VIDEO_START( sb2m600 );
99VIDEO_START( uk101 );
1010VIDEO_UPDATE( sb2m600 );
11extern discrete_sound_block sb2m600_discrete_interface[];
11DISCRETE_SOUND_EXTERN( sb2m600_discrete_interface );
1212READ8_HANDLER( osi_keyboard_r );
1313WRITE8_HANDLER ( sb2m600b_keyboard_w );
1414WRITE8_HANDLER ( uk101_keyboard_w );
r1051r1052
142142
143143/* Graphics Layouts */
144144
145static gfx_layout sb2m600_charlayout =
145static const gfx_layout sb2m600_charlayout =
146146{
147147   8, 8,
148148   256,
r1051r1052
153153   8 * 8
154154};
155155
156static gfx_layout uk101_charlayout =
156static const gfx_layout uk101_charlayout =
157157{
158158   8, 16,
159159   256,
r1051r1052
167167
168168/* Graphics Decode Information */
169169
170static gfx_decode sb2m600_gfxdecodeinfo[] =
171{
172   { REGION_GFX1, 0x0000, &sb2m600_charlayout, 0, 1 },
173   { -1 }
174};
170static GFXDECODE_START( sb2m600_gfxdecodeinfo )
171   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sb2m600_charlayout, 0, 1 )
172GFXDECODE_END
175173
176static gfx_decode uk101_gfxdecodeinfo[] =
177{
178   { REGION_GFX1, 0x0000, &uk101_charlayout, 0, 1 },
179   { -1 }
180};
174static GFXDECODE_START( uk101_gfxdecodeinfo )
175   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, uk101_charlayout, 0, 1 )
176GFXDECODE_END
181177
182178/* Machine Drivers */
183179
r1051r1052
205201   // sound hardware
206202   MDRV_SPEAKER_STANDARD_MONO("mono")
207203   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
208   MDRV_SOUND_CONFIG(sb2m600_discrete_interface)
204   MDRV_SOUND_CONFIG_DISCRETE(sb2m600_discrete_interface)
209205   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
210206MACHINE_DRIVER_END
211207
src/mess/drivers/mekd2.c
r1051r1052
111111   PORT_START         /* IN0 keys row 0 */
112112INPUT_PORTS_END
113113
114static gfx_layout led_layout =
114static const gfx_layout led_layout =
115115{
116116   18, 24,    /* 16 x 24 LED 7segment displays */
117117   128,      /* 128 codes */
r1051r1052
131131   24 * 24,   /* every LED code takes 32 times 18 (aligned 24) bit words */
132132};
133133
134static gfx_layout key_layout =
134static const gfx_layout key_layout =
135135{
136136   24, 18,    /* 24 * 18 keyboard icons */
137137   24,       /* 24  codes */
r1051r1052
146146   18 * 24 * 2,   /* every icon takes 18 rows of 24 * 2 bits */
147147};
148148
149static gfx_decode gfxdecodeinfo[] =
150{
151   { 1, 0, &led_layout, 0, 16 },
152   { 2, 0, &key_layout, 16*2, 2 },
153   { -1 } /* end of array */
154};
149static GFXDECODE_START( gfxdecodeinfo )
150   GFXDECODE_ENTRY( 1, 0, led_layout, 0, 16 )
151   GFXDECODE_ENTRY( 2, 0, key_layout, 16*2, 2 )
152GFXDECODE_END
155153
156154
157155
src/mess/drivers/snes.c
r1051r1052
159159static struct CustomSound_interface snes_sound_interface =
160160{ snes_sh_start, 0, 0 };
161161
162static gfx_decode gfxdecodeinfo[] =
163{
164   { -1 } /* end of array */
165};
162static GFXDECODE_START( gfxdecodeinfo )
163GFXDECODE_END
166164
167165static PALETTE_INIT( snes )
168166{
src/mess/drivers/saturn.c
r1051r1052
22262226
22272227
22282228
2229static const gfx_decode gfxdecodeinfo[] =
2230{
2231   { REGION_GFX1, 0, &tiles8x8x4_layout,   0x00, (0x80*(2+1))  },
2232   { REGION_GFX1, 0, &tiles16x16x4_layout, 0x00, (0x80*(2+1))  },
2233   { REGION_GFX1, 0, &tiles8x8x8_layout,   0x00, (0x08*(2+1))  },
2234   { REGION_GFX1, 0, &tiles16x16x8_layout, 0x00, (0x08*(2+1))  },
2229static GFXDECODE_START( gfxdecodeinfo )
2230   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8x4_layout, 0x00, (0x80*(2+1)) )
2231   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16x4_layout, 0x00, (0x80*(2+1)) )
2232   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles8x8x8_layout, 0x00, (0x08*(2+1)) )
2233   GFXDECODE_ENTRY( REGION_GFX1, 0, tiles16x16x8_layout, 0x00, (0x08*(2+1)) )
22352234
22362235   /* vdp1 .. pointless for drawing but can help us debug */
2237   { REGION_GFX2, 0, &tiles8x8x4_layout,   0x00, 0x100  },
2238   { REGION_GFX2, 0, &tiles16x16x4_layout, 0x00, 0x100  },
2239   { REGION_GFX2, 0, &tiles8x8x8_layout,   0x00, 0x20  },
2240   { REGION_GFX2, 0, &tiles16x16x8_layout, 0x00, 0x20  },
2236   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8x4_layout, 0x00, 0x100 )
2237   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16x4_layout, 0x00, 0x100 )
2238   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles8x8x8_layout, 0x00, 0x20 )
2239   GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16x8_layout, 0x00, 0x20 )
2240GFXDECODE_END
22412241
2242   { -1 } /* end of array */
2243};
2244
22452242struct sh2_config sh2_conf_master = { 0 };
22462243struct sh2_config sh2_conf_slave  = { 1 };
22472244
src/mess/drivers/apple1.c
r1051r1052
125125   8 * 8            /* 8 8-bit pixel rows per character */
126126};
127127
128static const gfx_decode apple1_gfxdecodeinfo[] =
129{
130   { REGION_GFX1, 0x0000, &apple1_charlayout, 0, 1},
131   { -1 }
132};
128static GFXDECODE_START( apple1_gfxdecodeinfo )
129   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple1_charlayout, 0, 1 )
130GFXDECODE_END
133131
134132/* Monochrome monitors were not easy to get when the Apple I was
135133   introduced, so most systems used a television display with an RF
src/mess/drivers/abc80x.c
r1051r1052
500500
501501/* Graphics Layouts */
502502
503static gfx_layout charlayout_abc800m =
503static const gfx_layout charlayout_abc800m =
504504{
505505   6, 10,
506506   128,
r1051r1052
511511   16*8
512512};
513513
514static gfx_layout charlayout_abc802_40 =
514static const gfx_layout charlayout_abc802_40 =
515515{
516516   12, 10,
517517   256,
r1051r1052
522522   16*8
523523};
524524
525static gfx_layout charlayout_abc802_80 =
525static const gfx_layout charlayout_abc802_80 =
526526{
527527   6, 10,
528528   256,
r1051r1052
535535
536536/* Graphics Decode Info */
537537
538static gfx_decode gfxdecodeinfo_abc800m[] =
539{
540   { REGION_GFX1, 0, &charlayout_abc800m, 0, 2 },
541   { -1 }
542};
538static GFXDECODE_START( gfxdecodeinfo_abc800m )
539   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_abc800m, 0, 2 )
540GFXDECODE_END
543541
544static gfx_decode gfxdecodeinfo_abc802[] =
545{
546   { REGION_GFX1, 0, &charlayout_abc802_40, 0, 8 },
547   { REGION_GFX1, 0, &charlayout_abc802_80, 0, 8 },
548   { -1 }
549};
542static GFXDECODE_START( gfxdecodeinfo_abc802 )
543   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_abc802_40, 0, 8 )
544   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_abc802_80, 0, 8 )
545GFXDECODE_END
550546
551547/* Machine Initialization */
552548
src/mess/drivers/nascom1.c
r1051r1052
7777
7878/* graphics output */
7979
80static gfx_layout nascom1_charlayout =
80static const gfx_layout nascom1_charlayout =
8181{
8282   8, 16,
8383   128,
r1051r1052
8989   8 * 16
9090};
9191
92static gfx_decode nascom1_gfxdecodeinfo[] =
93{
94   { REGION_GFX1, 0x0000, &nascom1_charlayout, 0, 1},
95   {-1}
96};
92static GFXDECODE_START( nascom1_gfxdecodeinfo )
93   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, nascom1_charlayout, 0, 1 )
94GFXDECODE_END
9795
98static gfx_layout nascom2_charlayout =
96static const gfx_layout nascom2_charlayout =
9997{
10098   8, 14,
10199   256,
r1051r1052
107105   8 * 16
108106};
109107
110static gfx_decode nascom2_gfxdecodeinfo[] =
111{
112   { REGION_GFX1, 0x0000, &nascom2_charlayout, 0, 1},
113   {-1}
114};
108static GFXDECODE_START( nascom2_gfxdecodeinfo )
109   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, nascom2_charlayout, 0, 1 )
110GFXDECODE_END
115111
116112static   unsigned   char   nascom1_palette[] =
117113{
src/mess/drivers/microtan.c
r1051r1052
162162    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_4WAY
163163INPUT_PORTS_END
164164
165static gfx_layout char_layout =
165static const gfx_layout char_layout =
166166{
167167    8, 16,      /* 8 x 16 graphics */
168168    128,        /* 128 codes */
r1051r1052
174174    8 * 16      /* code takes 8 times 16 bits */
175175};
176176
177static gfx_layout chunky_layout =
177static const gfx_layout chunky_layout =
178178{
179179    8, 16,      /* 8 x 16 graphics */
180180    256,        /* 256 codes */
r1051r1052
186186    8 * 16      /* code takes 8 times 16 bits */
187187};
188188
189static gfx_decode gfxdecodeinfo[] =
190{
191    { REGION_GFX1, 0, &char_layout, 0, 1 },
192    { REGION_GFX2, 0, &chunky_layout, 0, 1 },
193   {-1}
194};   /* end of array */
189static GFXDECODE_START( gfxdecodeinfo )
190   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout, 0, 1 )
191   GFXDECODE_ENTRY( REGION_GFX2, 0, chunky_layout, 0, 1 )
192GFXDECODE_END
195193
196194static struct AY8910interface ay8910_interface =
197195{
src/mess/drivers/ti99_2.c
r1051r1052
186186   return 0;
187187}
188188
189static gfx_layout ti99_2_charlayout =
189static const gfx_layout ti99_2_charlayout =
190190{
191191   8,8,        /* 8 x 8 characters */
192192   128,        /* 128 characters */
r1051r1052
199199   8*8         /* every char takes 8 bytes */
200200};
201201
202static gfx_decode gfxdecodeinfo[] =
203{
204   { REGION_CPU1, 0x1c00, & ti99_2_charlayout, 0, 0 },
205   { -1 }    /* end of array */
206};
202static GFXDECODE_START( gfxdecodeinfo )
203   GFXDECODE_ENTRY( REGION_CPU1, 0x1c00,  ti99_2_charlayout, 0, 0 )
204GFXDECODE_END
207205
208206
209207/*
src/mess/drivers/intv.c
r1051r1052
127127   8 * 8
128128};
129129
130static gfx_decode intv_gfxdecodeinfo[] =
131{
132   { REGION_CPU1, 0x3000<<1, &intv_gromlayout, 0, 256},
133    { 0, 0, &intv_gramlayout, 0, 256 },    /* Dynamically decoded from RAM */
134   { -1 }
135};
130static GFXDECODE_START( intv_gfxdecodeinfo )
131   GFXDECODE_ENTRY( REGION_CPU1, 0x3000<<1, intv_gromlayout, 0, 256 )
132   GFXDECODE_ENTRY( 0, 0, intv_gramlayout, 0, 256 )    /* Dynamically decoded from RAM */
133GFXDECODE_END
136134
137static gfx_decode intvkbd_gfxdecodeinfo[] =
138{
139   { REGION_CPU1, 0x3000<<1, &intv_gromlayout, 0, 256},
140    { 0, 0, &intv_gramlayout, 0, 256 },    /* Dynamically decoded from RAM */
141   { REGION_GFX1, 0x0000, &intvkbd_charlayout, 0, 256},
142   { -1 }
143};
135static GFXDECODE_START( intvkbd_gfxdecodeinfo )
136   GFXDECODE_ENTRY( REGION_CPU1, 0x3000<<1, intv_gromlayout, 0, 256 )
137   GFXDECODE_ENTRY( 0, 0, intv_gramlayout, 0, 256 )    /* Dynamically decoded from RAM */
138   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, intvkbd_charlayout, 0, 256 )
139GFXDECODE_END
144140
145141INPUT_PORTS_START( intv )
146142   PORT_START /* IN0 */   /* Right Player Controller Starts Here */
src/mess/drivers/jupiter.c
r1051r1052
6666
6767/* graphics output */
6868
69gfx_layout jupiter_charlayout =
69const gfx_layout jupiter_charlayout =
7070{
7171   8, 8,   /* 8x8 characters */
7272   128,   /* 128 characters */
r1051r1052
7777   8*8    /* each character takes 8 consecutive bytes */
7878};
7979
80static gfx_decode jupiter_gfxdecodeinfo[] =
81{
82   {REGION_CPU1, 0x2c00, &jupiter_charlayout, 0, 2},
83   {-1}
84};                           /* end of array */
80static GFXDECODE_START( jupiter_gfxdecodeinfo )
81   GFXDECODE_ENTRY( REGION_CPU1, 0x2c00, jupiter_charlayout, 0, 2 )
82GFXDECODE_END
8583
8684static unsigned char jupiter_palette[] =
8785{
src/mess/drivers/amstrad.c
r1051r1052
22152215   16*16*8
22162216};
22172217
2218static const gfx_decode asic_sprite_gfxdecodeinfo[] =
2219{
2220   { REGION_USER1, 0, &asic_sprite_layout,  32, 1 },
2221   {-1}
2222};
2218static GFXDECODE_START( asic_sprite_gfxdecodeinfo )
2219   GFXDECODE_ENTRY( REGION_USER1, 0, asic_sprite_layout, 32, 1 )
2220GFXDECODE_END
22232221
22242222
22252223
src/mess/drivers/coupe.c
r1051r1052
266266   AM_RANGE( 0x0000, 0x0ffff) AM_READWRITE( coupe_port_r, coupe_port_w )
267267ADDRESS_MAP_END
268268
269static gfx_decode coupe_gfxdecodeinfo[] = {
270   {-1}
271};    /* end of array */
269static GFXDECODE_START( coupe_gfxdecodeinfo )
270GFXDECODE_END
272271
273272INPUT_PORTS_START( coupe )
274273   PORT_START // FE  0
src/mess/drivers/trs80.c
r1051r1052
275275
276276INPUT_PORTS_END
277277
278static gfx_layout trs80_charlayout_normal_width =
278static const gfx_layout trs80_charlayout_normal_width =
279279{
280280   FW,FH,         /* 6 x 12 characters */
281281   256,         /* 256 characters */
r1051r1052
289289   8*FH         /* every char takes FH bytes */
290290};
291291
292static gfx_layout trs80_charlayout_double_width =
292static const gfx_layout trs80_charlayout_double_width =
293293{
294294   FW*2,FH,      /* FW*2 x FH*3 characters */
295295   256,         /* 256 characters */
r1051r1052
303303   8*FH         /* every char takes FH bytes */
304304};
305305
306static gfx_decode trs80_gfxdecodeinfo[] =
307{
308   { REGION_GFX1, 0, &trs80_charlayout_normal_width, 0, 4 },
309   { REGION_GFX1, 0, &trs80_charlayout_double_width, 0, 4 },
310   { -1 } /* end of array */
311};
306static GFXDECODE_START( trs80_gfxdecodeinfo )
307   GFXDECODE_ENTRY( REGION_GFX1, 0, trs80_charlayout_normal_width, 0, 4 )
308   GFXDECODE_ENTRY( REGION_GFX1, 0, trs80_charlayout_double_width, 0, 4 )
309GFXDECODE_END
312310
313311static unsigned char trs80_palette[] =
314312{
src/mess/drivers/odyssey2.c
r1051r1052
9898   PORT_BIT ( 0xe0, 0xe0,    IPT_UNUSED )
9999INPUT_PORTS_END
100100
101static gfx_layout odyssey2_graphicslayout =
101static const gfx_layout odyssey2_graphicslayout =
102102{
103103   8,1,
104104   256,                                    /* 256 characters */
r1051r1052
121121};
122122
123123
124static gfx_layout odyssey2_spritelayout =
124static const gfx_layout odyssey2_spritelayout =
125125{
126126   8,1,
127127   256,                                    /* 256 characters */
r1051r1052
136136   1*8
137137};
138138
139static gfx_decode odyssey2_gfxdecodeinfo[] =
140{
141    { REGION_GFX1, 0x0000, &odyssey2_graphicslayout, 0, 2 },
142    { REGION_GFX1, 0x0000, &odyssey2_spritelayout,   0, 2 },
143    { -1 } /* end of array */
144};
139static GFXDECODE_START( odyssey2_gfxdecodeinfo )
140   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, odyssey2_graphicslayout, 0, 2 )
141   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, odyssey2_spritelayout, 0, 2 )
142GFXDECODE_END
145143
146144static MACHINE_DRIVER_START( odyssey2 )
147145   /* basic machine hardware */
src/mess/drivers/apple2.c
r1051r1052
550550   8*8         /* every char takes 8 bytes */
551551};
552552
553static const gfx_decode apple2_gfxdecodeinfo[] =
554{
555   { REGION_GFX1, 0x0000, &apple2_text_layout, 0, 2 },
556   { REGION_GFX1, 0x0000, &apple2_dbltext_layout, 0, 2 },
557   { -1 } /* end of array */
558};
553static GFXDECODE_START( apple2_gfxdecodeinfo )
554   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple2_text_layout, 0, 2 )
555   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple2_dbltext_layout, 0, 2 )
556GFXDECODE_END
559557
560558static const gfx_layout apple2e_text_layout =
561559{
r1051r1052
579577   8*8         /* every char takes 8 bytes */
580578};
581579
582static const gfx_decode apple2e_gfxdecodeinfo[] =
583{
584   { REGION_GFX1, 0x0000, &apple2e_text_layout, 0, 2 },
585   { REGION_GFX1, 0x0000, &apple2e_dbltext_layout, 0, 2 },
586   { -1 } /* end of array */
587};
580static GFXDECODE_START( apple2e_gfxdecodeinfo )
581   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple2e_text_layout, 0, 2 )
582   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, apple2e_dbltext_layout, 0, 2 )
583GFXDECODE_END
588584
589585static const unsigned short apple2_colortable[] =
590586{
src/mess/drivers/ti99_4p.c
r1051r1052
216216INPUT_PORTS_END
217217
218218
219static const gfx_decode gfxdecodeinfo[] =
220{
221   { -1 }      /* end of array */
222};
219static GFXDECODE_START( gfxdecodeinfo )
220GFXDECODE_END
223221
224222static struct TMS5220interface tms5220interface =
225223{
src/mess/drivers/vc4000.c
r1051r1052
110110#endif
111111INPUT_PORTS_END
112112
113static gfx_layout vc4000_charlayout =
113static const gfx_layout vc4000_charlayout =
114114{
115        8,1,
116        256,                                    /* 256 characters */
117        1,                      /* 1 bits per pixel */
118        { 0 },                  /* no bitplanes; 1 bit per pixel */
119        /* x offsets */
120        {
121       0,
122       1,
123       2,
124       3,
125       4,
126       5,
127       6,
128       7,
129        },
130        /* y offsets */
131        { 0 },
132        1*8
115   8,1,
116   256,                                    /* 256 characters */
117   1,                      /* 1 bits per pixel */
118   { 0 },                  /* no bitplanes; 1 bit per pixel */
119   /* x offsets */
120   {
121   0,
122   1,
123   2,
124   3,
125   4,
126   5,
127   6,
128   7,
129   },
130   /* y offsets */
131   { 0 },
132   1*8
133133};
134134
135static gfx_decode vc4000_gfxdecodeinfo[] =
136{
137    { REGION_GFX1, 0x0000, &vc4000_charlayout,                     0, 2 },
138    { -1 } /* end of array */
139};
135static GFXDECODE_START( vc4000_gfxdecodeinfo )
136   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, vc4000_charlayout, 0, 2 )
137GFXDECODE_END
140138
141139#ifdef UNUSED_FUNCTION
142140static INTERRUPT_GEN( vc4000 )
src/mess/drivers/galaxy.c
r1051r1052
4444ADDRESS_MAP_END
4545
4646
47static gfx_decode galaxy_gfxdecodeinfo[] =
48{
49   {REGION_GFX1, 0x0000, &galaxy_charlayout, 0, 2},
50   {-1}
51};
47static GFXDECODE_START( galaxy_gfxdecodeinfo )
48   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxy_charlayout, 0, 2 )
49GFXDECODE_END
5250
5351INPUT_PORTS_START (galaxy)
5452   PORT_START /* line 0 */
src/mess/drivers/vtech2.c
r1051r1052
318318
319319INPUT_PORTS_END
320320
321static gfx_layout charlayout_80 =
321static const gfx_layout charlayout_80 =
322322{
323323   8,8,               /* 8 x 8 characters */
324324   256,               /* 256 characters */
r1051r1052
331331   8*8                /* every char takes 8 bytes */
332332};
333333
334static gfx_layout charlayout_40 =
334static const gfx_layout charlayout_40 =
335335{
336336   8*2,8,               /* 8*2 x 8 characters */
337337   256,               /* 256 characters */
r1051r1052
344344   8*8                /* every char takes 8 bytes */
345345};
346346
347static gfx_layout gfxlayout_1bpp =
347static const gfx_layout gfxlayout_1bpp =
348348{
349349   8,1,               /* 8x1 pixels */
350350   256,               /* 256 codes */
r1051r1052
357357   8                  /* one byte per code */
358358};
359359
360static gfx_layout gfxlayout_1bpp_dw =
360static const gfx_layout gfxlayout_1bpp_dw =
361361{
362362   8*2,1,               /* 8 times 2x1 pixels */
363363   256,               /* 256 codes */
r1051r1052
370370   8                  /* one byte per code */
371371};
372372
373static gfx_layout gfxlayout_1bpp_qw =
373static const gfx_layout gfxlayout_1bpp_qw =
374374{
375375   8*4,1,               /* 8 times 4x1 pixels */
376376   256,               /* 256 codes */
r1051r1052
383383   8                  /* one byte per code */
384384};
385385
386static gfx_layout gfxlayout_4bpp =
386static const gfx_layout gfxlayout_4bpp =
387387{
388388   2*4,1,               /* 2 times 4x1 pixels */
389389   256,               /* 256 codes */
r1051r1052
396396   2*4                /* one byte per code */
397397};
398398
399static gfx_layout gfxlayout_4bpp_dh =
399static const gfx_layout gfxlayout_4bpp_dh =
400400{
401401   2*4,2,               /* 2 times 4x2 pixels */
402402   256,               /* 256 codes */
r1051r1052
409409   2*4                /* one byte per code */
410410};
411411
412static gfx_decode gfxdecodeinfo[] =
413{
414   { REGION_GFX1, 0, &charlayout_80,        0, 256 },
415   { REGION_GFX1, 0, &charlayout_40,        0, 256 },
416   { REGION_GFX2, 0, &gfxlayout_1bpp,        0, 256 },
417   { REGION_GFX2, 0, &gfxlayout_1bpp_dw,     0, 256 },
418   { REGION_GFX2, 0, &gfxlayout_1bpp_qw,     0, 256 },
419   { REGION_GFX2, 0, &gfxlayout_4bpp,     2*256,   1 },
420   { REGION_GFX2, 0, &gfxlayout_4bpp_dh, 2*256,   1 },
421   { -1 } /* end of array */
422};
412static GFXDECODE_START( gfxdecodeinfo )
413   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_80, 0, 256 )
414   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_40, 0, 256 )
415   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_1bpp, 0, 256 )
416   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_1bpp_dw, 0, 256 )
417   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_1bpp_qw, 0, 256 )
418   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_4bpp, 2*256, 1 )
419   GFXDECODE_ENTRY( REGION_GFX2, 0, gfxlayout_4bpp_dh, 2*256, 1 )
420GFXDECODE_END
423421
424422
425423static unsigned char vt_palette[] =
docs/messnew.txt
r1051r1052
3030
3131Source Changes:
3232----------------
33- The core is based on MAME 0.119u1.  This incorporates all features of the
33- The core is based on MAME 0.119u2.  This incorporates all features of the
3434  update to this core.  [MAME team]
3535
3636- Fixed multisession crash with the new menu selector.  (bug #1328) [Nate
makefile
r1051r1052
6969# uncomment next line to include the debugger
7070# DEBUG = 1
7171
72# uncomment next line to include the internal profiler
73# PROFILER = 1
74
7275# uncomment next line to use DRC MIPS3 engine
7376X86_MIPS3_DRC = 1
7477
r1051r1052
107110# uncomment next line to include the symbols
108111# SYMBOLS = 1
109112
110# uncomment next line to include profiling information
113# uncomment next line to include profiling information from the compiler
111114# PROFILE = 1
112115
113116# uncomment next line to generate a link map for exception handling in windows
r1051r1052
129132
130133# disable DRC cores for 64-bit builds
131134ifdef PTR64
132X86_MIPS3_DRC =
133135X86_PPC_DRC =
134136endif
135137
r1051r1052
142144endif
143145endif
144146
147# profiler defaults to on for DEBUG builds
148ifdef DEBUG
149ifndef PROFILER
150PROFILER = 1
151endif
152endif
145153
146154
155
147156#-------------------------------------------------
148157# platform-specific definitions
149158#-------------------------------------------------
r1051r1052
293302DEFS += -DNDEBUG
294303endif
295304
305# define MAME_PROFILER if we are a profiling build
306ifdef PROFILER
307DEFS += -DMAME_PROFILER
308endif
309
296310# define VOODOO_DRC if we are building the DRC Voodoo engine
297311ifdef X86_VOODOO_DRC
298312DEFS += -DVOODOO_DRC
r1051r1052
382396LDFLAGS += -pg
383397endif
384398
385
386399# strip symbols and other metadata in non-symbols and non profiling builds
387400ifndef SYMBOLS
388401ifndef PROFILE

Previous 15994 Revisions Next


© 1998-2018 The MESS Team